diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 26e263f40..5ac3535ce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1002,9 +1002,9 @@ void MainWindow::loadPreferences(bool configure_session) { QBtSession::instance()->addConsoleMessage(tr("Options were saved successfully.")); const Preferences pref; const bool newSystrayIntegration = pref.systrayIntegration(); - actionLock_qBittorrent->setEnabled(newSystrayIntegration); - if(newSystrayIntegration != (systrayIcon!=0)) { - if(newSystrayIntegration) { + actionLock_qBittorrent->setVisible(newSystrayIntegration); + if (newSystrayIntegration != (systrayIcon!=0)) { + if (newSystrayIntegration) { // create the trayicon if(!QSystemTrayIcon::isSystemTrayAvailable()) { if(!configure_session) { // Program startup diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index 01ac1c270..5af2d95d3 100644 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -109,10 +109,14 @@ options_imp::options_imp(QWidget *parent): // Load options loadOptions(); // Disable systray integration if it is not supported by the system - if(!QSystemTrayIcon::isSystemTrayAvailable()){ +#ifndef Q_WS_MAC + if (!QSystemTrayIcon::isSystemTrayAvailable()) { +#endif checkShowSystray->setChecked(false); checkShowSystray->setEnabled(false); +#ifndef Q_WS_MAC } +#endif #if !defined(Q_WS_X11) label_trayIconStyle->setVisible(false); comboTrayIcon->setVisible(false); diff --git a/src/preferences/preferences.h b/src/preferences/preferences.h index c33606b0c..58fafdd07 100644 --- a/src/preferences/preferences.h +++ b/src/preferences/preferences.h @@ -120,7 +120,11 @@ public: } bool systrayIntegration() const { +#ifdef Q_WS_MAC + return false; +#else return value(QString::fromUtf8("Preferences/General/SystrayEnabled"), true).toBool(); +#endif } void setSystrayIntegration(bool enabled) {