From: Kevin Ottens Date: Mon, 14 Dec 2020 14:58:52 +0000 (+0100) Subject: Have the new account wizard open again X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~472^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5ed397a430874c6b4fa803c9e10809d549c1848b;p=nextcloud-desktop.git Have the new account wizard open again UserModel can't be connected to AccountSettings if the settings dialog doesn't exist. This is the case now since we delay the creation of that dialog and free it after use. Instead it should be properly channeled through the Systray object all the way up to OwncloudGui which knows how to handle this properly. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index b878aa58a..b2e1b8e47 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -214,9 +214,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) _ui->encryptionMessage->hide(); } - connect(UserModel::instance(), &UserModel::addAccount, - this, &AccountSettings::slotOpenAccountWizard); - customizeStyle(); } @@ -251,17 +248,6 @@ QString AccountSettings::selectedFolderAlias() const return _model->data(selected, FolderStatusDelegate::FolderAliasRole).toString(); } -void AccountSettings::slotOpenAccountWizard() -{ - // We can't call isSystemTrayAvailable with appmenu-qt5 because it breaks the systemtray - // (issue #4693, #4944) - if (qgetenv("QT_QPA_PLATFORMTHEME") == "appmenu-qt5" || QSystemTrayIcon::isSystemTrayAvailable()) { - topLevelWidget()->close(); - } - - OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)), nullptr); -} - void AccountSettings::slotToggleSignInState() { if (_accountState->isSignedOut()) { diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index ade9d6c58..60671afd2 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -89,7 +89,6 @@ protected slots: void slotFolderWizardRejected(); void slotDeleteAccount(); void slotToggleSignInState(); - void slotOpenAccountWizard(); void refreshSelectiveSyncStatus(); void slotMarkSubfolderEncrypted(const FolderStatusModel::SubFolderInfo* folderInfo); void slotSubfolderContextMenuRequested(const QModelIndex& idx, const QPoint& point); diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 422c41b88..c8d33f982 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -119,6 +119,8 @@ Systray::Systray() connect(UserModel::instance(), &UserModel::newUserSelected, this, &Systray::slotNewUserSelected); + connect(UserModel::instance(), &UserModel::addAccount, + this, &Systray::openAccountWizard); connect(AccountManager::instance(), &AccountManager::accountAdded, this, &Systray::showWindow);