10 #include "ui_modelmappingmodifyform.h"
21 using namespace swift::misc::network;
22 using namespace swift::misc::physical_quantities;
23 using namespace swift::misc::simulation;
26 namespace swift::gui::editors
28 CModelMappingModifyForm::CModelMappingModifyForm(
QWidget *parent)
32 ui->le_Parts->setPlaceholderText(
"Parts " + CAircraftModel::supportedParts());
36 ucv->setAllowedCharacters(CAircraftModel::supportedParts());
37 ui->le_Parts->setValidator(ucv);
55 if (ui->cb_Name->isChecked()) { vm.
addValue(CAircraftModel::IndexName, ui->le_Name->text().trimmed()); }
57 if (ui->cb_Description->isChecked())
59 vm.
addValue(CAircraftModel::IndexDescription, ui->le_Description->text().trimmed());
62 if (ui->cb_Mode->isChecked())
64 vm.
addValue(CAircraftModel::IndexModelMode, ui->selector_ModeSelector->getMode());
67 if (ui->cb_Simulator->isChecked())
69 vm.
addValue(CAircraftModel::IndexSimulatorInfo, ui->selector_SimulatorSelector->getValue());
72 if (ui->cb_Mode->isChecked())
74 vm.
addValue(CAircraftModel::IndexModelMode, ui->selector_ModeSelector->getMode());
77 if (ui->cb_Parts->isChecked())
79 vm.
addValue(CAircraftModel::IndexSupportedParts, ui->le_Parts->text().toUpper());
82 if (ui->cb_CG->isChecked())
84 const QString cgv = ui->le_CG->text().trimmed();
87 vm.
addValue(CAircraftModel::IndexCG, cg);
96 ui->le_Name->setText(model.
getName());
97 ui->selector_SimulatorSelector->setValue(model.
getSimulator());
98 ui->selector_ModeSelector->setValue(model);
113 ui->selector_ModeSelector->setValue(CAircraftModel::Include);
114 ui->selector_ModeSelector->setReadOnly(
false);
116 else { ui->selector_ModeSelector->setReadOnly(
true); }
121 void CModelMappingModifyForm::returnPressed()
128 void CModelMappingModifyForm::changed()
137 if (!widget) {
return nullptr; }
138 if (widget == ui->le_Description) {
return ui->cb_Description; }
139 if (widget == ui->le_Name) {
return ui->cb_Name; }
140 if (widget == ui->selector_ModeSelector) {
return ui->cb_Mode; }
141 if (widget == ui->le_CG) {
return ui->cb_CG; }
142 if (widget == ui->le_Parts) {
return ui->cb_Parts; }
143 if (widget == ui->selector_SimulatorSelector) {
return ui->cb_Simulator; }
147 void CModelMappingModifyForm::onCGEdited()
149 QString cgv = ui->le_CG->text().trimmed();
Specialized value object compliant map for variants, based on indexes.
void addValue(const CPropertyIndex &index, const CVariant &value)
Add a value.
QString toQString(bool i18n=false) const
Cast as QString.
Value object encapsulating information of an authentiated user.
bool hasAdminRole() const
Admin?
Physical unit length (length)
void parseFromString(const QString &value)
Parse value from string.
bool isNull() const
Is quantity null?
Aircraft model (used by another pilot, my models on disk)
CSimulatorInfo getSimulator() const
Simulator info.
const QString & getName() const
Name.
const QString & getDescription() const
Descriptive text.
High level reusable GUI components.
Free functions in swift::misc.
bool isDigitsOnlyString(const QString &testString)
String with digits only.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * sender() const const
bool isEmpty() const const