diff --git a/app/SysTray-X/SysTray-X-app/systrayx.cpp b/app/SysTray-X/SysTray-X-app/systrayx.cpp index fe30ec0..1298a11 100644 --- a/app/SysTray-X/SysTray-X-app/systrayx.cpp +++ b/app/SysTray-X/SysTray-X-app/systrayx.cpp @@ -321,6 +321,16 @@ void SysTrayX::createMenu() m_tray_icon_menu->addAction( m_about_action ); m_tray_icon_menu->addSeparator(); + /* + * Restart + */ + m_restart_action = new QAction(tr("&Restart"), this); + m_restart_action->setIcon( QIcon( ":/files/icons/windows-close.png" ) ); + connect( m_restart_action, &QAction::triggered, this, &SysTrayX::slotRestart ); + + m_tray_icon_menu->addAction( m_restart_action ); + m_tray_icon_menu->addSeparator(); + /* * Quit */ @@ -674,11 +684,6 @@ void SysTrayX::slotErrorAddOnShutdown() */ slotCloseApp(); - /* - * Restart Thunderbird? - */ - restartThunderbird(); - /* * Let's quit */ @@ -711,11 +716,6 @@ void SysTrayX::slotShutdown() */ emit signalClose(); - /* - * Restart Thunderbird? - */ - restartThunderbird(); - /* * Let's quit */ @@ -736,13 +736,17 @@ void SysTrayX::slotShutdown() /* - * Show the about dialog + * Quit the app by quit menu */ -void SysTrayX::restartThunderbird() +void SysTrayX::slotRestart() { QString platform = QGuiApplication::platformName(); QString os = m_preferences->getPlatformOs(); + emit signalConsole( QString( "Platform %1").arg(platform)); + emit signalConsole( QString( "OS %1").arg(os)); + + return; diff --git a/app/SysTray-X/SysTray-X-app/systrayx.h b/app/SysTray-X/SysTray-X-app/systrayx.h index 91abfb4..515198b 100644 --- a/app/SysTray-X/SysTray-X-app/systrayx.h +++ b/app/SysTray-X/SysTray-X-app/systrayx.h @@ -97,11 +97,6 @@ class SysTrayX : public QObject */ void resendMailCount(); - /** - * @brief restartThunderbird. restart thunderbird. - */ - void restartThunderbird(); - signals: /** @@ -183,6 +178,11 @@ class SysTrayX : public QObject */ void slotShutdown(); + /** + * @brief slotRestart. Handle restart request from the menu. + */ + void slotRestart(); + /** * @brief slotAbout. Handle about request from the menu. */ @@ -258,6 +258,7 @@ class SysTrayX : public QObject QAction* m_new_action; QAction* m_pref_action; QAction* m_about_action; + QAction* m_restart_action; QAction* m_quit_action; QList< QAction* > m_new_actions;