Revision: 6748
Author: nogu.dev
Date: Sat Sep 11 01:14:31 2010
Log: * helper/toolbar-common-gtk.c
  - (destroy_tooltips): Remove.
  - (popup_prop_menu, prop_button_create, helper_toolbar_prop_list_update):
    Don't use deprecated GtkTooltips.
  - (prop_data_flush, prop_button_destroy): Don't call removed function.
* helper/pref-gtk.c
  - (create_setting_button_box): Don't use deprecated GtkTooltips.
http://code.google.com/p/uim/source/detail?r=6748

Modified:
 /trunk/helper/pref-gtk.c
 /trunk/helper/toolbar-common-gtk.c

=======================================
--- /trunk/helper/pref-gtk.c    Sat Aug 14 16:49:23 2010
+++ /trunk/helper/pref-gtk.c    Sat Sep 11 01:14:31 2010
@@ -371,7 +371,6 @@
 {
   GtkWidget *setting_button_box;
   GtkWidget *button;
-  GtkTooltips *tooltip;

   setting_button_box = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(setting_button_box), GTK_BUTTONBOX_END);
@@ -382,8 +381,7 @@
   g_signal_connect(G_OBJECT(button), "clicked",
                   G_CALLBACK(defaults_button_clicked), (gpointer) group_name);
   gtk_box_pack_start(GTK_BOX(setting_button_box), button, TRUE, TRUE, 8);
-  tooltip = gtk_tooltips_new();
- gtk_tooltips_set_tip(tooltip, button, _("Revert all changes to default"), NULL);
+  gtk_widget_set_tooltip_text(button, _("Revert all changes to default"));


   /* Apply button */
@@ -392,16 +390,14 @@
                   G_CALLBACK(apply_button_clicked), (gpointer) group_name);
   gtk_widget_set_sensitive(pref_apply_button, FALSE);
gtk_box_pack_start(GTK_BOX(setting_button_box), pref_apply_button, TRUE, TRUE, 8);
-  tooltip = gtk_tooltips_new();
- gtk_tooltips_set_tip(tooltip, pref_apply_button, _("Apply all changes"), NULL);
+  gtk_widget_set_tooltip_text(pref_apply_button, _("Apply all changes"));

   /* Cancel button */
   button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
   g_signal_connect(G_OBJECT(button), "clicked",
                   G_CALLBACK(quit_confirm), NULL);
   gtk_box_pack_start(GTK_BOX(setting_button_box), button, TRUE, TRUE, 8);
-  tooltip = gtk_tooltips_new();
- gtk_tooltips_set_tip(tooltip, button, _("Quit this application without applying changes"), NULL); + gtk_widget_set_tooltip_text(button, _("Quit this application without applying changes"));

   /* OK button */
   pref_ok_button = gtk_button_new_from_stock(GTK_STOCK_OK);
@@ -411,8 +407,7 @@
 #if USE_CHANGES_SENSITIVE_OK_BUTTON
   gtk_widget_set_sensitive(pref_ok_button, FALSE);
 #endif
-  tooltip = gtk_tooltips_new();
- gtk_tooltips_set_tip(tooltip, pref_ok_button, _("Quit this application with applying changes"), NULL); + gtk_widget_set_tooltip_text(pref_ok_button, _("Quit this application with applying changes"));

   return setting_button_box;
 }
=======================================
--- /trunk/helper/toolbar-common-gtk.c  Mon Aug  9 21:19:47 2010
+++ /trunk/helper/toolbar-common-gtk.c  Sat Sep 11 01:14:31 2010
@@ -185,15 +185,6 @@

   return TRUE;
 }
-
-static void
-destroy_tooltips(GtkWidget *widget)
-{
-  GtkTooltipsData *ttd = gtk_tooltips_data_get(widget);
-
-  if (ttd)
-   g_signal_emit_by_name(ttd->tooltips, "destroy");
-}

 static void
 calc_menu_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
@@ -336,7 +327,6 @@
                GtkWidget *widget)
 {
   GtkWidget *menu_item, *hbox, *label, *img;
-  GtkTooltips *tooltip;
GList *menu_item_list, *icon_list, *label_list, *tooltip_list, *action_list,
        *state_list, *list;
   int i, selected = -1;
@@ -352,7 +342,6 @@

   list = menu_item_list;
   while (list) {
-    destroy_tooltips(list->data);
     gtk_widget_destroy(list->data);
     list = list->next;
   }
@@ -401,9 +390,8 @@
     }

     /* tooltips */
-    tooltip = gtk_tooltips_new();
-    gtk_tooltips_set_tip(tooltip, menu_item,
-                        tooltip_list ? tooltip_list->data : NULL, NULL);
+    gtk_widget_set_tooltip_text(menu_item,
+                        tooltip_list ? tooltip_list->data : NULL);

     /* add to the menu */
     gtk_menu_shell_append(GTK_MENU_SHELL(prop_menu), menu_item);
@@ -530,7 +518,6 @@
 static void
 prop_button_destroy(gpointer data, gpointer user_data)
 {
-  destroy_tooltips(data);
   prop_data_flush(data);
   gtk_widget_destroy(GTK_WIDGET(data));
 }
@@ -538,7 +525,6 @@
 static void
 tool_button_destroy(gpointer data, gpointer user_data)
 {
-  destroy_tooltips(data);
   gtk_widget_destroy(GTK_WIDGET(data));
 }

@@ -547,7 +533,6 @@
                   const gchar *label, const gchar *tip_text)
 {
   GtkWidget *button;
-  GtkTooltips *tooltip;
   GtkSizeGroup *sg;

   sg = g_object_get_data(G_OBJECT(widget), OBJECT_DATA_SIZE_GROUP);
@@ -568,8 +553,7 @@
   gtk_size_group_add_widget(sg, button);
   g_object_set_data(G_OBJECT(button), OBJECT_DATA_BUTTON_TYPE,
                    GINT_TO_POINTER(BUTTON_PROP));
-  tooltip = gtk_tooltips_new();
-  gtk_tooltips_set_tip(tooltip, button, tip_text, NULL);
+  gtk_widget_set_tooltip_text(button, tip_text);

   g_signal_connect(G_OBJECT(button), "button-press-event",
                   G_CALLBACK(button_pressed), widget);
@@ -732,7 +716,6 @@
   /* FIXME! command menu and buttons should be customizable. */
   for (i = 0; i < command_entry_len; i++) {
     GtkWidget *tool_button;
-    GtkTooltips *tooltip;
     GtkWidget *img;

     if (!command_entry[i].show_button)
@@ -765,8 +748,7 @@
                     G_CALLBACK(tool_button_clicked_cb), widget);

     /* tooltip */
-    tooltip = gtk_tooltips_new();
- gtk_tooltips_set_tip(tooltip, tool_button, _(command_entry[i].desc), NULL);
+    gtk_widget_set_tooltip_text(tool_button, _(command_entry[i].desc));

     append_tool_button(widget, tool_button);
   }

Reply via email to