mirror of
https://github.com/tnodir/fort
synced 2024-11-15 16:36:59 +00:00
UI: FortManager: Extract activateModalWidget().
This commit is contained in:
parent
feb671ab7f
commit
4b8dfd2dc9
@ -29,8 +29,6 @@
|
||||
#include "model/zonelistmodel.h"
|
||||
#include "stat/quotamanager.h"
|
||||
#include "stat/statmanager.h"
|
||||
#include "task/taskinfo.h"
|
||||
#include "task/taskinfoupdatechecker.h"
|
||||
#include "task/taskinfozonedownloader.h"
|
||||
#include "task/taskmanager.h"
|
||||
#include "translationmanager.h"
|
||||
@ -43,7 +41,6 @@
|
||||
#include "util/logger.h"
|
||||
#include "util/nativeeventfilter.h"
|
||||
#include "util/net/hostinfocache.h"
|
||||
#include "util/net/netutil.h"
|
||||
#include "util/osutil.h"
|
||||
#include "util/startuputil.h"
|
||||
#include "util/stringutil.h"
|
||||
@ -609,10 +606,7 @@ bool FortManager::checkPassword()
|
||||
return true;
|
||||
|
||||
if (g_passwordDialogOpened) {
|
||||
auto dialog = qApp->activeModalWidget();
|
||||
if (dialog) {
|
||||
dialog->activateWindow();
|
||||
}
|
||||
activateModalWidget();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -790,3 +784,11 @@ QWidget *FortManager::focusWidget() const
|
||||
auto w = QApplication::focusWidget();
|
||||
return w ? w : m_mainWindow;
|
||||
}
|
||||
|
||||
void FortManager::activateModalWidget()
|
||||
{
|
||||
auto w = qApp->activeModalWidget();
|
||||
if (w) {
|
||||
w->activateWindow();
|
||||
}
|
||||
}
|
||||
|
@ -170,6 +170,7 @@ private:
|
||||
void onTrayMessageClicked();
|
||||
|
||||
QWidget *focusWidget() const;
|
||||
static void activateModalWidget();
|
||||
|
||||
private:
|
||||
bool m_initialized : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user