mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-13 20:15:23 +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:
parent
fe8b0bc243
commit
e86538fac1
3 changed files with 23 additions and 6 deletions
|
@ -479,11 +479,16 @@ MainApplication::initSystray()
|
|||
|
||||
QMenu* systrayMenu = new QMenu();
|
||||
|
||||
QAction* exitAction = new QAction(tr("Exit"), this);
|
||||
connect(exitAction, &QAction::triggered, [this] {
|
||||
engine_->quit();
|
||||
cleanup();
|
||||
});
|
||||
QString quitString;
|
||||
#ifdef Q_OS_WINDOWS
|
||||
quitString = tr("E&xit");
|
||||
#else
|
||||
quitString = tr("&Quit");
|
||||
#endif
|
||||
|
||||
QAction* quitAction = new QAction(quitString, this);
|
||||
connect(quitAction, &QAction::triggered, this, &MainApplication::cleanup);
|
||||
|
||||
connect(systemTray_.get(),
|
||||
&QSystemTrayIcon::activated,
|
||||
[this](QSystemTrayIcon::ActivationReason reason) {
|
||||
|
@ -491,7 +496,7 @@ MainApplication::initSystray()
|
|||
restoreApp();
|
||||
});
|
||||
|
||||
systrayMenu->addAction(exitAction);
|
||||
systrayMenu->addAction(quitAction);
|
||||
systemTray_->setContextMenu(systrayMenu);
|
||||
systemTray_->show();
|
||||
}
|
||||
|
|
|
@ -612,6 +612,12 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.Quit
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: Qt.quit()
|
||||
}
|
||||
|
||||
KeyBoardShortcutTable {
|
||||
id: shortcutsTable
|
||||
}
|
||||
|
|
|
@ -77,6 +77,12 @@ BaseDialog {
|
|||
Description: qsTr("Fullscreen")
|
||||
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 {
|
||||
id: keyboardConversationShortcutsModel
|
||||
|
|
Loading…
Add table
Reference in a new issue