mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T286, fixes for copy component
* copy servers * clear status * refresh UI in "silent mode"
This commit is contained in:
@@ -156,7 +156,13 @@ namespace BlackGui
|
||||
|
||||
bool CCopyModelsFromOtherSwiftVersionsComponent::confirmOverride(const QString &msg)
|
||||
{
|
||||
if (ui->cb_Silent->isChecked()) { return true; }
|
||||
if (!sApp || sApp->isShuttingDown()) { return false; }
|
||||
if (ui->cb_Silent->isChecked())
|
||||
{
|
||||
// allow UI updates
|
||||
sApp->processEventsFor(50);
|
||||
return true;
|
||||
}
|
||||
const QMessageBox::StandardButton reply = QMessageBox::question(this, QStringLiteral("Confirm override"), withQUestionMark(msg), QMessageBox::Yes | QMessageBox::No);
|
||||
return reply == QMessageBox::Yes;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>508</width>
|
||||
<width>533</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -89,7 +89,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_Silent">
|
||||
<property name="text">
|
||||
<string>silent</string>
|
||||
<string>silent mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackGui
|
||||
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_SettingsNetworkTrafficServers, !CCacheSettingsUtils::hasOtherVersionSettingsFile(info, m_settingsNetworkServers.getFilename()));
|
||||
readOnlyCheckbox(ui->cb_CacheLastNetworkServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastNetworkServer.getFilename()));
|
||||
readOnlyCheckbox(ui->cb_CacheLastVatsimServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastVatsimServer.getFilename()));
|
||||
|
||||
@@ -133,8 +133,11 @@ namespace BlackGui
|
||||
|
||||
void CCopySettingsAndCachesComponent::copy()
|
||||
{
|
||||
ui->le_Status->clear();
|
||||
|
||||
const CApplicationInfo otherVersionInfo = ui->comp_OtherSwiftVersions->selectedOtherVersion();
|
||||
if (otherVersionInfo.isNull()) { return; }
|
||||
ui->le_Status->setText("Starting to copy from '" + otherVersionInfo.toQString(true) + "'");
|
||||
|
||||
// ------- audio -------
|
||||
if (ui->cb_SettingsAudio->isChecked())
|
||||
@@ -168,6 +171,16 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// ------- network -------
|
||||
if (ui->cb_SettingsNetworkTrafficServers->isChecked())
|
||||
{
|
||||
const QString joStr = CCacheSettingsUtils::otherVersionSettingsFileContent(otherVersionInfo, m_settingsNetworkServers.getFilename());
|
||||
if (!joStr.isEmpty())
|
||||
{
|
||||
const CServerList networkServers = CServerList::fromJson(joStr, true);
|
||||
this->displayStatusMessage(m_settingsNetworkServers.setAndSave(networkServers), networkServers.toQString(true));
|
||||
}
|
||||
}
|
||||
|
||||
if (ui->cb_CacheLastNetworkServer->isChecked())
|
||||
{
|
||||
const QString joStr = CCacheSettingsUtils::otherVersionCacheFileContent(otherVersionInfo, m_cacheLastNetworkServer.getFilename());
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace BlackGui
|
||||
BlackMisc::CSetting<BlackCore::Audio::TSettings> m_settingsAudio { this };
|
||||
BlackMisc::CSetting<BlackCore::Audio::TInputDevice> m_settingsAudioInputDevice { this };
|
||||
BlackMisc::CSetting<BlackCore::Audio::TOutputDevice> m_settingsAudioOutputDevice { this };
|
||||
BlackMisc::CSetting<BlackMisc::Network::Settings::TTrafficServers> m_settingsTrafficNetworkServers { this };
|
||||
BlackMisc::CSetting<BlackMisc::Network::Settings::TTrafficServers> m_settingsNetworkServers { this };
|
||||
BlackMisc::CSetting<Settings::TGeneralGui> m_settingsGuiGeneral { this };
|
||||
BlackMisc::CSetting<Settings::TDockWidget> m_settingsDockWidget { this };
|
||||
BlackMisc::CSetting<Settings::TViewUpdateSettings> m_settingsViewUpdate { this };
|
||||
|
||||
Reference in New Issue
Block a user