mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T515, mapping component improvements
* allow to re-display validation dialog * highlight disabled models
This commit is contained in:
committed by
Mat Sutcliffe
parent
6644927943
commit
583a5bfb28
@@ -25,6 +25,8 @@ namespace BlackGui
|
||||
ui(new Ui::CAircraftModelValidationComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
const CAircraftMatcherSetup setup = m_matchingSettings.get();
|
||||
ui->cb_EnableStartupCheck->setChecked(setup.doVerificationAtStartup());
|
||||
connect(ui->cb_EnableStartupCheck, &QCheckBox::toggled, this, &CAircraftModelValidationComponent::onCheckAtStartupChanged);
|
||||
connect(ui->pb_TempDisableInvalid, &QPushButton::released, this, &CAircraftModelValidationComponent::onButtonClicked);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ namespace BlackGui
|
||||
connect(ui->pb_ResetAircraft, &QPushButton::clicked, this, &CMappingComponent::onResetAircraft);
|
||||
connect(ui->pb_LoadModels, &QPushButton::clicked, this, &CMappingComponent::onModelsUpdateRequested);
|
||||
connect(ui->pb_DoMatchingAgain, &QPushButton::clicked, this, &CMappingComponent::doMatchingsAgain);
|
||||
connect(ui->pb_ValidateModelSet, &QPushButton::clicked, this, &CMappingComponent::requestValidationDialog);
|
||||
|
||||
m_currentMappingsViewDelegate = new CCheckBoxDelegate(":/diagona/icons/diagona/icons/tick.png", ":/diagona/icons/diagona/icons/cross.png", this);
|
||||
ui->tvp_RenderedAircraft->setItemDelegateForColumn(0, m_currentMappingsViewDelegate);
|
||||
@@ -411,8 +412,15 @@ namespace BlackGui
|
||||
|
||||
void CMappingComponent::onModelsUpdateRequested()
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
const CAircraftModelList modelSet(sGui->getIContextSimulator()->getModelSet());
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator()) { return; }
|
||||
CAircraftModelList modelSet(sGui->getIContextSimulator()->getModelSet());
|
||||
|
||||
const CAircraftModelList disabledModels = sGui->getIContextSimulator()->getDisabledModelsForMatching();
|
||||
const bool hasDisabledModels = !disabledModels.isEmpty();
|
||||
|
||||
ui->tvp_AircraftModels->setHighlightColor(Qt::red);
|
||||
ui->tvp_AircraftModels->setHighlight(hasDisabledModels);
|
||||
ui->tvp_AircraftModels->setHighlightModels(disabledModels);
|
||||
ui->tvp_AircraftModels->updateContainerMaybeAsync(modelSet);
|
||||
ui->tw_SpecializedViews->setCurrentIndex(TabAircraftModels);
|
||||
}
|
||||
@@ -425,6 +433,7 @@ namespace BlackGui
|
||||
sGui->getIContextSimulator()->disableModelsForMatching(models, true);
|
||||
const CStatusMessage m = CLogMessage(this).info(u"Disabled %1 model(s): %2") << models.size() << models.getCallsignsAsString(", ", true);
|
||||
this->showOverlayHTMLMessage(m, OverlayMessageMs);
|
||||
this->onModelsUpdateRequested();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@ namespace BlackGui
|
||||
//! Request a text message
|
||||
void requestTextMessageWidget(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
//! Request the validation dialog
|
||||
void requestValidationDialog();
|
||||
|
||||
private:
|
||||
//! Aircraft models available
|
||||
void onModelSetChanged(const BlackMisc::Simulation::CSimulatorInfo &dummy);
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gl_AircraftModifications">
|
||||
<layout class="QGridLayout" name="gl_AircraftModifications" columnstretch="0,0,1,1,1,1">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
@@ -170,7 +170,44 @@
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="2" column="3">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_Aircraft">
|
||||
<property name="toolTip">
|
||||
<string>aircraft enabled</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enbl.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QPushButton" name="pb_DoMatchingAgain">
|
||||
<property name="toolTip">
|
||||
<string>do all matchings again</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>re-match</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="6">
|
||||
<widget class="BlackGui::Components::CAircraftModelStringCompleter" name="completer_ModelStrings">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_AircraftIcon">
|
||||
<property name="text">
|
||||
<string>Icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QPushButton" name="pb_ResetAircraft">
|
||||
<property name="toolTip">
|
||||
<string>reset model by callsign</string>
|
||||
@@ -184,110 +221,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pb_DoMatchingAgain">
|
||||
<property name="toolTip">
|
||||
<string>do all matchings again</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>re-match</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="6">
|
||||
<widget class="BlackGui::Components::CAircraftModelStringCompleter" name="completer_ModelStrings">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QPushButton" name="pb_SaveAircraft">
|
||||
<property name="toolTip">
|
||||
<string>save selected model</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Aircraft">
|
||||
<property name="toolTip">
|
||||
<string>aircraft enabled</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enbl.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="le_Callsign">
|
||||
<property name="toolTip">
|
||||
<string>callsign of aircraft</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>callsign</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4" colspan="2">
|
||||
<widget class="QWidget" name="wi_LoadSet" native="true">
|
||||
<layout class="QHBoxLayout" name="hl_LoadSet">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="pb_LoadModels">
|
||||
<property name="toolTip">
|
||||
<string>load model set</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>load model set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="cb_AircraftEnabled">
|
||||
<property name="toolTip">
|
||||
<string>aircraft enabled/disable</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_AircraftIcon">
|
||||
<property name="text">
|
||||
<string>Icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="cb_AircraftIconDisplayed">
|
||||
<property name="toolTip">
|
||||
@@ -301,8 +234,68 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector"/>
|
||||
<item row="3" column="5">
|
||||
<widget class="QPushButton" name="pb_SaveAircraft">
|
||||
<property name="toolTip">
|
||||
<string>save selected model</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLineEdit" name="le_Callsign">
|
||||
<property name="toolTip">
|
||||
<string>callsign of aircraft</string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>callsign</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="cb_AircraftEnabled">
|
||||
<property name="toolTip">
|
||||
<string>aircraft enabled/disable</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="BlackGui::CElidedPushButton" name="pb_LoadModels">
|
||||
<property name="toolTip">
|
||||
<string>load model set</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>load model set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="pb_ValidateModelSet">
|
||||
<property name="text">
|
||||
<string>validate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2" alignment="Qt::AlignLeft">
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -311,6 +304,11 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CAircraftModelView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/aircraftmodelview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CSimulatorSelector</class>
|
||||
<extends>QFrame</extends>
|
||||
@@ -322,11 +320,6 @@
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/simulatedaircraftview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CAircraftModelView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/aircraftmodelview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CModelMatcherLogComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
@@ -345,11 +338,17 @@
|
||||
<header>blackgui/components/matchingstatisticscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::CElidedPushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>blackgui/elidedpushbutton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tw_SpecializedViews</tabstop>
|
||||
<tabstop>tvp_RenderedAircraft</tabstop>
|
||||
<tabstop>cb_AircraftIconDisplayed</tabstop>
|
||||
<tabstop>pb_ValidateModelSet</tabstop>
|
||||
<tabstop>pb_LoadModels</tabstop>
|
||||
<tabstop>cb_AircraftEnabled</tabstop>
|
||||
<tabstop>le_Callsign</tabstop>
|
||||
|
||||
@@ -310,7 +310,7 @@ void SwiftGuiStd::setContextAvailability()
|
||||
this->displayDBusReconnectDialog();
|
||||
}
|
||||
m_contextNetworkAvailable = m_coreAvailable && sGui->getIContextNetwork() && !sGui->getIContextNetwork()->isEmptyObject();
|
||||
m_contextAudioAvailable = m_coreAvailable && sGui->getIContextAudio() && !sGui->getIContextAudio()->isEmptyObject();
|
||||
m_contextAudioAvailable = m_coreAvailable && sGui->getIContextAudio() && !sGui->getIContextAudio()->isEmptyObject();
|
||||
|
||||
// react to a change in core's availability
|
||||
if (m_coreAvailable != corePreviouslyAvailable)
|
||||
@@ -437,15 +437,23 @@ void SwiftGuiStd::verifyPrerequisites()
|
||||
}
|
||||
|
||||
void SwiftGuiStd::onValidatedModelSet(const CSimulatorInfo &simulator, const CAircraftModelList &valid, const CAircraftModelList &invalid, bool stopped, const CStatusMessageList &msgs)
|
||||
{
|
||||
this->displayValidationDialog();
|
||||
m_validationDialog->validatedModelSet(simulator, valid, invalid, stopped, msgs);
|
||||
|
||||
// modal version
|
||||
// const int r = m_validationDialog->exec();
|
||||
// Q_UNUSED(r);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::displayValidationDialog()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (!m_validationDialog)
|
||||
{
|
||||
m_validationDialog.reset(new CAircraftModelSetValidationDialog(this));
|
||||
}
|
||||
m_validationDialog->validatedModelSet(simulator, valid, invalid, stopped, msgs);
|
||||
const int r = m_validationDialog->exec();
|
||||
Q_UNUSED(r);
|
||||
m_validationDialog->show();
|
||||
}
|
||||
|
||||
void SwiftGuiStd::checkDbDataLoaded()
|
||||
|
||||
@@ -272,6 +272,9 @@ private:
|
||||
//! Model set haas been verfied
|
||||
void onValidatedModelSet(const BlackMisc::Simulation::CSimulatorInfo &simulator, const BlackMisc::Simulation::CAircraftModelList &valid, const BlackMisc::Simulation::CAircraftModelList &invalid, bool stopped, const BlackMisc::CStatusMessageList &msgs);
|
||||
|
||||
//! Display validation dialog
|
||||
void displayValidationDialog();
|
||||
|
||||
//! Ckeck if the DB data have been loaded
|
||||
void checkDbDataLoaded();
|
||||
|
||||
|
||||
@@ -235,10 +235,10 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &SwiftGuiStd::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
|
||||
// login
|
||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::setMainPageToInfoArea);
|
||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::setMainPageToInfoArea);
|
||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::setMainPageToInfoArea);
|
||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||
connect(ui->comp_Login, &CLoginComponent::loginDataChangedDigest, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||
connect(ui->comp_Login, &CLoginComponent::loginDataChangedDigest, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||
connect(ui->comp_Login, &CLoginComponent::requestNetworkSettings, [ this ]()
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
@@ -258,7 +258,8 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(ui->comp_MainInfoArea->getAircraftComponent(), &CAircraftComponent::requestTextMessageWidget, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::showCorrespondingTab);
|
||||
connect(ui->comp_MainInfoArea->getUserComponent(), &CUserComponent::requestTextMessageWidget, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::showCorrespondingTab);
|
||||
|
||||
// interpolation
|
||||
// interpolation and validation
|
||||
connect(ui->comp_MainInfoArea->getMappingComponent(), &CMappingComponent::requestValidationDialog, this, &SwiftGuiStd::displayValidationDialog);
|
||||
connect(ui->comp_MainInfoArea->getInterpolationComponent(), &CInterpolationComponent::requestRenderingRestrictionsWidget, [ = ]
|
||||
{
|
||||
this->setSettingsPage(CSettingsComponent::SettingTabSimulator);
|
||||
|
||||
Reference in New Issue
Block a user