Ejemplo n.º 1
0
    def on_okay(self) -> None:
        """Execute when a user selects okay."""
        if self.editor.modified is False:
            return
        if self.settings_location is None:
            msg = QtWidgets.QMessageBox(parent=self)
            msg.setIcon(QtWidgets.QMessageBox.Warning)
            msg.setText("Unable to save settings. No settings location set")
            msg.exec()
            return
        print(f"Saving changes to {self.settings_location}")
        tabs.write_tabs_yaml(
            self.settings_location,
            tabs.extract_tab_information(
                cast(
                    models.TabsModel,
                    self.editor.selected_tab_combo_box.model()
                )
            )
        )

        msg_box = QtWidgets.QMessageBox(self)
        msg_box.setWindowTitle("Saved changes to tabs files")
        msg_box.setText("Please restart changes to take effect")
        msg_box.exec()
Ejemplo n.º 2
0
    def on_okay(self):
        if self.editor.modified is True:
            print("Saving changes")
            tabs = extract_tab_information(
                self.editor.selectedTabComboBox.model())

            speedwagon.tabs.write_tabs_yaml(self.tabs_file, tabs)

        self.close()
Ejemplo n.º 3
0
    def on_okay(self):
        if self.editor.modified is True:
            print(f"Saving changes to {self.settings_location}")
            tabs.write_tabs_yaml(
                self.settings_location,
                tabs.extract_tab_information(
                    self.editor.selectedTabComboBox.model()))

            msg_box = QtWidgets.QMessageBox(self)
            msg_box.setWindowTitle("Saved changes to tabs files")
            msg_box.setText("Please restart changes to take effect")
            msg_box.exec()
Ejemplo n.º 4
0
    def on_okay(self) -> None:
        if self.editor.modified is True:
            if self.tabs_file is None:
                return
            speedwagon.tabs.write_tabs_yaml(
                self.tabs_file,
                extract_tab_information(
                    cast(
                        speedwagon.models.TabsModel,
                        self.editor.selectedTabComboBox.model()
                    )
                )
            )

        self.close()