From a4350f4f17e102f36a457718e522552d12b4603b Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 19 Apr 2020 10:04:19 +0200 Subject: [PATCH] store Show All Musicians setting in the ini-file --- ChangeLog | 3 ++- src/client.cpp | 1 + src/client.h | 1 + src/clientdlg.cpp | 22 ++++++++++++---------- src/connectdlg.cpp | 11 ++++++++--- src/connectdlg.h | 3 +++ src/settings.cpp | 10 ++++++++++ 7 files changed, 37 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c4d5e89..4bde6568 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ 3.5.2git -TODO store Show All Musicians setting in the ini-file + * store Show All Musicians setting in the ini-file + TODO if you select server list filter all text and delete, the filter is not updated diff --git a/src/client.cpp b/src/client.cpp index 526f7de8..4a7d1975 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -37,6 +37,7 @@ CClient::CClient ( const quint16 iPortNumber, vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ), vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ), iNewClientFaderLevel ( 100 ), + bConnectDlgShowAllMusicians ( true ), vecWindowPosMain (), // empty array vecWindowPosSettings (), // empty array vecWindowPosChat (), // empty array diff --git a/src/client.h b/src/client.h index 1e890cd7..bcf60790 100755 --- a/src/client.h +++ b/src/client.h @@ -281,6 +281,7 @@ public: CVector vecStoredFaderIsSolo; CVector vecStoredFaderIsMute; int iNewClientFaderLevel; + bool bConnectDlgShowAllMusicians; // window position/state settings QByteArray vecWindowPosMain; diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 361b3e29..47cf4189 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -210,14 +210,12 @@ CClientDlg::CClientDlg ( CClient* pNCliP, ledBuffers->Reset(); ledDelay->Reset(); - - // init slider controls --- - // audio in fader + // init audio in fader sldAudioPan->setRange ( AUD_FADER_IN_MIN, AUD_FADER_IN_MAX ); sldAudioPan->setTickInterval ( AUD_FADER_IN_MAX / 5 ); UpdateAudioFaderSlider(); - // audio reverberation + // init audio reverberation sldAudioReverb->setRange ( 0, AUD_REVERB_MAX ); const int iCurAudReverb = pClient->GetReverbLevel(); sldAudioReverb->setValue ( iCurAudReverb ); @@ -226,6 +224,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP, // init reverb channel UpdateRevSelection(); + // init connect dialog + ConnectDlg.SetShowAllMusicians ( pClient->bConnectDlgShowAllMusicians ); + // set window title (with no clients connected -> "0") SetMyWindowTitle ( 0 ); @@ -579,13 +580,14 @@ void CClientDlg::closeEvent ( QCloseEvent* Event ) // store mixer fader settings (we have to hide all mixer faders first to // initiate a storage of the current mixer fader levels in case we are - // just in a connected state) + // just in a connected state) and other settings MainMixerBoard->HideAll(); - pClient->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags; - pClient->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels; - pClient->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo; - pClient->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute; - pClient->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel; + pClient->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags; + pClient->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels; + pClient->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo; + pClient->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute; + pClient->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel; + pClient->bConnectDlgShowAllMusicians = ConnectDlg.GetShowAllMusicians(); // default implementation of this event handler routine Event->accept(); diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index f993c835..c08c37ae 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -220,9 +220,6 @@ void CConnectDlg::RequestServerList() // clear filter edit box edtFilter->setText ( "" ); - // update Show All Musicians check box (this will call ShowAllMusicians()) - chbExpandAll->setCheckState ( bShowAllMusicians ? Qt::Checked : Qt::Unchecked ); - // get the IP address of the central server (using the ParseNetworAddress // function) when the connect dialog is opened, this seems to be the correct // time to do it @@ -516,6 +513,7 @@ void CConnectDlg::ShowAllMusicians ( const bool bState ) { bShowAllMusicians = bState; + // update list if ( bState ) { lvwServers->expandAll(); @@ -524,6 +522,13 @@ void CConnectDlg::ShowAllMusicians ( const bool bState ) { lvwServers->collapseAll(); } + + // update check box if necessary + if ( ( chbExpandAll->checkState() == Qt::Checked && !bShowAllMusicians ) || + ( chbExpandAll->checkState() == Qt::Unchecked && bShowAllMusicians ) ) + { + chbExpandAll->setCheckState ( bState ? Qt::Checked : Qt::Unchecked ); + } } void CConnectDlg::UpdateListFilter() diff --git a/src/connectdlg.h b/src/connectdlg.h index 39db1853..14aef15f 100755 --- a/src/connectdlg.h +++ b/src/connectdlg.h @@ -54,6 +54,9 @@ public: void Init ( const CVector& vstrIPAddresses ); void SetCentralServerAddress ( const QString strNewCentralServerAddr ) { strCentralServerAddress = strNewCentralServerAddr; } + void SetShowAllMusicians ( const bool bState ) { ShowAllMusicians ( bState ); } + bool GetShowAllMusicians() { return bShowAllMusicians; } + void SetServerList ( const CHostAddress& InetAddr, const CVector& vecServerInfo ); diff --git a/src/settings.cpp b/src/settings.cpp index fc7cc7bc..7ae68c17 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -106,6 +106,12 @@ void CSettings::Load() pClient->iNewClientFaderLevel = iValue; } + // connect dialog show all musicians + if ( GetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians", bValue ) ) + { + pClient->bConnectDlgShowAllMusicians = bValue; + } + // name pClient->ChannelInfo.strName = FromBase64ToString ( GetIniSetting ( IniXMLDocument, "client", "name_base64" ) ); @@ -469,6 +475,10 @@ void CSettings::Save() SetNumericIniSet ( IniXMLDocument, "client", "newclientlevel", pClient->iNewClientFaderLevel ); + // connect dialog show all musicians + SetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians", + pClient->bConnectDlgShowAllMusicians ); + // name PutIniSetting ( IniXMLDocument, "client", "name_base64", ToBase64 ( pClient->ChannelInfo.strName ) );