From 5eb81f050c62979b579119cbf352f4847a794fe5 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Tue, 28 Oct 2014 20:46:39 +0000 Subject: LinGui: fix more gtk deprecations gtk_misc is deprecated, use new alignment capabilities of gtk_widget gdkcolor is deprecated, use gdkrgba git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6472 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/audiohandler.c | 9 ++++++--- gtk/src/ghbcellrenderertext.c | 42 +++++++++++++++++++++--------------------- gtk/src/queuehandler.c | 5 +++-- 3 files changed, 30 insertions(+), 26 deletions(-) (limited to 'gtk/src') diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 38d4c3b11..fd3dbe6c4 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -1896,7 +1896,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) // Audio Quality Label label = GTK_LABEL(gtk_label_new("0.00")); gtk_label_set_width_chars(label, 4); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackQualityValue"); gtk_widget_show(GTK_WIDGET(label)); gtk_box_pack_start(qbox, GTK_WIDGET(label), FALSE, FALSE, 0); @@ -1957,7 +1958,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) // Audio Gain Label label = GTK_LABEL(gtk_label_new("0dB")); gtk_label_set_width_chars(label, 6); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackGainValue"); gtk_widget_show(GTK_WIDGET(label)); gtk_box_pack_start(box3, GTK_WIDGET(label), FALSE, FALSE, 0); @@ -1991,7 +1993,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) // Audio DRC Label label = GTK_LABEL(gtk_label_new("Off")); gtk_label_set_width_chars(label, 4); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackDRCValue"); gtk_widget_show(GTK_WIDGET(label)); gtk_box_pack_start(box3, GTK_WIDGET(label), FALSE, FALSE, 0); diff --git a/gtk/src/ghbcellrenderertext.c b/gtk/src/ghbcellrenderertext.c index 0968ef360..deef928df 100644 --- a/gtk/src/ghbcellrenderertext.c +++ b/gtk/src/ghbcellrenderertext.c @@ -246,7 +246,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class) g_param_spec_boxed ("background-gdk", P_("Background color"), P_("Background color as a GdkColor"), - GDK_TYPE_COLOR, + GDK_TYPE_RGBA, GTK_PARAM_READWRITE)); g_object_class_install_property (object_class, @@ -262,7 +262,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class) g_param_spec_boxed ("foreground-gdk", P_("Foreground color"), P_("Foreground color as a GdkColor"), - GDK_TYPE_COLOR, + GDK_TYPE_RGBA, GTK_PARAM_READWRITE)); @@ -845,9 +845,9 @@ ghb_cell_renderer_text_get_property (GObject *object, static void set_bg_color (GhbCellRendererText *celltext, - GdkColor *color) + GdkRGBA *rgba) { - if (color) + if (rgba) { if (!celltext->background_set) { @@ -855,9 +855,9 @@ set_bg_color (GhbCellRendererText *celltext, g_object_notify (G_OBJECT (celltext), "background-set"); } - celltext->background.red = color->red; - celltext->background.green = color->green; - celltext->background.blue = color->blue; + celltext->background.red = rgba->red; + celltext->background.green = rgba->green; + celltext->background.blue = rgba->blue; } else { @@ -872,9 +872,9 @@ set_bg_color (GhbCellRendererText *celltext, static void set_fg_color (GhbCellRendererText *celltext, - GdkColor *color) + GdkRGBA *rgba) { - if (color) + if (rgba) { if (!celltext->foreground_set) { @@ -882,9 +882,9 @@ set_fg_color (GhbCellRendererText *celltext, g_object_notify (G_OBJECT (celltext), "foreground-set"); } - celltext->foreground.red = color->red; - celltext->foreground.green = color->green; - celltext->foreground.blue = color->blue; + celltext->foreground.red = rgba->red; + celltext->foreground.green = rgba->green; + celltext->foreground.blue = rgba->blue; } else { @@ -1095,14 +1095,14 @@ ghb_cell_renderer_text_set_property (GObject *object, case PROP_BACKGROUND: { - GdkColor color; + GdkRGBA rgba; if (!g_value_get_string (value)) set_bg_color (celltext, NULL); /* reset to background_set to FALSE */ - else if (gdk_color_parse (g_value_get_string (value), &color)) - set_bg_color (celltext, &color); + else if (gdk_rgba_parse(&rgba, g_value_get_string(value))) + set_bg_color (celltext, &rgba); else - g_warning ("Don't know color `%s'", g_value_get_string (value)); + g_warning ("Don't know color `%s'", g_value_get_string(value)); g_object_notify (object, "background-gdk"); } @@ -1110,12 +1110,12 @@ ghb_cell_renderer_text_set_property (GObject *object, case PROP_FOREGROUND: { - GdkColor color; + GdkRGBA rgba; if (!g_value_get_string (value)) set_fg_color (celltext, NULL); /* reset to foreground_set to FALSE */ - else if (gdk_color_parse (g_value_get_string (value), &color)) - set_fg_color (celltext, &color); + else if (gdk_rgba_parse(&rgba, g_value_get_string(value))) + set_fg_color (celltext, &rgba); else g_warning ("Don't know color `%s'", g_value_get_string (value)); @@ -1629,8 +1629,8 @@ static void ghb_cell_renderer_text_render( { GhbCellRendererText *celltext = (GhbCellRendererText *) cell; PangoLayout *layout; - gint x_offset; - gint y_offset; + gint x_offset = 0; + gint y_offset = 0; GhbCellRendererTextPrivate *priv; priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell); diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 2b21fc991..45e14e8e2 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -472,7 +472,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) if (video_encoder->codec == HB_VCODEC_X264 && !ghb_settings_get_boolean(settings, "x264UseAdvancedOptions")) { - const gchar *extra_opt; + const gchar *extra_opt = NULL; // If the encoder supports presets... if (hb_video_encoder_get_presets(video_encoder->codec) != NULL) @@ -1375,7 +1375,8 @@ GtkWidget * title_create_row(signal_user_data_t *ud) // Title label title = GTK_LABEL(gtk_label_new("No Title")); gtk_label_set_width_chars(title, 12); - gtk_misc_set_alignment(GTK_MISC(title), 0, 0.5); + gtk_widget_set_halign(GTK_WIDGET(title), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(title), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(title), "title_label"); gtk_widget_show(GTK_WIDGET(title)); gtk_box_pack_start(hbox, GTK_WIDGET(title), FALSE, FALSE, 0); -- cgit v1.2.3