diff options
author | Christian Persch <chpe@gnome.org> | 2007-12-19 13:46:35 +0000 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2007-12-19 13:46:35 +0000 |
commit | c651fba1c6d3003bcaec888dcdd14ffa7f9e3bae (patch) | |
tree | c6fe27e7891c9080f3453da65ed5e0d4c73dc0b5 /src | |
parent | e2e1a3a0c1208dcc7537fe6f13885d1c5ba3b231 (diff) | |
download | glade-c651fba1c6d3003bcaec888dcdd14ffa7f9e3bae.tar.gz |
Port to gtk 2.12 tooltips API. Bug #500947. Remove the unnecessary event
2007-12-19 Christian Persch <chpe@gnome.org>
* configure.ac:
* gladeui/glade-app.c: (glade_app_refresh_undo_redo_button):
* gladeui/glade-base-editor.c: (glade_base_editor_add_properties):
* gladeui/glade-editor-property.c:
(glade_editor_property_tooltip_cb),
(glade_editor_property_sensitivity_cb),
(glade_editor_property_create_info_button),
(glade_editor_property_constructor),
(glade_editor_property_finalize),
(glade_editor_property_load_common),
(glade_eprop_text_show_i18n_dialog),
(glade_eprop_adjustment_table_add_label):
* gladeui/glade-editor-property.h:
* gladeui/glade-editor.c: (glade_editor_notebook_page),
(glade_editor_create_info_button),
(glade_editor_create_reset_button),
(glade_editor_table_append_item):
* gladeui/glade-palette.c: (glade_palette_dispose),
(glade_palette_new_item), (glade_palette_new_item_group),
(glade_palette_update_appearance), (glade_palette_init):
* gladeui/glade-project.c: (glade_project_dispose),
(glade_project_init):
* gladeui/glade-project.h:
* gladeui/glade-property-class.c:
(glade_property_class_new_from_spec):
* gladeui/glade-utils.c:
* gladeui/glade-widget.c: (expose_draw_selection):
* plugins/gtk+/glade-gtk.c: (glade_gtk_widget_set_property),
(glade_gtk_widget_get_property):
* src/glade-window.c: (format_project_list_item_tooltip),
(refresh_projects_list_menu), (glade_window_init): Port to gtk 2.12
tooltips API. Bug #500947. Remove the unnecessary event boxes on the property
labels, part of bug #490157.
svn path=/trunk/; revision=1660
Diffstat (limited to 'src')
-rw-r--r-- | src/glade-window.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/src/glade-window.c b/src/glade-window.c index 8d5994e1..7512f9e8 100644 --- a/src/glade-window.c +++ b/src/glade-window.c @@ -87,8 +87,6 @@ struct _GladeWindowPrivate GladeDesignView *active_view; gint num_tabs; - GtkTooltips *tooltips; - GtkWidget *inspectors_notebook; GtkWidget *statusbar; /* A pointer to the status bar. */ @@ -711,20 +709,23 @@ format_project_list_item_tooltip (GladeProject *project) if (glade_project_get_readonly (project)) { - tooltip = g_strdup_printf ("Activate '%s' %s", + /* FIXME add hint for translators */ + tooltip = g_strdup_printf (_("Activate '%s' %s"), path, READONLY_INDICATOR); } else { - tooltip = g_strdup_printf ("Activate '%s'", path); + /* FIXME add hint for translators */ + tooltip = g_strdup_printf (_("Activate '%s'"), path); } g_free (path); } else { name = glade_project_get_name (project); - tooltip = g_strdup_printf ("Activate '%s'", name); + /* FIXME add hint for translators */ + tooltip = g_strdup_printf (_("Activate '%s'"), name); g_free (name); } @@ -1079,10 +1080,10 @@ refresh_projects_list_menu (GladeWindow *window) GtkWidget *view; GladeProject *project; GtkRadioAction *action; - gchar *action_name; + gchar action_name[32]; gchar *project_name; gchar *tooltip; - gchar *accel; + gchar accel[7]; view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (p->notebook), i); project = glade_design_view_get_project (GLADE_DESIGN_VIEW (view)); @@ -1095,17 +1096,18 @@ refresh_projects_list_menu (GladeWindow *window) * the problem is worked around, action with the same name always * get the same accel. */ - action_name = g_strdup_printf ("Tab_%d", i); + g_snprintf (action_name, sizeof (action_name), "Tab_%d", i); project_name = get_formatted_project_name_for_display (project, FORMAT_NAME_MARK_UNSAVED | FORMAT_NAME_MIDDLE_TRUNCATE | FORMAT_NAME_ESCAPE_UNDERSCORES); tooltip = format_project_list_item_tooltip (project); - - /* alt + 1, 2, 3... 0 to switch to the first ten tabs */ - accel = (i < 10) ? g_strdup_printf ("<alt>%d", (i + 1) % 10) : NULL; + if (i < 10) + g_snprintf (accel, sizeof (accel), "<alt>%d", (i + 1) % 10); + else + accel[0] = '\0'; action = gtk_radio_action_new (action_name, project_name, @@ -1117,10 +1119,8 @@ refresh_projects_list_menu (GladeWindow *window) g_object_set_data (G_OBJECT (project), "project-list-action", action); g_object_set_data (G_OBJECT (action), "project", project); - if (group != NULL) - gtk_radio_action_set_group (action, group); - /* note that group changes each time we add an action, so it must be updated */ + gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); gtk_action_group_add_action_with_accel (p->projects_list_menu_actions, @@ -1142,10 +1142,8 @@ refresh_projects_list_menu (GladeWindow *window) g_object_unref (action); - g_free (action_name); g_free (project_name); g_free (tooltip); - g_free (accel); } p->projects_list_menu_ui_id = id; @@ -3048,22 +3046,15 @@ glade_window_init (GladeWindow *window) gtk_box_pack_start (GTK_BOX (vbox), priv->toolbar, FALSE, TRUE, 0); gtk_widget_show (priv->toolbar); - /* tooltips object */ - priv->tooltips = gtk_tooltips_new (); - /* undo/redo buttons */ priv->undo = gtk_menu_tool_button_new_from_stock (GTK_STOCK_UNDO); priv->redo = gtk_menu_tool_button_new_from_stock (GTK_STOCK_REDO); gtk_widget_show (GTK_WIDGET (priv->undo)); gtk_widget_show (GTK_WIDGET (priv->redo)); - gtk_menu_tool_button_set_arrow_tooltip (GTK_MENU_TOOL_BUTTON (priv->undo), - priv->tooltips, - _("Go back in undo history"), - NULL); - gtk_menu_tool_button_set_arrow_tooltip (GTK_MENU_TOOL_BUTTON (priv->redo), - priv->tooltips, - ("Go forward in undo history"), - NULL); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (priv->undo), + _("Go back in undo history")); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (priv->redo), + _("Go forward in undo history")); sep = GTK_WIDGET (gtk_separator_tool_item_new ()); gtk_widget_show (sep); |