[gthumb/gthumb-2-10] Bug 580801 – Deprecated GTK/Glib code used by gthumb
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb/gthumb-2-10] Bug 580801 – Deprecated GTK/Glib code used by gthumb
- Date: Thu, 30 Apr 2009 12:47:26 -0400 (EDT)
commit 2e2610c11d8614ce6c19a49c7de2bb8e912cba44
Author: Marc Pavot <marc pavot gmail com>
Date: Thu Apr 30 12:46:35 2009 -0400
Bug 580801 â?? Deprecated GTK/Glib code used by gthumb
Removed deprecated GtkTooltips and replaced it with
gtk_widget_set_tooltip_* methods.
---
configure.in | 2 +-
libgthumb/gthumb-info-bar.c | 14 ++++----------
src/dlg-file-utils.c | 10 +---------
src/gth-browser.c | 33 ++++++++++-----------------------
src/gth-filter-bar.c | 10 ++--------
5 files changed, 18 insertions(+), 51 deletions(-)
diff --git a/configure.in b/configure.in
index bc5e43b..9ab44e1 100644
--- a/configure.in
+++ b/configure.in
@@ -23,7 +23,7 @@ dnl
dnl ==========================================================================
GLIB_REQUIRED=2.6.0
-GTK_REQUIRED=2.10.0
+GTK_REQUIRED=2.12.0
LIBXML_REQUIRED=2.4.0
LIBGNOME_REQUIRED=2.6.0
LIBGNOMEUI_REQUIRED=2.6.0
diff --git a/libgthumb/gthumb-info-bar.c b/libgthumb/gthumb-info-bar.c
index e879ff4..f31ba2d 100644
--- a/libgthumb/gthumb-info-bar.c
+++ b/libgthumb/gthumb-info-bar.c
@@ -33,7 +33,6 @@ struct _GThumbInfoBarPrivate {
GtkWidget *hbox;
GtkWidget *label;
- GtkTooltips *tooltips;
};
@@ -48,8 +47,6 @@ gthumb_info_bar_destroy (GtkObject *object)
info_bar->priv->tooltip = NULL;
}
- gtk_object_destroy (GTK_OBJECT (info_bar->priv->tooltips));
-
g_free (info_bar->priv);
info_bar->priv = NULL;
}
@@ -130,7 +127,6 @@ gthumb_info_bar_init (GThumbInfoBar *info_bar)
gtk_misc_set_padding (GTK_MISC (priv->label), X_PADDING, Y_PADDING);
gtk_label_set_line_wrap (GTK_LABEL (priv->label), FALSE);
- info_bar->priv->tooltips = gtk_tooltips_new ();
info_bar->priv->tooltip = NULL;
}
@@ -209,13 +205,11 @@ set_tooltip (GThumbInfoBar *info_bar,
if (tooltip != NULL) {
info_bar->priv->tooltip = g_strdup (tooltip);
- gtk_tooltips_set_tip (info_bar->priv->tooltips,
- GTK_WIDGET (info_bar),
- info_bar->priv->tooltip,
- NULL);
- gtk_tooltips_enable (info_bar->priv->tooltips);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (info_bar),
+ info_bar->priv->tooltip);
+ gtk_widget_set_has_tooltip (GTK_WIDGET (info_bar), TRUE);
} else
- gtk_tooltips_disable (info_bar->priv->tooltips);
+ gtk_widget_set_has_tooltip (GTK_WIDGET (info_bar), FALSE);
}
diff --git a/src/dlg-file-utils.c b/src/dlg-file-utils.c
index b80680b..359309b 100644
--- a/src/dlg-file-utils.c
+++ b/src/dlg-file-utils.c
@@ -510,7 +510,6 @@ dlg_file_copy__ask_dest (GthWindow *window,
static void
set_filename_labels (GladeXML *gui,
- GtkTooltips *tooltips,
const char *filename_widget,
const char *filename_eventbox,
const char *size_widget,
@@ -534,7 +533,7 @@ set_filename_labels (GladeXML *gui,
g_free (name);
utf8_name = gnome_vfs_unescape_string_for_display (filename);
- gtk_tooltips_set_tip (tooltips, eventbox, utf8_name, NULL);
+ gtk_widget_set_tooltip_text (eventbox, utf8_name);
g_free (utf8_name);
label = glade_xml_get_widget (gui, size_widget);
@@ -566,7 +565,6 @@ typedef struct {
GtkWidget *overwrite_rename_radiobutton;
GtkWidget *overwrite_rename_entry;
- GtkTooltips *tooltips;
int overwrite_mode;
OverwriteDoneFunc done_func;
gpointer done_data;
@@ -577,7 +575,6 @@ static void
dlg_overwrite_data_free (DlgOverwriteData *owdata)
{
gtk_widget_destroy (owdata->dialog);
- gtk_object_destroy (GTK_OBJECT (owdata->tooltips));
g_object_unref (owdata->gui);
g_free (owdata->destination);
g_free (owdata);
@@ -623,7 +620,6 @@ create_overwrite_dialog (GthWindow *window,
return NULL;
}
- owdata->tooltips = gtk_tooltips_new ();
owdata->done_func = done_func;
owdata->done_data = done_data;
owdata->destination = remove_level_from_path (old_filename);
@@ -650,14 +646,12 @@ create_overwrite_dialog (GthWindow *window,
/* * set filename labels. */
set_filename_labels (owdata->gui,
- owdata->tooltips,
"old_image_filename_label",
"old_image_filename_eventbox",
"old_image_size_label",
"old_image_time_label",
old_filename);
set_filename_labels (owdata->gui,
- owdata->tooltips,
"new_image_filename_label",
"new_image_filename_eventbox",
"new_image_size_label",
@@ -745,8 +739,6 @@ create_overwrite_dialog (GthWindow *window,
/**/
- g_object_set_data (G_OBJECT (owdata->dialog), "tooltips", owdata->tooltips);
-
gtk_window_set_transient_for (GTK_WINDOW (owdata->dialog),
GTK_WINDOW (window));
gtk_window_set_modal (GTK_WINDOW (owdata->dialog), TRUE);
diff --git a/src/gth-browser.c b/src/gth-browser.c
index d54874e..6ee339f 100644
--- a/src/gth-browser.c
+++ b/src/gth-browser.c
@@ -263,7 +263,6 @@ struct _GthBrowserPrivateData {
GtkWidget *progress_info;
guint progress_timeout;
- GtkTooltips *tooltips;
guint help_message_cid;
guint list_info_cid;
@@ -5458,8 +5457,8 @@ add_rotate_toolbar_item (GthBrowser *browser)
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (priv->rotate_tool_item),
gtk_ui_manager_get_widget (priv->ui, "/RotateImageMenu"));
gtk_tool_item_set_homogeneous (priv->rotate_tool_item, FALSE);
- gtk_tool_item_set_tooltip (priv->rotate_tool_item, priv->tooltips, _("Rotate images without loss of quality"), NULL);
- gtk_menu_tool_button_set_arrow_tooltip (GTK_MENU_TOOL_BUTTON (priv->rotate_tool_item), priv->tooltips, _("Rotate images without loss of quality"), NULL);
+ gtk_tool_item_set_tooltip_text (priv->rotate_tool_item, _("Rotate images without loss of quality"));
+ gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (priv->rotate_tool_item), _("Rotate images without loss of quality"));
gtk_action_connect_proxy (gtk_ui_manager_get_action (priv->ui, "/MenuBar/Tools/Tools_JPEGRotate"),
GTK_WIDGET (priv->rotate_tool_item));
gtk_widget_show (GTK_WIDGET (priv->rotate_tool_item));
@@ -6473,8 +6472,6 @@ gth_browser_construct (GthBrowser *browser,
eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, DEF_WIN_WIDTH),
eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, DEF_WIN_HEIGHT));
- priv->tooltips = gtk_tooltips_new ();
-
/* Build the menu and the toolbar. */
priv->actions = actions = gtk_action_group_new ("Actions");
@@ -6916,10 +6913,8 @@ gth_browser_construct (GthBrowser *browser,
"clicked",
G_CALLBACK (close_preview_image_button_cb),
browser);
- gtk_tooltips_set_tip (priv->tooltips,
- button,
- _("Close"),
- NULL);
+ gtk_widget_set_tooltip_text (button,
+ _("Close"));
image = _gtk_image_new_from_inline (preview_comment_16_rgba);
priv->preview_button_comment = button = gtk_toggle_button_new ();
@@ -6930,10 +6925,8 @@ gth_browser_construct (GthBrowser *browser,
"toggled",
G_CALLBACK (preview_comment_button_cb),
browser);
- gtk_tooltips_set_tip (priv->tooltips,
- button,
- _("Image comment"),
- NULL);
+ gtk_widget_set_tooltip_text (button,
+ _("Image comment"));
image = _gtk_image_new_from_inline (preview_data_16_rgba);
priv->preview_button_data = button = gtk_toggle_button_new ();
@@ -6944,10 +6937,8 @@ gth_browser_construct (GthBrowser *browser,
"toggled",
G_CALLBACK (preview_data_button_cb),
browser);
- gtk_tooltips_set_tip (priv->tooltips,
- button,
- _("Image data"),
- NULL);
+ gtk_widget_set_tooltip_text (button,
+ _("Image data"));
image = _gtk_image_new_from_inline (preview_image_16_rgba);
priv->preview_button_image = button = gtk_toggle_button_new ();
@@ -6958,10 +6949,8 @@ gth_browser_construct (GthBrowser *browser,
"toggled",
G_CALLBACK (preview_image_button_cb),
browser);
- gtk_tooltips_set_tip (priv->tooltips,
- button,
- _("Image preview"),
- NULL);
+ gtk_widget_set_tooltip_text (button,
+ _("Image preview"));
}
gtk_widget_show_all (info_box);
@@ -7534,8 +7523,6 @@ close__step6 (FileData *file,
g_free (priv->initial_location);
- gtk_object_destroy (GTK_OBJECT (priv->tooltips));
-
if (last_window) { /* FIXME */
if (dir_list_tree_path != NULL) {
gtk_tree_path_free (dir_list_tree_path);
diff --git a/src/gth-filter-bar.c b/src/gth-filter-bar.c
index 2d92ba8..f24bae3 100644
--- a/src/gth-filter-bar.c
+++ b/src/gth-filter-bar.c
@@ -67,7 +67,6 @@ struct _GthFilterBarPrivate
GtkWidget *scope_combo_box;
GtkWidget *choose_categories_button;
GtkWidget *date_edit;
- GtkTooltips *tooltips;
GtkListStore *model;
};
@@ -84,7 +83,6 @@ gth_filter_bar_finalize (GObject *object)
filter_bar = GTH_FILTER_BAR (object);
if (filter_bar->priv != NULL) {
- gtk_object_destroy (GTK_OBJECT (filter_bar->priv->tooltips));
g_free (filter_bar->priv);
filter_bar->priv = NULL;
}
@@ -367,8 +365,6 @@ gth_filter_bar_construct (GthFilterBar *filter_bar)
GTK_BOX (filter_bar)->spacing = 6;
gtk_container_set_border_width (GTK_CONTAINER (filter_bar), 2);
- filter_bar->priv->tooltips = gtk_tooltips_new ();
-
/* choose category button */
filter_bar->priv->choose_categories_button = gtk_button_new_with_label ("...");
@@ -532,10 +528,8 @@ gth_filter_bar_construct (GthFilterBar *filter_bar)
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show_all (button);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_tooltips_set_tip (filter_bar->priv->tooltips,
- button,
- _("Close"),
- NULL);
+ gtk_widget_set_tooltip_text (button,
+ _("Close"));
g_signal_connect (G_OBJECT (button),
"clicked",
G_CALLBACK (close_button_clicked_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]