diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 5dc280bdc8ed2..c6f3aa66e8f47 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -85,6 +85,9 @@ ownCloudGui::ownCloudGui(Application *parent) connect(_tray.data(), &Systray::openHelp, this, &ownCloudGui::slotHelp); + connect(_tray.data(), &Systray::openMainDialog, + this, &ownCloudGui::slotOpenMainDialog); + connect(_tray.data(), &Systray::openSettings, this, &ownCloudGui::slotShowSettings); @@ -164,7 +167,7 @@ void ownCloudGui::slotOpenMainDialog() void ownCloudGui::slotTrayClicked(QSystemTrayIcon::ActivationReason reason) { - if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::Context) { + if (reason == QSystemTrayIcon::Trigger) { if (OwncloudSetupWizard::bringWizardToFrontIfVisible()) { // brought wizard to front } else if (_shareDialogs.size() > 0) { diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 93c0eba09e83f..15f9d668e141e 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef USE_FDO_NOTIFICATIONS #include @@ -79,6 +80,14 @@ Systray::Systray() } ); +#ifndef Q_OS_MAC + auto contextMenu = new QMenu(); + contextMenu->addAction(tr("Open main dialog"), this, &Systray::openMainDialog); + contextMenu->addAction(tr("Settings"), this, &Systray::openSettings); + contextMenu->addAction(tr("Exit %1").arg(Theme::instance()->appNameGUI()), this, &Systray::shutdown); + setContextMenu(contextMenu); +#endif + connect(UserModel::instance(), &UserModel::newUserSelected, this, &Systray::slotNewUserSelected); diff --git a/src/gui/systray.h b/src/gui/systray.h index 8f1612a2a2f49..e4d27c06583dd 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -64,6 +64,7 @@ class Systray signals: void currentUserChanged(); + void openMainDialog(); void openSettings(); void openHelp(); void shutdown(); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 92183f59fe764..d940b535e74f3 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -211,19 +211,13 @@ Window { } MenuItem { - text: qsTr("Open settings") + text: qsTr("Settings") font.pixelSize: Style.topLinePixelSize onClicked: Systray.openSettings() } MenuItem { - text: qsTr("Help") - font.pixelSize: Style.topLinePixelSize - onClicked: Systray.openHelp() - } - - MenuItem { - text: qsTr("Quit Nextcloud") + text: qsTr("Exit"); font.pixelSize: Style.topLinePixelSize onClicked: Systray.shutdown() }