[goffice] Add parent name for new objects in the graph guru "Add" menu.
- From: Jean Bréfort <jbrefort src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [goffice] Add parent name for new objects in the graph guru "Add" menu.
- Date: Tue, 3 Nov 2009 07:12:03 +0000 (UTC)
commit ec660d8207aa62b5d0aab8a0e8383a9d5f78482e
Author: Jean Brefort <jean brefort normalesup org>
Date: Tue Nov 3 08:12:28 2009 +0100
Add parent name for new objects in the graph guru "Add" menu.
ChangeLog | 6 ++++++
NEWS | 3 +++
goffice/graph/gog-child-button.c | 10 +++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8e8fe85..629c99f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-03 Jean Brefort <jean brefort normalesup org>
+
+ reviewed by: <delete if not using a buddy>
+
+ * goffice/graph/gog-child-button.c (ensure_menu):
+
2009-11-01 Morten Welinder <terra gnome org>
* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index db3c9f7..c2a82b0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
goffice 0.7.16:
+Jean:
+ * Add parent name for new objects in the graph guru "Add" menu.
+
--------------------------------------------------------------------------
goffice 0.7.15:
diff --git a/goffice/graph/gog-child-button.c b/goffice/graph/gog-child-button.c
index 0fd8202..99afd77 100644
--- a/goffice/graph/gog-child-button.c
+++ b/goffice/graph/gog-child-button.c
@@ -489,28 +489,31 @@ ensure_menu (GogChildButton *child_button)
GtkWidget *widget;
Addition *addition;
GSList *iter;
+ char *label = NULL;
child_button->menu = GTK_MENU (gtk_menu_new ());
g_object_ref_sink (child_button->menu);
for (iter = child_button->additions ; iter != NULL ; iter = iter->next) {
addition = iter->data;
+ g_free (label);
+ label = g_strdup_printf(_("%s to %s"), _(addition->role->id), gog_object_get_name (addition->parent));
if (!strcmp (addition->role->id, "Trend line")) {
GtkWidget *submenu = trend_line_type_menu_create (child_button, addition);
if (submenu != NULL) {
- widget = gtk_menu_item_new_with_label (_(addition->role->id));
+ widget = gtk_menu_item_new_with_label (label);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget), submenu);
} else
continue;
} else if (!strcmp (addition->role->id, "Plot")) {
GtkWidget *submenu = plot_type_menu_create (child_button, addition);
if (submenu != NULL) {
- widget = gtk_menu_item_new_with_label (_(addition->role->id));
+ widget = gtk_menu_item_new_with_label (label);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget), submenu);
} else
continue;
} else if (addition->role->naming_conv == GOG_OBJECT_NAME_BY_ROLE) {
- widget = gtk_menu_item_new_with_label (_(addition->role->id));
+ widget = gtk_menu_item_new_with_label (label);
g_object_set_data (G_OBJECT (widget), ADDITION_KEY,
(gpointer)addition);
g_signal_connect (G_OBJECT (widget), "activate",
@@ -521,6 +524,7 @@ ensure_menu (GogChildButton *child_button)
gtk_menu_shell_append (GTK_MENU_SHELL (child_button->menu), widget);
}
+ g_free (label);
g_signal_connect (child_button->menu, "deactivate",
G_CALLBACK(cb_menu_deactivate), child_button);
gtk_widget_show_all (GTK_WIDGET (child_button->menu));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]