mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Ref T294, display simulator internals correctly
* view rows not selectable * added settings to ISimulator * ISimulator implements initSimulatorInternals() and sets default values * also display plugin name * XPlane using initSimulatorInternals()
This commit is contained in:
@@ -19,7 +19,7 @@ namespace BlackMisc
|
||||
{
|
||||
void CSimulatorInternals::setValue(const QString &name, const QString &value)
|
||||
{
|
||||
this->m_data.addOrReplaceValue(name, value);
|
||||
m_data.addOrReplaceValue(name, value);
|
||||
}
|
||||
|
||||
CVariant CSimulatorInternals::getVariantValue(const QString &name) const
|
||||
@@ -57,6 +57,16 @@ namespace BlackMisc
|
||||
this->setValue("all/simulatorName", name);
|
||||
}
|
||||
|
||||
QString CSimulatorInternals::getSimulatorSwiftPluginName() const
|
||||
{
|
||||
return this->getStringValue("all/pluginName");
|
||||
}
|
||||
|
||||
void CSimulatorInternals::setSwiftPluginName(const QString &name)
|
||||
{
|
||||
this->setValue("all/pluginName", name);
|
||||
}
|
||||
|
||||
QString CSimulatorInternals::getSimulatorVersion() const
|
||||
{
|
||||
return this->getStringValue("all/versionInfo");
|
||||
@@ -82,30 +92,23 @@ namespace BlackMisc
|
||||
CVariant CSimulatorInternals::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
return CVariant::from(m_data);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
case IndexData: return CVariant::from(m_data);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorInternals::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CSimulatorInternals>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
this->m_data = variant.to<CNameVariantPairList>();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
case IndexData: m_data = variant.to<CNameVariantPairList>(); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -68,6 +68,12 @@ namespace BlackMisc
|
||||
//! Set simulator name
|
||||
void setSimulatorName(const QString &name);
|
||||
|
||||
//! Plugin name
|
||||
QString getSimulatorSwiftPluginName() const;
|
||||
|
||||
//! Set plugin name
|
||||
void setSwiftPluginName(const QString &name);
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user