Tray: Add a 'New account...' action if no account is configured #5307

Useful when left-clicking the tray icon isn't working for some reason.
This commit is contained in:
Christian Kamm 2016-11-18 12:17:05 +01:00
parent 01528427b5
commit 6451eb3ade
2 changed files with 13 additions and 1 deletions

View file

@ -159,7 +159,7 @@ void ownCloudGui::slotOpenSettingsDialog()
}
} else {
qDebug() << "No configured folders yet, starting setup wizard";
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
slotNewAccountWizard();
}
}
@ -599,6 +599,9 @@ void ownCloudGui::updateContextMenu()
_contextMenu->addMenu(_recentActionsMenu);
_contextMenu->addSeparator();
}
if (accountList.isEmpty()) {
_contextMenu->addAction(_actionNewAccountWizard);
}
_contextMenu->addAction(_actionSettings);
if (!Theme::instance()->helpUrl().isEmpty()) {
_contextMenu->addAction(_actionHelp);
@ -723,11 +726,13 @@ void ownCloudGui::setupActions()
_actionStatus = new QAction(tr("Unknown status"), this);
_actionStatus->setEnabled( false );
_actionSettings = new QAction(tr("Settings..."), this);
_actionNewAccountWizard = new QAction(tr("New account..."), this);
_actionRecent = new QAction(tr("Details..."), this);
_actionRecent->setEnabled( true );
QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotShowSyncProtocol()));
QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotShowSettings()));
QObject::connect(_actionNewAccountWizard, SIGNAL(triggered(bool)), SLOT(slotNewAccountWizard()));
_actionHelp = new QAction(tr("Help"), this);
QObject::connect(_actionHelp, SIGNAL(triggered(bool)), SLOT(slotHelp()));
_actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
@ -890,6 +895,11 @@ void ownCloudGui::slotPauseAllFolders()
setPauseOnAllFoldersHelper(true);
}
void ownCloudGui::slotNewAccountWizard()
{
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
}
void ownCloudGui::setPauseOnAllFoldersHelper(bool pause)
{
QList<AccountState*> accounts;

View file

@ -94,6 +94,7 @@ private slots:
void slotLogout();
void slotUnpauseAllFolders();
void slotPauseAllFolders();
void slotNewAccountWizard();
private:
void setPauseOnAllFoldersHelper(bool pause);
@ -123,6 +124,7 @@ private:
QAction *_actionLogin;
QAction *_actionLogout;
QAction *_actionNewAccountWizard;
QAction *_actionSettings;
QAction *_actionStatus;
QAction *_actionEstimate;