mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Made it possible to disable notification balloons again
This commit is contained in:
parent
e2cdbbb184
commit
39d86c5f61
@ -910,6 +910,7 @@ void GUI::updateGUI() {
|
||||
}
|
||||
|
||||
void GUI::showNotificationBaloon(QString title, QString msg) const {
|
||||
if(!Preferences::useProgramNotification()) return;
|
||||
#ifdef WITH_LIBNOTIFY
|
||||
if (notify_init ("summary-body")) {
|
||||
NotifyNotification* notification;
|
||||
|
@ -11,15 +11,15 @@
|
||||
#include "preferences.h"
|
||||
|
||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE };
|
||||
#define ROW_COUNT 12
|
||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS };
|
||||
#define ROW_COUNT 13
|
||||
|
||||
class AdvancedSettings: public QTableWidget {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen;
|
||||
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding;
|
||||
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding, *cb_program_notifications;
|
||||
QComboBox *combo_iface;
|
||||
|
||||
public:
|
||||
@ -52,6 +52,7 @@ public:
|
||||
delete spin_maxhalfopen;
|
||||
delete cb_super_seeding;
|
||||
delete combo_iface;
|
||||
delete cb_program_notifications;
|
||||
}
|
||||
|
||||
public slots:
|
||||
@ -85,6 +86,8 @@ public slots:
|
||||
} else {
|
||||
Preferences::setNetworkInterface(combo_iface->currentText());
|
||||
}
|
||||
// Program notification
|
||||
Preferences::useProgramNotification(cb_program_notifications->isChecked());
|
||||
}
|
||||
|
||||
protected slots:
|
||||
@ -186,6 +189,12 @@ protected slots:
|
||||
}
|
||||
connect(combo_iface, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSettingsChanged()));
|
||||
setCellWidget(NETWORK_IFACE, VALUE, combo_iface);
|
||||
// Program notifications
|
||||
setItem(PROGRAM_NOTIFICATIONS, PROPERTY, new QTableWidgetItem(tr("Display program notification baloons")));
|
||||
cb_program_notifications = new QCheckBox();
|
||||
connect(cb_program_notifications, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||
cb_program_notifications->setChecked(Preferences::useProgramNotification());
|
||||
setCellWidget(PROGRAM_NOTIFICATIONS, VALUE, cb_program_notifications);
|
||||
}
|
||||
|
||||
void emitSettingsChanged() {
|
||||
|
@ -78,6 +78,16 @@ public:
|
||||
settings.setValue(QString::fromUtf8("Preferences/General/Style"), style);
|
||||
}
|
||||
|
||||
static bool useProgramNotification() {
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/General/ProgramNotification"), true).toBool();
|
||||
}
|
||||
|
||||
static void useProgramNotification(bool use) {
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
settings.setValue(QString::fromUtf8("Preferences/General/ProgramNotification"), use);
|
||||
}
|
||||
|
||||
static bool deleteTorrentFilesAsDefault() {
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/General/DeleteTorrentsFilesAsDefault"), false).toBool();
|
||||
|
Loading…
x
Reference in New Issue
Block a user