Esempio n. 1
0
    def save_settings(self):
        """Saves all settings from the form to QSettings"""
        new_settings = {}

        for name, widget in self.form.widgets.items():
            value = self.form.get_widget_value(widget)
            new_settings[name] = value

        changed_settings = save_settings(new_settings)

        if len(changed_settings) > 0:
            self.settings_changed_signal.emit(changed_settings)
Esempio n. 2
0
    def load_project(self, project):
        """Load a project

        Get the settings for the project and load them as the current
        application settings.

        Set the current project name in the window title.

        Set the current project name setting in application settings.
        """
        project_settings = project.get_settings()

        project_name = project.get_project_name()

        set_setting('current_project', project_name)

        changed_settings = save_settings(project_settings)

        self.handle_settings_changed(changed_settings)

        self.main_window.set_window_title(project_name)
Esempio n. 3
0
    def load_project(self, project):
        """Load a project

        Get the settings for the project and load them as the current
        application settings.

        Set the current project name in the window title.

        Set the current project name setting in application settings.
        """
        project_settings = project.get_settings()

        project_name = project.get_project_name()

        set_setting('current_project', project_name)

        changed_settings = save_settings(project_settings)

        self.handle_settings_changed(changed_settings)

        self.main_window.set_window_title(project_name)