diff options
author | Paolo Borelli <pborelli@katamail.com> | 2008-07-14 19:38:30 +0800 |
---|---|---|
committer | Paolo Borelli <pborelli@src.gnome.org> | 2008-07-14 19:38:30 +0800 |
commit | c049cedd6969d77649db15b71f4ba112d4a2c065 (patch) | |
tree | ab42a98360f79974bcefa46a83cd3610aec1c6bf | |
parent | 5dcc53160bfb1202e53fece360838f39646a6d09 (diff) | |
download | gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar.gz gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar.bz2 gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar.lz gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar.xz gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.tar.zst gsoc2013-evolution-c049cedd6969d77649db15b71f4ba112d4a2c065.zip |
** Fix for bug #542889
2008-17-14 Paolo Borelli <pborelli@katamail.com>
** Fix for bug #542889
Port to the new gtk tooltip api.
svn path=/trunk/; revision=35744
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 4 | ||||
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-shell-window.c | 11 | ||||
-rw-r--r-- | shell/e-sidebar.c | 54 | ||||
-rw-r--r-- | shell/e-user-creatable-items-handler.c | 13 | ||||
-rw-r--r-- | widgets/misc/ChangeLog | 9 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 8 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.h | 2 | ||||
-rw-r--r-- | widgets/misc/e-task-widget.c | 13 |
11 files changed, 74 insertions, 59 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c778291424..f33f8c9bba 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2008-17-14 Paolo Borelli <pborelli@katamail.com> + + ** Fix for bug #542889 + + * gui/dialogs/event-page.c: + * gui/alarm-notify/alarm-queue.c: + Port to the new gtk tooltip api. + 2008-07-13 Paul Bolle <pebolle@tiscali.nl> ** Fix for bug #542101 diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index a04b82689c..9bc19d4aad 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1549,7 +1549,6 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, QueuedAlarm *qa; ECalComponent *comp; const char *summary, *location; - GtkTooltips *tooltips; ECalComponentText text; char *str, *start_str, *end_str, *alarm_str, *time_str; icaltimezone *current_zone; @@ -1579,7 +1578,6 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, e_cal_component_get_location (comp, &location); /* create the tray icon */ - tooltips = gtk_tooltips_new (); current_zone = config_data_get_timezone (); alarm_str = timet_to_str_with_zone (trigger, current_zone); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 0596c4c790..cf2a8e5c9e 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -784,15 +784,13 @@ static GtkWidget * create_image_event_box (const char *image_text, const char *tip_text) { GtkWidget *image, *box; - GtkTooltips *tip; box = gtk_event_box_new (); - tip = gtk_tooltips_new (); image = e_icon_factory_get_image (image_text, E_ICON_SIZE_MENU); gtk_container_add ((GtkContainer *) box, image); gtk_widget_show_all (box); - gtk_tooltips_set_tip (tip, box, tip_text, NULL); + gtk_widget_set_tooltip_text (box, tip_text); return box; } diff --git a/shell/ChangeLog b/shell/ChangeLog index 94aa1b2dfd..7c9dbea21e 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2008-17-14 Paolo Borelli <pborelli@katamail.com> + + ** Fix for bug #542889 + + * e-shell-window.c: + * e-user-creatable-items-handler.c: + * e-sidebar.c: + Port to the new gtk tooltip api. + 2008-07-13 Matthew Barnes <mbarnes@redhat.com> * e-shell-folder-title-bar.[ch]: diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index c6f08a7aa9..7d772fd2af 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -112,9 +112,6 @@ struct _EShellWindowPrivate { /* The current view (can be NULL initially). */ ComponentView *current_view; - /* Tooltips. */ - GtkTooltips *tooltips; - /* The status bar widgetry. */ GtkWidget *status_bar; GtkWidget *offline_toggle; @@ -407,7 +404,7 @@ update_offline_toggle_status (EShellWindow *window) gtk_image_set_from_file (GTK_IMAGE (priv->offline_toggle_image), icon_file); g_free (icon_file); gtk_widget_set_sensitive (priv->offline_toggle, sensitive); - gtk_tooltips_set_tip (priv->tooltips, priv->offline_toggle, tooltip, NULL); + gtk_widget_set_tooltip_text (priv->offline_toggle, tooltip); /* TODO: If we get more shell flags, this should be centralised */ t = es_menu_target_new_shell(priv->menu, flags); @@ -863,11 +860,6 @@ impl_dispose (GObject *object) priv->ui_component = NULL; } - if (priv->tooltips != NULL) { - gtk_object_destroy (GTK_OBJECT (priv->tooltips)); - priv->tooltips = NULL; - } - if (priv->store_window_size_timer) { g_source_remove (priv->store_window_size_timer); self->priv->store_window_size_timer = 0; @@ -992,7 +984,6 @@ e_shell_window_init (EShellWindow *shell_window) { EShellWindowPrivate *priv = g_new0 (EShellWindowPrivate, 1); - priv->tooltips = gtk_tooltips_new (); priv->shell_view = e_shell_view_new(shell_window); priv->destroyed = FALSE; diff --git a/shell/e-sidebar.c b/shell/e-sidebar.c index b665edf318..d3404b5813 100644 --- a/shell/e-sidebar.c +++ b/shell/e-sidebar.c @@ -36,7 +36,6 @@ typedef struct { GtkWidget *label; GtkWidget *icon; GtkWidget *hbox; - GtkTooltips *tooltips; GdkPixbuf *default_icon; int id; } Button; @@ -73,8 +72,11 @@ G_DEFINE_TYPE (ESidebar, e_sidebar, GTK_TYPE_CONTAINER) /* Utility functions. */ static Button * -button_new (GtkWidget *button_widget, GtkWidget *label, GtkWidget *icon, GtkTooltips *tooltips, - GtkWidget *hbox, int id) +button_new (GtkWidget *button_widget, + GtkWidget *label, + GtkWidget *icon, + GtkWidget *hbox, + int id) { Button *button = g_new (Button, 1); @@ -82,7 +84,6 @@ button_new (GtkWidget *button_widget, GtkWidget *label, GtkWidget *icon, GtkTool button->label = label; button->icon = icon; button->hbox = hbox; - button->tooltips = tooltips; button->id = id; button->default_icon = NULL; @@ -90,7 +91,6 @@ button_new (GtkWidget *button_widget, GtkWidget *label, GtkWidget *icon, GtkTool g_object_ref (label); g_object_ref (icon); g_object_ref (hbox); - g_object_ref (tooltips); return button; } @@ -102,7 +102,6 @@ button_free (Button *button) g_object_unref (button->label); g_object_unref (button->icon); g_object_unref (button->hbox); - g_object_unref (button->tooltips); if (button->default_icon) g_object_unref (button->default_icon); g_free (button); @@ -182,6 +181,30 @@ button_pressed_callback (GtkToggleButton *toggle_button, return return_val; } +static gboolean +button_query_tooltip (GtkWidget *widget, + gint x, + gint y, + gboolean keyboard_mode, + GtkTooltip *tooltip, + ESidebar *sidebar) +{ + /* Show the tooltip only if the label is hidden */ + if (INTERNAL_MODE (sidebar) == E_SIDEBAR_MODE_ICON) { + char *tip; + + tip = g_object_get_data (G_OBJECT (widget), + "ESidebar:button-tooltip"); + if (tip) { + gtk_tooltip_set_text (tooltip, tip); + + return TRUE; + } + } + + return FALSE; +} + /* Layout. */ @@ -529,7 +552,6 @@ e_sidebar_add_button (ESidebar *sidebar, GtkWidget *hbox; GtkWidget *icon_widget; GtkWidget *label_widget; - GtkTooltips *button_tooltips; button_widget = gtk_toggle_button_new (); if (sidebar->priv->show) @@ -548,29 +570,32 @@ e_sidebar_add_button (ESidebar *sidebar, label_widget = gtk_label_new (label); gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5); gtk_widget_show (label_widget); - button_tooltips = gtk_tooltips_new(); - gtk_tooltips_set_tip (GTK_TOOLTIPS (button_tooltips), button_widget, tooltips, NULL); + + g_object_set_data_full (G_OBJECT (button_widget), + "ESidebar:button-tooltip", + g_strdup (tooltips), + g_free); + gtk_widget_set_has_tooltip (button_widget, TRUE); + g_signal_connect (button_widget, "query-tooltip", + G_CALLBACK (button_query_tooltip), sidebar); switch (INTERNAL_MODE (sidebar)) { case E_SIDEBAR_MODE_TEXT: gtk_box_pack_start (GTK_BOX (hbox), label_widget, TRUE, TRUE, 0); - gtk_tooltips_disable (button_tooltips); break; case E_SIDEBAR_MODE_ICON: gtk_box_pack_start (GTK_BOX (hbox), icon_widget, TRUE, TRUE, 0); - gtk_tooltips_enable (button_tooltips); break; case E_SIDEBAR_MODE_BOTH: default: gtk_box_pack_start (GTK_BOX (hbox), icon_widget, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), label_widget, TRUE, TRUE, 0); - gtk_tooltips_disable (button_tooltips); break; } gtk_container_add (GTK_CONTAINER (button_widget), hbox); - sidebar->priv->buttons = g_slist_append (sidebar->priv->buttons, button_new (button_widget, label_widget, icon_widget, button_tooltips, hbox, id)); + sidebar->priv->buttons = g_slist_append (sidebar->priv->buttons, button_new (button_widget, label_widget, icon_widget, hbox, id)); gtk_widget_set_parent (button_widget, GTK_WIDGET (sidebar)); gtk_widget_queue_resize (GTK_WIDGET (sidebar)); @@ -657,7 +682,6 @@ set_mode_internal (ESidebar *sidebar, ESidebarMode mode ) if (INTERNAL_MODE (sidebar) == E_SIDEBAR_MODE_ICON) { gtk_box_pack_start (GTK_BOX (button->hbox), button->label, TRUE, TRUE, 0); gtk_widget_show (button->label); - gtk_tooltips_disable (button->tooltips); } break; case E_SIDEBAR_MODE_ICON: @@ -669,7 +693,6 @@ set_mode_internal (ESidebar *sidebar, ESidebarMode mode ) gtk_container_child_set (GTK_CONTAINER (button->hbox), button->icon, "expand", TRUE, NULL); - gtk_tooltips_enable (button->tooltips); break; case E_SIDEBAR_MODE_BOTH: if (INTERNAL_MODE (sidebar) == E_SIDEBAR_MODE_TEXT) { @@ -682,7 +705,6 @@ set_mode_internal (ESidebar *sidebar, ESidebarMode mode ) NULL); } - gtk_tooltips_disable (button->tooltips); gtk_box_pack_start (GTK_BOX (button->hbox), button->label, TRUE, TRUE, 0); gtk_widget_show (button->label); break; diff --git a/shell/e-user-creatable-items-handler.c b/shell/e-user-creatable-items-handler.c index ed17f4934c..f18deeb527 100644 --- a/shell/e-user-creatable-items-handler.c +++ b/shell/e-user-creatable-items-handler.c @@ -88,7 +88,6 @@ struct _EUserCreatableItemsHandlerPrivate { char *menu_xml; GtkWidget *new_button, *new_menu; BonoboControl *new_control; - GtkTooltips *tooltips; GtkAccelGroup *accel_group; }; @@ -744,11 +743,10 @@ setup_toolbar_button (EUserCreatableItemsHandler *handler) gconf_client_notify_add(gconf,"/desktop/gnome/interface/toolbar_style", (GConfClientNotifyFunc)new_button_change, handler, NULL, NULL); + gtk_widget_set_tooltip_text (priv->new_button, + priv->default_menu_item->tooltip); gtk_widget_show (priv->new_button); - priv->tooltips = gtk_tooltips_new (); - g_object_ref_sink (priv->tooltips); - gtk_tooltips_set_tip (priv->tooltips, priv->new_button, - priv->default_menu_item->tooltip, NULL); + g_free (val); g_object_unref (gconf); } @@ -796,11 +794,6 @@ impl_dispose (GObject *object) priv->new_control = NULL; } - if (priv->tooltips) { - g_object_unref (priv->tooltips); - priv->tooltips = NULL; - } - if (priv->accel_group) { g_object_unref (priv->accel_group); priv->accel_group = NULL; diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 57696e0e68..3649c5b274 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,12 @@ +2008-17-14 Paolo Borelli <pborelli@katamail.com> + + ** Fix for bug #542889 + + * e-search-bar.h: + * widgets/misc/e-search-bar.c: + * widgets/misc/e-task-widget.c: + Port to the new gtk tooltip api. + 2008-07-12 Paolo Borelli <pborelli@katamail.com> ** Fix for bug #542631 diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 2c18e3ce0d..ffef719f17 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -339,8 +339,9 @@ paint_search_text (GtkWidget *widget, ESearchBar *esb) } t = g_strdup_printf ("%s: %s\n%s", _("Search"), text, _("Click here to change the search type")); - gtk_tooltips_set_tip (esb->tooltips, esb->option_button, t, "Search type"); + gtk_widget_set_tooltip_text (esb->option_button, t); g_free (t); + gtk_widget_set_sensitive (esb->clear_button, FALSE); } @@ -474,7 +475,7 @@ option_activated_cb (GtkWidget *widget, else t = g_strdup_printf ("%s: %s", _("Search"), _("Click here to change the search type")); - gtk_tooltips_set_tip (esb->tooltips, esb->option_button, t, "Search type"); + gtk_widget_set_tooltip_text (esb->option_button, t); g_free (t); } @@ -934,7 +935,6 @@ init (ESearchBar *esb) esb->scopeoption = NULL; esb->scopeoption_box = NULL; - esb->tooltips = NULL; esb->pending_activate = 0; esb->item_id = 0; @@ -970,8 +970,6 @@ e_search_bar_construct (ESearchBar *search_bar, gtk_box_set_homogeneous (GTK_BOX (search_bar), FALSE); - search_bar->tooltips = gtk_tooltips_new (); - bighbox = gtk_hbox_new (FALSE, 0); search_bar->entry_box = gtk_hbox_new (0, FALSE); search_bar->icon_entry = e_icon_entry_new (); diff --git a/widgets/misc/e-search-bar.h b/widgets/misc/e-search-bar.h index ec9f24e11c..f4a8ec93c2 100644 --- a/widgets/misc/e-search-bar.h +++ b/widgets/misc/e-search-bar.h @@ -94,7 +94,7 @@ struct _ESearchBar GtkWidget *scopeoption_menu; guint pending_activate; - GtkTooltips *tooltips; + /* The currently-selected item & subitem */ int item_id; int viewitem_id; /* Current View Id */ diff --git a/widgets/misc/e-task-widget.c b/widgets/misc/e-task-widget.c index c0043ce88b..74b0ba6891 100644 --- a/widgets/misc/e-task-widget.c +++ b/widgets/misc/e-task-widget.c @@ -36,8 +36,6 @@ struct _ETaskWidgetPrivate { char *component_id; - GtkTooltips *tooltips; - GdkPixbuf *icon_pixbuf; GtkWidget *label; GtkWidget *box; @@ -61,11 +59,6 @@ impl_dispose (GObject *object) priv = task_widget->priv; - if (priv->tooltips != NULL) { - g_object_unref (priv->tooltips); - priv->tooltips = NULL; - } - if (priv->icon_pixbuf != NULL) { g_object_unref (priv->icon_pixbuf); priv->icon_pixbuf = NULL; @@ -107,7 +100,6 @@ e_task_widget_init (ETaskWidget *task_widget) priv = g_new (ETaskWidgetPrivate, 1); priv->component_id = NULL; - priv->tooltips = NULL; priv->icon_pixbuf = NULL; priv->label = NULL; priv->image = NULL; @@ -213,9 +205,6 @@ e_task_widget_construct (ETaskWidget *task_widget, } - priv->tooltips = gtk_tooltips_new (); - g_object_ref_sink (priv->tooltips); - e_task_widget_update (task_widget, information, -1.0); } @@ -297,7 +286,7 @@ e_task_widget_update (ETaskWidget *task_widget, gtk_label_set_text (GTK_LABEL (priv->label), text); - gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET (task_widget), text, NULL); + gtk_widget_set_tooltip_text (GTK_WIDGET (task_widget), text); g_free (text); } |