mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-05-07 06:36:29 +02:00
Quit app when not started from TB
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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:
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user