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. 37
      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)
void AddNewTorrentDialog::showEvent(QShowEvent *event) { void AddNewTorrentDialog::showEvent(QShowEvent *event) {
QDialog::showEvent(event); QDialog::showEvent(event);
Preferences pref;
if (!pref.AdditionDialogFront())
return;
activateWindow(); activateWindow();
raise(); raise();
} }

37
src/preferences/options.ui

@ -517,7 +517,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>458</width> <width>458</width>
<height>872</height> <height>905</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@ -536,16 +536,6 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>9</number>
</property> </property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkAdditionDialog">
<property name="text">
<string>Display torrent content and some options</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QCheckBox" name="checkStartPaused"> <widget class="QCheckBox" name="checkStartPaused">
<property name="text"> <property name="text">
@ -553,6 +543,28 @@
</property> </property>
</widget> </widget>
</item> </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>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -1022,7 +1034,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>458</width> <width>357</width>
<height>498</height> <height>498</height>
</rect> </rect>
</property> </property>
@ -2765,7 +2777,6 @@
<tabstop>comboI18n</tabstop> <tabstop>comboI18n</tabstop>
<tabstop>textSavePath</tabstop> <tabstop>textSavePath</tabstop>
<tabstop>browseSaveDirButton</tabstop> <tabstop>browseSaveDirButton</tabstop>
<tabstop>checkAdditionDialog</tabstop>
<tabstop>checkStartPaused</tabstop> <tabstop>checkStartPaused</tabstop>
<tabstop>spinPort</tabstop> <tabstop>spinPort</tabstop>
<tabstop>checkUPnP</tabstop> <tabstop>checkUPnP</tabstop>

3
src/preferences/options_imp.cpp

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

8
src/preferences/preferences.h

@ -282,6 +282,14 @@ public:
setValue("Preferences/Downloads/NewAdditionDialog", b); 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 { bool addTorrentsInPause() const {
return value(QString::fromUtf8("Preferences/Downloads/StartInPause"), false).toBool(); return value(QString::fromUtf8("Preferences/Downloads/StartInPause"), false).toBool();
} }

Loading…
Cancel
Save