1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-18 22:45:25 +02:00

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
This commit is contained in:
Amin Bandali 2021-05-25 14:52:39 -04:00 committed by Sébastien Blin
parent fe8b0bc243
commit e86538fac1
3 changed files with 23 additions and 6 deletions

View file

@ -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()
restoreApp(); restoreApp();
}); });
systrayMenu->addAction(exitAction); systrayMenu->addAction(quitAction);
systemTray_->setContextMenu(systrayMenu); systemTray_->setContextMenu(systrayMenu);
systemTray_->show(); systemTray_->show();
} }

View file

@ -612,6 +612,12 @@ Rectangle {
} }
} }
Shortcut {
sequence: StandardKey.Quit
context: Qt.ApplicationShortcut
onActivated: Qt.quit()
}
KeyBoardShortcutTable { KeyBoardShortcutTable {
id: shortcutsTable id: shortcutsTable
} }

View file

@ -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