mirror of
https://github.com/transmission/transmission
synced 2025-03-04 18:48:06 +00:00
(trunk qt) #2417: Qt client closes when clicking X rather than close to tray
This commit is contained in:
parent
d7c4537f2a
commit
34bfc1424c
2 changed files with 21 additions and 0 deletions
|
@ -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( )
|
||||
{
|
||||
|
|
|
@ -50,6 +50,9 @@ class TrMainWindow: public QMainWindow
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
virtual void closeEvent( QCloseEvent * event );
|
||||
|
||||
private:
|
||||
time_t myLastFullUpdateTime;
|
||||
QDialog * mySessionDialog;
|
||||
|
|
Loading…
Add table
Reference in a new issue