diff --git a/src/blackgui/components/configurationwizard.h b/src/blackgui/components/configurationwizard.h
index c9ea8a657..0668bace3 100644
--- a/src/blackgui/components/configurationwizard.h
+++ b/src/blackgui/components/configurationwizard.h
@@ -33,6 +33,7 @@ namespace BlackGui
enum Pages
{
Legal,
+ CopySettingsAndCaches,
CopyModels,
CopySettings,
CopyCaches,
diff --git a/src/blackgui/components/configurationwizard.ui b/src/blackgui/components/configurationwizard.ui
index 2cd628bf1..2806102ec 100644
--- a/src/blackgui/components/configurationwizard.ui
+++ b/src/blackgui/components/configurationwizard.ui
@@ -78,6 +78,31 @@
+
+
+ Copy settings and caches
+
+
+ Copy settings and caches from other swift versions
+
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+ -
+
+
+
+
Copy configuration from another installation
@@ -413,6 +438,18 @@
blackgui/components/legalinfocomponent.h
1
+
+ BlackGui::Components::CCopySettingsAndCachesComponent
+ QFrame
+ blackgui/components/copysettingsandcachescomponent.h
+ 1
+
+
+ BlackGui::Components::CCopySettingsAndCachesWizardPage
+ QWizardPage
+ blackgui/components/copysettingsandcachescomponent.h
+ 1
+
diff --git a/src/blackgui/components/copysettingsandcachescomponent.cpp b/src/blackgui/components/copysettingsandcachescomponent.cpp
new file mode 100644
index 000000000..7145b7fc1
--- /dev/null
+++ b/src/blackgui/components/copysettingsandcachescomponent.cpp
@@ -0,0 +1,388 @@
+/* Copyright (C) 2018
+ * swift project Community / Contributors
+ *
+ * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
+ * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
+ * including this file, may be copied, modified, propagated, or distributed except according to the terms
+ * contained in the LICENSE file.
+ */
+
+#include "copysettingsandcachescomponent.h"
+#include "ui_copysettingsandcachescomponent.h"
+#include "blackgui/guiapplication.h"
+#include "blackgui/guiutility.h"
+#include "blackmisc/cachesettingsutils.h"
+#include "blackmisc/json.h"
+#include "blackmisc/fileutils.h"
+#include "blackmisc/icons.h"
+
+#include
+#include
+#include
+
+using namespace BlackMisc;
+using namespace BlackMisc::Audio;
+using namespace BlackMisc::Input;
+using namespace BlackMisc::Network;
+using namespace BlackMisc::Network::Data;
+using namespace BlackMisc::Network::Settings;
+using namespace BlackMisc::Simulation::Settings;
+using namespace BlackCore::Audio;
+using namespace BlackCore::Application;
+using namespace BlackCore::Data;
+using namespace BlackGui::Settings;
+
+namespace BlackGui
+{
+ namespace Components
+ {
+ CCopySettingsAndCachesComponent::CCopySettingsAndCachesComponent(QWidget *parent) :
+ QFrame(parent),
+ ui(new Ui::CCopySettingsAndCachesComponent)
+ {
+ ui->setupUi(this);
+ this->initAll();
+ this->allCheckBoxesReadOnly();
+ connect(ui->pb_SelectAll, &QPushButton::clicked, this, &CCopySettingsAndCachesComponent::selectAll);
+ connect(ui->pb_DeselectAll, &QPushButton::clicked, this, &CCopySettingsAndCachesComponent::deselectAll);
+ connect(ui->pb_Copy, &QPushButton::clicked, this, &CCopySettingsAndCachesComponent::copy);
+ connect(ui->comp_OtherSwiftVersions, &COtherSwiftVersionsComponent::versionChanged, this, &CCopySettingsAndCachesComponent::onOtherVersionChanged);
+ }
+
+ CCopySettingsAndCachesComponent::~CCopySettingsAndCachesComponent()
+ { }
+
+ void CCopySettingsAndCachesComponent::onOtherVersionChanged(const CApplicationInfo &info)
+ {
+ readOnlyCheckbox(ui->cb_SettingsAudio, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsAudio.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsAudioInputDevice, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsAudio.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsAudioOutputDevice, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsAudioOutputDevice.getFilename()));
+
+ readOnlyCheckbox(ui->cb_SettingsNetworkTrafficServers, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsTrafficNetworkServers.getFilename()));
+ readOnlyCheckbox(ui->cb_CacheLastNetworkServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastNetworkServer.getFilename()));
+ readOnlyCheckbox(ui->cb_CacheLastVatsimServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastVatsimServer.getFilename()));
+
+ readOnlyCheckbox(ui->cb_SettingsGuiGeneral, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsGuiGeneral.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsDockWidget, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsDockWidget.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsViewUpdate, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsViewUpdate.getFilename()));
+
+ readOnlyCheckbox(ui->cb_SettingsEnabledSimulators, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsEnabledSimulators.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsSimulatorFSX, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsSimulatorFsx.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsSimulatorP3D, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsSimulatorP3D.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsSimulatorXPlane, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsSimulatorXPlane.getFilename()));
+
+ 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_SettingsConsolidation, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsConsolidation.getFilename()));
+ readOnlyCheckbox(ui->cb_SettingsModel, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsModel.getFilename()));
+ }
+
+ void CCopySettingsAndCachesComponent::initAll()
+ {
+ this->initAudio();
+ this->initNetwork();
+ this->initUi();
+ this->initSimulator();
+ this->initMisc();
+ this->initModel();
+ }
+
+ void CCopySettingsAndCachesComponent::initAudio()
+ {
+ ui->cb_SettingsAudio->setText(checkBoxText(TSettings::humanReadable(), true));
+ ui->cb_SettingsAudioInputDevice->setText(checkBoxText(TInputDevice::humanReadable(), true));
+ ui->cb_SettingsAudioOutputDevice->setText(checkBoxText(TOutputDevice::humanReadable(), true));
+ }
+
+ void CCopySettingsAndCachesComponent::initNetwork()
+ {
+ ui->cb_SettingsNetworkTrafficServers->setText(checkBoxText(TTrafficServers::humanReadable(), true));
+ ui->cb_CacheLastNetworkServer->setText(checkBoxText(TLastServer::humanReadable(), false));
+ ui->cb_CacheLastVatsimServer->setText(checkBoxText(TVatsimLastServer::humanReadable(), false));
+ }
+
+ void CCopySettingsAndCachesComponent::initUi()
+ {
+ ui->cb_SettingsGuiGeneral->setText(checkBoxText(TGeneralGui::humanReadable(), true));
+ ui->cb_SettingsDockWidget->setText(checkBoxText(TDockWidget::humanReadable(), true));
+ ui->cb_SettingsViewUpdate->setText(checkBoxText(TViewUpdateSettings::humanReadable(), true));
+ }
+
+ void CCopySettingsAndCachesComponent::initSimulator()
+ {
+ ui->cb_SettingsEnabledSimulators->setText(checkBoxText(TEnabledSimulators::humanReadable(), true));
+ ui->cb_SettingsSimulatorFSX->setText(checkBoxText(TSimulatorFsx::humanReadable(), true));
+ ui->cb_SettingsSimulatorP3D->setText(checkBoxText(TSimulatorP3D::humanReadable(), true));
+ ui->cb_SettingsSimulatorXPlane->setText(checkBoxText(TSimulatorXP::humanReadable(), true));
+ }
+
+ void CCopySettingsAndCachesComponent::initMisc()
+ {
+ ui->cb_SettingsActionHotkeys->setText(checkBoxText(TActionHotkeys::humanReadable(), true));
+ ui->cb_SettingsAtcStations->setText(checkBoxText(TAtcStationsSettings::humanReadable(), true));
+ ui->cb_SettingsTextMessages->setText(checkBoxText(TextMessageSettings::humanReadable(), true));
+ }
+
+ void CCopySettingsAndCachesComponent::initModel()
+ {
+ ui->cb_SettingsModel->setText(checkBoxText(TModel::humanReadable(), true));
+ ui->cb_SettingsConsolidation->setText(checkBoxText(TBackgroundConsolidation::humanReadable(), true));
+ }
+
+ void CCopySettingsAndCachesComponent::copy()
+ {
+ const CApplicationInfo otherVersionInfo = ui->comp_OtherSwiftVersions->selectedOtherVersion();
+ if (otherVersionInfo.isNull()) { return; }
+
+ // ------- audio -------
+ if (ui->cb_SettingsAudio->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsAudio.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const Audio::CSettings audioSettings = Audio::CSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsAudio.setAndSave(audioSettings), audioSettings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsAudioInputDevice->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsAudioInputDevice.getFilename());
+ const QString audioInputSettings = Json::firstJsonValueAsString(joStr);
+ if (!audioInputSettings.isEmpty())
+ {
+ this->displayStatusMessage(m_settingsAudioInputDevice.setAndSave(audioInputSettings), audioInputSettings);
+ }
+ }
+
+ if (ui->cb_SettingsAudioOutputDevice->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsAudioOutputDevice.getFilename());
+ const QString audioOutputSettings = Json::firstJsonValueAsString(joStr);
+ if (!audioOutputSettings.isEmpty())
+ {
+ this->displayStatusMessage(m_settingsAudioOutputDevice.setAndSave(audioOutputSettings), audioOutputSettings);
+ }
+ }
+
+ // ------- network -------
+ if (ui->cb_CacheLastNetworkServer->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionCacheFileContent(otherVersionInfo, m_cacheLastNetworkServer.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CServer server = CServer::fromJson(joStr, true);
+ this->displayStatusMessage(m_cacheLastNetworkServer.set(server), server.toQString(true));
+ }
+ }
+
+ if (ui->cb_CacheLastVatsimServer->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionCacheFileContent(otherVersionInfo, m_cacheLastVatsimServer.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CServer server = CServer::fromJson(joStr, true);
+ this->displayStatusMessage(m_cacheLastVatsimServer.set(server), server.toQString(true));
+ }
+ }
+
+ // ------- GUI -------
+ if (ui->cb_SettingsGuiGeneral->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsGuiGeneral.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CGeneralGuiSettings guiGeneral = CGeneralGuiSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsGuiGeneral.setAndSave(guiGeneral), guiGeneral.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsDockWidget->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsDockWidget.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CDockWidgetSettings dwSettings = CDockWidgetSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsDockWidget.setAndSave(dwSettings), dwSettings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsViewUpdate->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsViewUpdate.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CViewUpdateSettings viewUpdate = CViewUpdateSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsViewUpdate.setAndSave(viewUpdate), viewUpdate.toQString(true));
+ }
+ }
+
+ // ------- sims -------
+ if (ui->cb_SettingsEnabledSimulators->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsEnabledSimulators.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const QStringList enabledSims = Json::firstJsonValueAsStringList(joStr);
+ if (!enabledSims.isEmpty())
+ {
+ this->displayStatusMessage(m_settingsEnabledSimulators.setAndSave(enabledSims), enabledSims.join(", "));
+ }
+ }
+ }
+
+ if (ui->cb_SettingsSimulatorFSX->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsSimulatorFsx.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CSimulatorSettings settings = CSimulatorSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsSimulatorFsx.setAndSave(settings), settings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsSimulatorP3D->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsSimulatorP3D.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CSimulatorSettings settings = CSimulatorSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsSimulatorP3D.setAndSave(settings), settings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsSimulatorXPlane->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsSimulatorXPlane.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CSimulatorSettings settings = CSimulatorSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsSimulatorXPlane.setAndSave(settings), settings.toQString(true));
+ }
+ }
+
+ // ------ model ------
+ if (ui->cb_SettingsModel->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsModel.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CModelSettings settings = CModelSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsModel.setAndSave(settings), settings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsConsolidation->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsConsolidation.getFilename());
+ if (!joStr.isEmpty())
+ {
+ bool ok = false;
+ const int consolidation = Json::firstJsonValueAsInt(joStr, -1, &ok);
+ if (ok)
+ {
+ this->displayStatusMessage(m_settingsConsolidation.setAndSave(consolidation), QString::number(consolidation));
+ }
+ }
+ }
+
+ // ------ misc -------
+ if (ui->cb_SettingsActionHotkeys->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsActionHotkeys.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CActionHotkeyList hotkeys = CActionHotkeyList::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsActionHotkeys.setAndSave(hotkeys), hotkeys.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsAtcStations->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsAtcStations.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CAtcStationsSettings settings = CAtcStationsSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsAtcStations.setAndSave(settings), settings.toQString(true));
+ }
+ }
+
+ if (ui->cb_SettingsTextMessages->isChecked())
+ {
+ const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsTextMessage.getFilename());
+ if (!joStr.isEmpty())
+ {
+ const CTextMessageSettings settings = CTextMessageSettings::fromJson(joStr, true);
+ this->displayStatusMessage(m_settingsTextMessage.setAndSave(settings), settings.toQString(true));
+ }
+ }
+ }
+
+ void CCopySettingsAndCachesComponent::selectAll()
+ {
+ for (QCheckBox *cb : this->checkBoxes())
+ {
+ cb->setChecked(cb->isEnabled());
+ }
+ }
+
+ void CCopySettingsAndCachesComponent::deselectAll()
+ {
+ for (QCheckBox *cb : this->checkBoxes())
+ {
+ cb->setChecked(false);
+ }
+ }
+
+ QList CCopySettingsAndCachesComponent::checkBoxes() const
+ {
+ return this->findChildren();
+ }
+
+ void CCopySettingsAndCachesComponent::displayStatusMessage(const CStatusMessage &msg, const QString &value)
+ {
+ if (msg.isEmpty()) { return; }
+ if (value.isEmpty())
+ {
+ ui->le_Status->setText(msg.getMessage());
+ }
+ else
+ {
+ ui->le_Status->setText(msg.getMessage() % QStringLiteral(" ") % value);
+ }
+ if (sGui) { sGui->processEventsToRefreshGui(); }
+ }
+
+ void CCopySettingsAndCachesComponent::allCheckBoxesReadOnly()
+ {
+ for (QCheckBox *cb : checkBoxes())
+ {
+ readOnlyCheckbox(cb, true);
+ }
+ }
+
+ void CCopySettingsAndCachesComponent::readOnlyCheckbox(QCheckBox *cb, bool readOnly)
+ {
+ Q_ASSERT_X(cb, Q_FUNC_INFO, "need checkbox");
+ CGuiUtility::checkBoxReadOnly(cb, readOnly);
+ if (readOnly) { cb->setChecked(false); }
+ cb->setEnabled(!readOnly);
+ cb->setIcon(readOnly ? CIcons::cross16() : CIcons::tick16());
+ }
+
+ QString CCopySettingsAndCachesComponent::checkBoxText(const QString &text, bool setting)
+ {
+ static const QString s("%1 [setting]");
+ static const QString c("%1 [cache]");
+ return setting ? s.arg(text) : c.arg(text);
+ }
+
+ bool CCopySettingsAndCachesWizardPage::validatePage()
+ {
+ return true;
+ }
+
+ } // ns
+} // ns
diff --git a/src/blackgui/components/copysettingsandcachescomponent.h b/src/blackgui/components/copysettingsandcachescomponent.h
new file mode 100644
index 000000000..9a39f69a0
--- /dev/null
+++ b/src/blackgui/components/copysettingsandcachescomponent.h
@@ -0,0 +1,158 @@
+/* Copyright (C) 2018
+ * swift project Community / Contributors
+ *
+ * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
+ * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
+ * including this file, may be copied, modified, propagated, or distributed except according to the terms
+ * contained in the LICENSE file.
+ */
+
+//! \file
+
+#ifndef BLACKGUI_COMPONENTS_COPYSETTINGSANDCACHESCOMPONENT_H
+#define BLACKGUI_COMPONENTS_COPYSETTINGSANDCACHESCOMPONENT_H
+
+#include "blackgui/blackguiexport.h"
+#include "blackgui/settings/guisettings.h"
+#include "blackgui/settings/dockwidgetsettings.h"
+#include "blackgui/settings/viewupdatesettings.h"
+#include "blackgui/settings/textmessagesettings.h"
+#include "blackgui/settings/atcstationssettings.h"
+#include "blackcore/data/launchersetup.h"
+#include "blackcore/data/vatsimsetup.h"
+#include "blackcore/audio/audiosettings.h"
+#include "blackcore/application/applicationsettings.h"
+#include "blackcore/application/updatesettings.h"
+#include "blackmisc/simulation/data/modelcaches.h"
+#include "blackmisc/simulation/data/lastmodel.h"
+#include "blackmisc/simulation/settings/simulatorsettings.h"
+#include "blackmisc/simulation/settings/modelsettings.h"
+#include "blackmisc/network/data/lastserver.h"
+#include "blackmisc/network/settings/servers.h"
+#include "blackmisc/applicationinfo.h"
+
+#include
+#include
+#include
+#include
+#include
+
+namespace Ui { class CCopySettingsAndCachesComponent; }
+namespace BlackGui
+{
+ namespace Components
+ {
+ /**
+ * Copy settings and caches
+ */
+ class CCopySettingsAndCachesComponent : public QFrame
+ {
+ Q_OBJECT
+
+ public:
+ //! Ctor
+ explicit CCopySettingsAndCachesComponent(QWidget *parent = nullptr);
+
+ //! Dtor
+ virtual ~CCopySettingsAndCachesComponent();
+
+ private:
+ //! Other version has been changed
+ void onOtherVersionChanged(const BlackMisc::CApplicationInfo &info);
+
+ //! Init UI
+ void initAll();
+
+ //! Audio init
+ void initAudio();
+
+ //! Network init
+ void initNetwork();
+
+ //! UI init
+ void initUi();
+
+ //! Simulator init
+ void initSimulator();
+
+ //! Misc. init
+ void initMisc();
+
+ //! Model init
+ void initModel();
+
+ //! Copy
+ void copy();
+
+ //! Select all
+ void selectAll();
+
+ //! Deselect all
+ void deselectAll();
+
+ //! All checkboxes
+ QList checkBoxes() const;
+
+ //! Display status message
+ void displayStatusMessage(const BlackMisc::CStatusMessage &msg, const QString &value);
+
+ //! All check boxes read only
+ void allCheckBoxesReadOnly();
+
+ //! Enable checkbox
+ static void readOnlyCheckbox(QCheckBox *cb, bool readOnly);
+
+ //! Checkbox text
+ static QString checkBoxText(const QString &text, bool setting);
+
+ QScopedPointer ui;
+
+ BlackMisc::CSetting m_settingsAudio { this };
+ BlackMisc::CSetting m_settingsAudioInputDevice { this };
+ BlackMisc::CSetting m_settingsAudioOutputDevice { this };
+ BlackMisc::CSetting m_settingsTrafficNetworkServers { this };
+ BlackMisc::CSetting m_settingsGuiGeneral { this };
+ BlackMisc::CSetting m_settingsDockWidget { this };
+ BlackMisc::CSetting m_settingsViewUpdate { this };
+ BlackMisc::CSetting m_settingsEnabledSimulators { this };
+ BlackMisc::CSetting m_settingsActionHotkeys { this };
+ BlackMisc::CSetting m_settingsSimulatorFsx { this }; //!< FSX settings
+ BlackMisc::CSetting m_settingsSimulatorFs9 { this }; //!< FS9 settings
+ BlackMisc::CSetting m_settingsSimulatorP3D { this }; //!< P3D settings
+ BlackMisc::CSetting m_settingsSimulatorXPlane { this }; //!< XP settings
+ BlackMisc::CSetting m_settingsConsolidation { this }; //!< consolidation time
+ BlackMisc::CSetting m_settingsModel { this }; //!< model setting
+ BlackMisc::CSetting m_settingsAtcStations { this };
+ BlackMisc::CSetting m_settingsTextMessage { this };
+
+ BlackMisc::CData m_cacheLastNetworkServer { this }; //!< recently used server (VATSIM, other)
+ BlackMisc::CData m_cacheLastVatsimServer { this }; //!< recently used VATSIM server
+ BlackMisc::CData m_cacheModelSetCurrentSimulator { this };
+ BlackMisc::CData m_cacheModelsCurrentSimulator { this };
+ BlackMisc::CData m_cacheLastAircraftModel { this }; //!< recently used aircraft model
+ BlackMisc::CData m_cacheLauncherSetup { this };
+ BlackMisc::CData m_cacheVatsimSetup { this };
+ };
+
+ /**
+ * Wizard page for CCopySettingsAndCaches
+ */
+ class CCopySettingsAndCachesWizardPage : public QWizardPage
+ {
+ public:
+ //! Constructors
+ using QWizardPage::QWizardPage;
+
+ //! Set config
+ void setConfigComponent(CCopySettingsAndCachesComponent *config) { m_copyCachesAndSettings = config; }
+
+ //! \copydoc QWizardPage::validatePage
+ virtual bool validatePage() override;
+
+ private:
+ CCopySettingsAndCachesComponent *m_copyCachesAndSettings = nullptr;
+ };
+ } // ns
+} // ns
+
+#endif // guard
diff --git a/src/blackgui/components/copysettingsandcachescomponent.ui b/src/blackgui/components/copysettingsandcachescomponent.ui
new file mode 100644
index 000000000..cf9b1dfde
--- /dev/null
+++ b/src/blackgui/components/copysettingsandcachescomponent.ui
@@ -0,0 +1,351 @@
+
+
+ CCopySettingsAndCachesComponent
+
+
+
+ 0
+ 0
+ 379
+ 472
+
+
+
+ Frame
+
+
+ -
+
+
+ Select the version to copy from
+
+
+
-
+
+
+
+ 0
+ 125
+
+
+
+
+
+
+
+ -
+
+
+ What to copy?
+
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
-
+
+
+ true
+
+
+
+ -
+
+
+ deselect all
+
+
+
+ -
+
+
+ select all
+
+
+
+ -
+
+
+ copy
+
+
+
+
+
+
+ -
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Network
+
+
+
-
+
+
+ Network1
+
+
+
+ -
+
+
+ Network2
+
+
+
+ -
+
+
+ Network3
+
+
+
+
+
+
+ -
+
+
+ Simulator
+
+
+
-
+
+
+ Enabled sims
+
+
+
+ -
+
+
+ FSX
+
+
+
+ -
+
+
+ P3D
+
+
+
+ -
+
+
+ XPlane
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BlackGui::Components::COtherSwiftVersionsComponent
+ QFrame
+ blackgui/components/otherswiftversionscomponent.h
+ 1
+
+
+
+ cb_SettingsAudio
+ cb_SettingsAudioInputDevice
+ cb_SettingsAudioOutputDevice
+ cb_SettingsGuiGeneral
+ cb_SettingsDockWidget
+ cb_SettingsViewUpdate
+ cb_SettingsNetworkTrafficServers
+ cb_CacheLastNetworkServer
+ cb_CacheLastVatsimServer
+ cb_SettingsEnabledSimulators
+ cb_SettingsSimulatorFSX
+ cb_SettingsSimulatorP3D
+ cb_SettingsSimulatorXPlane
+ cb_SettingsActionHotkeys
+ le_Status
+ pb_DeselectAll
+ pb_SelectAll
+ pb_Copy
+
+
+
+