mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
refs #745, improved own model set dialog
* allow to consolidate data * display either preferences or all distributors * builder can consolidate * get model set from mapping component
This commit is contained in:
@@ -58,21 +58,36 @@ namespace BlackGui
|
||||
this->initDistributorDisplay();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::useSelectedDistributors() const
|
||||
bool COwnModelSetForm::optionUseSelectedDistributors() const
|
||||
{
|
||||
return this->ui->rb_SelectedDistributors->isChecked();
|
||||
return ui->rb_DistributorsSelected->isChecked();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::dbDataOnly() const
|
||||
bool COwnModelSetForm::optionUseAllDistributors() const
|
||||
{
|
||||
return this->ui->rb_DbDataOnly->isChecked();
|
||||
return ui->rb_DistributorsAll->isChecked();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::incrementalBuild() const
|
||||
bool COwnModelSetForm::optionDbDataOnly() const
|
||||
{
|
||||
return ui->rb_DbDataOnly->isChecked();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::optionIncrementalBuild() const
|
||||
{
|
||||
return ui->rb_Incremental->isChecked();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::optionSortByDistributorPreferences() const
|
||||
{
|
||||
return ui->cb_SortByPreferences->isChecked() && this->hasDistributorPreferences();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::optionConsolidateModelSetWithDbData() const
|
||||
{
|
||||
return ui->cb_ConsolidateModelSet->isChecked();
|
||||
}
|
||||
|
||||
void COwnModelSetForm::ps_preferencesChanged()
|
||||
{
|
||||
// void
|
||||
@@ -120,6 +135,14 @@ namespace BlackGui
|
||||
{
|
||||
ui->tvp_Distributors->setDistributorMode(hasPreferences ? CDistributorListModel::MinimalWithOrder : CDistributorListModel::Minimal);
|
||||
ui->tvp_Distributors->fullResizeToContents();
|
||||
if (hasPreferences)
|
||||
{
|
||||
ui->tvp_Distributors->setSorting(CDistributor::IndexOrder);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->tvp_Distributors->setSorting(CDistributor::IndexDbStringKey);
|
||||
}
|
||||
}
|
||||
|
||||
CDistributorList COwnModelSetForm::getDistributorsFromPreferences() const
|
||||
@@ -137,9 +160,18 @@ namespace BlackGui
|
||||
return sGui->getWebDataServices()->getDistributors().matchesSimulator(this->m_simulator);
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::dbIcaoCodesOnly() const
|
||||
CDistributorList COwnModelSetForm::getDistributorsBasedOnOptions() const
|
||||
{
|
||||
return this->ui->rb_DbIcaoCodesOnly->isChecked();
|
||||
if (ui->rb_DistributorsAll->isChecked()) { return this->getAllDistributors(); }
|
||||
if (ui->rb_DistributorsSelected->isChecked()) { return this->getSelectedDistributors(); }
|
||||
if (ui->rb_DistributorsFromBelow->isChecked()) { return this->getShownDistributors(); }
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong option");
|
||||
return CDistributorList();
|
||||
}
|
||||
|
||||
bool COwnModelSetForm::optionDbIcaoCodesOnly() const
|
||||
{
|
||||
return ui->rb_DbIcaoCodesOnly->isChecked();
|
||||
}
|
||||
|
||||
CDistributorList COwnModelSetForm::getSelectedDistributors() const
|
||||
@@ -147,6 +179,11 @@ namespace BlackGui
|
||||
return ui->tvp_Distributors->selectedObjects();
|
||||
}
|
||||
|
||||
CDistributorList COwnModelSetForm::getShownDistributors() const
|
||||
{
|
||||
return ui->tvp_Distributors->containerOrFilteredContainer();
|
||||
}
|
||||
|
||||
void COwnModelSetForm::setSimulator(const CSimulatorInfo &simulator)
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
|
||||
|
||||
@@ -41,23 +41,35 @@ namespace BlackGui
|
||||
//! Reload data
|
||||
void reloadData();
|
||||
|
||||
//! Selected providers?
|
||||
bool useSelectedDistributors() const;
|
||||
|
||||
//! Get selected providers
|
||||
BlackMisc::Simulation::CDistributorList getSelectedDistributors() const;
|
||||
|
||||
//! Current simulator
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Selected distributors?
|
||||
bool optionUseSelectedDistributors() const;
|
||||
|
||||
//! All distributors?
|
||||
bool optionUseAllDistributors() const;
|
||||
|
||||
//! Only DB data
|
||||
bool dbDataOnly() const;
|
||||
bool optionDbDataOnly() const;
|
||||
|
||||
//! DB ICAO codes
|
||||
bool dbIcaoCodesOnly() const;
|
||||
bool optionDbIcaoCodesOnly() const;
|
||||
|
||||
//! Request incremental build
|
||||
bool incrementalBuild() const;
|
||||
bool optionIncrementalBuild() const;
|
||||
|
||||
//! Sort by distributor preferences
|
||||
bool optionSortByDistributorPreferences() const;
|
||||
|
||||
//! Consolidate with DB data?
|
||||
bool optionConsolidateModelSetWithDbData() const;
|
||||
|
||||
//! Get selected distributors
|
||||
BlackMisc::Simulation::CDistributorList getSelectedDistributors() const;
|
||||
|
||||
//! Get shown distributors
|
||||
BlackMisc::Simulation::CDistributorList getShownDistributors() const;
|
||||
|
||||
//! Distributors from preferences
|
||||
BlackMisc::Simulation::CDistributorList getDistributorsFromPreferences() const;
|
||||
@@ -65,6 +77,9 @@ namespace BlackGui
|
||||
//! All distributors
|
||||
BlackMisc::Simulation::CDistributorList getAllDistributors() const;
|
||||
|
||||
//! Get distributors based on options
|
||||
BlackMisc::Simulation::CDistributorList getDistributorsBasedOnOptions() const;
|
||||
|
||||
//! Preferences for given simulator?
|
||||
bool hasDistributorPreferences() const;
|
||||
|
||||
|
||||
@@ -74,19 +74,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QRadioButton" name="rb_AllDistributors">
|
||||
<property name="text">
|
||||
<string>all</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_Distributors</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Mode">
|
||||
<property name="text">
|
||||
@@ -140,7 +127,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QRadioButton" name="rb_SelectedDistributors">
|
||||
<widget class="QRadioButton" name="rb_DistributorsSelected">
|
||||
<property name="text">
|
||||
<string>selected</string>
|
||||
</property>
|
||||
@@ -209,6 +196,29 @@
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QRadioButton" name="rb_DistributorsAll">
|
||||
<property name="text">
|
||||
<string>all</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_Distributors</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QRadioButton" name="rb_DistributorsFromBelow">
|
||||
<property name="text">
|
||||
<string>all from below</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_Distributors</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -245,16 +255,15 @@
|
||||
<tabstop>rb_DbDataOnly</tabstop>
|
||||
<tabstop>rb_DbIcaoCodesOnly</tabstop>
|
||||
<tabstop>rb_WithIcaoData</tabstop>
|
||||
<tabstop>rb_SelectedDistributors</tabstop>
|
||||
<tabstop>rb_AllDistributors</tabstop>
|
||||
<tabstop>rb_DistributorsSelected</tabstop>
|
||||
<tabstop>tvp_Distributors</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="bg_Distributors"/>
|
||||
<buttongroup name="bg_Mode"/>
|
||||
<buttongroup name="bg_SourceSet"/>
|
||||
<buttongroup name="bg_DisplayedDistributors"/>
|
||||
<buttongroup name="bg_Distributors"/>
|
||||
<buttongroup name="bg_SourceSet"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user