mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Settings, added TSettingTrait::humanReadable and used copydoc, T159 related
This commit is contained in:
committed by
Mathew Sutcliffe
parent
88a1c9f5d4
commit
7cdfe8c914
@@ -28,6 +28,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "application/actionhotkeys"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Hotkeys"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::isValid
|
||||
static bool isValid(const BlackMisc::Input::CActionHotkeyList &value)
|
||||
{
|
||||
@@ -47,6 +50,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "application/enabledsimulators"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Enabled simulators"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const QStringList &defaultValue()
|
||||
{
|
||||
@@ -55,7 +61,7 @@ namespace BlackCore
|
||||
return enabledSimulators;
|
||||
}
|
||||
|
||||
//! Simulator plugin identifiers valid?
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(const QStringList &pluginIdentifiers)
|
||||
{
|
||||
for (const QString &pluginIdentifier : pluginIdentifiers)
|
||||
@@ -75,6 +81,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "application/crashdumpuploadenabled"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Crash dumps"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static bool defaultValue() { return true; }
|
||||
};
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "audio/setup"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Audio"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::isValid
|
||||
static bool isValid(const BlackMisc::Audio::CSettings &value) { Q_UNUSED(value); return true; }
|
||||
};
|
||||
@@ -35,6 +38,9 @@ namespace BlackCore
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "audio/inputdevice"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Input device"); return name; }
|
||||
};
|
||||
|
||||
//! Audio input device settings
|
||||
@@ -42,8 +48,10 @@ namespace BlackCore
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "audio/outputdevice"; }
|
||||
};
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Output device"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace BlackCore
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "network/trafficservers"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Traffic servers"); return name; }
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -39,6 +42,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "network/currenttrafficserver"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Current traffic servers"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static const BlackMisc::Network::CServer &defaultValue()
|
||||
{
|
||||
@@ -114,6 +120,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "vatsimreaders/bookings"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("VATSIM bookings"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const BlackCore::Vatsim::CReaderSettings &defaultValue()
|
||||
{
|
||||
@@ -128,6 +137,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "vatsimreaders/datafile"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("VATSIM data file"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const BlackCore::Vatsim::CReaderSettings &defaultValue()
|
||||
{
|
||||
@@ -142,6 +154,9 @@ namespace BlackCore
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "vatsimreaders/metars"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("VATSIM METARs"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const BlackCore::Vatsim::CReaderSettings &defaultValue()
|
||||
{
|
||||
|
||||
@@ -63,6 +63,9 @@ namespace BlackGui
|
||||
{
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "atcstations"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("ATC stations"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -125,8 +125,11 @@ namespace BlackGui
|
||||
//! (of the parent object using this setting). If the object name is not set, it will not work correctly
|
||||
struct TDockWidget : public BlackMisc::TSettingTrait<CDockWidgetSettings>
|
||||
{
|
||||
//! Key in data cache https://dev.vatsim-germany.org/issues/776
|
||||
static const char *key() { return "guidockwidget/%Application%/%OwnerName%"; }
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guidockwidget/%Application%/%OwnerName%"; } // Key in data cache https://dev.vatsim-germany.org/issues/776
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Dockable widgets"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -78,25 +78,34 @@ namespace BlackGui
|
||||
{
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guigeneral"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("General GUI"); return name; }
|
||||
};
|
||||
|
||||
//! Settings for last manual entries of own aircraft mode
|
||||
struct TOwnAircraftModel : public BlackMisc::TSettingTrait<BlackMisc::Simulation::CAircraftModel>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guinownaircraftmodel"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Own aircraft"); return name; }
|
||||
};
|
||||
|
||||
//! Settings for last manual entries of own aircraft mode
|
||||
struct TBackgroundConsolidation : public BlackMisc::TSettingTrait<int>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "backgroundconsolidation"; }
|
||||
|
||||
//! Validator function.
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Background consolidation"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(const int &valueInSeconds) { return valueInSeconds == -1 || (valueInSeconds >= minSecs() && valueInSeconds <= maxSecs()); }
|
||||
|
||||
//! Default, not consolidating
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const int &defaultValue() { static const int i = 240; return i; }
|
||||
|
||||
//! Minimum
|
||||
|
||||
@@ -101,8 +101,11 @@ namespace BlackGui
|
||||
//! Trait for settings for navigator
|
||||
struct TNavigator : public BlackMisc::TSettingTrait<CNavigatorSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guinavigator"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Navigator"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -122,6 +122,9 @@ namespace BlackGui
|
||||
{
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "textmessages"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Text message"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -22,11 +22,14 @@ namespace BlackGui
|
||||
//! Trait for directory settings
|
||||
struct TUpdateNotificationSettings : public BlackMisc::TSettingTrait<bool>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guiupdatenotification/%Application%"; }
|
||||
|
||||
//! Default, not consolidating
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const bool &defaultValue() { static const bool d = true; return d; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Update notification"); return name; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -24,13 +24,16 @@ namespace BlackGui
|
||||
//! Trait for directory settings
|
||||
struct TViewDirectorySettings : public BlackMisc::TSettingTrait<QString>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guiviewdirectory/%Application%"; }
|
||||
|
||||
//! Validator function.
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("View directory"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(const QString &directory) { Q_UNUSED(directory); return true; }
|
||||
|
||||
//! Default, not consolidating
|
||||
//! \copydoc BlackCore::TSettingTrait::defaultValue
|
||||
static const QString &defaultValue() { return BlackMisc::CDirectoryUtils::documentationDirectory(); }
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -100,10 +100,13 @@ namespace BlackGui
|
||||
//! Trait for settings about update rates
|
||||
struct TViewUpdateSettings : public BlackMisc::TSettingTrait<CViewUpdateSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "guiviewupdate"; }
|
||||
|
||||
//! Validator function.
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("View update"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(const CViewUpdateSettings &settings) { return settings.isValid(); }
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -65,12 +65,18 @@ namespace BlackMisc
|
||||
struct TModel : public BlackMisc::TSettingTrait<CModelSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "settingsmodels"; }
|
||||
static const char *key() { return "Models"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Current traffic servers"); return name; }
|
||||
};
|
||||
|
||||
//! Mapping preferences for model distributor list
|
||||
struct TDistributorListPreferences : public BlackMisc::TSettingTrait<BlackMisc::Simulation::CDistributorListPreferences>
|
||||
{
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Distributor preferences"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "mapping/distributorpreferences"; }
|
||||
};
|
||||
|
||||
@@ -102,29 +102,41 @@ namespace BlackMisc
|
||||
//! Trait for simulator settings
|
||||
struct TSimulatorFsx : public BlackMisc::TSettingTrait<CSimulatorSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "settingssimulatorfsx"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("FSX"); return name; }
|
||||
};
|
||||
|
||||
//! Trait for simulator settings
|
||||
struct TSimulatorFs9 : public BlackMisc::TSettingTrait<CSimulatorSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "settingssimulatorfs9"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("FS9"); return name; }
|
||||
};
|
||||
|
||||
//! Trait for simulator settings
|
||||
struct TSimulatorP3D : public BlackMisc::TSettingTrait<CSimulatorSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "settingssimulatorp3d"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("P3D"); return name; }
|
||||
};
|
||||
|
||||
//! Trait for simulator settings
|
||||
struct TSimulatorXP : public BlackMisc::TSettingTrait<CSimulatorSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "settingssimulatorxplane"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("XPlane"); return name; }
|
||||
};
|
||||
|
||||
//! Bundle of settings for all simulators
|
||||
@@ -284,8 +296,11 @@ namespace BlackMisc
|
||||
//! Trait for simulator message settings
|
||||
struct TSimulatorMessages : public BlackMisc::TSettingTrait<CSimulatorMessagesSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "settingssimulatormessages"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Simulator messages"); return name; }
|
||||
};
|
||||
|
||||
//! Selected weather scenario
|
||||
@@ -294,6 +309,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "simulator/selectedweatherscenario"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Weather scenario"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static const BlackMisc::Weather::CWeatherScenario &defaultValue()
|
||||
{
|
||||
|
||||
@@ -92,10 +92,13 @@ namespace BlackMisc
|
||||
//! Trait for swift plugin settings
|
||||
struct TSwiftPlugin : public BlackMisc::TSettingTrait<CSwiftPluginSettings>
|
||||
{
|
||||
//! Key in data cache
|
||||
//! \copydoc BlackCore::TSettingTrait::key
|
||||
static const char *key() { return "settingsswiftplugin"; }
|
||||
|
||||
//! Validator function.
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("swift plugin"); return name; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(const CSwiftPluginSettings &value) { return value.getEmulatedSimulator().isSingleSimulator(); }
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -30,6 +30,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "xswiftbus/server"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("XSwiftBus"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static QString defaultValue() { return BlackMisc::CDBusServer::sessionBusAddress(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user