mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-10-26 07:46:09 +01:00
Add menu item
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user