mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
create collection dialog filename as dir name
This commit is contained in:
parent
8368a764fc
commit
1f207ba05c
@ -1066,8 +1066,17 @@ void RetroshareDirModel::createCollectionFile(QWidget *parent, const QModelIndex
|
||||
getDirDetailsFromSelect(list, dirVec);
|
||||
|
||||
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
|
||||
|
||||
RsCollection(dirVec,f).openNewColl(parent);
|
||||
|
||||
QString dir_name;
|
||||
if(!RemoteMode)
|
||||
{
|
||||
if(dirVec.size())
|
||||
{
|
||||
const DirDetails& details = dirVec[0];
|
||||
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
|
||||
}
|
||||
}
|
||||
RsCollection(dirVec,f).openNewColl(parent,dir_name);
|
||||
}
|
||||
|
||||
void RetroshareDirModel::downloadSelected(const QModelIndexList &list,bool interactive)
|
||||
|
@ -413,9 +413,8 @@ bool RsCollection::save(QWidget *parent) const
|
||||
}
|
||||
|
||||
|
||||
bool RsCollection::openNewColl(QWidget *parent)
|
||||
bool RsCollection::openNewColl(QWidget *parent, QString fileName)
|
||||
{
|
||||
QString fileName;
|
||||
if(!misc::getSaveFileName(parent, RshareSettings::LASTDIR_EXTRAFILE
|
||||
, QApplication::translate("RsCollectionFile", "Create collection file")
|
||||
, QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")"
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
bool save(const QString& fileName) const ;
|
||||
|
||||
// Open new collection
|
||||
bool openNewColl(QWidget *parent);
|
||||
bool openNewColl(QWidget *parent, QString fileName = "");
|
||||
// Open existing collection
|
||||
bool openColl(const QString& fileName, bool readOnly = false, bool showError = true);
|
||||
|
||||
|
@ -363,7 +363,7 @@ bool misc::getSaveFileName(QWidget *parent, RshareSettings::enumLastDir type
|
||||
, QString &file, QString *selectedFilter
|
||||
, QFileDialog::Options options)
|
||||
{
|
||||
QString lastDir = Settings->getLastDir(type);
|
||||
QString lastDir = Settings->getLastDir(type) + "/" + file;
|
||||
|
||||
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, QFileDialog::DontUseNativeDialog | options);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user