mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Disable system tray icon on Mac OS X
This commit is contained in:
parent
a5452d04ae
commit
5f5382297c
@ -1002,7 +1002,7 @@ void MainWindow::loadPreferences(bool configure_session) {
|
|||||||
QBtSession::instance()->addConsoleMessage(tr("Options were saved successfully."));
|
QBtSession::instance()->addConsoleMessage(tr("Options were saved successfully."));
|
||||||
const Preferences pref;
|
const Preferences pref;
|
||||||
const bool newSystrayIntegration = pref.systrayIntegration();
|
const bool newSystrayIntegration = pref.systrayIntegration();
|
||||||
actionLock_qBittorrent->setEnabled(newSystrayIntegration);
|
actionLock_qBittorrent->setVisible(newSystrayIntegration);
|
||||||
if (newSystrayIntegration != (systrayIcon!=0)) {
|
if (newSystrayIntegration != (systrayIcon!=0)) {
|
||||||
if (newSystrayIntegration) {
|
if (newSystrayIntegration) {
|
||||||
// create the trayicon
|
// create the trayicon
|
||||||
|
@ -109,10 +109,14 @@ options_imp::options_imp(QWidget *parent):
|
|||||||
// Load options
|
// Load options
|
||||||
loadOptions();
|
loadOptions();
|
||||||
// Disable systray integration if it is not supported by the system
|
// Disable systray integration if it is not supported by the system
|
||||||
|
#ifndef Q_WS_MAC
|
||||||
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||||
|
#endif
|
||||||
checkShowSystray->setChecked(false);
|
checkShowSystray->setChecked(false);
|
||||||
checkShowSystray->setEnabled(false);
|
checkShowSystray->setEnabled(false);
|
||||||
|
#ifndef Q_WS_MAC
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if !defined(Q_WS_X11)
|
#if !defined(Q_WS_X11)
|
||||||
label_trayIconStyle->setVisible(false);
|
label_trayIconStyle->setVisible(false);
|
||||||
comboTrayIcon->setVisible(false);
|
comboTrayIcon->setVisible(false);
|
||||||
|
@ -120,7 +120,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool systrayIntegration() const {
|
bool systrayIntegration() const {
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
return value(QString::fromUtf8("Preferences/General/SystrayEnabled"), true).toBool();
|
return value(QString::fromUtf8("Preferences/General/SystrayEnabled"), true).toBool();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSystrayIntegration(bool enabled) {
|
void setSystrayIntegration(bool enabled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user