mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
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 <michael@schuster.ms>
This commit is contained in:
parent
addb27a085
commit
aa18667905
2 changed files with 16 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
#include <QLabel>
|
||||
|
||||
#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<Application *>(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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue