[Gnucash-changes] 2005-10-02 Joshua Sled <jsled@asynchronous.org> * GNOME2_STATUS:

Joshua Sled jsled at cvs.gnucash.org
Sun Oct 2 18:12:48 EDT 2005


Log Message:
-----------
2005-10-02  Joshua Sled  <jsled at asynchronous.org>

	* GNOME2_STATUS: updates for status

	* src/register/register-gnome/gnucash-item-list.c
	(gnc_item_list_select): re-implement to get register combocells
	working better.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        GNOME2_STATUS
        ChangeLog
    gnucash/src/register/register-gnome:
        gnucash-item-list.c

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.300
retrieving revision 1.1487.2.301
diff -LChangeLog -LChangeLog -u -r1.1487.2.300 -r1.1487.2.301
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
+2005-10-02  Joshua Sled  <jsled at asynchronous.org>
+
+	* GNOME2_STATUS: updates for status
+
+	* src/register/register-gnome/gnucash-item-list.c
+	(gnc_item_list_select): re-implement to get register combocells
+	working better.
+
 2005-10-02  David Hampton  <hampton at employees.org>
 
 	* src/app-utils/prefs.scm:
Index: GNOME2_STATUS
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/Attic/GNOME2_STATUS,v
retrieving revision 1.1.2.64
retrieving revision 1.1.2.65
diff -LGNOME2_STATUS -LGNOME2_STATUS -u -r1.1.2.64 -r1.1.2.65
--- GNOME2_STATUS
+++ GNOME2_STATUS
@@ -52,6 +52,11 @@
     - Introduction to GConf -- http://developer.gnome.org/feature/archive/gconf/gconf.html
 
 - General
+
+  - Printing
+
+    - Main window: totally not hooked up
+
   - Startup CRITICAL errors...
 
     [jsled at phoenix:~/stuff/proj/gnucash/src-g2/gnucash]$ /opt/gnc-g2-unstable/bin/gnucash
@@ -83,24 +88,36 @@
 
 - Register Core - mostly functional
 
-  - Competion has problems.  It does complete when a character is typed but it fails to select the
-  inserted text.  This means that the next character typed is inserted
-  instead of continuing to test for completion
+  - Completion has problems.  It does complete when a character is typed but
+    it fails to select the inserted text.  This means that the next character
+    typed is inserted instead of continuing to test for completion
+
+  - The first time it is used, the combocell popups (account-list,
+    split-action) immediately closes (before user notices).  After that it
+    functions normally.
+    
+    - (jsled) This is due to the "changed" signal on the tree-view-selection
+      getting fired, causing the popup to naturally close.  I *believe*
+      "changed" is emitted because the popup window gets
+      gtk_widget_grab_focus()ed, but I'm not 100% sure.
+
+  - selection events on the combo-cells aren't working.
 
-  - The first time it is used, the account popup immediately selects the
-    first account.  After that it functions normally.
+    (gnucash:26380): GLib-GObject-WARNING **: gsignal.c:989: no emission of
+    signal "key-press-event" to stop for instance `0x855a240'
 
   - selection of the date for the datecell seems to also select the
     transaction underneath the calendar, leading to the "this transaction has
     changed, do you want to save" dialog.
 
-  - selection events on the combo-cells aren't working.
-
-    (gnucash:26380): GLib-GObject-WARNING **: gsignal.c:989: no emission of
-    signal "key-press-event" to stop for instance `0x855a240'
+    - (jsled) cannot reproduce as of 02 Oct 2005.
 
   - doesn't remember custom check formats.
 
+  - typing into an in-progress auto-completion field appends (in the middle
+    of the string) rather than replaces the selection portion, at least in
+    the account cells of the SX template.
+
 - Reconcile
 
   - Crash after initial value-prompting dialog:
@@ -129,7 +146,11 @@
 
     - Known issue with height/width bug in libgtkhtml 3.?.? on FC3.
 
-  - Save/restore in unknown state; believed to crash on re-start.
+  - When rendering, progress bar always says "Rendering 'Untitled' report...".
+
+    - warlord reports this was true in 1.8 as well.
+
+  - Removing a report page should remove the report from the runtime.
 
 - Importing
 
