mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 14:27:56 +00:00
Add a setting to also delete torrents files on hard disk as a default
This commit is contained in:
parent
defd77b94c
commit
6e3b570be4
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "ui_confirmdeletiondlg.h"
|
#include "ui_confirmdeletiondlg.h"
|
||||||
|
#include "preferences.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||||
@ -42,6 +43,8 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
|||||||
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
move(misc::screenCenter(this));
|
move(misc::screenCenter(this));
|
||||||
|
checkPermDelete->setChecked(Preferences::deleteTorrentFilesAsDefault());
|
||||||
|
buttonBox->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldDeleteLocalFiles() const {
|
bool shouldDeleteLocalFiles() const {
|
||||||
|
@ -197,6 +197,7 @@ comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/saoudi_arabia.png")))
|
|||||||
connect(checkSystrayBalloons, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkSystrayBalloons, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkDisplayToolbar, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkDisplayToolbar, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkNoSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkNoSplash, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
|
connect(checkDeleteTorrentFiles, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
// Downloads tab
|
// Downloads tab
|
||||||
connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkAppendLabel, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkAppendLabel, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
@ -385,6 +386,7 @@ void options_imp::saveOptions(){
|
|||||||
settings.setValue(QString::fromUtf8("NotificationBaloons"), OSDEnabled());
|
settings.setValue(QString::fromUtf8("NotificationBaloons"), OSDEnabled());
|
||||||
settings.setValue(QString::fromUtf8("ToolbarDisplayed"), isToolbarDisplayed());
|
settings.setValue(QString::fromUtf8("ToolbarDisplayed"), isToolbarDisplayed());
|
||||||
settings.setValue(QString::fromUtf8("NoSplashScreen"), isSlashScreenDisabled());
|
settings.setValue(QString::fromUtf8("NoSplashScreen"), isSlashScreenDisabled());
|
||||||
|
Preferences::setDeleteTorrentFilesAsDefault(checkDeleteTorrentFiles->isChecked());
|
||||||
// End General preferences
|
// End General preferences
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
// Downloads preferences
|
// Downloads preferences
|
||||||
@ -595,6 +597,7 @@ void options_imp::loadOptions(){
|
|||||||
checkNoSystray->setChecked(!Preferences::systrayIntegration());
|
checkNoSystray->setChecked(!Preferences::systrayIntegration());
|
||||||
checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed());
|
checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed());
|
||||||
checkNoSplash->setChecked(Preferences::isSlashScreenDisabled());
|
checkNoSplash->setChecked(Preferences::isSlashScreenDisabled());
|
||||||
|
checkDeleteTorrentFiles->setChecked(Preferences::deleteTorrentFilesAsDefault());
|
||||||
if(checkNoSystray->isChecked()) {
|
if(checkNoSystray->isChecked()) {
|
||||||
disableSystrayOptions();
|
disableSystrayOptions();
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,6 +63,16 @@ public:
|
|||||||
settings.setValue(QString::fromUtf8("Preferences/General/Style"), style);
|
settings.setValue(QString::fromUtf8("Preferences/General/Style"), style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool deleteTorrentFilesAsDefault() {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
return settings.value(QString::fromUtf8("Preferences/General/DeleteTorrentsFilesAsDefault"), false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setDeleteTorrentFilesAsDefault(bool del) {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
settings.setValue(QString::fromUtf8("Preferences/General/DeleteTorrentsFilesAsDefault"), del);
|
||||||
|
}
|
||||||
|
|
||||||
static bool confirmOnExit() {
|
static bool confirmOnExit() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
return settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool();
|
return settings.value(QString::fromUtf8("Preferences/General/ExitConfirm"), true).toBool();
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>506</width>
|
<width>506</width>
|
||||||
<height>543</height>
|
<height>571</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
@ -369,6 +369,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkDeleteTorrentFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>On torrent deletion, also delete files on hard disk as a default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user