Commit 32b59990 authored by Ronan's avatar Ronan

feat(app): add settings and about to tray icon

parent c84a0892
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>sende einen Befehl zur Anwendung für eine Kommandozeile</translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Schließen</translation>
</message>
<message>
<source>settings</source>
<translation>Einstellungen</translation>
</message>
<message>
<source>about</source>
<translation>Über</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>send an order to the application towards a command line</translation>
</message>
<message>
<source>restore</source>
<translation>Restore</translation>
</message>
<message>
<source>quit</source>
<translation>Quit</translation>
</message>
<message>
<source>settings</source>
<translation>Preferences</translation>
</message>
<message>
<source>about</source>
<translation>About</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>envoie un ordre à l&apos;application Linphone, voir --cli-help pour plus de détails</translation>
</message>
<message>
<source>restore</source>
<translation>Restorer</translation>
</message>
<message>
<source>quit</source>
<translation>Quitter</translation>
</message>
<message>
<source>settings</source>
<translation>Préférences</translation>
</message>
<message>
<source>about</source>
<translation>À propos</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>終了</translation>
</message>
<message>
<source>settings</source>
<translation>設定</translation>
</message>
<message>
<source>about</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>siųsti programai įsakymą į komandų eilutę</translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Išeiti</translation>
</message>
<message>
<source>settings</source>
<translation>Nuostatos</translation>
</message>
<message>
<source>about</source>
<translation>Apie</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>enviar um pedido para o aplicativo em direção a uma linha de comando</translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Sair</translation>
</message>
<message>
<source>settings</source>
<translation>Preferências</translation>
</message>
<message>
<source>about</source>
<translation>Sobre</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>отправка команды приложения через командную строку</translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Выйти</translation>
</message>
<message>
<source>settings</source>
<translation>Настройки</translation>
</message>
<message>
<source>about</source>
<translation>О программе</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Avsluta</translation>
</message>
<message>
<source>settings</source>
<translation>Inställningar</translation>
</message>
<message>
<source>about</source>
<translation>Om</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -76,6 +76,22 @@
<source>commandLineDescription</source>
<translation>komut satırıyla uygulamaya emir gönder</translation>
</message>
<message>
<source>restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>quit</source>
<translation>Çıkış</translation>
</message>
<message>
<source>settings</source>
<translation>Tercihler</translation>
</message>
<message>
<source>about</source>
<translation>Hakkında</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
......
......@@ -63,6 +63,9 @@ namespace {
constexpr int VersionUpdateCheckInterval = 86400000; // 24 hours in milliseconds.
constexpr char MainQmlUri[] = "Linphone";
constexpr char AttachVirtualWindowMethodName[] = "attachVirtualWindow";
constexpr char AboutPath[] = "qrc:/ui/views/App/Main/Dialogs/About.qml";
}
static inline bool installLocale (App &app, QTranslator &translator, const QLocale &locale) {
......@@ -463,14 +466,28 @@ void App::setTrayIcon () {
QSystemTrayIcon *systemTrayIcon = new QSystemTrayIcon(mEngine);
// trayIcon: Right click actions.
QAction *quitAction = new QAction("Quit", root);
root->connect(quitAction, &QAction::triggered, this, &App::quit);
QAction *settingsAction = new QAction(tr("settings"), root);
root->connect(settingsAction, &QAction::triggered, root, [this] {
App::smartShowWindow(getSettingsWindow());
});
QAction *aboutAction = new QAction(tr("about"), root);
root->connect(aboutAction, &QAction::triggered, root, [root] {
App::smartShowWindow(root);
QMetaObject::invokeMethod(
root, AttachVirtualWindowMethodName, Qt::DirectConnection,
Q_ARG(QVariant, QUrl(AboutPath)), Q_ARG(QVariant, QVariant()), Q_ARG(QVariant, QVariant())
);
});
QAction *restoreAction = new QAction("Restore", root);
QAction *restoreAction = new QAction(tr("restore"), root);
root->connect(restoreAction, &QAction::triggered, root, [root] {
smartShowWindow(root);
});
QAction *quitAction = new QAction(tr("quit"), root);
root->connect(quitAction, &QAction::triggered, this, &App::quit);
// trayIcon: Left click actions.
QMenu *menu = new QMenu();
root->connect(systemTrayIcon, &QSystemTrayIcon::activated, [root](
......@@ -485,6 +502,9 @@ void App::setTrayIcon () {
});
// Build trayIcon menu.
menu->addAction(settingsAction);
menu->addAction(aboutAction);
menu->addSeparator();
menu->addAction(restoreAction);
menu->addSeparator();
menu->addAction(quitAction);
......
......@@ -19,8 +19,8 @@ ApplicationWindow {
// ---------------------------------------------------------------------------
function attachVirtualWindow () {
Logic.attachVirtualWindow.apply(this, arguments)
function attachVirtualWindow (component, properties, exitStatusHandler) {
Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler)
}
function detachVirtualWindow () {
......
......@@ -19,8 +19,8 @@ Window {
// ---------------------------------------------------------------------------
function attachVirtualWindow () {
Logic.attachVirtualWindow.apply(this, arguments)
function attachVirtualWindow (component, properties, exitStatusHandler) {
Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler)
}
function detachVirtualWindow () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment