diff options
author | jstebbins <[email protected]> | 2014-01-14 16:07:46 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-01-14 16:07:46 +0000 |
commit | 81003b39a7c463b54f74bab1ddcd632b2f6ee757 (patch) | |
tree | a25a5d611650d29bab78b874f9a04a3c2bbf32ac | |
parent | 1d137b47c62a47a4a08f13fc2bd8207633464fd5 (diff) |
LinGui: fix some deprications in gtk 3.10
Fixes live preview play pause icons in gtk 3.10.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5967 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/ghbcompat.h | 9 | ||||
-rw-r--r-- | gtk/src/preview.c | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/gtk/src/ghbcompat.h b/gtk/src/ghbcompat.h index 0c5c6f21e..2acaa63b9 100644 --- a/gtk/src/ghbcompat.h +++ b/gtk/src/ghbcompat.h @@ -29,4 +29,13 @@ static inline gboolean gtk_widget_get_realized(GtkWidget *widget) } #endif +#if !GTK_CHECK_VERSION(3, 10, 0) +#define gtk_image_set_from_icon_name gtk_image_set_from_stock +#define GHB_PLAY_ICON "gtk-media-play" +#define GHB_PAUSE_ICON "gtk-media-pause" +#else +#define GHB_PLAY_ICON "media-playback-start" +#define GHB_PAUSE_ICON "media-playback-pause" +#endif + #endif // _GHB_COMPAT_H_ diff --git a/gtk/src/preview.c b/gtk/src/preview.c index 561deb15a..3df9311e0 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -474,7 +474,7 @@ live_preview_cb(GstBus *bus, GstMessage *msg, gpointer data) //printf("eos"); img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image")); - gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(img, GHB_PLAY_ICON, GTK_ICON_SIZE_BUTTON); gst_element_set_state(ud->preview->play, GST_STATE_PAUSED); ud->preview->pause = TRUE; gst_element_seek(ud->preview->play, 1.0, @@ -664,14 +664,14 @@ live_preview_start(signal_user_data_t *ud) img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image")); if (!ud->preview->encoded[ud->preview->frame]) { - gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(img, GHB_PLAY_ICON, GTK_ICON_SIZE_BUTTON); gst_element_set_state(ud->preview->play, GST_STATE_NULL); ud->preview->pause = TRUE; return; } uri = g_strdup_printf("file://%s", ud->preview->current); - gtk_image_set_from_stock(img, "gtk-media-pause", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(img, GHB_PAUSE_ICON, GTK_ICON_SIZE_BUTTON); ud->preview->state = PREVIEW_STATE_LIVE; g_object_set(G_OBJECT(ud->preview->play), "uri", uri, NULL); gst_element_set_state(ud->preview->play, GST_STATE_PLAYING); @@ -688,7 +688,7 @@ live_preview_pause(signal_user_data_t *ud) return; img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image")); - gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(img, GHB_PLAY_ICON, GTK_ICON_SIZE_BUTTON); gst_element_set_state(ud->preview->play, GST_STATE_PAUSED); ud->preview->pause = TRUE; } @@ -704,7 +704,7 @@ live_preview_stop(signal_user_data_t *ud) return; img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image")); - gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(img, GHB_PLAY_ICON, GTK_ICON_SIZE_BUTTON); #if defined(_ENABLE_GST) gst_element_set_state(ud->preview->play, GST_STATE_NULL); #endif |