From: Michael Schuster Date: Sat, 21 Dec 2019 02:16:22 +0000 (+0100) Subject: WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) upon showing SettingsDialog X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~458 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aa18667905881acdbf817f364bab79d3ea221c65;p=nextcloud-desktop.git WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) upon showing SettingsDialog Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden behind the SettingsDialog, and the users have to minimize a lot of other windows to find them again. See previous commit for dependent implementation details. Signed-off-by: Michael Schuster --- diff --git a/src/gui/creds/webflowcredentialsdialog.cpp b/src/gui/creds/webflowcredentialsdialog.cpp index 9971f8f34..7a1485bd1 100644 --- a/src/gui/creds/webflowcredentialsdialog.cpp +++ b/src/gui/creds/webflowcredentialsdialog.cpp @@ -4,6 +4,8 @@ #include #include "theme.h" +#include "application.h" +#include "owncloudgui.h" #include "wizard/owncloudwizardcommon.h" #include "wizard/webview.h" #include "wizard/flow2authwidget.h" @@ -37,6 +39,9 @@ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlo connect(_webView, &WebView::urlCatched, this, &WebFlowCredentialsDialog::urlCatched); } + auto app = static_cast(qApp); + connect(app, &Application::isShowingSettingsDialog, this, &WebFlowCredentialsDialog::slotShowSettingsDialog); + _errorLabel = new QLabel(); _errorLabel->hide(); _layout->addWidget(_errorLabel); @@ -82,4 +87,12 @@ void WebFlowCredentialsDialog::setError(const QString &error) { } } +void WebFlowCredentialsDialog::slotShowSettingsDialog() +{ + // bring window to top but slightly delay, to avoid being hidden behind the SettingsDialog + QTimer::singleShot(100, this, [this] { + ownCloudGui::raiseDialog(this); + }); +} + } diff --git a/src/gui/creds/webflowcredentialsdialog.h b/src/gui/creds/webflowcredentialsdialog.h index a540f0edb..9885eef29 100644 --- a/src/gui/creds/webflowcredentialsdialog.h +++ b/src/gui/creds/webflowcredentialsdialog.h @@ -31,6 +31,9 @@ public: protected: void closeEvent(QCloseEvent * e) override; +public slots: + void slotShowSettingsDialog(); + signals: void urlCatched(const QString user, const QString pass, const QString host);