From: Stephan Beyer Date: Mon, 6 Jul 2020 21:17:33 +0000 (+0200) Subject: Let context menu open wizard if there are no accounts X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~51 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cd008ffe59c08014ccb3b8fff8f364c508e8bc7c;p=nextcloud-desktop.git Let context menu open wizard if there are no accounts The context menu offers to open the main dialog and the settings even if no accounts are configured. In this case, the main dialog is useless and the settings are probably confusing. Hence, this commit replaces these actions in the context menu by an action to open the wizard (which also opens on left click, so this is the most natural thing to do). Signed-off-by: Stephan Beyer --- diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 22876641d..825844fcb 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::openAccountWizard, + this, &ownCloudGui::slotNewAccountWizard); + connect(_tray.data(), &Systray::openMainDialog, this, &ownCloudGui::slotOpenMainDialog); diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 23ffa5429..07f8e3353 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -82,8 +82,12 @@ 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); + if (AccountManager::instance()->accounts().isEmpty()) { + contextMenu->addAction(tr("Add account"), this, &Systray::openAccountWizard); + } else { + 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 diff --git a/src/gui/systray.h b/src/gui/systray.h index b78aa72ee..995d7c619 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -64,6 +64,7 @@ public: signals: void currentUserChanged(); + void openAccountWizard(); void openMainDialog(); void openSettings(); void openHelp();