profile window management

This commit is contained in:
Volker Fischer 2015-01-31 08:18:17 +00:00
parent 928cf8196e
commit 09cbb9d2ab
2 changed files with 32 additions and 1 deletions

View file

@ -39,7 +39,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
ClientSettingsDlg ( pNCliP, parent, Qt::Window ), ClientSettingsDlg ( pNCliP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ), ChatDlg ( parent, Qt::Window ),
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ), ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ),
AnalyzerConsole ( pNCliP, parent, Qt::Window ) AnalyzerConsole ( pNCliP, parent, Qt::Window ),
MusicianProfileDlg ( pNCliP, parent )
{ {
setupUi ( this ); setupUi ( this );
@ -292,6 +293,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
pViewMenu->addAction ( tr ( "&Connection Setup..." ), this, pViewMenu->addAction ( tr ( "&Connection Setup..." ), this,
SLOT ( OnOpenConnectionSetupDialog() ) ); SLOT ( OnOpenConnectionSetupDialog() ) );
pViewMenu->addAction ( tr ( "My &Profile..." ), this,
SLOT ( OnOpenMusicianProfileDialog() ) );
pViewMenu->addAction ( tr ( "C&hat..." ), this, pViewMenu->addAction ( tr ( "C&hat..." ), this,
SLOT ( OnOpenChatDialog() ) ); SLOT ( OnOpenChatDialog() ) );
@ -414,6 +418,17 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
ShowChatWindow(); ShowChatWindow();
} }
// musician profile window
if ( !pClient->vecWindowPosProfile.isEmpty() && !pClient->vecWindowPosProfile.isNull() )
{
MusicianProfileDlg.restoreGeometry ( pClient->vecWindowPosProfile );
}
if ( pClient->bWindowWasShownProfile )
{
ShowMusicianProfileDialog();
}
// connection setup window // connection setup window
if ( !pClient->vecWindowPosConnect.isEmpty() && !pClient->vecWindowPosConnect.isNull() ) if ( !pClient->vecWindowPosConnect.isEmpty() && !pClient->vecWindowPosConnect.isNull() )
{ {
@ -573,15 +588,18 @@ void CClientDlg::closeEvent ( QCloseEvent* Event )
pClient->vecWindowPosMain = saveGeometry(); pClient->vecWindowPosMain = saveGeometry();
pClient->vecWindowPosSettings = ClientSettingsDlg.saveGeometry(); pClient->vecWindowPosSettings = ClientSettingsDlg.saveGeometry();
pClient->vecWindowPosChat = ChatDlg.saveGeometry(); pClient->vecWindowPosChat = ChatDlg.saveGeometry();
pClient->vecWindowPosProfile = MusicianProfileDlg.saveGeometry();
pClient->vecWindowPosConnect = ConnectDlg.saveGeometry(); pClient->vecWindowPosConnect = ConnectDlg.saveGeometry();
pClient->bWindowWasShownSettings = ClientSettingsDlg.isVisible(); pClient->bWindowWasShownSettings = ClientSettingsDlg.isVisible();
pClient->bWindowWasShownChat = ChatDlg.isVisible(); pClient->bWindowWasShownChat = ChatDlg.isVisible();
pClient->bWindowWasShownProfile = MusicianProfileDlg.isVisible();
pClient->bWindowWasShownConnect = ConnectDlg.isVisible(); pClient->bWindowWasShownConnect = ConnectDlg.isVisible();
// if settings/connect dialog or chat dialog is open, close it // if settings/connect dialog or chat dialog is open, close it
ClientSettingsDlg.close(); ClientSettingsDlg.close();
ChatDlg.close(); ChatDlg.close();
MusicianProfileDlg.close();
ConnectDlg.close(); ConnectDlg.close();
AnalyzerConsole.close(); AnalyzerConsole.close();
@ -867,6 +885,16 @@ void CClientDlg::ShowConnectionSetupDialog()
ConnectDlg.activateWindow(); 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() void CClientDlg::ShowGeneralSettings()
{ {
// open general settings dialog // open general settings dialog

View file

@ -81,6 +81,7 @@ protected:
void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetGUIDesign ( const EGUIDesign eNewDesign );
void SetMyWindowTitle ( const int iNumClients ); void SetMyWindowTitle ( const int iNumClients );
void ShowConnectionSetupDialog(); void ShowConnectionSetupDialog();
void ShowMusicianProfileDialog();
void ShowGeneralSettings(); void ShowGeneralSettings();
void ShowChatWindow ( const bool bForceRaise = true ); void ShowChatWindow ( const bool bForceRaise = true );
void ShowAnalyzerConsole(); void ShowAnalyzerConsole();
@ -111,6 +112,7 @@ protected:
CChatDlg ChatDlg; CChatDlg ChatDlg;
CConnectDlg ConnectDlg; CConnectDlg ConnectDlg;
CAnalyzerConsole AnalyzerConsole; CAnalyzerConsole AnalyzerConsole;
CMusProfDlg MusicianProfileDlg;
public slots: public slots:
void OnAboutToQuit() { pSettings->Save(); } void OnAboutToQuit() { pSettings->Save(); }
@ -137,6 +139,7 @@ public slots:
#endif #endif
void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); } void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); }
void OnOpenMusicianProfileDialog() { ShowMusicianProfileDialog(); }
void OnOpenGeneralSettings() { ShowGeneralSettings(); } void OnOpenGeneralSettings() { ShowGeneralSettings(); }
void OnOpenChatDialog() { ShowChatWindow(); } void OnOpenChatDialog() { ShowChatWindow(); }
void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); } void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }