(trunk qt) #2417: Qt client closes when clicking X rather than close to tray

This commit is contained in:
Charles Kerr 2009-09-26 04:39:58 +00:00
parent d7c4537f2a
commit 34bfc1424c
2 changed files with 21 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include <iostream>
#include <QCheckBox>
#include <QCloseEvent>
#include <QDesktopServices>
#include <QFileDialog>
#include <QLabel>
@ -285,6 +286,23 @@ TrMainWindow :: ~TrMainWindow( )
*****
****/
void
TrMainWindow :: closeEvent( QCloseEvent * event )
{
// if they're using a tray icon, close to the tray
// instead of exiting
if( !myPrefs.getBool( Prefs :: SHOW_TRAY_ICON ) )
event->accept( );
else {
toggleWindows( false );
event->ignore( );
}
}
/****
*****
****/
void
TrMainWindow :: onSessionSourceChanged( )
{

View File

@ -50,6 +50,9 @@ class TrMainWindow: public QMainWindow
{
Q_OBJECT
private:
virtual void closeEvent( QCloseEvent * event );
private:
time_t myLastFullUpdateTime;
QDialog * mySessionDialog;