mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Some 1st model set wizard improvements
* only use DB models * icon for create button * confirm message before overriding the model set * info if there are no models
This commit is contained in:
committed by
Mat Sutcliffe
parent
cc6adc6c40
commit
a340167493
@@ -102,12 +102,12 @@ namespace BlackGui
|
||||
//! Simulator
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
||||
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
||||
|
||||
//! Deferred init of simulator
|
||||
void triggerSetSimulatorDeferred(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
||||
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
||||
|
||||
//! \copydoc CDbMappingComponentAware::setMappingComponent
|
||||
virtual void setMappingComponent(CDbMappingComponent *component) override;
|
||||
|
||||
|
||||
@@ -272,6 +272,27 @@ namespace BlackGui
|
||||
modelsForSet = modelsForSet.findByDistributors(distributors);
|
||||
}
|
||||
|
||||
if (ui->cb_DbDataOnly->isChecked()) { modelsForSet.removeObjectsWithoutDbKey(); }
|
||||
if (modelsForSet.isEmpty())
|
||||
{
|
||||
this->showOverlayHTMLMessage("Selection yielded no result!");
|
||||
return;
|
||||
}
|
||||
|
||||
// just in case, paranoia
|
||||
if (!m_modelSetDialog || !m_modelSetDialog->modelSetComponent())
|
||||
{
|
||||
this->showOverlayHTMLMessage("No model set dialog, cannot continue");
|
||||
return;
|
||||
}
|
||||
|
||||
const int modelsSetCount = m_modelSetDialog->modelSetComponent()->getModelSetCount();
|
||||
if (modelsSetCount > 0)
|
||||
{
|
||||
QMessageBox::StandardButton override = QMessageBox::question(this, "Override", "Override existing model set?", QMessageBox::Yes | QMessageBox::No);
|
||||
if (override != QMessageBox::Yes) { return; }
|
||||
}
|
||||
|
||||
m_modelSetDialog->modelSetComponent()->setModelSet(modelsForSet, simulator);
|
||||
ui->pb_ModelSet->click();
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>356</width>
|
||||
<height>500</height>
|
||||
<width>481</width>
|
||||
<height>279</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Configure a 1st model set</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="vl_FirstModelSetComponent">
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QFrame" name="fr_Info">
|
||||
<layout class="QHBoxLayout" name="hl_Info" stretch="0,1">
|
||||
@@ -56,143 +56,174 @@
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Simulator">
|
||||
<property name="title">
|
||||
<string>Simulator</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_Simulator">
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hs_Simulator">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Models">
|
||||
<property name="title">
|
||||
<string>Models</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gl_Models">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Models">
|
||||
<property name="text">
|
||||
<string>Models:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<widget class="QFrame" name="fr_ModelsAndSimulator">
|
||||
<layout class="QGridLayout" name="gl_ModelsAndSimulator">
|
||||
<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 row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_ModelDirectories">
|
||||
<property name="text">
|
||||
<string>Model dir.:</string>
|
||||
<widget class="QGroupBox" name="gb_Simulator">
|
||||
<property name="title">
|
||||
<string>Simulator</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_Simulator">
|
||||
<item alignment="Qt::AlignLeft">
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pb_ChangeModelDir">
|
||||
<property name="text">
|
||||
<string>change</string>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="gb_Selection">
|
||||
<property name="title">
|
||||
<string>Selection</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_Selection">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_DbDataOnly">
|
||||
<property name="text">
|
||||
<string>with DB data only</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pb_ClearModelDir">
|
||||
<property name="toolTip">
|
||||
<string>clear directory or multiple directories</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelDirectories">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model directory from settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_ModelSet">
|
||||
<property name="text">
|
||||
<string>Model set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelsInfo">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelSetInfo">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model set info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pb_Models">
|
||||
<property name="text">
|
||||
<string>display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pb_ModelSet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pb_ModelsTriggerReload">
|
||||
<property name="text">
|
||||
<string> reload </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pb_CreateModelSet">
|
||||
<property name="text">
|
||||
<string>create</string>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<widget class="QGroupBox" name="gb_Models">
|
||||
<property name="title">
|
||||
<string>Models</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gl_Models">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelDirectories">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model directory from settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Models">
|
||||
<property name="text">
|
||||
<string>Models:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_ModelSet">
|
||||
<property name="text">
|
||||
<string>Model set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_ModelDirectories">
|
||||
<property name="text">
|
||||
<string>Model dir.:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pb_ClearModelDir">
|
||||
<property name="toolTip">
|
||||
<string>clear directory or multiple directories</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pb_ModelSet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pb_Models">
|
||||
<property name="text">
|
||||
<string>display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pb_CreateModelSet">
|
||||
<property name="text">
|
||||
<string>create</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||
<normaloff>:/diagona/icons/diagona/icons/tick-white.png</normaloff>:/diagona/icons/diagona/icons/tick-white.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelsInfo">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="le_ModelSetInfo">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>model set info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pb_ModelsTriggerReload">
|
||||
<property name="text">
|
||||
<string> reload </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pb_ChangeModelDir">
|
||||
<property name="text">
|
||||
<string>change</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -200,10 +231,16 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Distributors">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Distributions</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="vl_Distributors">
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributors"/>
|
||||
</item>
|
||||
@@ -229,6 +266,20 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<tabstops>
|
||||
<tabstop>le_ModelDirectories</tabstop>
|
||||
<tabstop>pb_ClearModelDir</tabstop>
|
||||
<tabstop>pb_ChangeModelDir</tabstop>
|
||||
<tabstop>le_ModelsInfo</tabstop>
|
||||
<tabstop>pb_Models</tabstop>
|
||||
<tabstop>pb_ModelsTriggerReload</tabstop>
|
||||
<tabstop>cb_DbDataOnly</tabstop>
|
||||
<tabstop>le_ModelSetInfo</tabstop>
|
||||
<tabstop>pb_ModelSet</tabstop>
|
||||
<tabstop>pb_CreateModelSet</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user