From 089197fd7f4d52a8586bf543c70af8e9c80ad304 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 25 Mar 2006 16:35:31 +0000 Subject: [PATCH] Fix the lack of action strings in the popup menu. The problem occurs because the menu is populated before the the item edit widget is created. Add a list store to track these strings (what the old menustrings list did) which is then passed off to the item_edit widget when that is created. Fixes 334592. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13699 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 9 +++++++++ src/register/register-gnome/combocell-gnome.c | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bc94f667a..3e31f1703f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-25 David Hampton + + * src/register/register-gnome/combocell-gnome.c: Fix the lack of + action strings in the popup menu. The problem occurs because the + menu is populated before the the item edit widget is created. Add + a list store to track these strings (what the old menustrings list + did) which is then passed off to the item_edit widget when that is + created. Fixes 334592. + 2006-03-24 David Hampton * src/gnome/ui/gnc-reconcile-window-ui.xml: diff --git a/src/register/register-gnome/combocell-gnome.c b/src/register/register-gnome/combocell-gnome.c index 662babfb27..8925ecec9e 100644 --- a/src/register/register-gnome/combocell-gnome.c +++ b/src/register/register-gnome/combocell-gnome.c @@ -53,6 +53,7 @@ typedef struct _PopBox GnucashSheet *sheet; GncItemEdit *item_edit; GncItemList *item_list; + GtkListStore *tmp_store; gboolean signals_connected; /* list signals connected? */ @@ -142,6 +143,7 @@ gnc_combo_cell_init (ComboCell *cell) box->sheet = NULL; box->item_edit = NULL; box->item_list = NULL; + box->tmp_store = gtk_list_store_new (1, G_TYPE_STRING); box->signals_connected = FALSE; box->list_popped = FALSE; box->autosize = FALSE; @@ -430,7 +432,12 @@ gnc_combo_cell_add_menu_item (ComboCell *cell, char * menustr) gnc_item_list_select (box->item_list, menustr); unblock_list_signals (cell); - } + } else { + GtkTreeIter iter; + + gtk_list_store_append(box->tmp_store, &iter); + gtk_list_store_set(box->tmp_store, &iter, 0, menustr, -1); + } /* If we're going to be using a pre-fab quickfill, * then don't fill it in here */ @@ -742,7 +749,10 @@ gnc_combo_cell_gui_realize (BasicCell *bcell, gpointer data) /* initialize gui-specific, private data */ box->sheet = sheet; box->item_edit = item_edit; - box->item_list = gnc_item_edit_new_list(box->item_edit, cell->shared_store); + if (cell->shared_store) + box->item_list = gnc_item_edit_new_list(box->item_edit, cell->shared_store); + else + box->item_list = gnc_item_edit_new_list(box->item_edit, box->tmp_store); g_object_ref (box->item_list); gtk_object_sink (GTK_OBJECT(box->item_list));