Changeset 13750
- Timestamp:
- Jan 4, 2013, 12:00:55 AM (8 years ago)
- Location:
- branches/2.7x/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.7x/qt/mainwin.cc
r13555 r13750 251 251 252 252 connect( &myPrefs, SIGNAL(changed(int)), this, SLOT(refreshPref(int)) ); 253 connect( ui.action_ShowMainWindow, SIGNAL(t oggled(bool)), this, SLOT(toggleWindows(bool)));253 connect( ui.action_ShowMainWindow, SIGNAL(triggered(bool)), this, SLOT(toggleWindows(bool))); 254 254 connect( &myTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 255 255 this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); 256 256 257 ui.action_ShowMainWindow->setChecked( !minimized );257 toggleWindows( !minimized ); 258 258 ui.action_TrayIcon->setChecked( minimized || prefs.getBool( Prefs::SHOW_TRAY_ICON ) ); 259 259 … … 307 307 TrMainWindow :: ~TrMainWindow( ) 308 308 { 309 }310 311 /****312 *****313 ****/314 315 void316 TrMainWindow :: closeEvent( QCloseEvent * event )317 {318 // if they're using a tray icon, close to the tray319 // instead of exiting320 if( !myPrefs.getBool( Prefs :: SHOW_TRAY_ICON ) )321 event->accept( );322 else {323 toggleWindows( false );324 event->ignore( );325 }326 309 } 327 310 … … 568 551 569 552 void 553 TrMainWindow :: showEvent( QShowEvent * event ) 554 { 555 Q_UNUSED (event); 556 557 ui.action_ShowMainWindow->setChecked(true); 558 } 559 560 /**** 561 ***** 562 ****/ 563 564 void 565 TrMainWindow :: hideEvent( QHideEvent * event ) 566 { 567 Q_UNUSED (event); 568 569 if (!isVisible()) 570 ui.action_ShowMainWindow->setChecked(false); 571 } 572 573 /**** 574 ***** 575 ****/ 576 577 void 570 578 TrMainWindow :: onPrefsDestroyed( ) 571 579 { … … 994 1002 toggleWindows( true ); 995 1003 else 996 ui.action_ShowMainWindow->toggle();1004 toggleWindows( !isVisible() ); 997 1005 } 998 1006 } … … 1080 1088 ui.action_TrayIcon->setChecked( b ); 1081 1089 myTrayIcon.setVisible( b ); 1090 dynamic_cast<MyApp*>(QCoreApplication::instance())->setQuitOnLastWindowClosed(!b); 1082 1091 refreshTrayIconSoon( ); 1083 1092 break; -
branches/2.7x/qt/mainwin.h
r13446 r13750 53 53 54 54 private: 55 virtual void closeEvent( QCloseEvent * event ); 55 virtual void hideEvent( QHideEvent * event ); 56 virtual void showEvent( QShowEvent * event ); 56 57 57 58 private:
Note: See TracChangeset
for help on using the changeset viewer.