fix: Unify both Quit actions to use the same function
Mac os tray quit not working
This commit is contained in:
parent
13b58f2f7a
commit
2294981525
2 changed files with 10 additions and 6 deletions
|
|
@ -271,12 +271,7 @@ void MainWindow::connectSlots()
|
||||||
connect(m_actionHelp, &QAction::triggered, this, &MainWindow::openHelpUrl);
|
connect(m_actionHelp, &QAction::triggered, this, &MainWindow::openHelpUrl);
|
||||||
connect(m_actionMinimize, &QAction::triggered, this, &MainWindow::hide);
|
connect(m_actionMinimize, &QAction::triggered, this, &MainWindow::hide);
|
||||||
|
|
||||||
connect(m_actionQuit, &QAction::triggered, qApp, [this] {
|
connect(m_actionQuit, &QAction::triggered, this, &MainWindow::quitApp);
|
||||||
qDebug() << "quitting application";
|
|
||||||
m_Quitting = true;
|
|
||||||
QApplication::quit();
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(m_actionRestore, &QAction::triggered, this, &MainWindow::showAndActivate);
|
connect(m_actionRestore, &QAction::triggered, this, &MainWindow::showAndActivate);
|
||||||
connect(m_actionSave, &QAction::triggered, this, &MainWindow::saveConfig);
|
connect(m_actionSave, &QAction::triggered, this, &MainWindow::saveConfig);
|
||||||
connect(m_actionSettings, &QAction::triggered, this, &MainWindow::openSettings);
|
connect(m_actionSettings, &QAction::triggered, this, &MainWindow::openSettings);
|
||||||
|
|
@ -534,6 +529,13 @@ void MainWindow::setModeClient()
|
||||||
m_ConfigScopes.save();
|
m_ConfigScopes.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::quitApp()
|
||||||
|
{
|
||||||
|
qDebug() << "quitting application";
|
||||||
|
m_Quitting = true;
|
||||||
|
QApplication::quit();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onWindowSaveTimerTimeout()
|
void MainWindow::onWindowSaveTimerTimeout()
|
||||||
{
|
{
|
||||||
saveWindow();
|
saveWindow();
|
||||||
|
|
@ -580,6 +582,7 @@ void MainWindow::open()
|
||||||
// Duplicate quit needed for mac os tray menu
|
// Duplicate quit needed for mac os tray menu
|
||||||
QAction *actionTrayQuit = new QAction(tr("Quit Deskflow"), this);
|
QAction *actionTrayQuit = new QAction(tr("Quit Deskflow"), this);
|
||||||
actionTrayQuit->setShortcut(QKeySequence::Quit);
|
actionTrayQuit->setShortcut(QKeySequence::Quit);
|
||||||
|
connect(actionTrayQuit, &QAction::triggered, this, &MainWindow::quitApp);
|
||||||
|
|
||||||
m_actionRestore->setText(tr("Open Deskflow"));
|
m_actionRestore->setText(tr("Open Deskflow"));
|
||||||
trayActions.insert(3, m_actionRestore);
|
trayActions.insert(3, m_actionRestore);
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::MainWindow> ui;
|
std::unique_ptr<Ui::MainWindow> ui;
|
||||||
|
|
||||||
|
void quitApp();
|
||||||
void updateSize();
|
void updateSize();
|
||||||
AppConfig &appConfig()
|
AppConfig &appConfig()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue