(trunk qt) #2321: in qt client in 1.73, When main window minimized click on tray icon does nothing

This commit is contained in:
Charles Kerr 2009-08-11 18:57:49 +00:00
parent cb79214854
commit 3cdaeef78f
2 changed files with 20 additions and 5 deletions

View File

@ -227,7 +227,7 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
myTrayIcon.setIcon( QApplication::windowIcon( ) );
connect( &myPrefs, SIGNAL(changed(int)), this, SLOT(refreshPref(int)) );
connect( ui.action_ShowMainWindow, SIGNAL(toggled(bool)), this, SLOT(toggleWindows()));
connect( ui.action_ShowMainWindow, SIGNAL(toggled(bool)), this, SLOT(toggleWindows(bool)));
connect( &myTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason)));
@ -883,16 +883,31 @@ TrMainWindow :: setStatusbarVisible( bool visible )
**/
void
TrMainWindow :: toggleWindows( )
TrMainWindow :: toggleWindows( bool doShow )
{
setVisible( !isVisible( ) );
if( !doShow )
{
hide( );
}
else
{
if ( !isVisible( ) ) show( );
if ( isMinimized( ) ) showNormal( );
activateWindow( );
raise( );
}
}
void
TrMainWindow :: trayActivated( QSystemTrayIcon::ActivationReason reason )
{
if( reason == QSystemTrayIcon::Trigger )
ui.action_ShowMainWindow->toggle( );
{
if( isMinimized ( ) )
toggleWindows( true );
else
ui.action_ShowMainWindow->toggle( );
}
}

View File

@ -118,7 +118,7 @@ class TrMainWindow: public QMainWindow
void toggleSpeedMode( );
void dataReadProgress( );
void dataSendProgress( );
void toggleWindows( );
void toggleWindows( bool doShow );
void onSetPrefs( );
void onSetPrefs( bool );
void onSessionSourceChanged( );