Move helper functions to Utils::Gui namespace

This commit is contained in:
Chocobo1 2019-03-02 13:22:13 +08:00
parent 0f1fc7be9d
commit adbd34c795
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
21 changed files with 187 additions and 190 deletions

View file

@ -76,6 +76,10 @@ Q_IMPORT_PLUGIN(QICOPlugin)
#include "cmdoptions.h"
#include "upgrade.h"
#ifndef DISABLE_GUI
#include "gui/utils.h"
#endif
// Signal handlers
void sigNormalHandler(int signum);
#ifdef STACKTRACE
@ -328,7 +332,7 @@ void displayBadArgMessage(const QString &message)
QMessageBox msgBox(QMessageBox::Critical, QObject::tr("Bad command line"),
message + QLatin1Char('\n') + help, QMessageBox::Ok);
msgBox.show(); // Need to be shown or to moveToCenter does not work
msgBox.move(Utils::Misc::screenCenter(&msgBox));
msgBox.move(Utils::Gui::screenCenter(&msgBox));
msgBox.exec();
#else
const QString errMsg = QObject::tr("Bad command line: ") + '\n'
@ -364,7 +368,7 @@ bool userAgreesWithLegalNotice()
msgBox.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole);
const QAbstractButton *agreeButton = msgBox.addButton(QObject::tr("I Agree"), QMessageBox::AcceptRole);
msgBox.show(); // Need to be shown or to moveToCenter does not work
msgBox.move(Utils::Misc::screenCenter(&msgBox));
msgBox.move(Utils::Gui::screenCenter(&msgBox));
msgBox.exec();
if (msgBox.clickedButton() == agreeButton) {
// Save the answer