- improved message for initial data loading
- Simulator wizard page before 1st model set page
- 1st model set component, forced directory loading (and not just displaying model cache)
This commit is contained in:
Klaus Basan
2018-08-19 00:01:01 +02:00
parent cbb0805c7e
commit b79aa0601c
8 changed files with 84 additions and 54 deletions

View File

@@ -38,7 +38,7 @@ namespace BlackGui
explicit CCockpitComponent(QWidget *parent = nullptr);
//! Destructor
virtual ~CCockpitComponent();
virtual ~CCockpitComponent() override;
//! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;

View File

@@ -36,8 +36,8 @@ namespace BlackGui
DataLoad,
CopyModels,
CopySettingsAndCaches,
FirstModelSet,
ConfigSimulator,
FirstModelSet,
XSwiftBus,
ConfigHotkeys
};
@@ -46,7 +46,7 @@ namespace BlackGui
explicit CConfigurationWizard(QWidget *parent = nullptr);
//! Destructor
virtual ~CConfigurationWizard();
virtual ~CConfigurationWizard() override;
//! Was the last step skipped?
bool lastStepSkipped() const;

View File

@@ -75,11 +75,11 @@
</property>
<item>
<widget class="BlackGui::Components::CInitialDataLoadComponent" name="comp_DataLoad">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
</size>
</property>
</widget>
</item>
@@ -135,26 +135,6 @@
</item>
</layout>
</widget>
<widget class="BlackGui::Components::CFirstModelSetWizardPage" name="wp_FirstModelSet">
<property name="title">
<string>First model set</string>
</property>
<property name="subTitle">
<string>Create a simple model set (for a start)</string>
</property>
<layout class="QVBoxLayout" name="vl_FirstModelSet">
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="pb_SkipFirstModelSet">
<property name="text">
<string> I do this later / do not need this </string>
</property>
</widget>
</item>
<item>
<widget class="BlackGui::Components::CFirstModelSetComponent" name="comp_FirstModelSet"/>
</item>
</layout>
</widget>
<widget class="BlackGui::Components::CConfigSimulatorWizardPage" name="wp_Simulator">
<property name="title">
<string>Simulator</string>
@@ -177,11 +157,38 @@
</property>
<item>
<widget class="BlackGui::Components::CConfigSimulatorComponent" name="comp_Simulator">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<property name="minimumSize">
<size>
<width>0</width>
<height>125</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</widget>
</item>
</layout>
</widget>
<widget class="BlackGui::Components::CFirstModelSetWizardPage" name="wp_FirstModelSet">
<property name="title">
<string>First model set</string>
</property>
<property name="subTitle">
<string>Create a simple model set (for a start)</string>
</property>
<layout class="QVBoxLayout" name="vl_FirstModelSet">
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="pb_SkipFirstModelSet">
<property name="text">
<string> I do this later / do not need this </string>
</property>
</widget>
</item>
<item>
<widget class="BlackGui::Components::CFirstModelSetComponent" name="comp_FirstModelSet">
<property name="minimumSize">
<size>
<width>0</width>
<height>175</height>
</size>
</property>
</widget>
</item>
@@ -389,5 +396,21 @@
</hint>
</hints>
</connection>
<connection>
<sender>pb_SkipFirstModelSet</sender>
<signal>clicked()</signal>
<receiver>CConfigurationWizard</receiver>
<slot>next()</slot>
<hints>
<hint type="sourcelabel">
<x>678</x>
<y>67</y>
</hint>
<hint type="destinationlabel">
<x>804</x>
<y>121</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -39,6 +39,11 @@ namespace BlackGui
return ui->comp_OwnModels->requestModelsInBackground(simulator, onlyIfNotEmpty);
}
int CDbOwnModelsDialog::getOwnModelsCount() const
{
return ui->comp_OwnModels->getOwnModelsCount();
}
const CDbOwnModelsComponent *CDbOwnModelsDialog::modelsComponent() const
{
return ui->comp_OwnModels;

View File

@@ -42,6 +42,9 @@ namespace BlackGui
//! \copydoc CDbOwnModelsComponent::requestModelsInBackground
bool requestModelsInBackground(const BlackMisc::Simulation::CSimulatorInfo &simulator, bool onlyIfNotEmpty);
//! \copydoc CDbOwnModelsComponent::getOwnModelsCount
int getOwnModelsCount() const;
//! Direct access to component
//! \remark allows to use the powerful component class
const CDbOwnModelsComponent *modelsComponent() const;

View File

@@ -145,8 +145,12 @@ namespace BlackGui
void CFirstModelSetComponent::openOwnModelsDialog()
{
if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
if (!m_modelsDialog) { return; }
const bool reload = (QObject::sender() == ui->pb_ModelsTriggerReload);
const CSimulatorInfo simulator = ui->comp_SimulatorSelector->getValue();
m_modelsDialog->setSimulator(simulator);
if (reload)
{
if (!sGui->getWebDataServices()->hasDbModelData())
@@ -154,12 +158,15 @@ namespace BlackGui
const QMessageBox::StandardButton reply = QMessageBox::warning(this->mainWindow(), "DB data", "No DB data, models cannot be consolidated. Load anyway?", QMessageBox::Yes | QMessageBox::No);
if (reply != QMessageBox::Yes) { return; }
}
const CSimulatorInfo simulator = ui->comp_SimulatorSelector->getValue();
m_modelsDialog->requestModelsInBackground(simulator, true);
}
const CSimulatorInfo simulator = ui->comp_SimulatorSelector->getValue();
m_modelsDialog->setSimulator(simulator);
bool loadOnlyIfNotEmpty = true;
if (m_modelsDialog->getOwnModelsCount() > 0)
{
const QMessageBox::StandardButton reply = QMessageBox::warning(this->mainWindow(), "Model loading", "Reload the models?\nThe xisting cache data will we overridden.", QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) { loadOnlyIfNotEmpty = false; }
}
m_modelsDialog->requestModelsInBackground(simulator, loadOnlyIfNotEmpty);
}
m_modelsDialog->exec();
// force UI update
@@ -221,7 +228,7 @@ namespace BlackGui
bool useAllModels = false;
if (!ui->comp_Distributors->hasSelectedDistributors())
{
const QMessageBox::StandardButton reply = QMessageBox::question(this->mainWindow(), "Models", "No distributors selected, use all model?", QMessageBox::Yes | QMessageBox::No);
const QMessageBox::StandardButton reply = QMessageBox::question(this->mainWindow(), "Models", "No distributors selected, use all models?", QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
useAllModels = true;

View File

@@ -27,7 +27,7 @@
<item>
<widget class="QLabel" name="lbl_Explaination">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;The model set defines which aircraft you will use in the simulator. From all models you have installed on your disk you can select a subset actually being used.&lt;br/&gt;&lt;br/&gt;1) Reload your models if not already done&lt;br/&gt;2) Create your model set and SAVE the model set&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;The model set defines aircraft you will use in the simulator. From all models you have installed on your disk you can select a subset actually being used for model matching.&lt;br/&gt;&lt;br/&gt;1) Reload your models if not already done&lt;br/&gt;2) Create your model set and SAVE the model set&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
@@ -178,6 +178,9 @@
</item>
<item row="1" 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>
@@ -218,6 +221,7 @@
<tabstop>pb_ModelsTriggerReload</tabstop>
<tabstop>le_ModelSetInfo</tabstop>
<tabstop>pb_ModelSet</tabstop>
<tabstop>pb_CreateModelSet</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -13,13 +13,7 @@
<property name="windowTitle">
<string>Initial data loading</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="vl_DataLoadComponent">
<layout class="QVBoxLayout" name="vl_DataLoadComponent" stretch="0,1">
<property name="leftMargin">
<number>4</number>
</property>
@@ -34,13 +28,7 @@
</property>
<item>
<widget class="QFrame" name="fr_Header">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="hl_HeaderText" stretch="1,6">
<layout class="QHBoxLayout" name="hl_HeaderText" stretch="0,1">
<item>
<widget class="QLabel" name="lbl_HeaderIcon">
<property name="textFormat">
@@ -54,7 +42,7 @@
<item>
<widget class="QLabel" name="lbl_HeaderText">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;We recommend to download an initial data set. This may take some time, but then you can start to use all tools with full functionality.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;We recommend to download an initial data set. This may take some time, but then you can start to use all tools with full functionality. You can wait until the load is completed and you see entries for all cache values (C#). Or you can already move on, &lt;/span&gt;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;loading continues in background&lt;/span&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>