Move checkAccountExists out of gui class.

This commit is contained in:
Klaas Freitag 2013-11-29 16:12:58 +01:00
parent 58eb000163
commit 2f708c0877
3 changed files with 8 additions and 9 deletions

View file

@ -204,8 +204,9 @@ void Application::slotStartUpdateDetector()
void Application::slotCheckConnection()
{
if( _gui->checkAccountExists(false) ) {
Account *account = AccountManager::instance()->account();
if( account ) {
AbstractCredentials* credentials(account->credentials());
if (! credentials->ready()) {
@ -216,8 +217,8 @@ void Application::slotCheckConnection()
runValidator();
}
} else {
// the call to checkConfigExists opens the setup wizard
// if the config does not exist. Nothing to do here.
// let gui open the setup wizard
_gui->slotOpenSettingsDialog( true );
}
}

View file

@ -81,7 +81,7 @@ ownCloudGui::ownCloudGui(Application *parent) :
}
// This should rather be in application.... or rather in MirallConfigFile?
bool ownCloudGui::checkAccountExists(bool openSettings)
void ownCloudGui::slotOpenSettingsDialog( bool openSettings )
{
// if account is set up, start the configuration wizard.
if( AccountManager::instance()->account() ) {
@ -91,13 +91,10 @@ bool ownCloudGui::checkAccountExists(bool openSettings)
} else {
_settingsDialog->close();
}
}
return true;
} else {
qDebug() << "No configured folders yet, starting setup wizard";
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
return false;
}
}
@ -112,7 +109,7 @@ void ownCloudGui::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
// Linux, not on Mac. They want a menu entry.
#if !defined Q_OS_MAC
if( reason == QSystemTrayIcon::Trigger ) {
checkAccountExists(true); // start settings if config is existing.
slotOpenSettingsDialog(true); // start settings if config is existing.
}
#endif
}

View file

@ -65,6 +65,7 @@ public slots:
void slotTrayClicked( QSystemTrayIcon::ActivationReason reason );
void slotToggleLogBrowser();
void slotOpenOwnCloud();
void slotOpenSettingsDialog( bool openSettings );
void slotHelp();
void slotOpenPath(const QString& path);
void slotAccountStateChanged();