Commit ba948de6b8f1db8c6c97c095830d4c3512405653
1 parent
d08ed1d9
Exists in
master
and in
4 other branches
Fixing application settings.
Showing
5 changed files
with
12 additions
and
7 deletions
Show diff stats
src/include/pw3270.h
| ... | ... | @@ -61,8 +61,8 @@ |
| 61 | 61 | GtkWidget * widget; ///< @brief Settings widget. |
| 62 | 62 | const gchar * label; ///< @brief Page lagel. |
| 63 | 63 | const gchar * title; ///< @brief Page title. |
| 64 | - void (*load)(Pw3270SettingsPage *, GtkApplication *, GSettings *); | |
| 65 | - void (*apply)(Pw3270SettingsPage *, GtkApplication *, GSettings *); | |
| 64 | + void (*load)(Pw3270SettingsPage *, GtkApplication *); | |
| 65 | + void (*apply)(Pw3270SettingsPage *, GtkApplication *); | |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | 68 | void gtk_file_chooser_set_pw3270_filters(GtkFileChooser *chooser); | ... | ... |
src/include/pw3270/window.h
| ... | ... | @@ -79,6 +79,9 @@ |
| 79 | 79 | /// @brief Set window sub-title (If enabled). |
| 80 | 80 | void pw3270_window_set_subtitle(GtkWidget *window, const gchar *subtitle); |
| 81 | 81 | |
| 82 | + /// @brief Get window settings. | |
| 83 | + GSettings * pw3270_application_window_settings_new(void); | |
| 84 | + | |
| 82 | 85 | G_END_DECLS |
| 83 | 86 | |
| 84 | 87 | ... | ... |
src/objects/application/actions/preferences.c
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | for(page = settings->pages;page;page = page->next) { |
| 58 | 58 | Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; |
| 59 | 59 | if(widget->apply) { |
| 60 | - widget->apply(widget,GTK_APPLICATION(settings->application),pw3270_application_get_settings(settings->application)); | |
| 60 | + widget->apply(widget,GTK_APPLICATION(settings->application)); | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| ... | ... | @@ -172,7 +172,7 @@ |
| 172 | 172 | for(page = settings->pages;page;page = page->next) { |
| 173 | 173 | Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; |
| 174 | 174 | if(widget->load) { |
| 175 | - widget->load(widget,GTK_APPLICATION(settings->application),pw3270_application_get_settings(settings->application)); | |
| 175 | + widget->load(widget,GTK_APPLICATION(settings->application)); | |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | ... | ... |
src/objects/toolbar/settings.c
| ... | ... | @@ -30,6 +30,7 @@ |
| 30 | 30 | #include "private.h" |
| 31 | 31 | #include <pw3270/settings.h> |
| 32 | 32 | #include <pw3270/actions.h> |
| 33 | + #include <pw3270/window.h> | |
| 33 | 34 | |
| 34 | 35 | static const struct _comboboxes { |
| 35 | 36 | const gchar * name; |
| ... | ... | @@ -57,10 +58,11 @@ |
| 57 | 58 | |
| 58 | 59 | } ToolbarSettingsPage; |
| 59 | 60 | |
| 60 | - static void load(Pw3270SettingsPage *pg, GtkApplication *application, GSettings *settings) { | |
| 61 | + static void load(Pw3270SettingsPage *pg, GtkApplication *application) { | |
| 61 | 62 | |
| 62 | 63 | size_t ix; |
| 63 | 64 | ToolbarSettingsPage * page = (ToolbarSettingsPage *) pg; |
| 65 | + g_autoptr(GSettings) settings = pw3270_application_window_settings_new(); | |
| 64 | 66 | |
| 65 | 67 | debug("%s",__FUNCTION__); |
| 66 | 68 | |
| ... | ... | @@ -112,10 +114,11 @@ |
| 112 | 114 | |
| 113 | 115 | } |
| 114 | 116 | |
| 115 | - static void apply(Pw3270SettingsPage *pg, GtkApplication G_GNUC_UNUSED(*application), GSettings *settings) { | |
| 117 | + static void apply(Pw3270SettingsPage *pg, GtkApplication G_GNUC_UNUSED(*application)) { | |
| 116 | 118 | |
| 117 | 119 | size_t ix; |
| 118 | 120 | ToolbarSettingsPage * page = (ToolbarSettingsPage *) pg; |
| 121 | + g_autoptr(GSettings) settings = pw3270_application_window_settings_new(); | |
| 119 | 122 | |
| 120 | 123 | debug("%s",__FUNCTION__); |
| 121 | 124 | ... | ... |
src/objects/window/window.c
| ... | ... | @@ -35,7 +35,6 @@ |
| 35 | 35 | |
| 36 | 36 | static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); |
| 37 | 37 | static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); |
| 38 | - static GSettings *pw3270_application_window_settings_new(void); | |
| 39 | 38 | |
| 40 | 39 | G_DEFINE_TYPE(pw3270ApplicationWindow, pw3270ApplicationWindow, GTK_TYPE_APPLICATION_WINDOW); |
| 41 | 40 | ... | ... |