Skip to content
Snippets Groups Projects
Commit e86538fa authored by Amin Bandali's avatar Amin Bandali Committed by Sébastien Blin
Browse files

mainview: add standard quit shortcut

Also rename 'Exit' to 'Quit' in the tray icon context menu for
non-Windows platforms for more standard/consistent terminology.

Change-Id: Id39bd308f17e56466ffb6b9c4929789646334b5e
parent fe8b0bc2
No related branches found
No related tags found
No related merge requests found
...@@ -479,11 +479,16 @@ MainApplication::initSystray() ...@@ -479,11 +479,16 @@ MainApplication::initSystray()
QMenu* systrayMenu = new QMenu(); QMenu* systrayMenu = new QMenu();
QAction* exitAction = new QAction(tr("Exit"), this); QString quitString;
connect(exitAction, &QAction::triggered, [this] { #ifdef Q_OS_WINDOWS
engine_->quit(); quitString = tr("E&xit");
cleanup(); #else
}); quitString = tr("&Quit");
#endif
QAction* quitAction = new QAction(quitString, this);
connect(quitAction, &QAction::triggered, this, &MainApplication::cleanup);
connect(systemTray_.get(), connect(systemTray_.get(),
&QSystemTrayIcon::activated, &QSystemTrayIcon::activated,
[this](QSystemTrayIcon::ActivationReason reason) { [this](QSystemTrayIcon::ActivationReason reason) {
...@@ -491,7 +496,7 @@ MainApplication::initSystray() ...@@ -491,7 +496,7 @@ MainApplication::initSystray()
restoreApp(); restoreApp();
}); });
systrayMenu->addAction(exitAction); systrayMenu->addAction(quitAction);
systemTray_->setContextMenu(systrayMenu); systemTray_->setContextMenu(systrayMenu);
systemTray_->show(); systemTray_->show();
} }
......
...@@ -612,6 +612,12 @@ Rectangle { ...@@ -612,6 +612,12 @@ Rectangle {
} }
} }
Shortcut {
sequence: StandardKey.Quit
context: Qt.ApplicationShortcut
onActivated: Qt.quit()
}
KeyBoardShortcutTable { KeyBoardShortcutTable {
id: shortcutsTable id: shortcutsTable
} }
......
...@@ -77,6 +77,12 @@ BaseDialog { ...@@ -77,6 +77,12 @@ BaseDialog {
Description: qsTr("Fullscreen") Description: qsTr("Fullscreen")
KeyLength: 1 KeyLength: 1
} }
// TODO: add the following after redesign
// ListElement {
// Shortcut: Qt.platform.os !== "windows" ? "Ctrl+Q" : "Alt+F4"
// Description: Qt.platform.os !== "windows" ? qsTr("Quit") : qsTr("Exit")
// KeyLength: 2
// }
} }
ListModel { ListModel {
id: keyboardConversationShortcutsModel id: keyboardConversationShortcutsModel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment