r23111 - gnucash/trunk/src - Register rewrite Update, added extra dates and cursor changes. This update fixes the following, allow the cursor to move between cells and make active, changed the preference for showing date entered to include reconcile date and added another option to show when transaction selected. Also added menu option to show these extra dates. Author: Robert Fewell

John Ralls jralls at code.gnucash.org
Fri Aug 2 13:55:12 EDT 2013


Author: jralls
Date: 2013-08-02 13:55:10 -0400 (Fri, 02 Aug 2013)
New Revision: 23111
Trac: http://svn.gnucash.org/trac/changeset/23111

Modified:
   gnucash/trunk/src/engine/Split.c
   gnucash/trunk/src/engine/Split.h
   gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h
   gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h
   gnucash/trunk/src/gnome-utils/gnc-tree-view.c
   gnucash/trunk/src/gnome-utils/gnc-tree-view.h
   gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade
   gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
   gnucash/trunk/src/gnome/gnc-split-reg2.c
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml
Log:
Register rewrite Update, added extra dates and cursor changes. This update fixes the following, allow the cursor to move between cells and make active, changed the preference for showing date entered to include reconcile date and added another option to show when transaction selected. Also added menu option to show these extra dates. Author: Robert Fewell

Modified: gnucash/trunk/src/engine/Split.c
===================================================================
--- gnucash/trunk/src/engine/Split.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/engine/Split.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -1657,6 +1657,14 @@
     return split ? split->date_reconciled : ts;
 }
 
+/*################## Added for Reg2 #################*/
+time64
+xaccSplitGetDateReconciled (const Split * split)
+{
+    return split ? split->date_reconciled.tv_sec : 0;
+}
+/*################## Added for Reg2 #################*/
+
 /********************************************************************\
 \********************************************************************/
 

Modified: gnucash/trunk/src/engine/Split.h
===================================================================
--- gnucash/trunk/src/engine/Split.h	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/engine/Split.h	2013-08-02 17:55:10 UTC (rev 23111)
@@ -210,6 +210,11 @@
 /** Returns the date (as Timespec) on which this split was reconciled. */
 Timespec      xaccSplitRetDateReconciledTS (const Split *split);
 
+/*################## Added for Reg2 #################*/
+/** Retrieve the date when the Split was reconciled. */
+time64        xaccSplitGetDateReconciled (const Split *split);
+/*################## Added for Reg2 #################*/
+
 /** @} */
 
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -148,6 +148,7 @@
 static void gnc_plugin_page_register2_cmd_view_filter_by (GtkAction *action, GncPluginPageRegister2 *plugin_page);
 static void gnc_plugin_page_register2_cmd_style_changed (GtkAction *action, GtkRadioAction *current, GncPluginPageRegister2 *plugin_page);
 static void gnc_plugin_page_register2_cmd_style_double_line (GtkToggleAction *action, GncPluginPageRegister2 *plugin_page);
+static void gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action, GncPluginPageRegister2 *plugin_page);
 
 static void gnc_plugin_page_register2_cmd_reconcile (GtkAction *action, GncPluginPageRegister2 *plugin_page);
 static void gnc_plugin_page_register2_cmd_autoclear (GtkAction *action, GncPluginPageRegister2 *plugin_page);
@@ -275,7 +276,7 @@
         G_CALLBACK (gnc_plugin_page_register2_cmd_delete_transaction)
     },
     {
-        "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve Other Splits"), NULL,
+        "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve All Splits"), NULL,
         N_("Remove all splits in the current transaction"),
         G_CALLBACK (gnc_plugin_page_register2_cmd_reinitialize_transaction)
     },
@@ -405,6 +406,12 @@
     },
 
     {
+        "ViewStyleExtraDatesAction", NULL, N_("Show _Extra Dates"), NULL,
+        N_("Show entered and reconciled dates"),
+        G_CALLBACK (gnc_plugin_page_register2_cmd_style_extra_dates), FALSE
+    },
+
+    {
         "SplitTransactionAction", GNC_STOCK_SPLIT_TRANS, N_("S_plit Transaction"), NULL,
         N_("Show all splits in the current transaction"),
         G_CALLBACK (gnc_plugin_page_register2_cmd_expand_transaction), FALSE
@@ -996,6 +1003,7 @@
     GtkActionGroup *action_group;
     GtkAction *action;
     Account *account;
+    GncTreeViewSplitReg *view;
     GncTreeModelSplitReg *model;
     GNCLedgerDisplay2Type ledger_type;
     int i;
@@ -1030,12 +1038,21 @@
     gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
     g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register2_cmd_style_changed, page);
 
+    view = gnc_split_reg2_get_register (priv->gsr);
+
     /* Set "double line" toggle button */
     action = gtk_action_group_get_action (action_group,
                                           "ViewStyleDoubleLineAction");
     g_signal_handlers_block_by_func(action, gnc_plugin_page_register2_cmd_style_double_line, page);
     gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), model->use_double_line);
     g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register2_cmd_style_double_line, page);
+
+    /* Set "extar dates" toggle button */
+    action = gtk_action_group_get_action (action_group,
+                                          "ViewStyleExtraDatesAction");
+    g_signal_handlers_block_by_func(action, gnc_plugin_page_register2_cmd_style_extra_dates, page);
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), view->show_extra_dates);
+    g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register2_cmd_style_extra_dates, page);
 }
 
 
@@ -1295,8 +1312,8 @@
 #define KEY_ACCOUNT_NAME        "AccountName"
 #define KEY_REGISTER_STYLE      "RegisterStyle"
 #define KEY_DOUBLE_LINE         "DoubleLineMode"
+#define KEY_EXTRA_DATES         "ExtraDatesMode"
 
-
 #define LABEL_ACCOUNT		"Account"
 #define LABEL_SUBACCOUNT	"SubAccount"
 #define LABEL_GL		"GL"
@@ -1321,6 +1338,7 @@
     GncPluginPageRegister2 *page;
     GncPluginPageRegister2Private *priv;
     GNCLedgerDisplay2Type ledger_type;
+    GncTreeViewSplitReg *view;
     GncTreeModelSplitReg *model;
     Account *leader;
 
@@ -1334,6 +1352,7 @@
     page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
     priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
 
+    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
     model = gnc_ledger_display2_get_split_model_register (priv->ledger);
     ledger_type = gnc_ledger_display2_type (priv->ledger);
     if (ledger_type > LD2_GL)
@@ -1370,6 +1389,7 @@
 
     g_key_file_set_string (key_file, group_name, KEY_REGISTER_STYLE, style_names[model->style]);
     g_key_file_set_boolean (key_file, group_name, KEY_DOUBLE_LINE, model->use_double_line);
+    g_key_file_set_boolean (key_file, group_name, KEY_EXTRA_DATES, view->show_extra_dates);
 
     LEAVE(" ");
 }
@@ -1397,6 +1417,7 @@
     gchar *style_name;
     gint i;
     gboolean use_double_line;
+    gboolean show_extra_dates;
 
     ENTER(" ");
     priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
@@ -1429,6 +1450,13 @@
     action = gnc_plugin_page_get_action (page, "ViewStyleDoubleLineAction");
     gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), use_double_line);
 
+    /* Update the extra dates action on this page */
+    show_extra_dates =
+        g_key_file_get_boolean (key_file, group_name, KEY_EXTRA_DATES, &error);
+    DEBUG("Setting extra_dates_mode: %d", show_extra_dates);
+    action = gnc_plugin_page_get_action (page, "ViewStyleExtraDatesAction");
+    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), show_extra_dates);
+
     LEAVE(" ");
 }
 
@@ -3103,13 +3131,43 @@
         gnc_tree_view_split_reg_set_format (view);
 
         // This will update the row colors in anything but ledgers
-        if (model->style != REG2_STYLE_LEDGER)
+//        if (model->style != REG2_STYLE_LEDGER)
             gnc_tree_view_split_reg_change_vis_rows (view);
     }
     LEAVE(" ");
 }
 
 static void
+gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
+        GncPluginPageRegister2 *plugin_page) // this works
+{
+    GncPluginPageRegister2Private *priv;
+    GncTreeModelSplitReg *model;
+    GncTreeViewSplitReg *view;
+    gboolean show_extra_dates;
+
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
+
+    g_return_if_fail (GTK_IS_ACTION (action));
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
+
+    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
+    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
+
+    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
+
+    show_extra_dates = gtk_toggle_action_get_active (action);
+    if (show_extra_dates != view->show_extra_dates)
+    {
+        view->show_extra_dates = show_extra_dates;
+
+        gnc_tree_view_split_reg_change_vis_rows (view);
+
+    }
+    LEAVE(" ");
+}
+
+static void
 gnc_plugin_page_register2_cmd_transfer (GtkAction *action,
                                        GncPluginPageRegister2 *page) //this works
 {

Modified: gnucash/trunk/src/gnome/gnc-split-reg2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -238,8 +238,6 @@
     
     account = gnc_ledger_display2_leader (gsr->ledger);
     guid = xaccAccountGetGUID (account);
-    /* Used for saving different register column widths under seperate keys */
-    gconf_key = g_strconcat (GCONF_SECTION,"/", (gchar*)guid_to_string (guid), NULL);
 
     ENTER("create table gsr=%p", gsr);
 
@@ -251,14 +249,20 @@
     ledger_type = gnc_ledger_display2_type (gsr->ledger);
 
     model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
+
+    /* Used for saving different register column widths under seperate keys */
+    if (ledger_type == LD2_SUBACCOUNT)
+        gconf_key = g_strconcat (GCONF_SECTION,"/", (gchar*)guid_to_string (guid), "_sub", NULL);
+    else
+        gconf_key = g_strconcat (GCONF_SECTION,"/", (gchar*)guid_to_string (guid), NULL);
+
+    gnc_tree_model_split_reg_set_display (model, ((ledger_type == LD2_SUBACCOUNT)?TRUE:FALSE), ((ledger_type == LD2_GL)?TRUE:FALSE));
+
     view = gnc_tree_view_split_reg_new_with_model (model);
 
     g_object_unref (G_OBJECT (model));
 
-    gnc_tree_model_split_reg_set_display (model, ((ledger_type == LD2_SUBACCOUNT)?TRUE:FALSE), ((ledger_type == LD2_GL)?TRUE:FALSE));
-
     // We need to give the General Ledger a Key other than all zeros which the search register gets.
-//    if (account == NULL && model->type == GENERAL_LEDGER2)
     if (ledger_type == LD2_GL && model->type == GENERAL_LEDGER2)
         gconf_key = g_strconcat (GCONF_SECTION,"/", "00000000000000000000000000000001", NULL);
 

Modified: gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml	2013-08-02 17:55:10 UTC (rev 23111)
@@ -10,11 +10,10 @@
       <menuitem name="CutTransaction"     	action="CutTransactionAction"/>
       <menuitem name="CopyTransaction"    	action="CopyTransactionAction"/>
       <menuitem name="PasteTransaction"   	action="PasteTransactionAction"/>
-      <menuitem name="TransactionUp"            action="TransactionUpAction"/>
-      <menuitem name="TransactionDown"          action="TransactionDownAction"/>
       <menuitem name="DuplicateTransaction"    	action="DuplicateTransactionAction"/>
       <menuitem name="DeleteTransaction"       	action="DeleteTransactionAction"/>
       <menuitem name="RemoveTransactionSplits" 	action="RemoveTransactionSplitsAction"/>
+      <!--menuitem name="ShiftTransactionForward" 	action="ShiftTransactionForwardAction"/-->
       <separator name="TransactionSep1"/>
       <menuitem name="RecordTransaction"        action="RecordTransactionAction"/>
       <menuitem name="CancelTransaction"        action="CancelTransactionAction"/>
@@ -31,6 +30,7 @@
         <menuitem name="ViewStyleJournal"      	action="ViewStyleJournalAction"/>
         <separator name="ViewSep44"/>
         <menuitem name="ViewStyleDoubleLine"   	action="ViewStyleDoubleLineAction"/>
+        <menuitem name="ViewStyleExtraDates"   	action="ViewStyleExtraDatesAction"/>
       </placeholder>
     </menu>
 
@@ -65,8 +65,6 @@
 
   <toolbar name="DefaultToolbar">
     <placeholder name="DefaultToolbarPlaceholder">
-      <toolitem name="ToolbarTransactionUp"        action="TransactionUpAction"/>
-      <toolitem name="ToolbarTransactionDown"      action="TransactionDownAction"/>
       <toolitem name="ToolbarDuplicateTransaction" action="DuplicateTransactionAction"/>
       <toolitem name="ToolbarDeleteTransaction"    action="DeleteTransactionAction"/>
       <separator name="ToolbarSep66"/>
@@ -88,11 +86,10 @@
       <menuitem name="ViewFilterBy"            action="ViewFilterByAction"/>
     </placeholder>
     <placeholder name="PopupPlaceholder2">
-      <menuitem name="TransactionUp"           action="TransactionUpAction"/>
-      <menuitem name="TransactionDown"         action="TransactionDownAction"/>
       <menuitem name="DuplicateTransaction"    action="DuplicateTransactionAction"/>
       <menuitem name="DeleteTransaction"       action="DeleteTransactionAction"/>
       <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
+      <!--menuitem name="ShiftTransactionForward" 	action="ShiftTransactionForwardAction"/-->
       <separator name="PopupSep2"/>
       <menuitem name="RecordTransaction"       action="RecordTransactionAction"/>
       <menuitem name="CancelTransaction"       action="CancelTransactionAction"/>

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -928,6 +928,14 @@
             return;
     }
 
+    /* Deleting the blank trans just cancels */
+    {
+        Transaction *blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
+
+        if (trans == blank_trans)
+            return;
+    }
+
     window = gnc_tree_view_split_reg_get_parent (view);
 
     /* On a split cursor, just delete the one split. */
@@ -2222,6 +2230,7 @@
     GtkTreeIter *ma = gtk_tree_iter_copy (fa);
     GtkTreeIter *mb = gtk_tree_iter_copy (fb);
     GList *tnodea, *tnodeb;
+    Account *anchor;
     int depth;
     time64 i, j;
     int retval;
@@ -2255,8 +2264,8 @@
         retval = xaccTransOrder (tnodea->data, tnodeb->data);
         if (retval)
            return retval;
+        break;
 
-        break;
         case 2: // Date Entered
         i = xaccTransGetDateEntered (tnodea->data);
         j = xaccTransGetDateEntered (tnodeb->data);
@@ -2269,6 +2278,27 @@
 
         return (gint)(i - j);
         break;
+
+        case 3: // Date Reconciled
+        anchor = gnc_tree_model_split_reg_get_anchor (model);
+
+        if (anchor != NULL)
+        {
+            i = xaccSplitGetDateReconciled (xaccTransFindSplitByAccount (tnodea->data, anchor))
+               ? xaccSplitGetDateReconciled (xaccTransFindSplitByAccount (tnodea->data, anchor)) : 0;
+            j = xaccSplitGetDateReconciled (xaccTransFindSplitByAccount (tnodeb->data, anchor))
+               ? xaccSplitGetDateReconciled (xaccTransFindSplitByAccount (tnodeb->data, anchor)) : 0;
+
+            if ((gint)(i - j) == 0)
+            {
+                i = xaccTransGetDate (tnodeb->data);
+                j = xaccTransGetDate (tnodea->data);
+            }
+            return (gint)(i - j);
+        }
+        else
+            return 0;
+        break;
     }
     return 0;
 }

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -496,44 +496,6 @@
     return FALSE; /* do not stop walking the store, call us with next row */
 }
 
-
-/* Emit change signal for all visable model entries */
-void
-gnc_tree_model_split_reg_change_vis_rows (GncTreeModelSplitReg *model, GtkTreePath *start_path, GtkTreePath *end_path)
-{
-    GList *rr_list = NULL;    /* list of GtkTreeRowReferences */
-    GList *node;
-    GtkTreeIter iter;
-
-    gtk_tree_model_foreach (GTK_TREE_MODEL(model), (GtkTreeModelForeachFunc)gtm_sr_foreach_func, &rr_list);
-
-    for ( node = rr_list;  node != NULL;  node = node->next )
-    {
-        GtkTreePath *path;
-        path = gtk_tree_row_reference_get_path ((GtkTreeRowReference*)node->data);
-
-        if ((path) && gnc_tree_model_split_reg_get_iter (GTK_TREE_MODEL (model), &iter, path))
-        {
-            gchar *path_string;
-            path_string = gtk_tree_path_to_string (path);
-            PINFO("path is - '%s'", path_string);
-
-            // Only emit change if path > start_path and < end_path
-            if ((gtk_tree_path_compare (path, end_path) == -1) && (gtk_tree_path_compare (start_path, path) == -1))
-            {
-                path_string = gtk_tree_path_to_string (path);
-                PINFO("row_changed at path - '%s'", path_string);
-                gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
-            }
-            g_free (path_string);
-            gtk_tree_path_free (path);
-        }
-    }
-    g_list_foreach (rr_list, (GFunc) gtk_tree_row_reference_free, NULL);
-    g_list_free (rr_list);
-}
-
-
 /* Remove all model entries */
 static void
 gtm_sr_remove_all_rows (GncTreeModelSplitReg *model)
@@ -560,14 +522,13 @@
     g_list_free (rr_list);
 }
 
-
 /* Load the model with unique transactions based on a GList of splits */
 void
 gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Account *default_account)
 {
     GncTreeModelSplitRegPrivate *priv;
 
-    ENTER("Load ModelSplitReg = %p and slist length is %d", model, g_list_length (slist));
+    ENTER("#### Load ModelSplitReg = %p and slist length is %d ####", model, g_list_length (slist));
 
     priv = model->priv;
 
@@ -581,7 +542,7 @@
     /* Add the blank transaction to the tlist */
     priv->tlist = g_list_append (priv->tlist, priv->btrans);
 
-    PINFO("Register for Account '%s' has %d transactions and %d splits",
+    PINFO("#### Register for Account '%s' has %d transactions and %d splits ####",
           default_account ? xaccAccountGetName (default_account) : "NULL", g_list_length (priv->tlist), g_list_length (slist));
 
     /* Update the completion model liststores */
@@ -590,7 +551,7 @@
     priv->anchor = default_account;
     priv->bsplit_parent_node = NULL;
 
-    LEAVE("Leave Model Load");
+    LEAVE("#### Leave Model Load ####");
 }
 
 
@@ -706,17 +667,17 @@
     string = g_static_private_get (&gtmits_buffer_key);
     if (string == NULL)
     {
-        string = g_malloc(ITER_STRING_LEN + 1);
+        string = g_malloc (ITER_STRING_LEN + 1);
         g_static_private_set (&gtmits_buffer_key, string, g_free);
     }
 #else
-    static GPrivate gtmits_buffer_key = G_PRIVATE_INIT(g_free);
+    static GPrivate gtmits_buffer_key = G_PRIVATE_INIT (g_free);
     gchar *string;
 
     string = g_private_get (&gtmits_buffer_key);
     if (string == NULL)
     {
-        string = g_malloc(ITER_STRING_LEN + 1);
+        string = g_malloc (ITER_STRING_LEN + 1);
         g_private_set (&gtmits_buffer_key, string);
     }
 #endif
@@ -728,17 +689,17 @@
         snprintf(
             string, ITER_STRING_LEN,
             "[stamp:%x data:%d, %p (%p:%s), %p (%p:%s)]",
-            iter->stamp, GPOINTER_TO_INT(iter->user_data),
+            iter->stamp, GPOINTER_TO_INT (iter->user_data),
             iter->user_data2,
             iter->user_data2 ? ((GList *) iter->user_data2)->data : 0,
             iter->user_data2 ?
-            (QOF_INSTANCE(((GList *) iter->user_data2)->data))->e_type : "",
+            (QOF_INSTANCE (((GList *) iter->user_data2)->data))->e_type : "",
             iter->user_data3,
             iter->user_data3 ? ((GList *) iter->user_data3)->data : 0,
             iter->user_data3 ?
-            (QOF_INSTANCE(((GList *) iter->user_data3)->data))->e_type : "");
+            (QOF_INSTANCE (((GList *) iter->user_data3)->data))->e_type : "");
     else
-        strcpy(string, "(null)");
+        strcpy (string, "(null)");
     return string;
 }
 
@@ -925,7 +886,6 @@
             goto fail;
         }
     }
-
     else {
         DEBUG("Invalid path depth");
         goto fail;
@@ -1019,15 +979,15 @@
     for (node = xaccTransGetSplitList (trans); node; node = node->next)
     {
         Split *split = node->data;
-        Account *split_acc = xaccSplitGetAccount(split);
+        Account *split_acc = xaccSplitGetAccount (split);
 
-        if (!xaccTransStillHasSplit(trans, split))
+        if (!xaccTransStillHasSplit (trans, split))
             continue;
 
         if (ancestor == split_acc)
             return split_acc;
 
-        if (ancestor && xaccAccountHasAncestor(split_acc, ancestor))
+        if (ancestor && xaccAccountHasAncestor (split_acc, ancestor))
             return split_acc;
     }
     return NULL;
@@ -1045,7 +1005,7 @@
 
     if (trow2)
     {
-        if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
+        if (qof_book_use_split_action_for_num_field (model->priv->book))
             return TRUE;
         else
             return FALSE;
@@ -1058,17 +1018,13 @@
 static gboolean
 gnc_tree_model_split_reg_get_filter_vis (GncTreeModelSplitReg *model, Transaction *trans, gboolean trow1)
 {
-    GList *tnode, *tnode_last = NULL;
     gboolean return_value = FALSE;
     char chars[6];
     int i = 0;
     time64 date_posted;
     Account *account;
 
-    tnode = g_list_find (model->priv->tlist, trans); // row trans
-    tnode_last = g_list_last (model->priv->tlist); // Blank trans
-
-    if (tnode == tnode_last) // Blank trans is always visable.
+    if (trans == model->priv->btrans) // Blank trans is always visable.
        return TRUE;
 
     // Get the posted date
@@ -1092,15 +1048,6 @@
     if (model->filter_cleared_match == CLEARED_ALL)
         return TRUE;
 
-    // Test for sub account register, if so, check split accounts against ancestor
-    if (model->priv->display_subacc)
-        account = gtm_sr_trans_get_account_for_splits_ancestor (trans, model->priv->anchor);
-    else
-        account = model->priv->anchor;
-
-    if (account == NULL)
-        return FALSE;
-
      // Test for the status field.
     if (model->filter_cleared_match & CLEARED_CLEARED)
         chars[i++] = CREC;
@@ -1114,15 +1061,36 @@
         chars[i++] = VREC;
     chars[i] = '\0';
 
-    // Loop through splits checking state.
-    for (i = 0; i < 5; i++)
+    // Test for sub account register, if so, check split accounts against ancestor
+    if (model->priv->display_subacc)
+        account = gtm_sr_trans_get_account_for_splits_ancestor (trans, model->priv->anchor);
+    else
+        account = model->priv->anchor;
+
+    if (account != NULL) // Normal Register and Subaccounts
     {
-        if (xaccTransHasSplitsInStateByAccount (trans, chars[i], account))
+        // Loop through splits checking state.
+        for (i = 0; i < 5; i++)
         {
-            return_value = TRUE;
-            break;
+            if (xaccTransHasSplitsInStateByAccount (trans, chars[i], account))
+            {
+                return_value = TRUE;
+                break;
+            }
         }
     }
+    else // General Register
+    {
+        // Loop through splits checking state.
+        for (i = 0; i < 5; i++)
+        {
+            if (xaccTransHasSplitsInState (trans, chars[i]))
+            {
+                return_value = TRUE;
+                break;
+            }
+        }
+    }
 
     if (return_value == FALSE && trow1 == TRUE)
         g_signal_emit_by_name (model, "selection_move_filter", trans);
@@ -1135,15 +1103,7 @@
 gboolean
 gnc_tree_model_split_reg_get_read_only (GncTreeModelSplitReg *model, Transaction *trans)
 {
-    QofBook *book;
-    GList *tnode, *tnode_last = NULL;
-
-    book = gnc_get_current_book ();
-
-    tnode = g_list_find (model->priv->tlist, trans);
-    tnode_last = g_list_last (model->priv->tlist);
-
-    if (qof_book_is_readonly (book)) // book is read only
+    if (qof_book_is_readonly (model->priv->book)) // book is read only
         return TRUE;
 
     if (model->read_only) // register is read only
@@ -1153,9 +1113,9 @@
     if (xaccTransHasSplitsInState (trans, VREC))
         return TRUE;
 
-    if (qof_book_uses_autoreadonly (book)) // use auto read only
+    if (qof_book_uses_autoreadonly (model->priv->book)) // use auto read only
     {
-        if (tnode == tnode_last) // blank transaction
+        if (trans == model->priv->btrans) // blank transaction
             return FALSE;
         else
             return xaccTransIsReadonlyByPostedDate (trans);
@@ -1844,9 +1804,9 @@
 
     if (trans == NULL && split == NULL)
     {
-        gchar *path_string = gtk_tree_path_to_string (path);
-
+        gchar *path_string;
         gtk_tree_path_append_index (path, number);
+        path_string = gtk_tree_path_to_string (path);
         LEAVE("path is %s", path_string);
         g_free (path_string);
         return path;
@@ -2126,7 +2086,7 @@
     gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
     gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (model), path, &iter);
 
-    DEBUG("insert %d splits for transaction %p\n", xaccTransCountSplits (trans), trans);
+    DEBUG("insert %d splits for transaction %p", xaccTransCountSplits (trans), trans);
 
     for (snode = xaccTransGetSplitList (trans); snode; snode = snode->next)
     {
@@ -2323,7 +2283,7 @@
 }
 
 
-/* Update the dsiplay sub account and general ledger settings */
+/* Update the display sub account and general ledger settings */
 void
 gnc_tree_model_split_reg_set_display (GncTreeModelSplitReg *model, gboolean subacc, gboolean gl)
 {
@@ -2719,7 +2679,7 @@
     /* Clear the liststore, Store is short name, full name and account pointer */
     gtk_list_store_clear (priv->account_list);
 
-    root = gnc_book_get_root_account (gnc_get_current_book());
+    root = gnc_book_get_root_account (priv->book);
 
     // Get a list of accounts.
     accts = gnc_account_get_descendants (root);

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h	2013-08-02 17:55:10 UTC (rev 23111)
@@ -273,10 +273,6 @@
 /* Returns TRUE if iter is a blank transaction */
 gboolean gnc_tree_model_split_reg_is_blank_trans (GncTreeModelSplitReg *model, GtkTreeIter *iter);
 
-/* Emit change signal for all visable model entries */
-void gnc_tree_model_split_reg_change_vis_rows (GncTreeModelSplitReg *model,
-               GtkTreePath *start_path, GtkTreePath *end_path);
-
 /* Return the split for which ancestor is it's parent */
 Split * gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (const Transaction *trans, const Account *ancestor);
 

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -66,7 +66,7 @@
 
 
 /** Static Globals *******************************************************/
-static QofLogModule log_module = GNC_MOD_GUI;
+static QofLogModule log_module = GNC_MOD_LEDGER;
 
 static void gnc_tree_view_split_reg_class_init (GncTreeViewSplitRegClass *klass);
 static void gnc_tree_view_split_reg_init (GncTreeViewSplitReg *view);
@@ -100,7 +100,7 @@
 static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
 				const gchar *path, gpointer user_data); //FIXME This may not be needed
 
-static void gtv_sr_begin_edit (GncTreeViewSplitReg *view, Split *split, Transaction *trans);
+static void gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans);
 
 static void gtv_sr_finish_edit (GncTreeViewSplitReg *view);
 
@@ -121,6 +121,8 @@
 
 static gboolean gtv_sr_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
 
+static gboolean gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
+
 static gboolean gtv_sr_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
 
 static gboolean gtv_sr_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer user_data);
@@ -271,12 +273,15 @@
     gboolean             use_vertical_lines;  // Draw vertical lines
 
     gboolean             show_calendar_buttons;        // Show the calendar buttons
-    gboolean             show_entered_date;            // Show the entered date below the posted date
+    gboolean             show_extra_dates_on_selection;// Show the above on the selected transaction
     gboolean             selection_to_blank_on_expand; // Move the selection to the blank split on expand
 
     gint                 key_length;                   // The number of characters before auto complete starts.
     gint                 single_button_press;          // Capture single button press.
 
+    gchar               *transfer_string;              // This is the account transfer string.
+    gboolean             stop_cell_move;               // This stops the cursor moving to another cell.
+
 };
 
 /* Define some cell colors */
@@ -479,7 +484,15 @@
 {
     GncTreeModelSplitReg *model;
     GtkTreePath *start_path, *end_path;
+    GtkTreeIter iter;
+    gboolean valid = TRUE;
+    gint depth;
+    GtkTreeRowReference  *rowref;
+    GList *rr_list = NULL;    /* list of GtkTreeRowReferences */
+    GList *node;
 
+    ENTER("");
+
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
     if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (view), &start_path, &end_path))
@@ -491,11 +504,70 @@
         g_free (estring);
         g_free (sstring);
 
-        gnc_tree_model_split_reg_change_vis_rows (model, start_path, end_path);
+        // Step through the visable rows and send update signal
+        while (valid)
+        {
+            GtkTreePath *mpath;
+            depth = gtk_tree_path_get_depth (start_path);
 
+            mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, start_path);
+
+            if ((mpath) && gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, mpath))
+            {
+                rowref = gtk_tree_row_reference_new (GTK_TREE_MODEL(model), mpath);
+                rr_list = g_list_append (rr_list, rowref);
+
+                gtk_tree_path_free (mpath);
+            }
+
+            if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), start_path) && depth == 1)
+            {
+                gtk_tree_path_down (start_path);
+            }
+            else
+            {
+                if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), start_path) && depth == 2)
+                {
+                    gtk_tree_path_down (start_path);
+                } 
+                else
+                {
+                    gtk_tree_path_next (start_path);
+                    if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), start_path) && depth > 2)
+                    {
+                        gtk_tree_path_prev (start_path);
+                        gtk_tree_path_up (start_path);
+                        gtk_tree_path_next (start_path);
+                    }
+                    if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), start_path) && depth > 1)
+                    {
+                        gtk_tree_path_prev (start_path);
+                        gtk_tree_path_up (start_path);
+                        gtk_tree_path_next (start_path);
+                    }
+                }
+            }
+            if (gtk_tree_path_compare (start_path, end_path) == 1)
+                valid = FALSE;
+        }
         gtk_tree_path_free (start_path);
         gtk_tree_path_free (end_path);
+
+
+        PINFO("Visable List length is %d", g_list_length (rr_list));
+
+        // Go througth references and emit update signal.
+        for ( node = rr_list;  node != NULL;  node = node->next )
+        {
+            GtkTreePath *path;
+            path = gtk_tree_row_reference_get_path ((GtkTreeRowReference*)node->data);
+            gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
+            gtk_tree_path_free (path);
+        }
+        g_list_foreach (rr_list, (GFunc) gtk_tree_row_reference_free, NULL);
+        g_list_free (rr_list);
     }
+    LEAVE("");
 }
 
 
@@ -517,8 +589,12 @@
     view->priv->trans_confirm = RESET;
     view->priv->single_button_press = 0;
 
+    view->priv->transfer_string = g_strdup ("Dummy");
+    view->priv->stop_cell_move = FALSE;
+
     view->priv->show_calendar_buttons = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER, "show_calendar_buttons", NULL);
-    view->priv->show_entered_date = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER, "show_entered_date", NULL);
+    view->show_extra_dates = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER, "show_extra_dates", NULL);
+    view->priv->show_extra_dates_on_selection = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER, "show_extra_dates_on_selection", NULL);
     view->priv->selection_to_blank_on_expand = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER, "selection_to_blank_on_expand", NULL);
     view->priv->key_length = gnc_gconf_get_float(GCONF_GENERAL_REGISTER, "key_length", NULL);
 
@@ -567,6 +643,9 @@
     if (view->help_text)
         g_free (view->help_text);
 
+    if (view->priv->transfer_string)
+        g_free (view->priv->transfer_string);
+
     gnc_gconf_general_remove_cb ("draw_horizontal_lines",
                                 gnc_tree_view_split_reg_gconf_changed,
                                 view);
@@ -680,6 +759,7 @@
 gnc_tree_view_split_reg_get_colummn_list (GncTreeModelSplitReg *model)
 {
     DEBUG("Model-type is %d", model->type);
+
     switch (model->type)
     {
     case BANK_REGISTER2:
@@ -759,14 +839,11 @@
 
 /* Creates a treeview with the list of fields */
 static GncTreeViewSplitReg *
-gnc_tree_view_split_reg_set_cols (GncTreeViewSplitReg *view,
+gnc_tree_view_split_reg_set_cols (GncTreeViewSplitReg *view, GncTreeModelSplitReg *model,
                                     const ViewCol col_list[])
 {
     int i = 0;
 
-    GncTreeModelSplitReg *model;
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
     while (col_list && col_list[i] != -1) {
         GList *renderers;
         GtkCellRenderer *cr0;
@@ -879,10 +956,6 @@
     }
     gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), GTK_SELECTION_BROWSE);
 
-    // Connect a call back to update the sort settings.
-    g_signal_connect (GTK_TREE_SORTABLE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))),
-        "sort-column-changed", G_CALLBACK (gnc_tree_control_split_reg_sort_changed_cb), view);
-
     g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), "changed", G_CALLBACK (gtv_sr_motion_cb), view);
 
     //Add a data-edited property to keep track of transaction edits.
@@ -891,9 +964,6 @@
     // This is used to move the selected item if the selected transaction is deleted.
     g_signal_connect (G_OBJECT (model), "selection_move_delete", G_CALLBACK (gtv_sr_selection_move_delete_cb), view);
 
-    // This is used to move the selected item when we refilter.
-    g_signal_connect (G_OBJECT (model), "selection_move_filter", G_CALLBACK (gtv_sr_selection_move_filter_cb), view);
-
     // This will refresh the view.
     g_signal_connect (G_OBJECT (model), "refresh_trans", G_CALLBACK (gtv_sr_refresh_trans_cb), view);
 
@@ -903,9 +973,6 @@
     // This is for mouse buttons...
     g_signal_connect (G_OBJECT (view), "button_press_event", G_CALLBACK (gtv_sr_button_cb), NULL);
 
-    // Set the view to fixed height mode...
-    gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (view), TRUE);
-
     return view;
 }
 
@@ -919,7 +986,7 @@
     GtkTreePath *mpath, *spath;
     gint total_num = 0;
 
-    ENTER(" ");
+    ENTER(" #### Set View Format #### ");
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
@@ -983,7 +1050,7 @@
             /* This updates the plugin page gui */
             gnc_tree_view_split_reg_call_uiupdate_cb(view);
 
-            LEAVE("journal format");
+            LEAVE("#### Journal format ####");
             return (FALSE);
         }
 
@@ -993,7 +1060,7 @@
 
             priv->expanded = FALSE;
 
-            LEAVE("single line foramt");
+            LEAVE("#### Single line foramt ####");
         }
 
         if (model->use_double_line)
@@ -1012,7 +1079,7 @@
                 index = index + 1;
             }
             gtk_tree_path_free (path);
-            LEAVE("double line format");
+            LEAVE("#### Double line format ####");
         }
 
         /* This expands to split from top level auto.. */
@@ -1021,7 +1088,7 @@
             gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
 
             priv->expanded = TRUE;
-            LEAVE("auto expand line format");
+            LEAVE("#### Auto expand line format ####");
         }
     }
 
@@ -1057,7 +1124,7 @@
     {
         gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), spath);
         priv->expanded = FALSE;
-        LEAVE("single line transaction foramt");
+        LEAVE("#### Single line transaction foramt ####");
     }
 
     if ((model->use_double_line) && (model->style != REG2_STYLE_JOURNAL))
@@ -1067,7 +1134,7 @@
         gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), spath);
         gtk_tree_path_up (spath);
         priv->expanded = FALSE;
-        LEAVE("double line transaction format");
+        LEAVE("#### Double line transaction format ####");
     }
 
     /* This expands to split from top level auto.. */
@@ -1075,7 +1142,7 @@
     {
         gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
         priv->expanded = TRUE;
-        LEAVE("auto expand line transaction format");
+        LEAVE("#### Auto expand line transaction format ####");
     }
 
     gtk_tree_path_free (mpath);
@@ -1095,9 +1162,6 @@
     GncTreeViewSplitReg *view = user_data;
     Transaction *trans = item;
 
-    /* Refilter the tree view register */
-    gnc_tree_view_split_reg_refilter (view); //FIXME is this needed ???
-
     gnc_tree_view_split_reg_format_trans (view, trans);
 
     /* scroll window to show selection when view is idle */
@@ -1113,47 +1177,16 @@
     GncTreeViewSplitReg *view;
     GtkTreeSelection    *selection;
 
-    gtk_rc_parse_string (rc_string);
-
     view = g_object_new (gnc_tree_view_split_reg_get_type(), NULL);
     g_object_set (view, "name", "split_reg_tree", NULL);
 
-    // Setup the filter model
-    f_model = gtk_tree_model_filter_new (GTK_TREE_MODEL (model), NULL);
-    // do not do this - g_object_unref (G_OBJECT (model));
-
-    // Setup the sort model
-    s_model = gtk_tree_model_sort_new_with_model (f_model);
-    g_object_unref (G_OBJECT (f_model));
-
-    // Connect model to tree view
-    gnc_tree_view_set_model (GNC_TREE_VIEW (view), s_model);
-    g_object_unref (G_OBJECT (s_model));
-
-    /* Set the user_data for the sort callback */
-    gnc_tree_view_set_sort_user_data (GNC_TREE_VIEW (view), view);
-
     view->priv->anchor = gnc_tree_model_split_reg_get_anchor (model);
     view->priv->reg_comm = xaccAccountGetCommodity (view->priv->anchor);
-    view->priv->reg_currency = gnc_account_or_default_currency (view->priv->anchor, NULL);
-    g_assert(view->priv->reg_currency);
-    g_assert(gnc_commodity_is_currency(view->priv->reg_currency));
     view->help_text = g_strdup ("Help Text");
 
-    gnc_tree_view_split_reg_set_cols (view, gnc_tree_view_split_reg_get_colummn_list (model));
+    // This sets up solid lines for the grid line.
+    gtk_rc_parse_string (rc_string);
 
-    // Filtering function.
-    gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER (f_model),
-                                              GNC_TREE_MODEL_SPLIT_REG_COL_FILTER_VIS);
-
-    // Default the sorting to date.
-    gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (s_model),
-                                          GNC_TREE_MODEL_SPLIT_REG_COL_DATE,
-                                          GTK_SORT_ASCENDING);
-
-    /* Set default visibilities */
-    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), TRUE);
-
     /* TreeView Grid lines */
     if (view->priv->use_horizontal_lines)
     {
@@ -1167,6 +1200,9 @@
     else
         gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_NONE);
 
+    // Set the view to fixed height mode...
+    gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (view), TRUE);
+
     /* Expanders off */
     gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (view), FALSE);
 
@@ -1175,6 +1211,49 @@
 
     gtk_tree_selection_unselect_all (selection);
 
+    // Setup the filter model
+    f_model = gtk_tree_model_filter_new (GTK_TREE_MODEL (model), NULL);
+
+    // Setup the sort model
+    s_model = gtk_tree_model_sort_new_with_model (f_model);
+    g_object_unref (G_OBJECT (f_model));
+
+    PINFO("#### After Models are Setup ####");
+
+    /* Set the user_data for the sort callback */
+    gnc_tree_view_set_sort_user_data (GNC_TREE_VIEW (view), s_model);
+
+    /* Set up the columns */
+    gnc_tree_view_split_reg_set_cols (view, model, gnc_tree_view_split_reg_get_colummn_list (model));
+
+    // Connect a call back to update the sort settings.
+    g_signal_connect (GTK_TREE_SORTABLE (s_model), "sort-column-changed",
+          G_CALLBACK (gnc_tree_control_split_reg_sort_changed_cb), view);
+
+    PINFO("#### Before View connected to Model ####");
+
+    // Connect model to tree view
+    gnc_tree_view_set_model (GNC_TREE_VIEW (view), s_model);
+    g_object_unref (G_OBJECT (s_model));
+
+    PINFO("#### After View connected to Model ####");
+
+    // Filtering function.
+    gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER (f_model),
+                                              GNC_TREE_MODEL_SPLIT_REG_COL_FILTER_VIS);
+
+    PINFO("#### After set Filter Function ####");
+
+    // Default the sorting to date.
+    gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (s_model),
+                                          GNC_TREE_MODEL_SPLIT_REG_COL_DATE,
+                                          GTK_SORT_ASCENDING);
+
+    PINFO("#### After Set Default Sort Column ####");
+
+    // This is used to move the selected item when we refilter.
+    g_signal_connect (G_OBJECT (model), "selection_move_filter", G_CALLBACK (gtv_sr_selection_move_filter_cb), view);
+
     return view;
 }
 
@@ -1198,7 +1277,7 @@
     GtkTreePath *new_mpath, *mpath, *spath;
     gint *indices;
 
-    ENTER(" ");
+    ENTER("#### Default Selection ####");
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
@@ -1245,19 +1324,28 @@
     gtk_tree_path_free (spath);
     gtk_tree_path_free (new_mpath);
 
+    PINFO("#### Default Selection - Before Refilter ####");
+
     /* Refilter the tree view register */
+//FIXME    if ((model->filter_start_time > 0) || (model->filter_end_time > 0) || (model->filter_cleared_match != CLEARED_ALL))
     gnc_tree_view_split_reg_refilter (view);
 
+    PINFO("#### Default Selection - After Refilter ####");
+
     /* Update the titles */
     gtv_sr_titles (view, view->priv->current_depth);
 
+    PINFO("#### Default Selection - After Titles ####");
+
     /* Set the view format */
     gnc_tree_view_split_reg_set_format (view);
 
+    PINFO("#### Default Selection - After View Format ####");
+
     /* scroll window to show selection when view is idle */
     g_idle_add ((GSourceFunc) gnc_tree_view_split_reg_scroll_to_cell, view );
 
-    LEAVE(" ");
+    LEAVE("#### Leave Default Selection ####");
 }
 
 /*###########################################################################*/
@@ -1457,13 +1545,13 @@
 
     mpath = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &m_iter);
 
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
+//    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
 
-    indices = gtk_tree_path_get_indices (spath);
+    indices = gtk_tree_path_get_indices (mpath);
 
     row_color = gnc_tree_model_split_reg_get_row_color (model, is_trow1, is_trow2, is_split, indices[0]);
 
-    gtk_tree_path_free (spath);
+//    gtk_tree_path_free (spath);
     gtk_tree_path_free (mpath);
 
     /* Set the background color / this works for sorting and deleting transactions */
@@ -1483,7 +1571,7 @@
     GncTreeModelSplitReg *model;
     GtkTreeIter m_iter, f_iter;
     GtkTreeModel *f_model;
-    GtkTreePath *mpath, *spath;
+    GtkTreePath *spath;
     ViewCol viewcol;
     Transaction *trans;
     Split *split;
@@ -1493,6 +1581,7 @@
     gboolean open_edited = FALSE;
     gboolean is_template = FALSE;
     gboolean negative_in_red = FALSE;
+    gboolean show_extra_dates = FALSE;
     gnc_numeric num;
     const gchar *s = "";
     const gchar *row_color;
@@ -1517,10 +1606,8 @@
                           &is_trow1, &is_trow2, &is_split, &is_blank,
                           &split, &trans));
 
-    mpath = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &m_iter);
+    spath = gtk_tree_model_get_path (GTK_TREE_MODEL (s_model), s_iter);
 
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
     depth = gtk_tree_path_get_depth (spath);
 
     indices = gtk_tree_path_get_indices (spath);
@@ -1538,7 +1625,6 @@
         expanded = TRUE; // splits are always expanded
 
     gtk_tree_path_free (spath);
-    gtk_tree_path_free (mpath);
 
     /* Set the background color / this works for sorting and deleting of transactions */
     g_object_set (cell, "cell-background", row_color, (gchar*)NULL);
@@ -1573,9 +1659,14 @@
         if (is_split)
             g_object_set (cell, "cell-background", "white", (gchar*)NULL);
 
-        if (is_trow2 && view->priv->show_entered_date)
-            g_object_set (cell, "cell-background", YELLOWCELL, (gchar*)NULL);
+        // Show the extra dates for selected transaction
+        if ((view->priv->current_trans == trans) && view->priv->show_extra_dates_on_selection)
+            show_extra_dates = TRUE;
 
+        // Show the extra dates allways
+        if (view->show_extra_dates == TRUE)
+            show_extra_dates = TRUE;
+
         if (is_trow1) {
             Timespec ts = {0,0};
             xaccTransGetDatePostedTS (trans, &ts);
@@ -1585,13 +1676,16 @@
             if (ts.tv_sec == 0)
             {
                 ts.tv_sec = gnc_time (NULL);
-                //xaccTransSetDatePostedSecs(trans, ts.tv_sec);
+                //xaccTransSetDatePostedSecs (trans, ts.tv_sec);
             }//if
             s = gnc_print_date(ts);
             editable = TRUE;
         }
-        else if (is_trow2 && view->priv->show_entered_date) {
+        else if (is_trow2 && show_extra_dates) {
             Timespec ts = {0,0};
+
+            g_object_set (cell, "cell-background", YELLOWCELL, (gchar*)NULL);
+
             xaccTransGetDateEnteredTS (trans, &ts);
             //If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
             //is a new transaction and set the time to current time to show current
@@ -1599,11 +1693,31 @@
             if (ts.tv_sec == 0)
             {
                 ts.tv_sec = gnc_time (NULL);
-                //xaccTransSetDateEnteredSecs(trans, ts.tv_sec);
+                //xaccTransSetDateEnteredSecs (trans, ts.tv_sec);
             }//if
             s = gnc_print_date(ts);
             editable = FALSE;
         }
+        else if (is_split && show_extra_dates) {
+            Timespec ts = {0,0};
+
+            if (xaccSplitGetReconcile (split) == YREC)
+            {
+                xaccSplitGetDateReconciledTS (split, &ts);
+                //If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
+                //is a new transaction and set the time to current time to show current
+                //date on new transactions
+                if (ts.tv_sec == 0)
+                {
+                    ts.tv_sec = gnc_time (NULL);
+                    //xaccSplitSetDateReconciledTS (split, ts.tv_sec);
+                }//if
+                s = gnc_print_date(ts);
+            }
+            else
+                s = "";
+            editable = FALSE;
+        }
         else {
             s = "";
             editable = FALSE;
@@ -1615,11 +1729,16 @@
             s =  _(" Scheduled ");
             editable = FALSE;
         }
-        else if (is_template && is_trow2 && view->priv->show_entered_date)
+        else if (is_template && is_trow2 && show_extra_dates)
         {
             s = "";
             editable = FALSE;
         }
+        else if (is_template && is_split && show_extra_dates)
+        {
+            s = "";
+            editable = FALSE;
+        }
 
         editable = (read_only == TRUE) ? FALSE : editable;
 
@@ -2595,19 +2714,12 @@
 }
 
 
-//FIXME I am not sure if we need the split here at all ???????
 /* Open Transaction for editing */
 static void
-gtv_sr_begin_edit (GncTreeViewSplitReg *view, Split *split, Transaction *trans)
+gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans)
 {
-    ENTER("gtv_sr_begin_edit split %p and trans %p", split, trans);
+    ENTER("gtv_sr_begin_edit trans %p", trans);
 
-    if (split && trans != xaccSplitGetParent (split))
-    {
-        LEAVE("gtv_sr_begin_edit - blank split, return");
-        return;
-    }
-
     if (trans != view->priv->dirty_trans)
     {
         Timespec ts = {0,0};
@@ -2624,7 +2736,7 @@
             //date on new transactions
 
             ts.tv_sec = gnc_time (NULL);
-            xaccTransSetDatePostedSecsNormalized (trans, ts.tv_sec);
+            xaccTransSetDatePostedSecs (trans, ts.tv_sec);
         }
     }
     LEAVE(" ");
@@ -2743,7 +2855,7 @@
         {
             g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (TRUE));
         }
-        if (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag") != NULL) //recn flag
+        if (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag") != NULL) // flag
             g_object_set_data (G_OBJECT (view->priv->temp_cr), "current-flag", NULL);
 
         g_object_set_data (G_OBJECT (view->priv->temp_cr), "cell-editable", NULL);
@@ -2803,6 +2915,42 @@
    return FALSE;
 }
 
+/* This is used in g_idle_add to repopulate the transfer cell */
+static gboolean
+gtv_sr_idle_transfer (GncTreeViewSplitReg *view)
+{
+    GtkTreePath *spath;
+    GList *columns;
+    GList  *column;
+    gint i;
+
+    spath = gnc_tree_view_split_reg_get_current_path (view);
+    columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
+
+    for (column = columns, i = 1; column; column = g_list_next (column), i++)
+    {
+        GList *renderers;
+        GtkCellRenderer *cr0;
+        GtkTreeViewColumn *tvc;
+        ViewCol viewcol;
+
+        tvc = column->data;
+
+        // Get the first renderer, it has the view-column value.
+        renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tvc));
+        cr0 = g_list_nth_data (renderers, 0);
+        g_list_free (renderers);
+
+        viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
+
+        if (viewcol == COL_TRANSFERVOID)
+            gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
+    }
+    g_list_free (columns);
+    gtk_tree_path_free (spath);
+    return FALSE;
+}
+
 /*###########################################################################*/
 
 /* Set the column titles based on register type and depth */
@@ -2848,26 +2996,19 @@
             {
             default: //FIXME These if statements may not be required
                 /* Display arrows if we are sorting on this row */
-                if ((depth == TRANS1 || depth == SPLIT3) && view->sort_col == viewcol)
-                {
-                    if (view->sort_depth == TRANS1 || view->sort_depth == SPLIT3)
-                        gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                    else
-                        gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-                }
+                if (view->sort_depth == depth && view->sort_col == viewcol)
+                    gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
+                else
+                    gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
 
-                if (depth == TRANS2 && view->sort_col == viewcol)
-                {
-                    if (view->sort_depth == TRANS2)
-                        gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                    else
-                        gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-                }
-
-                if (depth == TRANS1 || depth == SPLIT3)
+                if (depth == TRANS1)
                     gtk_tree_view_column_set_title (tvc, _("Date Posted"));
                 else if (depth == TRANS2)
                     gtk_tree_view_column_set_title (tvc, _("Date Entered"));
+                else if (depth == SPLIT3)
+                    gtk_tree_view_column_set_title (tvc, _("Date Reconciled"));
+                else
+                    gtk_tree_view_column_set_title (tvc, _("Date Posted / Entered / Reconciled"));
                 break;
             }
             break;
@@ -3644,6 +3785,10 @@
         // Make sure we have stoped editing.
         gnc_tree_view_split_reg_finish_edit (view);
 
+        // This prevents the cell changing.
+        if (view->priv->stop_cell_move == TRUE)
+            return TRUE;
+
         /* Get tree path for row that was clicked, true if row exists */
         if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (view), (gint) event->x, (gint) event->y,
                                              &spath, &col, NULL, NULL))
@@ -3916,6 +4061,7 @@
         return TRUE; //FIXME I may use these to expand / collapse to splits later...
         break;
 
+    case GDK_KEY_Return:
     case GDK_KEY_space:
 
         if (!spath)
@@ -3932,7 +4078,6 @@
         return TRUE;
         break;
 
-    case GDK_KEY_Return:
     case GDK_KEY_KP_Enter:
 
         if (!spath)
@@ -3968,9 +4113,20 @@
         if (!spath)
             return TRUE;
 
+        // Bypass Auto-complete
+        if (event->state & GDK_CONTROL_MASK)
+            view->priv->auto_complete = TRUE;
+
         // Make sure we have stopped editing.
         gnc_tree_view_split_reg_finish_edit (view);
 
+        // This prevents the cell changing.
+        if (view->priv->stop_cell_move == TRUE)
+        {
+            gtk_tree_path_free (spath);
+            return TRUE;
+        }
+
         while (!editing && !step_off) // lets step over non editable columns
         {
             // Create a copy of the path we started with.
@@ -4129,12 +4285,14 @@
             if (gtv_sr_transaction_changed (view))
             {
                 gtk_tree_path_free (spath);
+                LEAVE("Leave Transaction Changed");
                 return;
             }
         }
         if (view->priv->trans_confirm == CANCEL)
         {
             gtk_tree_path_free (spath);
+            LEAVE("Leave Transaction Changed - Cancel");
             return;
         }
 
@@ -4181,7 +4339,7 @@
         gnc_tree_model_split_reg_set_blank_split_parent (model, NULL, FALSE);
 
         /* Set the default selection start position */
-        gnc_tree_view_split_reg_default_selection (view);
+//FIXME        gnc_tree_view_split_reg_default_selection (view);
     }
 
     /* This updates the plugin page gui */
@@ -4218,7 +4376,10 @@
     gtk_widget_grab_focus (GTK_WIDGET (view));
 
     if (g_strcmp0 (g_object_get_data (G_OBJECT (cell), "current-string"), new_text) == 0) // No change, return
-        return;
+    {
+        if (view->priv->stop_cell_move == FALSE)
+            return;
+    }
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
     g_return_if_fail (model);
@@ -4270,20 +4431,20 @@
             gnc_tree_util_split_reg_parse_date (&parsed_date, new_text);
             if (g_date_valid (&parsed_date))
             {
-                gtv_sr_begin_edit (view, NULL, trans);
+                gtv_sr_begin_edit (view, trans);
                 xaccTransSetDate (trans, g_date_get_day (&parsed_date), g_date_get_month (&parsed_date), g_date_get_year (&parsed_date));
             }
             else
             {
                 // We should never get here
-                PERR("invalid date `%s`", new_text);
+                PERR("invalid date '%s'", new_text);
             }
         }
         break;
 
     case COL_NUMACT:
         /* Column is NUM / ACT */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         if (is_trow1)
         {
             /* set per book option */
@@ -4320,7 +4481,7 @@
 
     case COL_DESCNOTES:
         /* Column is DESCRIPTION / NOTES / MEMO */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         if (is_trow1)
         {
             xaccTransSetDescription (trans, new_text);
@@ -4341,7 +4502,7 @@
 
     case COL_RECN:
         /* Column is RECONCILE */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         {
             char rec = 'n';
 
@@ -4374,8 +4535,7 @@
 
     case COL_TYPE:
         /* Column is TYPE */
-        gtv_sr_begin_edit (view, NULL, trans);
-
+        gtv_sr_begin_edit (view, trans);
         {
             char type = TXN_TYPE_NONE;
             if (new_text != NULL)
@@ -4400,7 +4560,7 @@
             gboolean       force = FALSE;
             gboolean       input_used = FALSE;
 
-            gtv_sr_begin_edit (view, NULL, trans);
+            gtv_sr_begin_edit (view, trans);
 
             /* Get the split pair if anchored to a register */
             if (!is_split && anchor)
@@ -4415,6 +4575,7 @@
             /* Setup the account field */
             if (viewcol == COL_TRANSFERVOID)
             {
+                view->priv->stop_cell_move = FALSE;
                 acct = gnc_tree_control_split_reg_get_account_by_name (view, new_text);
                 if (acct == NULL)
                 {
@@ -4422,6 +4583,13 @@
                     xaccSplitReinit(split);
                     if (osplit)
                         xaccSplitDestroy (osplit);
+
+                    g_free (view->priv->transfer_string);
+                    view->priv->transfer_string = g_strdup (new_text);
+                    view->priv->stop_cell_move = TRUE;
+
+                    /* this will populate cell with original value */
+                    g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
                     break;
                 }
 
@@ -4593,7 +4761,7 @@
     switch (viewcol) {
     case COL_NUMACT:
         /* Column is NUM / ACT */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         if (is_trow1)
         {
             /* set per book option */
@@ -4630,7 +4798,7 @@
 
     case COL_DESCNOTES:
         /* Column is DESCRIPTION / NOTES / MEMO */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         if (is_trow1)
         {
             xaccTransSetDescription (trans, new_text);
@@ -4651,7 +4819,7 @@
 
     case COL_RECN:
         /* Column is RECONCILE */
-        gtv_sr_begin_edit (view, NULL, trans);
+        gtv_sr_begin_edit (view, trans);
         {
             char rec = 'n';
 
@@ -4686,7 +4854,7 @@
     case COL_DEBIT:
     case COL_CREDIT:
         {
-            gtv_sr_begin_edit (view, NULL, trans);
+            gtv_sr_begin_edit (view, trans);
 
             /* Setup the account field */
             if (viewcol == COL_TRANSFERVOID)
@@ -4697,10 +4865,18 @@
                 Account *acct;
 
                 /* save the account GncGUID into the kvp_data. */
+                view->priv->stop_cell_move = FALSE;
                 acct = gnc_tree_control_split_reg_get_account_by_name (view, new_text);
-                if (!acct)
+                if (acct == NULL)
                 {
-                    PERR ("unknown account");
+                    DEBUG("Template Account is NULL");
+
+                    g_free (view->priv->transfer_string);
+                    view->priv->transfer_string = g_strdup (new_text);
+                    view->priv->stop_cell_move = TRUE;
+
+                    /* this will populate cell with original value */
+                    g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
                     break;
                 }
 
@@ -5258,6 +5434,200 @@
     g_free (result);
 }
 
+
+/* For handling keynav */
+static gboolean
+gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+{
+    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
+    GncTreeModelSplitReg *model;
+    GtkTreeViewColumn *col;
+    GtkTreePath *spath, *start_spath;
+    gboolean goto_blank = FALSE;
+    gboolean next_trans = TRUE;
+    Transaction *btrans, *ctrans;
+    gint depth;
+    gboolean auto_popped = FALSE;
+
+    // spath is where we are, before key press...
+    gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
+
+    if (event->type != GDK_KEY_PRESS)
+    {
+        if (spath)
+            gtk_tree_path_free (spath);
+        return FALSE;
+    }
+
+    switch (event->keyval)
+    {
+
+    case GDK_KEY_Up:
+    case GDK_KEY_Down:
+
+        if (!spath)
+            return TRUE;
+
+        // This is to test for the auto completion popup window
+        {
+            GtkWidget *toplevel;
+            GtkWindowGroup *window_group;
+            GList *win_list;
+
+            toplevel = gtk_widget_get_toplevel (widget);
+            if (GTK_IS_WINDOW (toplevel))
+            {
+                window_group = gtk_window_get_group (GTK_WINDOW (toplevel));
+                win_list = gtk_window_group_list_windows (window_group);
+                if (g_list_length (win_list) == 1 && gtk_widget_get_visible (GTK_WIDGET (win_list->data)))
+                    auto_popped = TRUE;
+
+            g_list_free (win_list);
+            }
+        }
+
+        // Auto complete window popped
+        if (auto_popped == TRUE)
+        {
+            gtk_tree_path_free (spath);
+            return FALSE;
+        }
+
+        model = gnc_tree_view_split_reg_get_model_from_view (view);
+
+        // Make sure we have stopped editing.
+        gnc_tree_view_split_reg_finish_edit (view);
+
+        // This stops the cell changing.
+        if (view->priv->stop_cell_move == TRUE)
+        {
+            gtk_tree_path_free (spath);
+            return TRUE;
+        }
+
+        depth = gtk_tree_path_get_depth (spath);
+        if (event->keyval == GDK_KEY_Up)
+        {
+            if (depth == 1)
+            {
+                if (gtk_tree_path_prev (spath))
+                {
+                    if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath))
+                    {
+                        gtk_tree_path_down (spath);
+
+                        if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath) && model->type == GENERAL_LEDGER2)
+                        {
+                            gtk_tree_path_down (spath);
+
+                            while (gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath))
+                            {
+                                gtk_tree_path_next (spath);
+                            }
+                            gtk_tree_path_prev (spath);
+                        }
+                    }
+                }
+            }
+            else if (!gtk_tree_path_prev (spath) && depth > 1)
+            {
+                gtk_tree_path_up (spath);
+            }
+        }
+        else if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath))
+        {
+            gtk_tree_path_down (spath);
+        }
+        else
+        {
+            gtk_tree_path_next (spath);
+            if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath) && depth > 2)
+            {
+                gtk_tree_path_prev (spath);
+                gtk_tree_path_up (spath);
+                gtk_tree_path_next (spath);
+            }
+            if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath) && depth > 1)
+            {
+                gtk_tree_path_prev (spath);
+                gtk_tree_path_up (spath);
+                gtk_tree_path_next (spath);
+            }
+        }
+
+        /* Set cursor to new column, open for editing */
+        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
+
+        return TRUE;
+        break;
+
+    case GDK_KEY_Return:
+
+        if (!spath)
+            return TRUE;
+
+        // This stops the cell changing.
+        if (view->priv->stop_cell_move == TRUE)
+        {
+            gtk_tree_path_free (spath);
+            return TRUE;
+        }
+
+        // Do sums if we have ctrl key
+        if (event->state & GDK_CONTROL_MASK)
+        {
+            // Make sure we have stopped editing.
+            gnc_tree_view_split_reg_finish_edit (view);
+
+            /* Set cursor to the column, open for editing */
+            gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
+            gtk_tree_path_free (spath);
+            return TRUE;
+        }
+        return FALSE;
+        break;
+
+    case GDK_KEY_KP_Enter:
+
+        if (!spath)
+            return TRUE;
+
+        // This stops the cell changing.
+        if (view->priv->stop_cell_move == TRUE)
+        {
+            gtk_tree_path_free (spath);
+            return TRUE;
+        }
+
+        goto_blank = gnc_gconf_get_bool (GCONF_GENERAL_REGISTER,
+                                    "enter_moves_to_end", NULL);
+
+        model = gnc_tree_view_split_reg_get_model_from_view (view);
+        btrans = gnc_tree_model_split_get_blank_trans (model);
+        ctrans = gnc_tree_view_split_reg_get_current_trans (view);
+
+        /* Are we on the blank transaction */
+        if (btrans == ctrans)
+            next_trans = FALSE;
+
+        /* First record the transaction */
+        if (gnc_tree_view_split_reg_enter (view))
+        {
+            /* Now move. */
+            if (goto_blank)
+                gnc_tree_control_split_reg_jump_to_blank (view);
+            else if (next_trans)
+                gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
+        }
+        return TRUE;
+        break;
+
+    default:
+        gtk_tree_path_free (spath);
+	return FALSE;
+    }
+}
+
 /*###########################################################################*/
 
 /* The main Start Editing Call back for the TEXT columns */
@@ -5281,7 +5651,7 @@
 
     GtkEntryCompletion *completion = gtk_entry_completion_new();
 
-    ENTER("ngtv_sr_editable_start_editing_cb Path string is '%s'\n", path_string);
+    ENTER("gtv_sr_editable_start_editing_cb Path string is '%s'\n", path_string);
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
@@ -5305,6 +5675,9 @@
 
     g_object_set_data (G_OBJECT (cr), "cell-editable", editable);
 
+    // This is for key navigation...
+    g_signal_connect (G_OBJECT (editable), "key-press-event", G_CALLBACK (gtv_sr_ed_key_press_cb), view);
+
     /* DATE COLUMN */
     if (viewcol == COL_DATE)
     {
@@ -5323,6 +5696,20 @@
     {
         entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (editable)));
 
+        // This is for key navigation...
+        g_signal_connect (G_OBJECT (entry), "key-press-event", G_CALLBACK (gtv_sr_ed_key_press_cb), view);
+
+        {
+            GtkEditable *editable = GTK_EDITABLE (entry);
+
+            if (view->priv->stop_cell_move == TRUE)
+            {
+                gint textPosition = 0;
+                gtk_editable_insert_text (GTK_EDITABLE (editable), view->priv->transfer_string, -1, &textPosition);
+                gtk_editable_set_position (GTK_EDITABLE (editable), -1);
+            }
+        }
+
         // Update the Account list combo.
         gnc_tree_model_split_reg_update_account_list (model);
 
@@ -5566,6 +5953,15 @@
         view->priv->dirty_trans = NULL;
     }
 
+    /* Reset stop_cell_move */
+    if (view->priv->stop_cell_move == TRUE)
+    {
+        view->priv->stop_cell_move = FALSE;
+
+        /* this will populate cell with original value */
+        g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
+    }
+
     /* Reset Help text */
     if (view->help_text)
         g_free (view->help_text);
@@ -5576,7 +5972,6 @@
     g_object_set_data (G_OBJECT (cr), "edit-canceled", GINT_TO_POINTER (TRUE));	
 }
 
-
 /*####################################################################
           ^^^^   gtv function call backs    ^^^^
 #####################################################################*/
@@ -5588,6 +5983,8 @@
     GncTreeModelSplitReg *model;
     GtkTreePath *mpath, *spath;
 
+    PINFO("#### Start Scroll to Cell ####");
+
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
     mpath = gnc_tree_view_split_reg_get_current_path (view);
@@ -5611,6 +6008,9 @@
     }
     gtk_tree_path_free (mpath);
     gtk_tree_path_free (spath);
+
+    PINFO("#### End Scroll to Cell ####");
+
     return (FALSE);
 }
 
@@ -5740,7 +6140,9 @@
         Split *s;
         int i = 0;
 
-        gtv_sr_begin_edit (view, NULL, trans);
+        if (!xaccTransIsOpen (trans))
+            xaccTransBeginEdit (trans);
+
         gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 
         while ((s = xaccTransGetSplit (trans, i)) != NULL)
@@ -5759,7 +6161,6 @@
 {
     Transaction           *trans;
     Split                 *split;
-    gboolean               was_open;
 
     /* Make sure we have stopped editing */
     gnc_tree_view_split_reg_finish_edit (view);
@@ -5767,16 +6168,15 @@
     trans = view->priv->current_trans;
     split = view->priv->current_split;
 
-    gtv_sr_begin_edit (view, NULL, trans);
+    if (!xaccTransIsOpen (trans))
+        xaccTransBeginEdit (trans);
 
     gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 
     // Lets get out of the way, move selection to trans - selection is blocked
     gnc_tree_control_split_reg_goto_rel_trans_row (view, 0);
 
-    was_open = xaccTransIsOpen (trans);
-    if (was_open)
-        xaccSplitDestroy (split);
+    xaccSplitDestroy (split);
 }
 
 
@@ -5785,7 +6185,6 @@
 gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view)
 {
     Transaction           *trans;
-    gboolean               was_open;
 
     /* We do not use the normal confirmation with this one as we have
        all ready asked the user to confirm delete */
@@ -5798,17 +6197,14 @@
     /* We need to go back one to select the next transaction */
     gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
 
-    gtv_sr_begin_edit (view, NULL, trans);
+    if (!xaccTransIsOpen (trans))
+        xaccTransBeginEdit (trans);
+    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 
-    was_open = xaccTransIsOpen (trans);
+    xaccTransDestroy (trans);
+    xaccTransCommitEdit (trans);
 
-    xaccTransDestroy (trans);
-    if (was_open)
-    {
-        DEBUG("committing");
-        xaccTransCommitEdit (trans);
-    }
-    view->priv->dirty_trans = NULL;
+    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 }
 
 
@@ -5864,7 +6260,7 @@
         // Set the transaction to show correct view
         gnc_tree_view_split_reg_format_trans (view, view->priv->dirty_trans);
 
-        view->priv->dirty_trans = NULL;
+        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 
         split = gnc_tree_model_split_get_blank_split (model);
         xaccSplitReinit (split); // Clear the blank split

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h	2013-08-02 17:55:10 UTC (rev 23111)
@@ -63,6 +63,7 @@
     gboolean                    reg_closing;              // This is set when closing the register.
     gboolean                    change_allowed;           // This is set when we allow the reconciled split to change.
     gboolean                    editing_now;              // This is set while editing of a cell.
+    gboolean                    show_extra_dates;         // Show the entered date below the posted date and reconciled date on split row
 
 
 } GncTreeViewSplitReg;

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view.c	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view.c	2013-08-02 17:55:10 UTC (rev 23111)
@@ -111,8 +111,8 @@
     GtkWidget         *column_menu;
     gboolean           show_column_menu;
 
-    /* Sort callback user_data */
-    gpointer           sort_user_data;
+    /* Sort callback model */
+    GtkTreeModel      *sort_model;
 
     /* Gconf related values */
     gchar             *gconf_section;
@@ -238,7 +238,7 @@
     priv = GNC_TREE_VIEW_GET_PRIVATE(view);
     priv->column_menu = NULL;
     priv->show_column_menu = FALSE;
-    priv->sort_user_data = NULL;
+    priv->sort_model = NULL;
     priv->gconf_section = NULL;
     priv->seen_gconf_visibility = FALSE;
     priv->columns_changed_cb_id = 0;
@@ -1658,18 +1658,19 @@
 }
 
 
-/* This set the user_data value used in the sort callback */
+/* This allows the columns to be setup without the model connected */
+//FIXME I think this should be specified as a parameter to the add columns functions...
 void
-gnc_tree_view_set_sort_user_data (GncTreeView *view, gpointer user_data)
+gnc_tree_view_set_sort_user_data (GncTreeView *view, GtkTreeModel *s_model)
 {
     GncTreeViewPrivate *priv;
 
     g_return_if_fail (GNC_IS_TREE_VIEW (view));
 
-    ENTER("view %p, user_data %p", view, user_data);
+    ENTER("view %p, sort_model %p", view, s_model);
     priv = GNC_TREE_VIEW_GET_PRIVATE (view);
 
-    priv->sort_user_data = user_data;
+    priv->sort_model = s_model;
     LEAVE(" ");
 }
 
@@ -1906,20 +1907,27 @@
         gtk_tree_view_column_set_sort_column_id (column, data_column);
         if (column_sort_fn)
         {
-            priv = GNC_TREE_VIEW_GET_PRIVATE(view);
-            if (priv->sort_user_data != NULL)
-                gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(s_model),
-                                             data_column, column_sort_fn,
-                                             priv->sort_user_data,
-                                             NULL /* destroy fn */);
-            else
-                gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(s_model),
-                                             data_column, column_sort_fn,
-                                             GINT_TO_POINTER(data_column),
-                                             NULL /* destroy fn */);
+            gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(s_model),
+                                         data_column, column_sort_fn,
+                                         GINT_TO_POINTER(data_column),
+                                         NULL /* destroy fn */);
         }
     }
 
+    // Used in registers, sort model not connected to view yet
+    priv = GNC_TREE_VIEW_GET_PRIVATE(view);
+    if (priv->sort_model != NULL)
+    {
+        gtk_tree_view_column_set_sort_column_id (column, data_column);
+        if (column_sort_fn)
+        {
+            gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(priv->sort_model),
+                                         data_column, column_sort_fn,
+                                         view,
+                                         NULL /* destroy fn */);
+        }
+    }
+
     /* Add to the column selection menu */
     if (pref_name)
     {

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view.h	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view.h	2013-08-02 17:55:10 UTC (rev 23111)
@@ -400,7 +400,7 @@
  *
  *  @param view The tree view.
  *
- *  @param column The column in the model containg color strings.
+ *  @param column The column in the model containing color strings.
  *
  *  @param func This is a cell data function that sets the "cell-background".
  */
@@ -408,15 +408,14 @@
 gnc_tree_view_set_control_column_background (GncTreeView *view, gint column,
                                              GtkTreeCellDataFunc func);
 
-
-/** This function sets the user_data value used in the sort callback
+/** This allows the columns to be setup without the model connected
  *
  *  @param view The tree view.
  *
- *  @param user_data pointer to the user_data to be used.
+ *  @param sort model.
  */
 void
-gnc_tree_view_set_sort_user_data (GncTreeView *view, gpointer user_data);
+gnc_tree_view_set_sort_user_data (GncTreeView *view, GtkTreeModel *s_model);
 
 /** This function is called to set the "show-column-menu" property on
  *  this view.  This function has no visible effect if the

Modified: gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade
===================================================================
--- gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade	2013-08-01 20:06:57 UTC (rev 23110)
+++ gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade	2013-08-02 17:55:10 UTC (rev 23111)
@@ -2185,6 +2185,48 @@
                   <placeholder/>
                 </child>
                 <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
                   <object class="GtkLabel" id="label115">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -2693,7 +2735,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="n_rows">14</property>
+                <property name="n_rows">15</property>
                 <property name="n_columns">4</property>
                 <child>
                   <placeholder/>
@@ -2714,6 +2756,18 @@
                   <placeholder/>
                 </child>
                 <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
                   <object class="GtkLabel" id="label63">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -2973,13 +3027,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="gconf/general/register/show_entered_date">
-                    <property name="label" translatable="yes">Show the _entered date</property>
+                  <object class="GtkCheckButton" id="gconf/general/register/show_extra_dates">
+                    <property name="label" translatable="yes">Show the _entered and reconcile dates</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="tooltip_markup">Show the date when the transaction was entered below the posted date.</property>
-                    <property name="tooltip_text" translatable="yes">Show the date when the transaction was entered below the posted date.</property>
+                    <property name="tooltip_markup">Show the date when the transaction was entered below the posted date and reconciled date on split row.</property>
+                    <property name="tooltip_text" translatable="yes">Show the date when the transaction was entered below the posted date and reconciled date on split row.</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
@@ -3005,8 +3059,8 @@
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
-                    <property name="top_attach">12</property>
-                    <property name="bottom_attach">13</property>
+                    <property name="top_attach">13</property>
+                    <property name="bottom_attach">14</property>
                     <property name="x_options">GTK_FILL</property>
                     <property name="y_options"/>
                     <property name="x_padding">12</property>
@@ -3025,15 +3079,32 @@
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
-                    <property name="top_attach">13</property>
-                    <property name="bottom_attach">14</property>
+                    <property name="top_attach">14</property>
+                    <property name="bottom_attach">15</property>
                     <property name="x_options">GTK_FILL</property>
                     <property name="y_options"/>
                     <property name="x_padding">12</property>
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
+                  <object class="GtkCheckButton" id="gconf/general/register/show_extra_dates_on_selection">
+                    <property name="label" translatable="yes">_Show entered and reconciled dates on selection</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_markup">Show the entered date and reconciled date on selection</property>
+                    <property name="tooltip_text" translatable="yes">Show the entered date and reconciled date on selection</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="right_attach">4</property>
+                    <property name="top_attach">12</property>
+                    <property name="bottom_attach">13</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                    <property name="x_padding">12</property>
+                  </packing>
                 </child>
                 <child>
                   <placeholder/>
@@ -3044,15 +3115,6 @@
                 <child>
                   <placeholder/>
                 </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
               </object>
               <packing>
                 <property name="position">6</property>



More information about the gnucash-changes mailing list