From eab9603d8a382aabb6f6fe7f1fb70545029d18db Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Fri, 7 Aug 2026 21:52:40 +0200 Subject: [PATCH 1/4] Fixed saving coil master Removed "isVisible" check on max_slave_checkbox before saving because isVisible is maybe not true, when the ok button is pressed Then the value -1 is written and so on not saved to the elements xml --- sources/editor/ui/elementpropertieseditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 202cc23a5..55bcbc947 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -371,7 +371,7 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() m_data.m_master_type = ui->m_master_type_cb->currentData().value(); //If the checkbox is checked, save the number; otherwise, -1 (infinity) - if (ui->max_slaves_checkbox->isVisible() && ui->max_slaves_checkbox->isChecked()) { + if (ui->max_slaves_checkbox->isChecked()) { m_data.m_max_slaves = ui->max_slaves_spinbox->value(); } else { m_data.m_max_slaves = -1; From b9153269a4936b28ecf7e98ef147ad72fb58cc7e Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Sat, 8 Aug 2026 09:05:27 +0200 Subject: [PATCH 2/4] Fixed saving coil master -> correction Added check to the type of master so that types which are not using "max slave elements" are saved with the value -1 (infinity). --- sources/editor/ui/elementpropertieseditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 55bcbc947..dc492d2c6 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -371,7 +371,7 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() m_data.m_master_type = ui->m_master_type_cb->currentData().value(); //If the checkbox is checked, save the number; otherwise, -1 (infinity) - if (ui->max_slaves_checkbox->isChecked()) { + if (m_data.m_master_type == ElementData::Coil || m_data.m_master_type ==ElementData::Protection || m_data.m_master_type == ElementData::Commutator && ui->max_slaves_checkbox->isChecked()) { m_data.m_max_slaves = ui->max_slaves_spinbox->value(); } else { m_data.m_max_slaves = -1; From d7c75ea5a58cd5f9eff88a61b78baa1e4bd608bf Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Sat, 8 Aug 2026 09:07:22 +0200 Subject: [PATCH 3/4] Fixed saving coil master -> correction + Added space for a better style ;) --- sources/editor/ui/elementpropertieseditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index dc492d2c6..6e0247687 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -371,7 +371,7 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() m_data.m_master_type = ui->m_master_type_cb->currentData().value(); //If the checkbox is checked, save the number; otherwise, -1 (infinity) - if (m_data.m_master_type == ElementData::Coil || m_data.m_master_type ==ElementData::Protection || m_data.m_master_type == ElementData::Commutator && ui->max_slaves_checkbox->isChecked()) { + if (m_data.m_master_type == ElementData::Coil || m_data.m_master_type == ElementData::Protection || m_data.m_master_type == ElementData::Commutator && ui->max_slaves_checkbox->isChecked()) { m_data.m_max_slaves = ui->max_slaves_spinbox->value(); } else { m_data.m_max_slaves = -1; From fb0649ceee9dcacc6f78746599e51d3227cdbfc9 Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Fri, 14 Aug 2026 22:23:25 +0200 Subject: [PATCH 4/4] Fixed incorrect OR and AND checks --- sources/editor/ui/elementpropertieseditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 6e0247687..da400ba5d 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -371,7 +371,7 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() m_data.m_master_type = ui->m_master_type_cb->currentData().value(); //If the checkbox is checked, save the number; otherwise, -1 (infinity) - if (m_data.m_master_type == ElementData::Coil || m_data.m_master_type == ElementData::Protection || m_data.m_master_type == ElementData::Commutator && ui->max_slaves_checkbox->isChecked()) { + if ((m_data.m_master_type == ElementData::Coil || m_data.m_master_type == ElementData::Protection || m_data.m_master_type == ElementData::Commutator) && ui->max_slaves_checkbox->isChecked()) { m_data.m_max_slaves = ui->max_slaves_spinbox->value(); } else { m_data.m_max_slaves = -1;