diff options
author | Stephan Beyer <s-beyer@gmx.net> | 2020-07-07 00:17:33 +0300 |
---|---|---|
committer | Kevin Ottens <ervin@ipsquad.net> | 2020-07-23 22:08:53 +0300 |
commit | cd008ffe59c08014ccb3b8fff8f364c508e8bc7c (patch) | |
tree | aed63dfac5198eac1cca130c92d6cad498d19926 /src/gui/systray.cpp | |
parent | 3fd32e55f99bf3e9190e77778c410624ec4555cc (diff) |
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 <s-beyer@gmx.net>
Diffstat (limited to 'src/gui/systray.cpp')
-rw-r--r-- | src/gui/systray.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 |