Browse Source

Now qbt remembers the last used folder. Fixes #799697. ver2

adaptive-webui-19844
sledgehammer_999 13 years ago
parent
commit
7c29e613f0
  1. 3
      src/preferences/options_imp.cpp
  2. 5
      src/torrentadditiondlg.cpp
  3. 25
      src/torrentadditiondlg.ui

3
src/preferences/options_imp.cpp

@ -155,7 +155,6 @@ options_imp::options_imp(QWidget *parent): @@ -155,7 +155,6 @@ options_imp::options_imp(QWidget *parent):
connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(textTempPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkAppendLabel, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkLastLocation, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAppendqB, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkPreallocateAll, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAdditionDialog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -392,7 +391,6 @@ void options_imp::saveOptions(){ @@ -392,7 +391,6 @@ void options_imp::saveOptions(){
#endif
pref.setTempPath(temp_path);
pref.setAppendTorrentLabel(checkAppendLabel->isChecked());
pref.setRememberLastLocation(checkLastLocation->isChecked());
#if LIBTORRENT_VERSION_MINOR > 14
pref.useIncompleteFilesExtension(checkAppendqB->isChecked());
#endif
@ -570,7 +568,6 @@ void options_imp::loadOptions(){ @@ -570,7 +568,6 @@ void options_imp::loadOptions(){
#endif
textTempPath->setText(temp_path);
checkAppendLabel->setChecked(pref.appendTorrentLabel());
checkLastLocation->setChecked(pref.rememberLastLocation());
#if LIBTORRENT_VERSION_MINOR > 14
checkAppendqB->setChecked(pref.useIncompleteFilesExtension());
#endif

5
src/torrentadditiondlg.cpp

@ -88,6 +88,7 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) : @@ -88,6 +88,7 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
savePathTxt->setInsertPolicy(QComboBox::InsertAtCurrent);
//torrentContentList->header()->setResizeMode(0, QHeaderView::Stretch);
QString lastLocation = pref.lastLocationPath();
checkLastFolder->setChecked(pref.rememberLastLocation());
//lastLocation will always have '/' as separator since it is saved in
//::on_OkButton_clicked() after the conversion is done.
if (pref.rememberLastLocation() && !lastLocation.isEmpty() && QFile(lastLocation).exists())
@ -700,7 +701,9 @@ void torrentAdditionDialog::on_OkButton_clicked(){ @@ -700,7 +701,9 @@ void torrentAdditionDialog::on_OkButton_clicked(){
//Save last location path
{//limit the scope of pref
Preferences pref;
if (pref.rememberLastLocation())
bool isChecked = checkLastFolder->isChecked();
if (pref.rememberLastLocation() != isChecked) pref.setRememberLastLocation(isChecked);
if (pref.rememberLastLocation() && save_path != pref.lastLocationPath())
pref.setLastLocationPath(save_path);
}
// save filtered files

25
src/torrentadditiondlg.ui

@ -190,6 +190,12 @@ @@ -190,6 +190,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
@ -217,6 +223,12 @@ @@ -217,6 +223,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
@ -238,6 +250,12 @@ @@ -238,6 +250,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
@ -263,6 +281,13 @@ @@ -263,6 +281,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkLastFolder">
<property name="text">
<string>Remember last used folder</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">

Loading…
Cancel
Save