summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/audiohandler.c2
-rw-r--r--gtk/src/callbacks.c24
-rw-r--r--gtk/src/main.c4
-rw-r--r--gtk/src/preview.c6
-rw-r--r--gtk/src/settings.c16
-rw-r--r--gtk/src/settings.h1
-rw-r--r--gtk/src/x264handler.c2
7 files changed, 25 insertions, 30 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 773da280e..f8804e561 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -478,7 +478,7 @@ drc_widget_changed_cb(GtkWidget *widget, gdouble val, signal_user_data_t *ud)
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);
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index fa574227c..9f89ba9d8 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -199,7 +199,7 @@ ghb_check_dependency(
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;
@@ -1068,7 +1068,7 @@ dvd_source_activate_cb(GtkAction *action, signal_user_data_t *ud)
gchar *sourcename;
sourcename = ghb_settings_get_string(ud->settings, "scan_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 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
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 @@ G_MODULE_EXPORT void
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 @@ G_MODULE_EXPORT void
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 @@ pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
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 @@ use_m4v_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
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 @@ show_status_cb(GtkWidget *widget, signal_user_data_t *ud)
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 @@ vqual_granularity_changed_cb(GtkWidget *widget, signal_user_data_t *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);
gdouble vqmin, vqmax, step, page;
@@ -3643,7 +3643,7 @@ tweaks_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
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 @@ hbfd_feature_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
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 @@ tweak_setting_cb(
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);
diff --git a/gtk/src/main.c b/gtk/src/main.c
index e92f974d5..55b3cfe63 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -152,7 +152,7 @@ MyConnect(
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 @@ change_font(GtkWidget *widget, gpointer data)
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))
{
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 3cbc9ee20..07ae765df 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -877,7 +877,7 @@ preview_button_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
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 @@ fullscreen_clicked_cb(GtkWidget *toggle, signal_user_data_t *ud)
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 @@ preview_duration_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
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);
}
diff --git a/gtk/src/settings.c b/gtk/src/settings.c
index 4bafd9b2d..cc9ae4bc8 100644
--- a/gtk/src/settings.c
+++ b/gtk/src/settings.c
@@ -179,17 +179,14 @@ ghb_settings_combo_string(const GValue *settings, const gchar *key)
// 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 @@ ghb_widget_value(GtkWidget *widget)
}
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 @@ ghb_widget_to_setting(GValue *settings, GtkWidget *widget)
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)
diff --git a/gtk/src/settings.h b/gtk/src/settings.h
index 43fbdbfa9..5ec717f0c 100644
--- a/gtk/src/settings.h
+++ b/gtk/src/settings.h
@@ -108,5 +108,6 @@ gint ghb_widget_boolean(GtkWidget *widget);
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_
diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c
index e739bbbc4..61adaa0b0 100644
--- a/gtk/src/x264handler.c
+++ b/gtk/src/x264handler.c
@@ -523,7 +523,7 @@ static void
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;