From a40b3b728cd4c42fe84f709ee86405743b410e0f Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 25 Aug 2018 14:46:30 +0200 Subject: [PATCH] Ref T306, copy directory settings in wizard --- .../copysettingsandcachescomponent.cpp | 14 + .../copysettingsandcachescomponent.h | 1 + .../copysettingsandcachescomponent.ui | 378 +++++++++--------- 3 files changed, 210 insertions(+), 183 deletions(-) diff --git a/src/blackgui/components/copysettingsandcachescomponent.cpp b/src/blackgui/components/copysettingsandcachescomponent.cpp index 86bae3c9c..782e744d7 100644 --- a/src/blackgui/components/copysettingsandcachescomponent.cpp +++ b/src/blackgui/components/copysettingsandcachescomponent.cpp @@ -26,6 +26,7 @@ using namespace BlackMisc::Input; using namespace BlackMisc::Network; using namespace BlackMisc::Network::Data; using namespace BlackMisc::Network::Settings; +using namespace BlackMisc::Settings; using namespace BlackMisc::Simulation::Settings; using namespace BlackCore::Audio; using namespace BlackCore::Application; @@ -74,6 +75,7 @@ namespace BlackGui readOnlyCheckbox(ui->cb_SettingsActionHotkeys, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsActionHotkeys.getFilename())); readOnlyCheckbox(ui->cb_SettingsTextMessages, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsTextMessage.getFilename())); readOnlyCheckbox(ui->cb_SettingsAtcStations, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsAtcStations.getFilename())); + readOnlyCheckbox(ui->cb_SettingsDirectories, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsDirectories.getFilename())); readOnlyCheckbox(ui->cb_SettingsConsolidation, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsConsolidation.getFilename())); readOnlyCheckbox(ui->cb_SettingsModel, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsModel.getFilename())); @@ -123,6 +125,7 @@ namespace BlackGui ui->cb_SettingsActionHotkeys->setText(checkBoxText(TActionHotkeys::humanReadable(), true)); ui->cb_SettingsAtcStations->setText(checkBoxText(TAtcStationsSettings::humanReadable(), true)); ui->cb_SettingsTextMessages->setText(checkBoxText(TextMessageSettings::humanReadable(), true)); + ui->cb_SettingsDirectories->setText(checkBoxText(TDirectorySettings::humanReadable(), true)); } void CCopySettingsAndCachesComponent::initModel() @@ -173,6 +176,17 @@ namespace BlackGui } } + // ------- directories ------- + if (ui->cb_SettingsDirectories->isChecked()) + { + const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsDirectories.getFilename()); + if (!joStr.isEmpty()) + { + const CDirectories directories = CDirectories::fromJsonNoThrow(joStr, true, success, errMsg); + if (this->parsingMessage(success, errMsg, m_settingsDirectories.getKey())) { this->displayStatusMessage(m_settingsDirectories.setAndSave(directories), directories.toQString(true)); } + } + } + // ------- network ------- if (ui->cb_SettingsNetworkTrafficServers->isChecked()) { diff --git a/src/blackgui/components/copysettingsandcachescomponent.h b/src/blackgui/components/copysettingsandcachescomponent.h index 84147b3e9..bdc5b3e22 100644 --- a/src/blackgui/components/copysettingsandcachescomponent.h +++ b/src/blackgui/components/copysettingsandcachescomponent.h @@ -122,6 +122,7 @@ namespace BlackGui BlackMisc::CSetting m_settingsEnabledSimulators { this }; BlackMisc::CSetting m_settingsActionHotkeys { this }; BlackMisc::CSetting m_settingsAudio { this }; + BlackMisc::CSetting m_settingsDirectories { this }; BlackMisc::CSetting m_settingsNetworkServers { this }; BlackMisc::CSetting m_settingsSimulatorFsx { this }; //!< FSX settings BlackMisc::CSetting m_settingsSimulatorFs9 { this }; //!< FS9 settings diff --git a/src/blackgui/components/copysettingsandcachescomponent.ui b/src/blackgui/components/copysettingsandcachescomponent.ui index cf9b1dfde..55672f1e4 100644 --- a/src/blackgui/components/copysettingsandcachescomponent.ui +++ b/src/blackgui/components/copysettingsandcachescomponent.ui @@ -13,7 +13,7 @@ Frame - + @@ -39,6 +39,59 @@ What to copy? + + + + Models + + + + + + Model + + + + + + + Consolidation + + + + + + + + + + Audio + + + + + + Audio1 + + + + + + + Audio2 + + + + + + + Audio3 + + + + + + @@ -79,156 +132,7 @@ - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Audio - - - - - - Audio1 - - - - - - - Audio2 - - - - - - - Audio3 - - - - - - - - - - UI - - - - - - UI1 - - - - - - - UI2 - - - - - - - UI3 - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Misc. - - - - - - Keys - - - - - - - ATC stations - - - - - - - Text Messages - - - - - - - - - - Models - - - - - - Model - - - - - - - Consolidation - - - - - - - - - - + @@ -243,36 +147,6 @@ 0 - - - - Network - - - - - - Network1 - - - - - - - Network2 - - - - - - - Network3 - - - - - - @@ -313,6 +187,139 @@ + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Misc. + + + + + + Keys + + + + + + + Directories + + + + + + + ATC stations + + + + + + + Text Messages + + + + + + + + + + + + + Network + + + + + + Network1 + + + + + + + Network2 + + + + + + + Network3 + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + UI + + + + + + UI1 + + + + + + + UI2 + + + + + + + UI3 + + + + + + + + + @@ -328,8 +335,8 @@ cb_SettingsAudio - cb_SettingsAudioInputDevice cb_SettingsAudioOutputDevice + cb_SettingsAudioInputDevice cb_SettingsGuiGeneral cb_SettingsDockWidget cb_SettingsViewUpdate @@ -337,10 +344,15 @@ cb_CacheLastNetworkServer cb_CacheLastVatsimServer cb_SettingsEnabledSimulators - cb_SettingsSimulatorFSX cb_SettingsSimulatorP3D + cb_SettingsSimulatorFSX cb_SettingsSimulatorXPlane + cb_SettingsModel + cb_SettingsConsolidation cb_SettingsActionHotkeys + cb_SettingsDirectories + cb_SettingsAtcStations + cb_SettingsTextMessages le_Status pb_DeselectAll pb_SelectAll