6 #include "ui_settingsswiftplugin.h"
11 using namespace swift::misc::simulation;
12 using namespace swift::misc::simulation::settings;
16 CSettingsSwiftPlugin::CSettingsSwiftPlugin(QWidget *parent) : QFrame(parent), ui(new Ui::
CSettingsSwiftPlugin)
20 this->onSettingsChanged();
22 connect(ui->pb_Save, &QPushButton::clicked,
this, &CSettingsSwiftPlugin::save);
29 return m_settings.
get();
32 void CSettingsSwiftPlugin::onSettingsChanged()
35 ui->comp_EmulatedSimulatorSelector->setValue(settings.getEmulatedSimulator());
36 ui->lep_OwnModel->setText(settings.getOwnModel().getModelString());
37 ui->lep_DefaultModel->setText(settings.getDefaultModel().getModelString());
38 ui->cb_LogFunctionCalls->setChecked(settings.isLoggingFunctionCalls());
41 void CSettingsSwiftPlugin::save()
45 if (!msg.
isEmpty()) { CLogMessage::preformatted(msg); }
Settings for the swift pseudo driver.
virtual ~CSettingsSwiftPlugin()
Dtor.
swift::misc::simulation::settings::CSwiftPluginSettings getPluginSettings() const
Get the plugin settings.
CStatusMessage setAndSave(const T &value, qint64 timestamp=0)
Write and save in the same step. Must be called from the thread in which the owner lives.
T get() const
Get a copy of the current value.
bool isEmpty() const
Message empty.
Streamable status message, e.g.
Aircraft model (used by another pilot, my models on disk)
void setModelString(const QString &modelString)
Model string.
bool hasModelString() const
Non empty model string?
void setOwnModel(const CAircraftModel &ownModel)
Set own model.
void setLoggingFunctionCalls(bool log)
Log function calls?
void setEmulatedSimulator(const CSimulatorInfo &simulator)
Emulated simualtor.
void setDefaultModel(const CAircraftModel &defaultModel)
Set default model.
High level reusable GUI components.
Free functions in swift::misc.