mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +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)
|
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);
|
const QMessageBox::StandardButton reply = QMessageBox::question(this, QStringLiteral("Confirm override"), withQUestionMark(msg), QMessageBox::Yes | QMessageBox::No);
|
||||||
return reply == QMessageBox::Yes;
|
return reply == QMessageBox::Yes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>508</width>
|
<width>533</width>
|
||||||
<height>495</height>
|
<height>495</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cb_Silent">
|
<widget class="QCheckBox" name="cb_Silent">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>silent</string>
|
<string>silent mode</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace BlackGui
|
|||||||
readOnlyCheckbox(ui->cb_SettingsAudioInputDevice, !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_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_CacheLastNetworkServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastNetworkServer.getFilename()));
|
||||||
readOnlyCheckbox(ui->cb_CacheLastVatsimServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastVatsimServer.getFilename()));
|
readOnlyCheckbox(ui->cb_CacheLastVatsimServer, !CCacheSettingsUtils::hasOtherVersionCacheFile(info, m_cacheLastVatsimServer.getFilename()));
|
||||||
|
|
||||||
@@ -133,8 +133,11 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CCopySettingsAndCachesComponent::copy()
|
void CCopySettingsAndCachesComponent::copy()
|
||||||
{
|
{
|
||||||
|
ui->le_Status->clear();
|
||||||
|
|
||||||
const CApplicationInfo otherVersionInfo = ui->comp_OtherSwiftVersions->selectedOtherVersion();
|
const CApplicationInfo otherVersionInfo = ui->comp_OtherSwiftVersions->selectedOtherVersion();
|
||||||
if (otherVersionInfo.isNull()) { return; }
|
if (otherVersionInfo.isNull()) { return; }
|
||||||
|
ui->le_Status->setText("Starting to copy from '" + otherVersionInfo.toQString(true) + "'");
|
||||||
|
|
||||||
// ------- audio -------
|
// ------- audio -------
|
||||||
if (ui->cb_SettingsAudio->isChecked())
|
if (ui->cb_SettingsAudio->isChecked())
|
||||||
@@ -168,6 +171,16 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------- network -------
|
// ------- 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())
|
if (ui->cb_CacheLastNetworkServer->isChecked())
|
||||||
{
|
{
|
||||||
const QString joStr = CCacheSettingsUtils::otherVersionCacheFileContent(otherVersionInfo, m_cacheLastNetworkServer.getFilename());
|
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::TSettings> m_settingsAudio { this };
|
||||||
BlackMisc::CSetting<BlackCore::Audio::TInputDevice> m_settingsAudioInputDevice { this };
|
BlackMisc::CSetting<BlackCore::Audio::TInputDevice> m_settingsAudioInputDevice { this };
|
||||||
BlackMisc::CSetting<BlackCore::Audio::TOutputDevice> m_settingsAudioOutputDevice { 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::TGeneralGui> m_settingsGuiGeneral { this };
|
||||||
BlackMisc::CSetting<Settings::TDockWidget> m_settingsDockWidget { this };
|
BlackMisc::CSetting<Settings::TDockWidget> m_settingsDockWidget { this };
|
||||||
BlackMisc::CSetting<Settings::TViewUpdateSettings> m_settingsViewUpdate { this };
|
BlackMisc::CSetting<Settings::TViewUpdateSettings> m_settingsViewUpdate { this };
|
||||||
|
|||||||
Reference in New Issue
Block a user