Browse Source

Option to disallow bringing the torrent dialog to the front.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
08cd1c9b0c
  1. 3
      src/addnewtorrentdialog.cpp
  2. 33
      src/preferences/options.ui
  3. 3
      src/preferences/options_imp.cpp
  4. 8
      src/preferences/preferences.h

3
src/addnewtorrentdialog.cpp

@ -141,6 +141,9 @@ void AddNewTorrentDialog::showMagnet(const QString& link) @@ -141,6 +141,9 @@ void AddNewTorrentDialog::showMagnet(const QString& link)
void AddNewTorrentDialog::showEvent(QShowEvent *event) {
QDialog::showEvent(event);
Preferences pref;
if (!pref.AdditionDialogFront())
return;
activateWindow();
raise();
}

33
src/preferences/options.ui

@ -517,7 +517,7 @@ @@ -517,7 +517,7 @@
<x>0</x>
<y>0</y>
<width>458</width>
<height>872</height>
<height>905</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -536,21 +536,33 @@ @@ -536,21 +536,33 @@
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkAdditionDialog">
<item row="1" column="0">
<widget class="QCheckBox" name="checkStartPaused">
<property name="text">
<string comment="The torrent will be added to download list in pause state">Do not start the download automatically</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="checkAdditionDialog">
<property name="title">
<string>Display torrent content and some options</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_15">
<item row="0" column="0">
<widget class="QCheckBox" name="checkAdditionDialogFront">
<property name="text">
<string>Bring torrent dialog to the front</string>
</property>
<property name="checked">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkStartPaused">
<property name="text">
<string comment="The torrent will be added to download list in pause state">Do not start the download automatically</string>
</property>
</layout>
</widget>
</item>
</layout>
@ -1022,7 +1034,7 @@ @@ -1022,7 +1034,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>458</width>
<width>357</width>
<height>498</height>
</rect>
</property>
@ -2765,7 +2777,6 @@ @@ -2765,7 +2777,6 @@
<tabstop>comboI18n</tabstop>
<tabstop>textSavePath</tabstop>
<tabstop>browseSaveDirButton</tabstop>
<tabstop>checkAdditionDialog</tabstop>
<tabstop>checkStartPaused</tabstop>
<tabstop>spinPort</tabstop>
<tabstop>checkUPnP</tabstop>

3
src/preferences/options_imp.cpp

@ -161,6 +161,7 @@ options_imp::options_imp(QWidget *parent): @@ -161,6 +161,7 @@ options_imp::options_imp(QWidget *parent):
connect(checkAppendqB, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkPreallocateAll, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAdditionDialog, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAdditionDialogFront, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkStartPaused, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkExportDir, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkExportDirFin, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -400,6 +401,7 @@ void options_imp::saveOptions() { @@ -400,6 +401,7 @@ void options_imp::saveOptions() {
pref.useIncompleteFilesExtension(checkAppendqB->isChecked());
pref.preAllocateAllFiles(preAllocateAllFiles());
pref.useAdditionDialog(useAdditionDialog());
pref.AdditionDialogFront(checkAdditionDialogFront->isChecked());
pref.addTorrentsInPause(addTorrentsInPause());
ScanFoldersModel::instance()->makePersistent();
addedScanDirs.clear();
@ -581,6 +583,7 @@ void options_imp::loadOptions() { @@ -581,6 +583,7 @@ void options_imp::loadOptions() {
checkAppendqB->setChecked(pref.useIncompleteFilesExtension());
checkPreallocateAll->setChecked(pref.preAllocateAllFiles());
checkAdditionDialog->setChecked(pref.useAdditionDialog());
checkAdditionDialogFront->setChecked(pref.AdditionDialogFront());
checkStartPaused->setChecked(pref.addTorrentsInPause());
strValue = pref.getTorrentExportDir();

8
src/preferences/preferences.h

@ -282,6 +282,14 @@ public: @@ -282,6 +282,14 @@ public:
setValue("Preferences/Downloads/NewAdditionDialog", b);
}
bool AdditionDialogFront() const {
return value(QString::fromUtf8("Preferences/Downloads/NewAdditionDialogFront"), true).toBool();
}
void AdditionDialogFront(bool b) {
setValue("Preferences/Downloads/NewAdditionDialogFront", b);
}
bool addTorrentsInPause() const {
return value(QString::fromUtf8("Preferences/Downloads/StartInPause"), false).toBool();
}

Loading…
Cancel
Save