From 09cbb9d2ab8c3a74c894cb9cebb3616dbce11df9 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 31 Jan 2015 08:18:17 +0000 Subject: [PATCH] profile window management --- src/clientdlg.cpp | 30 +++++++++++++++++++++++++++++- src/clientdlg.h | 3 +++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index e5893a48..8e3d8275 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -39,7 +39,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP, ClientSettingsDlg ( pNCliP, parent, Qt::Window ), ChatDlg ( parent, Qt::Window ), ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ), - AnalyzerConsole ( pNCliP, parent, Qt::Window ) + AnalyzerConsole ( pNCliP, parent, Qt::Window ), + MusicianProfileDlg ( pNCliP, parent ) { setupUi ( this ); @@ -292,6 +293,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP, pViewMenu->addAction ( tr ( "&Connection Setup..." ), this, SLOT ( OnOpenConnectionSetupDialog() ) ); + pViewMenu->addAction ( tr ( "My &Profile..." ), this, + SLOT ( OnOpenMusicianProfileDialog() ) ); + pViewMenu->addAction ( tr ( "C&hat..." ), this, SLOT ( OnOpenChatDialog() ) ); @@ -414,6 +418,17 @@ CClientDlg::CClientDlg ( CClient* pNCliP, ShowChatWindow(); } + // musician profile window + if ( !pClient->vecWindowPosProfile.isEmpty() && !pClient->vecWindowPosProfile.isNull() ) + { + MusicianProfileDlg.restoreGeometry ( pClient->vecWindowPosProfile ); + } + + if ( pClient->bWindowWasShownProfile ) + { + ShowMusicianProfileDialog(); + } + // connection setup window if ( !pClient->vecWindowPosConnect.isEmpty() && !pClient->vecWindowPosConnect.isNull() ) { @@ -573,15 +588,18 @@ void CClientDlg::closeEvent ( QCloseEvent* Event ) pClient->vecWindowPosMain = saveGeometry(); pClient->vecWindowPosSettings = ClientSettingsDlg.saveGeometry(); pClient->vecWindowPosChat = ChatDlg.saveGeometry(); + pClient->vecWindowPosProfile = MusicianProfileDlg.saveGeometry(); pClient->vecWindowPosConnect = ConnectDlg.saveGeometry(); pClient->bWindowWasShownSettings = ClientSettingsDlg.isVisible(); pClient->bWindowWasShownChat = ChatDlg.isVisible(); + pClient->bWindowWasShownProfile = MusicianProfileDlg.isVisible(); pClient->bWindowWasShownConnect = ConnectDlg.isVisible(); // if settings/connect dialog or chat dialog is open, close it ClientSettingsDlg.close(); ChatDlg.close(); + MusicianProfileDlg.close(); ConnectDlg.close(); AnalyzerConsole.close(); @@ -867,6 +885,16 @@ void CClientDlg::ShowConnectionSetupDialog() ConnectDlg.activateWindow(); } +void CClientDlg::ShowMusicianProfileDialog() +{ + // show musician profile dialog + MusicianProfileDlg.show(); + + // make sure dialog is upfront and has focus + MusicianProfileDlg.raise(); + MusicianProfileDlg.activateWindow(); +} + void CClientDlg::ShowGeneralSettings() { // open general settings dialog diff --git a/src/clientdlg.h b/src/clientdlg.h index 77d7e8cb..43d0c901 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -81,6 +81,7 @@ protected: void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetMyWindowTitle ( const int iNumClients ); void ShowConnectionSetupDialog(); + void ShowMusicianProfileDialog(); void ShowGeneralSettings(); void ShowChatWindow ( const bool bForceRaise = true ); void ShowAnalyzerConsole(); @@ -111,6 +112,7 @@ protected: CChatDlg ChatDlg; CConnectDlg ConnectDlg; CAnalyzerConsole AnalyzerConsole; + CMusProfDlg MusicianProfileDlg; public slots: void OnAboutToQuit() { pSettings->Save(); } @@ -137,6 +139,7 @@ public slots: #endif void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); } + void OnOpenMusicianProfileDialog() { ShowMusicianProfileDialog(); } void OnOpenGeneralSettings() { ShowGeneralSettings(); } void OnOpenChatDialog() { ShowChatWindow(); } void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }