1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
Index: gtk/src/settings.c
===================================================================
--- gtk/src/settings.c (revision 3134)
+++ gtk/src/settings.c (revision 3135)
@@ -179,17 +179,14 @@
// Map widget names to setting keys
// Widgets that map to settings have names
// of this format: s_<setting key>
-static const gchar*
-get_setting_key(GtkWidget *widget)
+const gchar*
+ghb_get_setting_key(GtkWidget *widget)
{
const gchar *name;
g_debug("get_setting_key ()\n");
if (widget == NULL) return NULL;
- if (GTK_IS_ACTION(widget))
- name = gtk_action_get_name(GTK_ACTION(widget));
- else
- name = gtk_widget_get_name(widget);
+ name = gtk_buildable_get_name(GTK_BUILDABLE(widget));
if (name == NULL)
{
@@ -214,10 +211,7 @@
}
type = GTK_WIDGET_TYPE(widget);
- if (GTK_IS_ACTION(widget))
- name = gtk_action_get_name(GTK_ACTION(widget));
- else
- name = gtk_widget_get_name(widget);
+ name = ghb_get_setting_key(widget);
g_debug("ghb_widget_value widget (%s)\n", name);
if (type == GTK_TYPE_ENTRY)
{
@@ -442,7 +436,7 @@
if (widget == NULL) return;
g_debug("ghb_widget_to_setting");
// Find corresponding setting
- key = get_setting_key(widget);
+ key = ghb_get_setting_key(widget);
if (key == NULL) return;
value = ghb_widget_value(widget);
if (value != NULL)
Index: gtk/src/settings.h
===================================================================
--- gtk/src/settings.h (revision 3134)
+++ gtk/src/settings.h (revision 3135)
@@ -108,5 +108,6 @@
void ghb_widget_to_setting(GValue *settings, GtkWidget *widget);
int ghb_ui_update(
signal_user_data_t *ud, const gchar *name, const GValue *value);
+const gchar* ghb_get_setting_key(GtkWidget *widget);
#endif // _SETTINGS_H_
Index: gtk/src/preview.c
===================================================================
--- gtk/src/preview.c (revision 3134)
+++ gtk/src/preview.c (revision 3135)
@@ -877,7 +877,7 @@
ghb_widget_to_setting (ud->settings, xwidget);
ghb_preview_set_visible(ud);
ghb_check_dependency(ud, xwidget, NULL);
- const gchar *name = gtk_widget_get_name(xwidget);
+ const gchar *name = ghb_get_setting_key(xwidget);
ghb_pref_save(ud->settings, name);
}
@@ -934,7 +934,7 @@
g_debug("fullscreen_clicked_cb()");
ghb_widget_to_setting (ud->settings, toggle);
ghb_check_dependency(ud, toggle, NULL);
- const gchar *name = gtk_widget_get_name(toggle);
+ const gchar *name = ghb_get_setting_key(toggle);
ghb_pref_save(ud->settings, name);
window = GTK_WINDOW(GHB_WIDGET (ud->builder, "preview_window"));
@@ -1030,7 +1030,7 @@
ghb_live_reset(ud);
ghb_widget_to_setting (ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
}
Index: gtk/src/audiohandler.c
===================================================================
--- gtk/src/audiohandler.c (revision 3134)
+++ gtk/src/audiohandler.c (revision 3135)
@@ -478,7 +478,7 @@
G_MODULE_EXPORT void
subtitle_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
g_debug("subtitle_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
Index: gtk/src/x264handler.c
===================================================================
--- gtk/src/x264handler.c (revision 3134)
+++ gtk/src/x264handler.c (revision 3135)
@@ -523,7 +523,7 @@
x264_opt_update(signal_user_data_t *ud, GtkWidget *widget)
{
gint jj;
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
gchar **opt_syns = NULL;
const gchar *def_val = NULL;
gint type;
Index: gtk/src/callbacks.c
===================================================================
--- gtk/src/callbacks.c (revision 3134)
+++ gtk/src/callbacks.c (revision 3135)
@@ -199,7 +199,7 @@
type = GTK_WIDGET_TYPE(widget);
if (type == GTK_TYPE_COMBO_BOX || type == GTK_TYPE_COMBO_BOX_ENTRY)
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
- name = gtk_widget_get_name(widget);
+ name = ghb_get_setting_key(widget);
}
else
name = alt_name;
@@ -1054,7 +1054,7 @@
gchar *sourcename;
sourcename = ghb_settings_get_string(ud->settings, "source");
- filename = gtk_action_get_name(action);
+ filename = gtk_buildable_get_name(GTK_BUILDABLE(action));
ghb_do_scan(ud, filename, 0, TRUE);
if (strcmp(sourcename, filename) != 0)
{
@@ -1694,7 +1694,7 @@
G_MODULE_EXPORT void
target_size_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
g_debug("target_size_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
@@ -1713,7 +1713,7 @@
start_point_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
gint start, end;
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
g_debug("start_point_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
@@ -1765,7 +1765,7 @@
end_point_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
gint start, end;
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
g_debug("end_point_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
@@ -3588,7 +3588,7 @@
g_debug("pref_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
}
@@ -3598,7 +3598,7 @@
g_debug("use_m4v_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
ghb_update_destination_extension(ud);
}
@@ -3609,7 +3609,7 @@
g_debug("show_status_cb");
ghb_widget_to_setting (ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
GtkStatusIcon *si;
@@ -3626,7 +3626,7 @@
ghb_widget_to_setting (ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
gdouble vqmin, vqmax, step, page;
@@ -3643,7 +3643,7 @@
{
g_debug("tweaks_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
}
@@ -3652,7 +3652,7 @@
{
g_debug("hbfd_feature_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
- const gchar *name = gtk_widget_get_name(widget);
+ const gchar *name = ghb_get_setting_key(widget);
ghb_pref_save(ud->settings, name);
gboolean hbfd = ghb_settings_get_boolean(ud->settings, "hbfd_feature");
@@ -4559,7 +4559,7 @@
GtkResponseType response;
gchar *tweak = NULL;
- name = gtk_widget_get_name(widget);
+ name = ghb_get_setting_key(widget);
if (g_str_has_prefix(name, "tweak_"))
{
tweak_name = g_strdup(name);
Index: gtk/src/main.c
===================================================================
--- gtk/src/main.c (revision 3134)
+++ gtk/src/main.c (revision 3135)
@@ -152,7 +152,7 @@
g_return_if_fail(handler_name != NULL);
g_return_if_fail(signal_name != NULL);
- //const gchar *name = gtk_widget_get_name((GtkWidget*)object);
+ //const gchar *name = ghb_get_setting_key((GtkWidget*)object);
//g_message("\n\nname %s", name);
g_debug("handler_name %s", handler_name);
g_debug("signal_name %s", signal_name);
@@ -192,7 +192,7 @@
font_desc = pango_font_description_from_string(font);
if (font_desc == NULL) exit(1);
gtk_widget_modify_font(widget, font_desc);
- name = gtk_widget_get_name(widget);
+ name = ghb_get_setting_key(widget);
g_debug("changing font for widget %s\n", name);
if (GTK_IS_CONTAINER(widget))
{
|