diff --git a/soitool/setup_settings.py b/soitool/setup_settings.py index 2a2ad841340d50aa733016fd98c891d71d299603..0463e44acaef62e5924589b7fe7f35c86f049dc5 100644 --- a/soitool/setup_settings.py +++ b/soitool/setup_settings.py @@ -44,13 +44,13 @@ class Setup(QDialog): # pylint: disable = R0902 self.group_algorithm_pack = QGroupBox() self.group_algorithm_sort = QGroupBox() - # labels for headings + # labels for mainheadings self.label_header = QLabel("Headerdata") self.label_paper_orientation = QLabel("Papirretning") self.label_algorithm = QLabel("Plasseringsalgoritmer") self.label_module_placement = QLabel("Modulplassering") - # headerdata and edits + # headerdata self.layout_setup.addWidget(self.label_header) self.label_title = QLabel("Tittel:") self.label_description = QLabel("Beskrivelse:") @@ -135,7 +135,7 @@ class Setup(QDialog): # pylint: disable = R0902 self.layout_setup.addWidget(self.group_algorithm_pack) self.layout_setup.addWidget(self.group_algorithm_sort) - # exit-buttons + # save and cancel self.button_cancel = QPushButton("Avbryt") self.button_save = QPushButton("Lagre") self.layout_buttons.addWidget(self.button_cancel) @@ -148,10 +148,11 @@ class Setup(QDialog): # pylint: disable = R0902 self.button_save.clicked.connect(self.save) # enter-key (default) def cancel(self): + """Close the dialog and nothing is saved.""" self.reject() def save(self): - # data sendes fra oppsett og oppdaterer soi + """Save and update the SOI with the given changes.""" self.soi.title = self.edit_title.text() self.soi.description = self.edit_description.text() self.soi.version = self.edit_version.text() @@ -160,6 +161,7 @@ class Setup(QDialog): # pylint: disable = R0902 self.soi.valid_to = self.edit_valid_to.text() self.soi.classification = self.edit_classification.currentText() + # finds which radiobutton that is checked if self.rbutton_landscape.isChecked(): self.soi.orientation = "landscape" else: @@ -170,6 +172,7 @@ class Setup(QDialog): # pylint: disable = R0902 else: self.soi.placement_strategy = "manual" + # loops through groupbox to find checked radiobuttons for i in self.group_algorithm_bin.findChildren(QRadioButton): if i.isChecked(): self.soi.algorithm_bin = i.text() @@ -185,7 +188,7 @@ class Setup(QDialog): # pylint: disable = R0902 self.accept() def get_from_soi(self): - # data hentes fra soi og settes inn i oppsett + """Get the data from the SOI and updates the dialog with the data.""" self.edit_title.setText(self.soi.title) self.edit_description.setText(self.soi.description) self.edit_version.setText(self.soi.version)