mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Split of CSimulatorPluginInfo and CSimulatorSetup
refs #404, and discussion https://dev.vatsim-germany.org/issues/404#note-8 * Changed CSimulatorSetup to use CNameVariantPairList as data. The old version was an hack and had to go, CNameVariantPairList would allow complex types in the future and can be already shown in the GUI. * CNameVariantPairList was improved slightly in the same step * Functions to get CSimulatorSetup from driver / context * Removed CSimulatorSetup data from CSimulatorPluginInfo
This commit is contained in:
@@ -108,8 +108,9 @@ namespace BlackGui
|
||||
return;
|
||||
}
|
||||
int p = port.toInt();
|
||||
|
||||
//! \todo filename is only available if driver has been loaded
|
||||
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
|
||||
QString fileName = this->getIContextSimulator()->getSimulatorSetup().getStringValue(CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename());
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
CLogMessage(this).validationError("Invalid or empty filename empty, driver loaded?");
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace BlackGui
|
||||
if (!this->getIContextSimulator()->isSimulating()) {
|
||||
this->addOrUpdateByName("info",
|
||||
tr("Simulator (%1) not yet running").arg(
|
||||
getIContextSimulator()->getSimulatorInfo().getSimulator()
|
||||
getIContextSimulator()->getSimulatorPluginInfo().getSimulator()
|
||||
),
|
||||
CIcons::StandardIconWarning16);
|
||||
return;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace BlackGui
|
||||
|
||||
int CNameVariantPairModel::getRowIndexForName(const QString &name) const
|
||||
{
|
||||
int rowIndex = this->m_container.getNameRowIndex(name);
|
||||
int rowIndex = this->m_container.getIndexForName(name);
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BlackGui
|
||||
bool CNameVariantPairModel::containsNameValue(const QString &name, const BlackMisc::CVariant &value) const
|
||||
{
|
||||
int rowIndex = this->getRowIndexForName(name);
|
||||
if (rowIndex < 0) return false;
|
||||
if (rowIndex < 0) { return false; }
|
||||
QModelIndex i = this->index(rowIndex, 0);
|
||||
const CNameVariantPair cv = this->at(i);
|
||||
return value == cv.toCVariant();
|
||||
|
||||
@@ -22,9 +22,7 @@ namespace BlackGui
|
||||
namespace Models
|
||||
{
|
||||
|
||||
/*!
|
||||
* Simple model displaying name / variant values
|
||||
*/
|
||||
//! Simple model displaying name / variant values
|
||||
class CNameVariantPairModel : public CListModelBase<BlackMisc::CNameVariantPair, BlackMisc::CNameVariantPairList>
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user