refactor: MainWindow remove test menu
This commit is contained in:
@ -81,9 +81,7 @@ MainWindow::MainWindow()
|
||||
m_actionRestore{new QAction(tr("&Open Deskflow"), this)},
|
||||
m_actionSettings{new QAction(tr("Preferences"), this)},
|
||||
m_actionStartCore{new QAction(tr("&Start"), this)},
|
||||
m_actionStopCore{new QAction(tr("S&top"), this)},
|
||||
m_actionTestCriticalError{new QAction(tr("Test Critical Error"), this)},
|
||||
m_actionTestFatalError{new QAction(tr("Test Fatal Error"), this)}
|
||||
m_actionStopCore{new QAction(tr("S&top"), this)}
|
||||
{
|
||||
const auto themeName = QStringLiteral("deskflow-%1").arg(iconMode());
|
||||
if (QIcon::themeName().isEmpty())
|
||||
@ -303,8 +301,6 @@ void MainWindow::connectSlots()
|
||||
connect(m_actionSettings, &QAction::triggered, this, &MainWindow::openSettings);
|
||||
connect(m_actionStartCore, &QAction::triggered, this, &MainWindow::startCore);
|
||||
connect(m_actionStopCore, &QAction::triggered, this, &MainWindow::stopCore);
|
||||
connect(m_actionTestFatalError, &QAction::triggered, this, &MainWindow::testFatalError);
|
||||
connect(m_actionTestCriticalError, &QAction::triggered, this, &MainWindow::testCriticalError);
|
||||
|
||||
connect(&m_versionChecker, &VersionChecker::updateFound, this, &MainWindow::versionCheckerUpdateFound);
|
||||
|
||||
@ -439,16 +435,6 @@ void MainWindow::stopCore()
|
||||
m_coreProcess.stop();
|
||||
}
|
||||
|
||||
void MainWindow::testFatalError() const
|
||||
{
|
||||
qFatal() << "test fatal error";
|
||||
}
|
||||
|
||||
void MainWindow::testCriticalError() const
|
||||
{
|
||||
qCritical() << "test critical error";
|
||||
}
|
||||
|
||||
void MainWindow::clearSettings()
|
||||
{
|
||||
if (!messages::showClearSettings(this)) {
|
||||
@ -676,14 +662,6 @@ void MainWindow::createMenuBar()
|
||||
menuBar->addMenu(menuEdit);
|
||||
menuBar->addMenu(menuHelp);
|
||||
|
||||
const auto enableTestMenu = QVariant(qEnvironmentVariable("DESKFLOW_TEST_MENU")).toBool();
|
||||
if (enableTestMenu || kDebugBuild) {
|
||||
auto testMenu = new QMenu(tr("Test"));
|
||||
menuBar->addMenu(testMenu);
|
||||
testMenu->addAction(m_actionTestFatalError);
|
||||
testMenu->addAction(m_actionTestCriticalError);
|
||||
}
|
||||
|
||||
setMenuBar(menuBar);
|
||||
}
|
||||
|
||||
|
||||
@ -115,8 +115,6 @@ private:
|
||||
void startCore();
|
||||
void stopCore();
|
||||
bool saveServerConfig();
|
||||
void testFatalError() const;
|
||||
void testCriticalError() const;
|
||||
void resetCore();
|
||||
|
||||
void showMyFingerprint();
|
||||
@ -206,6 +204,4 @@ private:
|
||||
QAction *m_actionSettings = nullptr;
|
||||
QAction *m_actionStartCore = nullptr;
|
||||
QAction *m_actionStopCore = nullptr;
|
||||
QAction *m_actionTestCriticalError = nullptr;
|
||||
QAction *m_actionTestFatalError = nullptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user