@@ -159,6 +180,8 @@
 
   - Being converted over from a scheme file backend to gconf.  (In progress - DRH)
 
+  - Weird initialization and per-checkbox behavior in New Prefs f/ Scheduled Transactions.
+
 - Hierarchy Merge - BROKEN
 
   - Doesn't let you complete the conflict resolution process, thus you can never complete the druid.
Index: gnucash-item-list.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/register/register-gnome/gnucash-item-list.c,v
retrieving revision 1.2.6.8
retrieving revision 1.2.6.9
diff -Lsrc/register/register-gnome/gnucash-item-list.c -Lsrc/register/register-gnome/gnucash-item-list.c -u -r1.2.6.8 -r1.2.6.9
--- src/register/register-gnome/gnucash-item-list.c
+++ src/register/register-gnome/gnucash-item-list.c
@@ -46,6 +46,8 @@
 static GnomeCanvasWidgetClass *gnc_item_list_parent_class;
 static guint gnc_item_list_signals[LAST_SIGNAL];
 
+gboolean _gnc_item_find_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
+
 
 void
 gnc_item_list_clear (GncItemList *item_list)
@@ -79,44 +81,77 @@
 }
 
 
+typedef struct _findSelectionData
+{
+        GncItemList *item_list;
+        const char *string_to_find;
+        GtkTreeIter *found_iter;
+} FindSelectionData;
+
+gboolean
+_gnc_item_find_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
+{
+        FindSelectionData *to_find = (FindSelectionData*)data;
+        gchar *iterStr;
+
+        gtk_tree_model_get(model, iter, 0, &iterStr, -1);
+        if (safe_strcmp(to_find->string_to_find, iterStr) == 0)
+        {
+                to_find->found_iter = gtk_tree_iter_copy(iter);
+                return TRUE;
+        }
+        return FALSE;
+}
+
 void
 gnc_item_list_select (GncItemList *item_list, const char *string)
 {
-#if 0
-	gint row = 0;
-	gchar *text;
+        GtkTreeSelection *tree_sel = NULL;
+        FindSelectionData *to_find_data;
 
-	g_return_if_fail(item_list != NULL);
-	g_return_if_fail(IS_GNC_ITEM_LIST(item_list));
+        g_return_if_fail(item_list != NULL);
+        g_return_if_fail(IS_GNC_ITEM_LIST(item_list));
 
-	if (string == NULL) {
-		gtk_clist_unselect_all(item_list->clist);
-		return;
-	}
+        tree_sel = gtk_tree_view_get_selection(item_list->tree_view);
 
-	while (gtk_clist_get_text(item_list->clist, row, 0, &text)) {
+        if (string == NULL)
+        {
+                gtk_tree_selection_unselect_all(tree_sel);
+                return;
+        }
 
-		if (safe_strcmp(string, text) != 0) {
-			row++;
-			continue;
-		}
-
-                gtk_clist_freeze(item_list->clist);
-                item_list->clist->focus_row = row;
-		gtk_clist_select_row(item_list->clist, row, 0);
-                gtk_clist_thaw(item_list->clist);
+        to_find_data = (FindSelectionData*)g_new0(FindSelectionData, 1);
+        to_find_data->item_list = item_list;
+        to_find_data->string_to_find = string;
+
+        gtk_tree_model_foreach(GTK_TREE_MODEL(item_list->list_store),
+                               _gnc_item_find_selection,
+                               to_find_data);
+
+        if (to_find_data->found_iter != NULL)
+        {
+                GtkTreeIter iter;
+                gchar *sel_path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(item_list->list_store), to_find_data->found_iter);
+                gboolean converted = gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(item_list->list_store), &iter, sel_path);
+                gtk_tree_selection_select_iter(tree_sel, &iter);
 
                 gnc_item_list_show_selected(item_list);
+                g_free(sel_path);
+        }
 
-		return;
-	}
-#endif
+        if (to_find_data->found_iter != NULL)
+        {
+                gtk_tree_iter_free(to_find_data->found_iter);
+        }
+        g_free(to_find_data);
 }
 
 
 void
 gnc_item_list_show_selected (GncItemList *item_list)
 {
+        //gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(...), path, column, ...)
+
 #if 0
 	GtkVisibility visibility;
         gint row;


More information about the gnucash-changes mailing list