mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 14:45:33 +08:00
Ref T430, follow ups of FG integration fixing wrong distributor handling
* fixing a bug where the radio button and check box names got mixed * removed code for FG disabling * style Backend T576
This commit is contained in:
committed by
Mat Sutcliffe
parent
cdca20abe9
commit
3988fbdb32
@@ -251,13 +251,6 @@ namespace BlackConfig
|
|||||||
static const int bws = Private::buildWordSizeImpl();
|
static const int bws = Private::buildWordSizeImpl();
|
||||||
return bws;
|
return bws;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBuildConfig::supportFlightGear()
|
|
||||||
{
|
|
||||||
// for testing set to "true", never commit with TRUE before FG is completed
|
|
||||||
// this will be removed when FG is fully productive
|
|
||||||
return true; // && isLocalDeveloperDebugBuild();
|
|
||||||
}
|
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|||||||
@@ -149,10 +149,6 @@ namespace BlackConfig
|
|||||||
//! \returns 32, 64 or -1 (in case no info is possible)
|
//! \returns 32, 64 or -1 (in case no info is possible)
|
||||||
static int buildWordSize();
|
static int buildWordSize();
|
||||||
|
|
||||||
//! Ref T430 FG preparations, will be removed later
|
|
||||||
//! \fixme KB 2019-01 remove after FG is fully implemented
|
|
||||||
static bool supportFlightGear();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Major version
|
//! Major version
|
||||||
static constexpr int versionMajor(); // defined in buildconfig_gen.inc.in
|
static constexpr int versionMajor(); // defined in buildconfig_gen.inc.in
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
menuActions.addAction(m_loadActions[3], CMenuAction::pathSimulator());
|
menuActions.addAction(m_loadActions[3], CMenuAction::pathSimulator());
|
||||||
}
|
}
|
||||||
if (CBuildConfig::supportFlightGear() && sims.isFG())
|
if (sims.isFG())
|
||||||
{
|
{
|
||||||
if (!m_loadActions[4])
|
if (!m_loadActions[4])
|
||||||
{
|
{
|
||||||
@@ -458,7 +458,7 @@ namespace BlackGui
|
|||||||
menuActions.addAction(m_reloadActions[7], CMenuAction::pathSimulatorModelsReload());
|
menuActions.addAction(m_reloadActions[7], CMenuAction::pathSimulatorModelsReload());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CBuildConfig::supportFlightGear() && sims.isFG())
|
if (sims.isFG())
|
||||||
{
|
{
|
||||||
if (!m_reloadActions[8])
|
if (!m_reloadActions[8])
|
||||||
{
|
{
|
||||||
@@ -551,7 +551,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
menuActions.addAction(m_clearCacheActions[3], CMenuAction::pathSimulatorModelsClearCache());
|
menuActions.addAction(m_clearCacheActions[3], CMenuAction::pathSimulatorModelsClearCache());
|
||||||
}
|
}
|
||||||
if (CBuildConfig::supportFlightGear() && sims.isFG())
|
if (sims.isFG())
|
||||||
{
|
{
|
||||||
if (!m_clearCacheActions[4])
|
if (!m_clearCacheActions[4])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,10 +36,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
const bool withFG = CBuildConfig::supportFlightGear();
|
|
||||||
this->enableFG(withFG);
|
|
||||||
this->addComboxBoxValues();
|
this->addComboxBoxValues();
|
||||||
|
|
||||||
this->setMode(CheckBoxes, true);
|
this->setMode(CheckBoxes, true);
|
||||||
|
|
||||||
connect(ui->rb_FS9, &QRadioButton::toggled, this, &CSimulatorSelector::radioButtonChanged);
|
connect(ui->rb_FS9, &QRadioButton::toggled, this, &CSimulatorSelector::radioButtonChanged);
|
||||||
@@ -86,8 +83,8 @@ namespace BlackGui
|
|||||||
switch (m_mode)
|
switch (m_mode)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case CheckBoxes: return CSimulatorInfo(ui->cb_FSX->isChecked(), ui->cb_FS9->isChecked(), ui->cb_XPlane->isChecked(), ui->cb_P3D->isChecked(), m_withFG && ui->cb_FG->isChecked());
|
case CheckBoxes: return CSimulatorInfo(ui->cb_FSX->isChecked(), ui->cb_FS9->isChecked(), ui->cb_XPlane->isChecked(), ui->cb_P3D->isChecked(), ui->cb_FG->isChecked());
|
||||||
case RadioButtons: return CSimulatorInfo(ui->rb_FSX->isChecked(), ui->rb_FS9->isChecked(), ui->rb_XPlane->isChecked(), ui->rb_P3D->isChecked(), m_withFG && ui->rb_FG->isChecked());
|
case RadioButtons: return CSimulatorInfo(ui->rb_FSX->isChecked(), ui->rb_FS9->isChecked(), ui->rb_XPlane->isChecked(), ui->rb_P3D->isChecked(), ui->rb_FG->isChecked());
|
||||||
case ComboBox: return CSimulatorInfo(ui->cb_Simulators->currentText());
|
case ComboBox: return CSimulatorInfo(ui->cb_Simulators->currentText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +109,7 @@ namespace BlackGui
|
|||||||
if (simulator.isFS9()) { ui->rb_FS9->setChecked(simulator.isFS9()); return; }
|
if (simulator.isFS9()) { ui->rb_FS9->setChecked(simulator.isFS9()); return; }
|
||||||
if (simulator.isXPlane()) { ui->rb_XPlane->setChecked(simulator.isXPlane()); return; }
|
if (simulator.isXPlane()) { ui->rb_XPlane->setChecked(simulator.isXPlane()); return; }
|
||||||
if (simulator.isP3D()) { ui->rb_P3D->setChecked(simulator.isP3D()); return; }
|
if (simulator.isP3D()) { ui->rb_P3D->setChecked(simulator.isP3D()); return; }
|
||||||
if (simulator.isFG()) { ui->rb_FG->setChecked(simulator.isFG()); return; }
|
if (simulator.isFG()) { ui->rb_FG->setChecked(simulator.isFG()); return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +178,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CSimulatorSelector::enableFG(bool enabled)
|
void CSimulatorSelector::enableFG(bool enabled)
|
||||||
{
|
{
|
||||||
m_withFG = enabled;
|
|
||||||
ui->cb_FG->setVisible(enabled);
|
ui->cb_FG->setVisible(enabled);
|
||||||
ui->rb_FG->setVisible(enabled);
|
ui->rb_FG->setVisible(enabled);
|
||||||
ui->cb_FG->setChecked(false);
|
ui->cb_FG->setChecked(false);
|
||||||
@@ -218,10 +214,10 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case CheckBoxes:
|
case CheckBoxes:
|
||||||
c = ui->cb_FSX->isChecked() || ui->cb_FS9->isChecked() || ui->cb_XPlane->isChecked() || ui->cb_P3D->isChecked() || (m_withFG && ui->rb_FG->isChecked());
|
c = ui->cb_FSX->isChecked() || ui->cb_FS9->isChecked() || ui->cb_XPlane->isChecked() || ui->cb_P3D->isChecked() || ui->cb_FG->isChecked();
|
||||||
break;
|
break;
|
||||||
case RadioButtons:
|
case RadioButtons:
|
||||||
c = ui->rb_FSX->isChecked() || ui->rb_FS9->isChecked() || ui->rb_XPlane->isChecked() || ui->cb_P3D->isChecked() || (m_withFG && ui->cb_FG->isChecked());
|
c = ui->rb_FSX->isChecked() || ui->rb_FS9->isChecked() || ui->rb_XPlane->isChecked() || ui->rb_P3D->isChecked() || ui->rb_FG->isChecked();
|
||||||
break;
|
break;
|
||||||
case ComboBox:
|
case ComboBox:
|
||||||
const int i = ui->cb_Simulators->currentIndex();
|
const int i = ui->cb_Simulators->currentIndex();
|
||||||
@@ -238,7 +234,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case CheckBoxes:
|
case CheckBoxes:
|
||||||
c = ui->cb_FSX->isChecked() && ui->cb_FS9->isChecked() && ui->cb_XPlane->isChecked() && ui->cb_P3D->isChecked() && (!m_withFG || ui->cb_FG->isChecked());
|
c = ui->cb_FSX->isChecked() && ui->cb_FS9->isChecked() && ui->cb_XPlane->isChecked() && ui->cb_P3D->isChecked() && ui->cb_FG->isChecked();
|
||||||
break;
|
break;
|
||||||
case RadioButtons:
|
case RadioButtons:
|
||||||
// actually this should never be true
|
// actually this should never be true
|
||||||
@@ -377,10 +373,7 @@ namespace BlackGui
|
|||||||
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::fsx().toQString());
|
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::fsx().toQString());
|
||||||
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::p3d().toQString());
|
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::p3d().toQString());
|
||||||
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::xplane().toQString());
|
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::xplane().toQString());
|
||||||
if (m_withFG)
|
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::fg().toQString());
|
||||||
{
|
|
||||||
ui->cb_Simulators->insertItem(cbi++, CSimulatorInfo::fg().toQString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace BlackGui
|
|||||||
explicit CSimulatorSelector(QWidget *parent = nullptr);
|
explicit CSimulatorSelector(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CSimulatorSelector();
|
virtual ~CSimulatorSelector() override;
|
||||||
|
|
||||||
//! How to display
|
//! How to display
|
||||||
void setMode(Mode mode, bool forced = false);
|
void setMode(Mode mode, bool forced = false);
|
||||||
@@ -147,7 +147,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
QScopedPointer<Ui::CSimulatorSelector> ui;
|
QScopedPointer<Ui::CSimulatorSelector> ui;
|
||||||
Mode m_mode = CheckBoxes;
|
Mode m_mode = CheckBoxes;
|
||||||
bool m_withFG = false; //! with FG
|
|
||||||
bool m_noSelectionMeansAll = false; //!< for filters, no selection means all
|
bool m_noSelectionMeansAll = false; //!< for filters, no selection means all
|
||||||
bool m_rememberSelection = false; //!< remember last selection
|
bool m_rememberSelection = false; //!< remember last selection
|
||||||
BlackMisc::CDigestSignal m_digestButtonsChanged { this, &CSimulatorSelector::emitChangedSignal, 250, 3 };
|
BlackMisc::CDigestSignal m_digestButtonsChanged { this, &CSimulatorSelector::emitChangedSignal, 250, 3 };
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDistributorFilterBar::connectTriggerFilterSignals()
|
void CDistributorFilterBar::connectTriggerFilterSignals()
|
||||||
{
|
{
|
||||||
connect(ui->comp_Simulator, &CSimulatorSelector::changed, this, &CFilterWidget::triggerFilter);
|
connect(ui->comp_Simulator, &CSimulatorSelector::changed, this, &CFilterWidget::triggerFilter, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ namespace BlackGui
|
|||||||
// no wildcard, just string matching
|
// no wildcard, just string matching
|
||||||
if (!filter.contains('*'))
|
if (!filter.contains('*'))
|
||||||
{
|
{
|
||||||
return (v.indexOf(f, 0, cs) == 0) &&
|
return (v.indexOf(f, 0, cs) == 0) && (v.length() == f.length());
|
||||||
(v.length() == f.length());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString filterNoWildcard = stripWildcard(f);
|
const QString filterNoWildcard = stripWildcard(f);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace BlackGui
|
|||||||
virtual ContainerType filter(const ContainerType &container) const = 0;
|
virtual ContainerType filter(const ContainerType &container) const = 0;
|
||||||
|
|
||||||
//! Anything to do?
|
//! Anything to do?
|
||||||
bool isValid() const { return this->m_valid; }
|
bool isValid() const { return m_valid; }
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
virtual bool isEnabled() const { return m_enabled && isValid(); }
|
virtual bool isEnabled() const { return m_enabled && isValid(); }
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ namespace BlackMisc
|
|||||||
return CDistributor();
|
return CDistributor();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString description(json.value(prefix + "description").toString());
|
const QString description(json.value(prefix % u"description").toString());
|
||||||
if (description.isEmpty())
|
if (description.isEmpty())
|
||||||
{
|
{
|
||||||
// stub, only key, maybe also timestamps
|
// stub, only key, maybe also timestamps
|
||||||
|
|||||||
Reference in New Issue
Block a user