diff --git a/app/SysTray-X/systrayx.cpp b/app/SysTray-X/systrayx.cpp index 2d2ce56..60d3464 100644 --- a/app/SysTray-X/systrayx.cpp +++ b/app/SysTray-X/systrayx.cpp @@ -38,6 +38,14 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent ) */ m_win_ctrl = new WindowCtrl( m_preferences ); + if( !m_win_ctrl->thunderbirdStart() ) + { + /* + * Let's quit + */ + exit(0); + } + /* * Setup the link */ diff --git a/app/SysTray-X/windowctrl.cpp b/app/SysTray-X/windowctrl.cpp index 09c38d4..2b5313b 100644 --- a/app/SysTray-X/windowctrl.cpp +++ b/app/SysTray-X/windowctrl.cpp @@ -50,6 +50,18 @@ WindowCtrl::WindowCtrl( Preferences* pref, QObject *parent ) } +/* + * Is thunderbird our parent? + */ +bool WindowCtrl::thunderbirdStart() const +{ + return isThunderbird( getPpid() ); +} + + +/* + * Test func 1 + */ void WindowCtrl::slotWindowTest1() { emit signalConsole("Test 1 started"); @@ -67,6 +79,9 @@ void WindowCtrl::slotWindowTest1() } +/* + * Test func 2 + */ void WindowCtrl::slotWindowTest2() { emit signalConsole("Test 2 started"); @@ -81,6 +96,9 @@ void WindowCtrl::slotWindowTest2() } +/* + * Test func 3 + */ void WindowCtrl::slotWindowTest3() { emit signalConsole("Test 3 started"); diff --git a/app/SysTray-X/windowctrl.h b/app/SysTray-X/windowctrl.h index e17dd4c..de89bc1 100644 --- a/app/SysTray-X/windowctrl.h +++ b/app/SysTray-X/windowctrl.h @@ -40,6 +40,13 @@ class WindowCtrl : public QObject */ explicit WindowCtrl( Preferences* pref, QObject *parent = nullptr ); + /** + * @brief thunderbirdStart. Has the app been started by TB. + * + * @return True if Thunderbird is our parent. + */ + bool thunderbirdStart() const; + public slots: /**