diff --git a/soitool/setup_settings.py b/soitool/setup_settings.py index d8b90fbdf91ac56bde67a10b740d41d700a61c97..f186cba2e027d647b9b52a2072fef870f49220f7 100644 --- a/soitool/setup_settings.py +++ b/soitool/setup_settings.py @@ -158,7 +158,7 @@ class Setup(AcceptRejectDialog): # pylint: disable = R0902 self.layout_content.addLayout(self.layout_setup) - def accept(self): # pylint: disable = R0912 + def accept(self): """Save and update the SOI with the given changes. Overriden to implement custom behavior on accept, executes superclass' @@ -201,23 +201,19 @@ class Setup(AcceptRejectDialog): # pylint: disable = R0902 for i in self.group_algorithm_sort.findChildren(QRadioButton): if i.isChecked() and i.text() == "Ingen": property_changes["algorithm_sort"] = "none" - break - if i.isChecked() and i.text() == "Areal": + elif i.isChecked() and i.text() == "Areal": property_changes["algorithm_sort"] = "area" - break - if i.isChecked() and i.text() == "Bredde": + elif i.isChecked() and i.text() == "Bredde": property_changes["algorithm_sort"] = "width" - break - if i.isChecked() and i.text() == "Høyde": + elif i.isChecked() and i.text() == "Høyde": property_changes["algorithm_sort"] = "height" - break # Pass changes as unpacked variable list self.soi.update_properties(**property_changes) super().accept() - def get_from_soi(self): # pylint: disable = R0912 + def get_from_soi(self): """Get data from the SOI and update the dialog with the data.""" self.edit_title.setText(self.soi.title) self.edit_description.setText(self.soi.description) @@ -252,13 +248,9 @@ class Setup(AcceptRejectDialog): # pylint: disable = R0902 for i in self.group_algorithm_sort.findChildren(QRadioButton): if i.text() == "Ingen" and self.soi.algorithm_sort == "none": i.setChecked(True) - break - if i.text() == "Areal" and self.soi.algorithm_sort == "area": + elif i.text() == "Areal" and self.soi.algorithm_sort == "area": i.setChecked(True) - break - if i.text() == "Bredde" and self.soi.algorithm_sort == "width": + elif i.text() == "Bredde" and self.soi.algorithm_sort == "width": i.setChecked(True) - break - if i.text() == "Høyde" and self.soi.algorithm_sort == "height": + elif i.text() == "Høyde" and self.soi.algorithm_sort == "height": i.setChecked(True) - break