mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +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
|
//! Simulator
|
||||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|
||||||
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
|
||||||
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
|
||||||
|
|
||||||
//! Deferred init of simulator
|
//! Deferred init of simulator
|
||||||
void triggerSetSimulatorDeferred(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void triggerSetSimulatorDeferred(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|
||||||
|
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
||||||
|
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
||||||
|
|
||||||
//! \copydoc CDbMappingComponentAware::setMappingComponent
|
//! \copydoc CDbMappingComponentAware::setMappingComponent
|
||||||
virtual void setMappingComponent(CDbMappingComponent *component) override;
|
virtual void setMappingComponent(CDbMappingComponent *component) override;
|
||||||
|
|
||||||
|
|||||||
@@ -272,6 +272,27 @@ namespace BlackGui
|
|||||||
modelsForSet = modelsForSet.findByDistributors(distributors);
|
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);
|
m_modelSetDialog->modelSetComponent()->setModelSet(modelsForSet, simulator);
|
||||||
ui->pb_ModelSet->click();
|
ui->pb_ModelSet->click();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>356</width>
|
<width>481</width>
|
||||||
<height>500</height>
|
<height>279</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Configure a 1st model set</string>
|
<string>Configure a 1st model set</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="vl_FirstModelSetComponent">
|
||||||
<item alignment="Qt::AlignTop">
|
<item alignment="Qt::AlignTop">
|
||||||
<widget class="QFrame" name="fr_Info">
|
<widget class="QFrame" name="fr_Info">
|
||||||
<layout class="QHBoxLayout" name="hl_Info" stretch="0,1">
|
<layout class="QHBoxLayout" name="hl_Info" stretch="0,1">
|
||||||
@@ -56,143 +56,174 @@
|
|||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gb_Simulator">
|
<widget class="QFrame" name="fr_ModelsAndSimulator">
|
||||||
<property name="title">
|
<layout class="QGridLayout" name="gl_ModelsAndSimulator">
|
||||||
<string>Simulator</string>
|
<property name="leftMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<layout class="QHBoxLayout" name="hl_Simulator">
|
</property>
|
||||||
<item>
|
<property name="topMargin">
|
||||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
<number>0</number>
|
||||||
<property name="minimumSize">
|
</property>
|
||||||
<size>
|
<property name="rightMargin">
|
||||||
<width>100</width>
|
<number>0</number>
|
||||||
<height>0</height>
|
</property>
|
||||||
</size>
|
<property name="bottomMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
</widget>
|
</property>
|
||||||
</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>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lbl_ModelDirectories">
|
<widget class="QGroupBox" name="gb_Simulator">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string>Model dir.:</string>
|
<string>Simulator</string>
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="1" column="0">
|
||||||
<widget class="QPushButton" name="pb_ChangeModelDir">
|
<widget class="QGroupBox" name="gb_Selection">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string>change</string>
|
<string>Selection</string>
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="1" rowspan="2">
|
||||||
<widget class="QPushButton" name="pb_ClearModelDir">
|
<widget class="QGroupBox" name="gb_Models">
|
||||||
<property name="toolTip">
|
<property name="title">
|
||||||
<string>clear directory or multiple directories</string>
|
<string>Models</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>
|
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -200,10 +231,16 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gb_Distributors">
|
<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">
|
<property name="title">
|
||||||
<string>Distributions</string>
|
<string>Distributions</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="vl_Distributors">
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributors"/>
|
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributors"/>
|
||||||
</item>
|
</item>
|
||||||
@@ -229,6 +266,20 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</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/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user