Restart TB base setup

This commit is contained in:
Ximi1970
2025-09-21 20:35:53 +02:00
parent 4c677e0266
commit f0fd37f1ce
7 changed files with 64 additions and 1 deletions

View File

@@ -25,5 +25,7 @@
<file>files/icons/new-indicator-star-open.png</file>
<file>languages/SysTray-X.el.qm</file>
<file>languages/SysTray-X.fr.qm</file>
<file>files/restart.sh</file>
<file>files/restart.bat</file>
</qresource>
</RCC>

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,3 @@
#/bin/sh

View File

@@ -237,12 +237,21 @@ void Preferences::displayDebug()
}
/*
* Set the platform os
*/
const QString& Preferences::getPlatformOs() const
{
return m_platform_os;
}
/*
* Set the platform os
*/
void Preferences::setPlatformOs( const QString os )
{
m_platform_os = os;
m_platform_os = os;
}

View File

@@ -141,6 +141,13 @@ class Preferences : public QObject
*/
void displayDebug();
/**
* @brief getPlatformOs. Get the platform OS.
*
* @return The platform os.
*/
const QString& getPlatformOs() const;
/**
* @brief setPlatformOs. Set the platform OS.
*

View File

@@ -674,6 +674,11 @@ void SysTrayX::slotErrorAddOnShutdown()
*/
slotCloseApp();
/*
* Restart Thunderbird?
*/
restartThunderbird();
/*
* Let's quit
*/
@@ -706,6 +711,11 @@ void SysTrayX::slotShutdown()
*/
emit signalClose();
/*
* Restart Thunderbird?
*/
restartThunderbird();
/*
* Let's quit
*/
@@ -725,6 +735,32 @@ void SysTrayX::slotShutdown()
}
/*
* Show the about dialog
*/
void SysTrayX::restartThunderbird()
{
QString platform = QGuiApplication::platformName();
QString os = m_preferences->getPlatformOs();
return;
QString app = m_preferences->getCloseApp();
QString args = m_preferences->getCloseAppArgs();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QStringList args_list = args.split( ' ', Qt::SkipEmptyParts );
#else
QStringList args_list = args.split( ' ', QString::SkipEmptyParts );
#endif
if( !app.isEmpty() )
{
QProcess::startDetached( app, args_list );
}
}
/*
* Show the about dialog
*/

View File

@@ -97,6 +97,11 @@ class SysTrayX : public QObject
*/
void resendMailCount();
/**
* @brief restartThunderbird. restart thunderbird.
*/
void restartThunderbird();
signals:
/**