refs #661, allow to sort by distributor order in builder

* some style changes
* pass distributors to builder
* distributor model mode
* flags
This commit is contained in:
Klaus Basan
2016-05-26 20:13:13 +02:00
parent c13b9ded55
commit 8ad640704c
9 changed files with 33 additions and 19 deletions

View File

@@ -51,6 +51,7 @@ namespace BlackGui
const bool hasPreferences = this->hasDIstributorPreferences();
ui->cb_Preferences->setChecked(hasPreferences);
ui->comp_SimulatorSelector->setValue(this->m_simulator);
ui->tvp_Distributors->setDistributorMode(hasPreferences ? CDistributorListModel::MinimalWithOrder : CDistributorListModel::Minimal);
if (!distributors.isEmpty())
{
this->ui->tvp_Distributors->updateContainerMaybeAsync(distributors);
@@ -87,6 +88,7 @@ namespace BlackGui
CDistributorList COwnModelSetForm::getDistributors() const
{
Q_ASSERT_X(sGui && sGui->hasWebDataServices(), Q_FUNC_INFO, "Missing web data services");
Q_ASSERT_X(this->m_simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
const CDistributorListPreferences prefs(this->m_distributorPreferences.getCopy());
const CDistributorList distributors(prefs.getDistributors(this->m_simulator));
if (!distributors.isEmpty()) { return distributors; }