1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 13:04:23 +00:00

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

This commit is contained in:
sledgehammer_999 2011-09-21 02:21:14 +03:00
parent a82ccd8e95
commit 7c29e613f0
3 changed files with 29 additions and 4 deletions

View File

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

View File

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

View File

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