[goobox] removed use of deprecated functions, require latests version of glib and gtk+
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goobox] removed use of deprecated functions, require latests version of glib and gtk+
- Date: Mon, 3 Oct 2011 18:54:55 +0000 (UTC)
commit c75e8e9dc4f1e7b145911a545d6618da17176eeb
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Oct 3 20:25:27 2011 +0200
removed use of deprecated functions, require latests version of glib and gtk+
configure.ac | 29 +++++++++++++++++------------
src/Makefile.am | 1 -
src/goo-player-info.c | 9 +++++----
src/goo-player-info.h | 4 ++--
src/goo-volume-tool-button.c | 12 ++++++------
src/goo-window.c | 5 +++--
src/gth-window.c | 6 +++---
src/gtk-file-chooser-preview.c | 6 +++---
src/gtk-utils.c | 12 ++++++------
9 files changed, 45 insertions(+), 39 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9f8b118..85d87e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,8 +15,8 @@ GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES
GLIB_GSETTINGS
-GLIB_REQUIRED=2.28
-GTK_REQUIRED=3.0.0
+GLIB_REQUIRED=2.30
+GTK_REQUIRED=3.2.0
GSTREAMER_REQUIRED=0.10.12
LIBNOTIFY_REQUIRED=0.4.3
LIBMUSICBRAINZ3_REQUIRED=3.0.0
@@ -138,12 +138,15 @@ fi
dnl ===========================================================================
-AC_ARG_ENABLE(deprecations,
- [AS_HELP_STRING([--enable-deprecations],[warn about deprecated usages])])
-if test "x$enable_deprecations" = "xyes"; then
- DISABLE_DEPRECATED="-DGSEAL_ENABLE -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+AC_ARG_ENABLE(deprecated,
+ AS_HELP_STRING([--disable-deprecated], [do not use deprecated API]),
+ disable_deprecated=yes,
+ disable_deprecated=no)
+if test x$disable_deprecated = xyes; then
+ CFLAGS="$CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
+ CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+ CFLAGS="$CFLAGS -DGSEAL_ENABLE"
fi
-AC_SUBST(DISABLE_DEPRECATED)
dnl ===========================================================================
@@ -182,9 +185,11 @@ echo "
Configuration:
- Source code location: ${srcdir}
- Compiler: ${CC}
- Run in place: ${enable_run_in_place}
- Enable notification: ${enable_notification}
- Enable media keys: ${enable_media_keys}
+ Source code location : ${srcdir}
+ Compiler : ${CC}
+ Prefix : ${prefix}
+ CFLAGS : ${CFLAGS}
+ Run in place : ${enable_run_in_place}
+ Enable notification : ${enable_notification}
+ Enable media keys : ${enable_media_keys}
"
diff --git a/src/Makefile.am b/src/Makefile.am
index 1084aa9..df9a0ba 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,7 +17,6 @@ INCLUDES = \
-DGOO_DATADIR=\"$(datadir)\" \
-DGOO_LIBDIR=\"$(libdir)\" \
-DGOO_UIDIR=\""$(uidir)"\" \
- $(DISABLE_DEPRECATED) \
$(GOO_CFLAGS) \
$(LIBNOTIFY_CFLAGS)
diff --git a/src/goo-player-info.c b/src/goo-player-info.c
index 8992610..38a5055 100644
--- a/src/goo-player-info.c
+++ b/src/goo-player-info.c
@@ -88,7 +88,7 @@ static void goo_player_info_finalize (GObject *object);
#define GOO_PLAYER_INFO_GET_PRIVATE_DATA(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), GOO_TYPE_PLAYER_INFO, GooPlayerInfoPrivateData))
-G_DEFINE_TYPE (GooPlayerInfo, goo_player_info, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GooPlayerInfo, goo_player_info, GTK_TYPE_BOX)
static void
goo_player_info_get_preferred_width (GtkWidget *widget,
@@ -330,6 +330,7 @@ cover_button_drag_data_received (GtkWidget *widget,
static void
goo_player_info_init (GooPlayerInfo *info)
{
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (info), GTK_ORIENTATION_HORIZONTAL);
info->priv = GOO_PLAYER_INFO_GET_PRIVATE_DATA (info);
}
@@ -381,9 +382,9 @@ goo_player_info_construct (GooPlayerInfo *info)
/* Time */
- time_box = gtk_hbox_new (FALSE, 6);
+ time_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- priv->time_scale = gtk_hscale_new_with_range (0.0, 1.0, 0.01);
+ priv->time_scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.0, 1.0, 0.01);
gtk_range_set_increments (GTK_RANGE (priv->time_scale), 0.01, 0.1);
gtk_scale_set_draw_value (GTK_SCALE (priv->time_scale), FALSE);
gtk_widget_set_size_request (priv->time_scale, SCALE_WIDTH, -1);
@@ -469,7 +470,7 @@ goo_player_info_construct (GooPlayerInfo *info)
/**/
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), priv->title1_label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), priv->title2_label, FALSE, FALSE, 0);
diff --git a/src/goo-player-info.h b/src/goo-player-info.h
index 08284e1..8920beb 100644
--- a/src/goo-player-info.h
+++ b/src/goo-player-info.h
@@ -39,13 +39,13 @@ typedef struct _GooPlayerInfoPrivateData GooPlayerInfoPrivateData;
struct _GooPlayerInfo
{
- GtkHBox __parent;
+ GtkBox __parent;
GooPlayerInfoPrivateData *priv;
};
struct _GooPlayerInfoClass
{
- GtkHBoxClass __parent_class;
+ GtkBoxClass __parent_class;
/*<signals>*/
diff --git a/src/goo-volume-tool-button.c b/src/goo-volume-tool-button.c
index 88df3e4..9f42ddd 100644
--- a/src/goo-volume-tool-button.c
+++ b/src/goo-volume-tool-button.c
@@ -98,11 +98,11 @@ goo_volume_tool_button_construct_contents (GooVolumeToolButton *button)
orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (button));
if (orientation == GTK_ORIENTATION_HORIZONTAL) {
- box = gtk_hbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_arrow_set (GTK_ARROW (button->priv->arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE);
}
else {
- box = gtk_vbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_arrow_set (GTK_ARROW (button->priv->arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
}
@@ -645,7 +645,7 @@ goo_volume_button_construct (GooVolumeToolButton *button)
/**/
- volume_vbox = gtk_vbox_new (FALSE, 0);
+ volume_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (volume_vbox), 0);
gtk_container_add (GTK_CONTAINER (out_frame), volume_vbox);
@@ -673,7 +673,7 @@ goo_volume_button_construct (GooVolumeToolButton *button)
button);
gtk_box_pack_start (GTK_BOX (volume_vbox), up_button, FALSE, FALSE, 0);
- button->priv->volume_scale = gtk_vscale_new_with_range (0.0, 1.0, 0.1);
+ button->priv->volume_scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL, 0.0, 1.0, 0.1);
gtk_range_set_inverted (GTK_RANGE (button->priv->volume_scale), TRUE);
gtk_scale_set_draw_value (GTK_SCALE (button->priv->volume_scale), FALSE);
/*gtk_range_set_update_policy (GTK_RANGE (button->priv->volume_scale), GTK_UPDATE_DELAYED);*/
@@ -717,7 +717,7 @@ goo_volume_button_construct (GooVolumeToolButton *button)
/**/
- gtk_box_pack_start (GTK_BOX (volume_vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (volume_vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 0);
button->priv->volume_label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (volume_vbox), button->priv->volume_label, FALSE, FALSE, 3);
@@ -726,7 +726,7 @@ goo_volume_button_construct (GooVolumeToolButton *button)
gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (button), FALSE);
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), GOO_STOCK_VOLUME_MAX);
- box = gtk_hbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
real_button = gtk_bin_get_child (GTK_BIN (button));
g_object_ref (real_button);
diff --git a/src/goo-window.c b/src/goo-window.c
index f5b40d6..19faa83 100644
--- a/src/goo-window.c
+++ b/src/goo-window.c
@@ -2413,6 +2413,7 @@ goo_window_construct (GooWindow *window,
window->priv->toolbar = toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar");
gtk_style_context_add_class (gtk_widget_get_style_context (window->priv->toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
+ gtk_widget_set_hexpand (toolbar, TRUE);
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE);
gth_window_attach_toolbar (GTH_WINDOW (window), 0, window->priv->toolbar);
@@ -2498,10 +2499,10 @@ goo_window_construct (GooWindow *window,
/**/
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
diff --git a/src/gth-window.c b/src/gth-window.c
index 7223f10..7df049e 100644
--- a/src/gth-window.c
+++ b/src/gth-window.c
@@ -82,17 +82,17 @@ gth_window_set_n_pages (GthWindow *self,
for (i = 0; i < n_pages; i++) {
GtkWidget *page;
- page = gtk_vbox_new (FALSE, 0);
+ page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (page);
gtk_notebook_append_page (GTK_NOTEBOOK (self->priv->notebook),
page,
NULL);
- self->priv->toolbars[i] = gtk_hbox_new (FALSE, 0);
+ self->priv->toolbars[i] = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (self->priv->toolbars[i]);
gtk_box_pack_start (GTK_BOX (page), self->priv->toolbars[i], FALSE, FALSE, 0);
- self->priv->contents[i] = gtk_hbox_new (FALSE, 0);
+ self->priv->contents[i] = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (self->priv->contents[i]);
gtk_box_pack_start (GTK_BOX (page), self->priv->contents[i], TRUE, TRUE, 0);
}
diff --git a/src/gtk-file-chooser-preview.c b/src/gtk-file-chooser-preview.c
index 9da8c39..e47e4ab 100644
--- a/src/gtk-file-chooser-preview.c
+++ b/src/gtk-file-chooser-preview.c
@@ -155,7 +155,7 @@ gtk_file_chooser_preview_construct (GtkFileChooserPreview *preview)
gtk_container_add (GTK_CONTAINER (preview), event_box);
gtk_widget_show (event_box);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (event_box), vbox);
gtk_widget_show (vbox);
@@ -182,7 +182,7 @@ gtk_file_chooser_preview_construct (GtkFileChooserPreview *preview)
G_CALLBACK (gtk_true),
NULL);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_widget_show (vbox2);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, TRUE, FALSE, 0);
@@ -261,7 +261,7 @@ gtk_file_chooser_preview_set_uri (GtkFileChooserPreview *preview,
w = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width");
h = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height");
- size_text = g_format_size_for_display (g_file_info_get_size (info));
+ size_text = g_format_size (g_file_info_get_size (info));
text = g_strconcat (size_text,
((w == NULL)?NULL:"\n"),
w, " x ", h, " ", _("pixels"),
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index 8b40236..b5c2b24 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -58,7 +58,7 @@ create_button (const char *stock_id,
else
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
label = gtk_label_new_with_mnemonic (label_text);
- hbox = gtk_hbox_new (FALSE, 2);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_widget_set_can_default (button, TRUE);
@@ -128,7 +128,7 @@ _gtk_message_dialog_new (GtkWindow *parent,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_pack_start (GTK_BOX (hbox), image,
@@ -212,8 +212,8 @@ _gtk_request_dialog_run (GtkWindow *parent,
gtk_entry_set_text (GTK_ENTRY (entry), default_value);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
- hbox = gtk_hbox_new (FALSE, 6);
- vbox = gtk_vbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_set_spacing (GTK_BOX (hbox), 12);
@@ -304,7 +304,7 @@ _gtk_yesno_dialog_new (GtkWindow *parent,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_pack_start (GTK_BOX (hbox), image,
@@ -402,7 +402,7 @@ _gtk_ok_dialog_with_checkbutton_new (GtkWindow *parent,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_pack_start (GTK_BOX (hbox), image,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]