def test_get_config(self, dummy_window, app, initial_config_parametrized):
        """
        Make sure retrieval of field values works as expected.

        In particular we need to make sure that unicode/utf-8 handling works as
        expected.
        """
        dialog = PreferencesDialog(dummy_window, app, initial_config_parametrized)
        result = dialog.get_config()
        assert result == initial_config_parametrized
    def test_get_config(self, dummy_window, app, initial_config_parametrized):
        """
        Make sure retrieval of field values works as expected.

        In particular we need to make sure that unicode/utf-8 handling works as
        expected.
        """
        dialog = PreferencesDialog(dummy_window, app,
                                   initial_config_parametrized)
        result = dialog.get_config()
        assert result == initial_config_parametrized
 def _on_preferences_button(self, button):
     """Bring up, process and shut down preferences dialog."""
     def get_initial():
         """Return current values as a dict."""
         return self._app._config
     parent = get_parent_window(self)
     dialog = PreferencesDialog(parent, parent.app, get_initial())
     response = dialog.run()
     if response == Gtk.ResponseType.APPLY:
         config = dialog.get_config()
         self._app.save_config(config)
     else:
         pass
     dialog.destroy()
Example #4
0
    def _on_preferences_action(self, action, parameter):
        """Bring up, process and shut down preferences dialog."""
        def get_initial():
            """Return current values as a dict."""
            return self._config

        dialog = PreferencesDialog(self.window, self, get_initial())
        response = dialog.run()
        if response == Gtk.ResponseType.APPLY:
            config = dialog.get_config()
            self.save_config(config)
        else:
            pass
        dialog.destroy()
Example #5
0
    def _on_preferences_button(self, button):
        """Bring up, process and shut down preferences dialog."""
        def get_initial():
            """Return current values as a dict."""
            return self._app._config

        parent = get_parent_window(self)
        dialog = PreferencesDialog(parent, parent.app, get_initial())
        response = dialog.run()
        if response == Gtk.ResponseType.APPLY:
            config = dialog.get_config()
            self._app.save_config(config)
        else:
            pass
        dialog.destroy()