mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 17:51:26 -05:00
Channels:
- Use destination directory when manually downloading a file from a channel - Show destination directory in channel details - Fixed utf8 issue when choosing the destination directory git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6902 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fc56b95d3f
commit
c447ab2829
@ -310,13 +310,13 @@ void ChannelFeed::chooseDestinationDirectory()
|
|||||||
if (!rsChannels->getChannelInfo(mChannelId, ci))
|
if (!rsChannels->getChannelInfo(mChannelId, ci))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Select channel destination directory"),QString::fromStdString(ci.destination_directory),QFileDialog::ShowDirsOnly) ;
|
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Select channel destination directory"),QString::fromUtf8(ci.destination_directory.c_str()),QFileDialog::ShowDirsOnly) ;
|
||||||
|
|
||||||
if(dirname.isNull())
|
if(dirname.isNull())
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
std::cerr << "Setting new directory " << dirname.toStdString() << " to channel " << mChannelId << std::endl;
|
std::cerr << "Setting new directory " << dirname.toStdString() << " to channel " << mChannelId << std::endl;
|
||||||
rsChannels->channelSetDestinationDirectory(mChannelId,dirname.toStdString()) ;
|
rsChannels->channelSetDestinationDirectory(mChannelId, dirname.toUtf8().constData()) ;
|
||||||
}
|
}
|
||||||
void ChannelFeed::createChannel()
|
void ChannelFeed::createChannel()
|
||||||
{
|
{
|
||||||
|
@ -43,12 +43,6 @@ ChannelDetails::ChannelDetails(QWidget *parent)
|
|||||||
|
|
||||||
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||||
|
|
||||||
ui.nameline ->setReadOnly(true);
|
|
||||||
ui.popline ->setReadOnly(true);
|
|
||||||
ui.postline ->setReadOnly(true);
|
|
||||||
ui.IDline ->setReadOnly(true);
|
|
||||||
ui.DescriptiontextEdit ->setReadOnly(true);
|
|
||||||
|
|
||||||
ui.typeEncrypted->setEnabled(false);
|
ui.typeEncrypted->setEnabled(false);
|
||||||
ui.typePrivate->setEnabled(false);
|
ui.typePrivate->setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -114,4 +108,7 @@ void ChannelDetails::loadChannel()
|
|||||||
ui.typeEncrypted->setChecked(true);
|
ui.typeEncrypted->setChecked(true);
|
||||||
ui.typePrivate->setChecked(false);
|
ui.typePrivate->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set destination directory
|
||||||
|
ui.destinationDirectoryLineEdit->setText(QString::fromUtf8(ci.destination_directory.c_str()));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>455</width>
|
<width>455</width>
|
||||||
<height>408</height>
|
<height>417</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -46,7 +46,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="nameline"/>
|
<widget class="QLineEdit" name="nameline">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QLabel" name="label_10">
|
||||||
@ -84,7 +88,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLineEdit" name="IDline"/>
|
<widget class="QLineEdit" name="IDline">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@ -93,7 +101,11 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTextEdit" name="DescriptiontextEdit"/>
|
<widget class="QTextEdit" name="DescriptiontextEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
@ -121,6 +133,20 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Destination directory</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLineEdit" name="destinationDirectoryLineEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -141,6 +167,18 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>stabWidget</tabstop>
|
||||||
|
<tabstop>nameline</tabstop>
|
||||||
|
<tabstop>popline</tabstop>
|
||||||
|
<tabstop>postline</tabstop>
|
||||||
|
<tabstop>IDline</tabstop>
|
||||||
|
<tabstop>destinationDirectoryLineEdit</tabstop>
|
||||||
|
<tabstop>DescriptiontextEdit</tabstop>
|
||||||
|
<tabstop>typePrivate</tabstop>
|
||||||
|
<tabstop>typeEncrypted</tabstop>
|
||||||
|
<tabstop>buttonBox</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -208,6 +208,7 @@ void ChanMsgItem::updateItemStatic()
|
|||||||
/* add file */
|
/* add file */
|
||||||
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size,
|
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size,
|
||||||
SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
|
SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
|
||||||
|
fi->setChannelId(mChanId);
|
||||||
mFileItems.push_back(fi);
|
mFileItems.push_back(fi);
|
||||||
|
|
||||||
/* check if the file is a media file */
|
/* check if the file is a media file */
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
|
|
||||||
|
#include <retroshare/rschannels.h>
|
||||||
|
|
||||||
/****
|
/****
|
||||||
* #define DEBUG_ITEM 1
|
* #define DEBUG_ITEM 1
|
||||||
@ -599,6 +600,14 @@ void SubFileItem::download()
|
|||||||
|
|
||||||
std::list<std::string> sources ;
|
std::list<std::string> sources ;
|
||||||
|
|
||||||
|
std::string destination;
|
||||||
|
if (!mChannelId.empty() && mType == SFI_TYPE_CHANNEL) {
|
||||||
|
ChannelInfo ci;
|
||||||
|
if (rsChannels->getChannelInfo(mChannelId, ci)) {
|
||||||
|
destination = ci.destination_directory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add possible direct sources.
|
// Add possible direct sources.
|
||||||
//
|
//
|
||||||
FileInfo finfo ;
|
FileInfo finfo ;
|
||||||
@ -614,7 +623,7 @@ void SubFileItem::download()
|
|||||||
if (mSrcId != "")
|
if (mSrcId != "")
|
||||||
sources.push_back(mSrcId);
|
sources.push_back(mSrcId);
|
||||||
|
|
||||||
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, "", RS_FILE_REQ_ANONYMOUS_ROUTING, sources);
|
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, destination, RS_FILE_REQ_ANONYMOUS_ROUTING, sources);
|
||||||
|
|
||||||
downloadButton->setEnabled(false);
|
downloadButton->setEnabled(false);
|
||||||
|
|
||||||
|
@ -73,6 +73,8 @@ public:
|
|||||||
bool isDownloadable(bool &startable);
|
bool isDownloadable(bool &startable);
|
||||||
bool isPlayable(bool &startable);
|
bool isPlayable(bool &startable);
|
||||||
|
|
||||||
|
void setChannelId(const std::string &channelId) { mChannelId = channelId; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void download();
|
void download();
|
||||||
void play();
|
void play();
|
||||||
@ -95,6 +97,7 @@ private:
|
|||||||
std::string mFileName;
|
std::string mFileName;
|
||||||
uint64_t mFileSize;
|
uint64_t mFileSize;
|
||||||
std::string mSrcId;
|
std::string mSrcId;
|
||||||
|
std::string mChannelId;
|
||||||
|
|
||||||
uint32_t mMode;
|
uint32_t mMode;
|
||||||
uint32_t mType;
|
uint32_t mType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user