From 6596a464a4844e3cb4388b29bf24c947b81093fd Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 8 May 2011 17:53:29 +0000 Subject: [PATCH] unregister server on shutdown, add tooltip to server task bar icon --- src/llconserverdlg.cpp | 15 +++++++++++++++ src/llconserverdlg.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/llconserverdlg.cpp b/src/llconserverdlg.cpp index 517e1dd8..8e2bd5aa 100755 --- a/src/llconserverdlg.cpp +++ b/src/llconserverdlg.cpp @@ -132,6 +132,9 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, SystemTrayIcon.setContextMenu ( pSystemTrayIconMenu ); + // set tool text + SystemTrayIcon.setToolTip ( QString ( APP_NAME ) + tr ( " server" ) ); + // show icon of state "inactive" SystemTrayIcon.setIcon ( QIcon ( BitmapSystemTrayInactive ) ); SystemTrayIcon.show(); @@ -300,6 +303,18 @@ ListViewClients->setMinimumHeight ( 140 ); Timer.start ( GUI_CONTRL_UPDATE_TIME ); } +void CLlconServerDlg::closeEvent ( QCloseEvent* Event ) +{ + // if server was registered at the central server, unregister on shutdown + if ( pServer->GetServerListEnabled() ) + { + pServer->UnregisterSlaveServer(); + } + + // default implementation of this event handler routine + Event->accept(); +} + void CLlconServerDlg::OnStartOnOSStartStateChanged ( int value ) { const bool bCurAutoStartMinState = ( value == Qt::Checked ); diff --git a/src/llconserverdlg.h b/src/llconserverdlg.h index 0dc50cdc..a22dc0ae 100755 --- a/src/llconserverdlg.h +++ b/src/llconserverdlg.h @@ -65,6 +65,7 @@ public: protected: virtual void customEvent ( QEvent* pEvent ); virtual void changeEvent ( QEvent* pEvent ); + virtual void closeEvent ( QCloseEvent* Event ); void UpdateGUIDependencies(); void UpdateSystemTrayIcon ( const bool bIsActive );