mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Merge commit 'refs/merge-requests/4' of git://gitorious.org/qbittorrent/qbittorrent into merge-requests/4
This commit is contained in:
commit
c25f51e866
3 changed files with 63 additions and 2 deletions
|
@ -229,6 +229,22 @@ public:
|
||||||
setValue("Preferences/Downloads/AppendLabel", b);
|
setValue("Preferences/Downloads/AppendLabel", b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool rememberLastLocation() const {
|
||||||
|
return value(QString::fromUtf8("Preferences/Downloads/RememberLastLocation"), false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setRememberLastLocation(bool b) {
|
||||||
|
setValue("Preferences/Downloads/RememberLastLocation", b);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString lastLocationPath() const {
|
||||||
|
return value(QString::fromUtf8("Preferences/Downloads/LastLocationPath"), QString()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setLastLocationPath(const QString &path) {
|
||||||
|
setValue(QString::fromUtf8("Preferences/Downloads/LastLocationPath"), path);
|
||||||
|
}
|
||||||
|
|
||||||
bool preAllocateAllFiles() const {
|
bool preAllocateAllFiles() const {
|
||||||
return value(QString::fromUtf8("Preferences/Downloads/PreAllocation"), false).toBool();
|
return value(QString::fromUtf8("Preferences/Downloads/PreAllocation"), false).toBool();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ using namespace libtorrent;
|
||||||
|
|
||||||
torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
||||||
QDialog(parent), old_label(""), hidden_height(0), m_showContentList(true) {
|
QDialog(parent), old_label(""), hidden_height(0), m_showContentList(true) {
|
||||||
const Preferences pref;
|
Preferences pref;
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setMinimumSize(0, 0);
|
setMinimumSize(0, 0);
|
||||||
|
@ -87,7 +87,19 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
||||||
// Important: as a default, it inserts at the bottom which is not desirable
|
// Important: as a default, it inserts at the bottom which is not desirable
|
||||||
savePathTxt->setInsertPolicy(QComboBox::InsertAtCurrent);
|
savePathTxt->setInsertPolicy(QComboBox::InsertAtCurrent);
|
||||||
//torrentContentList->header()->setResizeMode(0, QHeaderView::Stretch);
|
//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())
|
||||||
|
defaultSavePath = lastLocation;
|
||||||
|
else
|
||||||
|
{
|
||||||
defaultSavePath = pref.getSavePath();
|
defaultSavePath = pref.getSavePath();
|
||||||
|
//In case of the LastLocationPath doesn't exist anymore, empty the string
|
||||||
|
pref.setLastLocationPath(QString());
|
||||||
|
}
|
||||||
|
|
||||||
appendLabelToSavePath = pref.appendTorrentLabel();
|
appendLabelToSavePath = pref.appendTorrentLabel();
|
||||||
QString display_path = defaultSavePath.replace("\\", "/");
|
QString display_path = defaultSavePath.replace("\\", "/");
|
||||||
if(!display_path.endsWith("/"))
|
if(!display_path.endsWith("/"))
|
||||||
|
@ -686,6 +698,14 @@ void torrentAdditionDialog::on_OkButton_clicked(){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Save last location path
|
||||||
|
{//limit the scope of pref
|
||||||
|
Preferences pref;
|
||||||
|
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
|
// save filtered files
|
||||||
if(!is_magnet && t->num_files() > 1)
|
if(!is_magnet && t->num_files() > 1)
|
||||||
savePiecesPriorities();
|
savePiecesPriorities();
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue