diff options
Diffstat (limited to 'src/gui/mphoneform.cpp')
-rw-r--r-- | src/gui/mphoneform.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/mphoneform.cpp b/src/gui/mphoneform.cpp index 7726a41..96a3519 100644 --- a/src/gui/mphoneform.cpp +++ b/src/gui/mphoneform.cpp @@ -183,6 +183,9 @@ void MphoneForm::init() menu = new QMenu(this); sysTray->setContextMenu(menu); + + connect(sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + this, SLOT(sysTrayIconClicked(QSystemTrayIcon::ActivationReason))); // Call menu menu->addAction(callInvite); @@ -363,7 +366,7 @@ void MphoneForm::closeEvent( QCloseEvent *e ) void MphoneForm::fileExit() { hide(); - QApplication::exit(0); + qApp->quit(); } // Append a string to the display window @@ -3186,3 +3189,14 @@ void MphoneForm::whatsThis() { QWhatsThis::enterWhatsThisMode(); } + +void MphoneForm::sysTrayIconClicked(QSystemTrayIcon::ActivationReason reason) +{ + if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::DoubleClick) + { + if (sys_config->get_gui_hide_on_close()) + setVisible(!isVisible()); + else + activateWindow(); + } +} |