gnucash unstable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Thu Nov 9 17:16:14 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/61316648 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1895ae28 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/45bab936 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c19f851c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/90bbeac0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/97c3483e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c71bfe8d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/78cd5416 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64cfab05 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e26c55e6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f2834377 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0b3da701 (commit)
	from  https://github.com/Gnucash/gnucash/commit/f888eb88 (commit)



commit 61316648b801e4726876e07ef4cf1dda46d488be
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Nov 9 13:00:27 2017 -0800

    Bug 789608 - Compilation problems when linking libraries.
    
    Fix using a preproc macro in a different file from where it was declared
    and more-strict template resolution of error_handler<> by gcc-7.x.

diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index 9ea3723..4e6077e 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -93,7 +93,6 @@ extern "C"
 
 #if LIBDBI_VERSION >= 900
 #define HAVE_LIBDBI_R 1
-#define HAVE_LIBDBI_TO_LONGLONG 1
 static dbi_inst dbi_instance = nullptr;
 #else
 #define HAVE_LIBDBI_R 0
@@ -253,8 +252,8 @@ GncDbiBackend<Type>::set_standard_connection_options (dbi_conn conn,
     return true;
 }
 
-template <DbType Type> void error_handler(void* conn, void* data);
-void error_handler(void* conn, void* data);
+template <DbType Type> void error_handler(dbi_conn conn, void* data);
+void error_handler(dbi_conn conn, void* data);
 
 template <DbType Type> dbi_conn
 GncDbiBackend<Type>::conn_setup (PairVec& options, UriStrings& uri)
diff --git a/libgnucash/backend/dbi/gnc-dbisqlresult.cpp b/libgnucash/backend/dbi/gnc-dbisqlresult.cpp
index 6ceb595..4115a11 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlresult.cpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlresult.cpp
@@ -36,6 +36,12 @@ extern "C"
 
 static QofLogModule log_module = G_LOG_DOMAIN;
 
+#if LIBDBI_VERSION >= 900
+#define HAVE_LIBDBI_TO_LONGLONG 1
+#else
+#define HAVE_LIBDBI_TO_LONGLONG 0
+#endif
+
 GncDbiSqlResult::~GncDbiSqlResult()
 {
     int status = dbi_result_free (m_dbi_result);
@@ -152,17 +158,17 @@ GncDbiSqlResult::IteratorImpl::get_string_at_col(const char* col) const
 time64
 GncDbiSqlResult::IteratorImpl::get_time64_at_col (const char* col) const
 {
-    auto type = dbi_result_get_field_type (m_inst->m_dbi_result, col);
-    auto attrs = dbi_result_get_field_attribs (m_inst->m_dbi_result, col);
+    auto result = (dbi_result_t*) (m_inst->m_dbi_result);
+    auto type = dbi_result_get_field_type (result, col);
+    auto attrs = dbi_result_get_field_attribs (result, col);
     if (type != DBI_TYPE_DATETIME)
         throw (std::invalid_argument{"Requested time64 from non-time64 column."});
     gnc_push_locale (LC_NUMERIC, "C");
 #if HAVE_LIBDBI_TO_LONGLONG
-    /* A less evil hack than the one equrie by libdbi-0.8, but
+    /* A less evil hack than the one required by libdbi-0.8, but
      * still necessary to work around the same bug.
      */
-    auto retval = dbi_result_get_as_longlong(dbi_row->result,
-                                             col_name);
+    auto retval = dbi_result_get_as_longlong(result, col);
 #else
     /* A seriously evil hack to work around libdbi bug #15
      * https://sourceforge.net/p/libdbi/bugs/15/. When libdbi
@@ -170,7 +176,6 @@ GncDbiSqlResult::IteratorImpl::get_time64_at_col (const char* col) const
      * dbi_result_get_as_longlong.
      * Note: 0.9 is available in Debian Jessie and Fedora 21.
      */
-    auto result = (dbi_result_t*) (m_inst->m_dbi_result);
     auto row = dbi_result_get_currow (result);
     auto idx = dbi_result_get_field_idx (result, col) - 1;
     time64 retval = result->rows[row]->field_values[idx].d_datetime;

commit 1895ae280c08eb6f750ceb546ad2af78c7a78bca
Merge: f888eb8 45bab93
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Nov 9 13:43:32 2017 -0800

    Merge branch 'maint' into unstable

diff --cc gnucash/gnome-search/dialog-search.c
index 2eb6284,0000000..badc97d
mode 100644,000000..100644
--- a/gnucash/gnome-search/dialog-search.c
+++ b/gnucash/gnome-search/dialog-search.c
@@@ -1,1501 -1,0 +1,1502 @@@
 +/*
 + * dialog-search.c -- Search Dialog
 + * Copyright (C) 2002 Derek Atkins
 + * Author: Derek Atkins <warlord at MIT.EDU>
 + *
 + * Copyright (c) 2006 David Hampton <hampton at employees.org>
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, contact:
 + *
 + * Free Software Foundation           Voice:  +1-617-542-5942
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org
 + */
 +
 +#include <config.h>
 +
 +#include <gtk/gtk.h>
 +#include <glib/gi18n.h>
 +
 +#include "dialog-utils.h"
 +#include "gnc-component-manager.h"
 +#include "gnc-ui-util.h"
 +#include "gnc-ui.h"
 +#include "gnc-gui-query.h"
 +#include "gnc-query-view.h"
 +#include "gnc-prefs.h"
 +#include "gnc-session.h"
 +#include "qof.h"
 +#include "engine-helpers.h"
 +#include "qofbookslots.h"
 +
 +#include "Transaction.h"	/* for the SPLIT_* and TRANS_* */
 +
 +#include "dialog-search.h"
 +#include "search-core-type.h"
 +#include "search-param.h"
 +
 +/* This static indicates the debugging module that this .o belongs to.  */
 +static QofLogModule log_module = G_LOG_DOMAIN;
 +
 +#define DIALOG_SEARCH_CM_CLASS "dialog-search"
 +#define GNC_PREFS_GROUP_SEARCH_GENERAL "dialogs.search"
 +#define GNC_PREF_NEW_SEARCH_LIMIT  "new-search-limit"
 +#define GNC_PREF_ACTIVE_ONLY       "search-for-active-only"
 +
 +typedef enum
 +{
 +    GNC_SEARCH_MATCH_ALL = 0,
 +    GNC_SEARCH_MATCH_ANY = 1
 +} GNCSearchType;
 +
 +enum search_cols
 +{
 +    SEARCH_COL_NAME = 0,
 +    SEARCH_COL_POINTER,
 +    NUM_SEARCH_COLS
 +};
 +
 +struct _GNCSearchWindow
 +{
 +    GtkWidget               *dialog;
 +    GtkWidget               *grouping_combo;
 +    GtkWidget               *match_all_label;
 +    GtkWidget               *criteria_table;
 +    GtkWidget               *result_hbox;
 +
 +    /* The "results" sub-window widgets */
 +    GtkWidget               *result_view;
 +    gpointer                 selected_item;
 +    GList                   *selected_item_list;
 +
 +    /* The search_type radio-buttons */
 +    GtkWidget               *new_rb;
 +    GtkWidget               *narrow_rb;
 +    GtkWidget               *add_rb;
 +    GtkWidget               *del_rb;
 +    GtkWidget               *active_only_check;
 +
 +    /* The Select button */
 +    GtkWidget               *select_button;
 +    GList                   *button_list;
 +
 +    /* The close/cancel buttons */
 +    GtkWidget               *close_button;
 +    GtkWidget               *cancel_button;
 +
 +    /* Callbacks */
 +    GNCSearchResultCB        result_cb;
 +    GNCSearchNewItemCB       new_item_cb;
 +    GNCSearchCallbackButton *buttons;
 +    GNCSearchFree            free_cb;
 +    gpointer                 user_data;
 +
 +    GNCSearchSelectedCB      selected_cb;
 +    gpointer                 select_arg;
 +    gboolean                 allow_clear;
 +
 +    /* What we're searching for, and how */
 +    const gchar              *type_label;
 +    QofIdTypeConst            search_for;
 +    GNCSearchType             grouping;     /* Match Any, Match All */
 +    const QofParam           *get_guid;     /* Function to GetGUID from the object */
 +    int                       search_type;  /* New, Narrow, Add, Delete */
 +
 +    /* Our query status */
 +    QofQuery                 *q;
 +    QofQuery                 *start_q;      /* The query to start from, if any */
 +
 +    /* The list of criteria */
 +    GNCSearchParam           *last_param;
 +    GList                    *params_list;  /* List of GNCSearchParams */
 +    GList                    *display_list; /* List of GNCSearchParamSimples for Display */
 +    gint                      num_cols;     /* Number of Display Columns */
 +    GList                    *crit_list;    /* List of crit_data */
 +
 +    gint                      component_id;
 +    const gchar              *prefs_group;
 +};
 +
 +struct _crit_data
 +{
 +    GNCSearchParam    *param;
 +    GNCSearchCoreType *element;
 +    GtkWidget         *elemwidget;
 +    GtkWidget         *container;
 +    GtkWidget         *button;
 +    GtkDialog         *dialog;
 +};
 +
 +static void search_clear_criteria (GNCSearchWindow *sw);
 +static void gnc_search_dialog_display_results (GNCSearchWindow *sw);
 +
 +static void
 +gnc_search_callback_button_execute (GNCSearchCallbackButton *cb,
 +                                    GNCSearchWindow *sw)
 +{
 +    GNCQueryView     *qview = GNC_QUERY_VIEW(sw->result_view);
 +    GtkTreeSelection *selection;
 +
 +    // Sanity check
 +    g_assert(qview);
 +    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(qview));
 +    g_assert(gtk_tree_selection_get_mode(selection) == GTK_SELECTION_MULTIPLE);
 +    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(qview));
 +
 +    /* Do we have a callback for multi-selections ? */
 +    if (cb->cb_multiselect_fn && (!cb->cb_fcn ))
 +    {
 +        /* We have allready populated the selected_item_list from the select row callback */
 +        // We use g_list_prepend (for performance reasons), so we have to reverse once here
 +        sw->selected_item_list = g_list_reverse(sw->selected_item_list);
 +
 +        // Call the callback
 +        (cb->cb_multiselect_fn)(sw->selected_item_list, sw->user_data);
 +    }
 +    else
 +    {
 +        // No, stick to the single-item callback
 +        if (cb->cb_fcn)
 +            (cb->cb_fcn)(&(sw->selected_item), sw->user_data);
 +    }
 +}
 +
 +
 +static void
 +gnc_search_dialog_result_clicked (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    GNCSearchCallbackButton *cb;
 +
 +    cb = g_object_get_data (G_OBJECT (button), "data");
 +    gnc_search_callback_button_execute (cb, sw);
 +}
 +
 +
 +static void
 +gnc_search_dialog_select_buttons_enable (GNCSearchWindow *sw, gint selected)
 +{
 +    gboolean enable, read_only;
 +    GList  *blist;
 +
 +    read_only = qof_book_is_readonly (gnc_get_current_book ());
 +
 +    for (blist = sw->button_list; blist; blist = blist->next)
 +    {
 +        GNCSearchCallbackButton  *button_spec = g_object_get_data (G_OBJECT(blist->data) , "data");
 +
 +        if(selected == 0)
 +        {
 +            gtk_widget_set_sensitive (GTK_WIDGET(blist->data), FALSE);
 +            continue;
 +        }
 +
 +        if(read_only == TRUE)
 +        {
 +            if((selected > 1) && (!(button_spec->cb_multiselect_fn == NULL)) && (button_spec->sensitive_if_readonly == TRUE))
 +                enable = TRUE;
 +            else
 +                enable = FALSE;
 +
 +            if((selected == 1) && (button_spec->sensitive_if_readonly == TRUE))
 +                enable = TRUE;
 +        }
 +        else
 +        {
 +            if((selected > 1) && (!(button_spec->cb_multiselect_fn == NULL)))
 +                enable = TRUE;
 +            else
 +                enable = FALSE;
 +
 +            if(selected == 1)
 +                enable = TRUE;
 +        }
 +        gtk_widget_set_sensitive (GTK_WIDGET(blist->data), enable);
 +    }
 +}
 +
 +
 +static void
 +gnc_search_dialog_select_cb (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    g_return_if_fail (sw->selected_cb);
 +
 +    if (sw->selected_item == NULL && sw->allow_clear == FALSE)
 +    {
 +        char *msg = _("You must select an item from the list");
 +        gnc_error_dialog (sw->dialog, "%s", msg);
 +        return;
 +    }
 +
 +    (sw->selected_cb)(sw->selected_item, sw->select_arg);
 +    gnc_search_dialog_destroy (sw);
 +}
 +
 +
 +static void
 +gnc_search_dialog_select_row_cb (GNCQueryView *qview,
 +                                 gpointer item,
 +                                 gpointer user_data)
 +{
 +    GNCSearchWindow  *sw = user_data;
 +    gint              number_of_rows;
 +
 +    sw->selected_item_list = NULL;
 +    sw->selected_item = NULL;
 +
 +    number_of_rows = GPOINTER_TO_INT(item);
 +
 +    gnc_search_dialog_select_buttons_enable(sw, number_of_rows);
 +
 +    if(number_of_rows == 1)
 +    {
 +        sw->selected_item = qview->selected_entry;
 +        sw->selected_item_list = qview->selected_entry_list;
 +    }
 +    else
 +        sw->selected_item_list = qview->selected_entry_list;
 +}
 +
 +
 +static void
 +gnc_search_dialog_double_click_cb (GNCQueryView *qview,
 +                                   gpointer item,
 +                                   gpointer user_data)
 +{
 +    GNCSearchWindow  *sw = user_data;
 +
 +    sw->selected_item = item;
 +    if (sw->selected_cb)
 +        /* Select the item */
 +        gnc_search_dialog_select_cb (NULL, sw);
 +    else if (sw->buttons)
 +        /* Call the first button (usually view/edit) */
 +        gnc_search_callback_button_execute (sw->buttons, sw);
 +
 +    /* If we get here, then nothing to do for a double-click */
 +}
 +
 +
 +static void
 +gnc_search_dialog_init_result_view (GNCSearchWindow *sw)
 +{
 +    GtkTreeSelection *selection;
 +
 +    sw->result_view = gnc_query_view_new(sw->display_list, sw->q);
 +
 +    // We want the multi-selection mode of the tree view.
 +    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(sw->result_view));
 +    gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
 +
 +    /* Set the sort order of the tree view */
 +    gnc_query_sort_order(GNC_QUERY_VIEW(sw->result_view), 1, GTK_SORT_ASCENDING);
 +
 +    /* Setup the list callbacks */
 +    g_signal_connect (GNC_QUERY_VIEW(sw->result_view), "row_selected",
 +                      G_CALLBACK (gnc_search_dialog_select_row_cb), sw);
 +
 +    g_signal_connect (GNC_QUERY_VIEW(sw->result_view), "double_click_entry",
 +                      G_CALLBACK(gnc_search_dialog_double_click_cb), sw);
 +}
 +
 +
 +static void
 +gnc_search_dialog_display_results (GNCSearchWindow *sw)
 +{
 +    gdouble max_count;
 +
 +    /* Check if this is the first time this is called for this window.
 +     * If so, then build the results sub-window, the scrolled treeview,
 +     * and the active buttons.
 +     */
 +    if (sw->result_view == NULL)
 +    {
 +        GtkWidget *scroller, *frame, *button_box, *button;
 +
 +        /* Create the view */
 +        gnc_search_dialog_init_result_view (sw);
 +
 +        frame = gtk_frame_new(NULL);
 +
 +        /* Create the scroller and add the view to the scroller */
 +        scroller = gtk_scrolled_window_new (NULL, NULL);
 +        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
 +                                        GTK_POLICY_AUTOMATIC,
 +                                        GTK_POLICY_AUTOMATIC);
 +        gtk_widget_set_size_request(GTK_WIDGET(scroller), 300, 100);
 +        gtk_container_add (GTK_CONTAINER (scroller), sw->result_view);
 +        gtk_container_add(GTK_CONTAINER(frame), scroller);
 +
 +        /* Create the button_box */
 +        button_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
 +        gtk_box_set_homogeneous (GTK_BOX (button_box), FALSE);
 +
 +        /* ... and add all the buttons */
 +        if (sw->buttons)
 +        {
 +            int i;
 +
 +            button = gtk_button_new_with_label (_("Select"));
 +            g_signal_connect (G_OBJECT (button), "clicked",
 +                              G_CALLBACK (gnc_search_dialog_select_cb), sw);
 +            gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
 +            sw->select_button = button;
 +
 +            for (i = 0; sw->buttons[i].label; i++)
 +            {
 +                GNCSearchCallbackButton* button_spec = sw->buttons + i;
 +                button = gtk_button_new_with_label (_(button_spec->label));
 +                g_object_set_data (G_OBJECT (button), "data", button_spec);
 +
 +                if (qof_book_is_readonly (gnc_get_current_book ()))
 +                    gtk_widget_set_sensitive (GTK_WIDGET(button), button_spec->sensitive_if_readonly);
 +
 +                /* Save the button pointer */
 +                sw->button_list = g_list_append(sw->button_list, button);
 +
 +                g_signal_connect (G_OBJECT (button), "clicked",
 +                                  G_CALLBACK (gnc_search_dialog_result_clicked), sw);
 +                gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 3);
 +            }
 +        }
 +
 +        /* Add the scrolled-view and button-box to the results_box */
 +        gtk_box_pack_end (GTK_BOX (sw->result_hbox), button_box, FALSE, FALSE, 3);
 +        gtk_box_pack_end (GTK_BOX (sw->result_hbox), frame, TRUE, TRUE, 3);
 +
 +        /* And show the results */
 +        gtk_widget_show_all (sw->result_hbox);
 +
 +        /* But may be hide the select button */
 +        if (!sw->selected_cb)
 +            gtk_widget_hide (sw->select_button);
 +    }
 +    else
 +        /* Update the query in the view */
 +        gnc_query_view_reset_query (GNC_QUERY_VIEW(sw->result_view), sw->q);
 +
 +    /* Deselect all the select buttons and any items */
 +    gnc_search_dialog_select_buttons_enable (sw, 0);
 +    gnc_query_view_unselect_all (GNC_QUERY_VIEW(sw->result_view));
 +
 +    /* set 'new search' if fewer than max_count items is returned. */
 +    max_count = gnc_prefs_get_float(GNC_PREFS_GROUP_SEARCH_GENERAL, GNC_PREF_NEW_SEARCH_LIMIT);
 +    if (gnc_query_view_get_num_entries(GNC_QUERY_VIEW(sw->result_view)) < max_count)
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE);
 +}
 +
 +
 +static void
 +match_combo_changed (GtkComboBoxText *combo_box, GNCSearchWindow *sw)
 +{
 +    sw->grouping = gtk_combo_box_get_active(GTK_COMBO_BOX(combo_box));
 +}
 +
 +
 +static void
 +search_type_cb (GtkToggleButton *button, GNCSearchWindow *sw)
 +{
 +    GSList * buttongroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
 +
 +    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
 +    {
 +        sw->search_type =
 +            g_slist_length (buttongroup) - g_slist_index (buttongroup, button) - 1;
 +    }
 +}
 +
 +
 +static void
 +search_active_only_cb (GtkToggleButton *button, GNCSearchWindow *sw)
 +{
 +
 +    gnc_prefs_set_bool(sw->prefs_group, GNC_PREF_ACTIVE_ONLY,
 +                       gtk_toggle_button_get_active (button));
 +}
 +
 +static QofQuery *
 +create_query_fragment (QofIdTypeConst search_for, GNCSearchParam *param, QofQueryPredData *pdata)
 +{
 +    GNCSearchParamKind kind = gnc_search_param_get_kind (param);
 +    QofQuery *q = qof_query_create_for (search_for);
 +    
 +    if (kind == SEARCH_PARAM_ELEM)
 +    {
 +        /* The "op" parameter below will be ignored since q has no terms. */
 +        qof_query_add_term (q, gnc_search_param_get_param_path (GNC_SEARCH_PARAM_SIMPLE (param)),
 +                            pdata, QOF_QUERY_OR);
 +    } 
 +    else
 +    {
 +        GList *plist = gnc_search_param_get_search (GNC_SEARCH_PARAM_COMPOUND (param));
 +        
 +        for ( ; plist; plist  = plist->next)
 +        {
 +            QofQuery *new_q;
 +            GNCSearchParam *param2 = plist->data;
 +            QofQuery *q2 = create_query_fragment (search_for, param2, 
 +                                                  qof_query_core_predicate_copy (pdata));
 +            new_q = qof_query_merge (q, q2, kind == SEARCH_PARAM_ANY ? 
 +                                                    QOF_QUERY_OR : QOF_QUERY_AND);
 +            qof_query_destroy (q);
 +            qof_query_destroy (q2);
 +            q = new_q;
 +        }
 +        qof_query_core_predicate_free (pdata);
 +    }
 +    return q;
 +}
 +
 +static void
 +search_update_query (GNCSearchWindow *sw)
 +{
 +    static GSList *active_params = NULL;
 +    QofQuery *q, *q2, *new_q;
 +    GList *node;
 +    QofQueryOp op;
 +
 +    if (sw->grouping == GNC_SEARCH_MATCH_ANY)
 +        op = QOF_QUERY_OR;
 +    else
 +        op = QOF_QUERY_AND;
 +
 +    if (active_params == NULL)
 +        active_params = g_slist_prepend (NULL, QOF_PARAM_ACTIVE);
 +
 +    /* Make sure we supply a book! */
 +    if (sw->start_q == NULL)
 +    {
 +        sw->start_q = qof_query_create_for (sw->search_for);
 +        qof_query_set_book (sw->start_q, gnc_get_current_book ());
 +    }
 +    else
 +    {
 +        /* We've got a query -- purge it of any "active" parameters */
 +        qof_query_purge_terms (sw->start_q, active_params);
 +    }
 +
 +    /* Now create a new query to work from */
 +    q = qof_query_create_for (sw->search_for);
 +
 +    /* Walk the list of criteria */
 +    for (node = sw->crit_list; node; node = node->next)
 +    {
 +        struct _crit_data *data = node->data;
 +        QofQueryPredData* pdata;
 +
 +        pdata = gnc_search_core_type_get_predicate (data->element);
 +        if (pdata)
 +        {
 +            q2 = create_query_fragment(sw->search_for, GNC_SEARCH_PARAM (data->param), pdata);
 +            q = qof_query_merge (q, q2, op);
 +        }
 +    }
 +
 +    /* Now combine this query with the existing query, depending on
 +     * what we want to do...  We can assume that cases 1, 2, and 3
 +     * already have sw->q being valid!
 +     */
 +
 +    switch (sw->search_type)
 +    {
 +    case 0:			/* New */
 +        new_q = qof_query_merge (sw->start_q, q, QOF_QUERY_AND);
 +        qof_query_destroy (q);
 +        break;
 +    case 1:			/* Refine */
 +        new_q = qof_query_merge (sw->q, q, QOF_QUERY_AND);
 +        qof_query_destroy (q);
 +        break;
 +    case 2:			/* Add */
 +        new_q = qof_query_merge (sw->q, q, QOF_QUERY_OR);
 +        qof_query_destroy (q);
 +        break;
 +    case 3:			/* Delete */
 +        q2 = qof_query_invert (q);
 +        new_q = qof_query_merge (sw->q, q2, QOF_QUERY_AND);
 +        qof_query_destroy (q2);
 +        qof_query_destroy (q);
 +        break;
 +    default:
 +        g_warning ("bad search type: %d", sw->search_type);
 +        new_q = q;
 +        break;
 +    }
 +
 +    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw->active_only_check)))
 +    {
 +        qof_query_add_boolean_match (new_q, active_params, TRUE, QOF_QUERY_AND);
 +        active_params = NULL;
 +    }
 +
 +    /* Destroy the old query */
 +    if (sw->q)
 +        qof_query_destroy (sw->q);
 +
 +    /* And save the new one */
 +    sw->q = new_q;
 +}
 +
 +
 +static void
 +gnc_search_dialog_show_close_cancel (GNCSearchWindow *sw)
 +{
 +    if (sw->selected_cb)
 +    {
 +        gtk_widget_show (sw->cancel_button);
 +        gtk_widget_hide (sw->close_button);
 +    }
 +    else
 +    {
 +        gtk_widget_hide (sw->cancel_button);
 +        gtk_widget_show (sw->close_button);
 +    }
 +}
 +
 +
 +static void
 +gnc_search_dialog_reset_widgets (GNCSearchWindow *sw)
 +{
 +    gboolean sens = (sw->q != NULL);
 +
 +    gtk_widget_set_sensitive(GTK_WIDGET(sw->narrow_rb), sens);
 +    gtk_widget_set_sensitive(GTK_WIDGET(sw->add_rb), sens);
 +    gtk_widget_set_sensitive(GTK_WIDGET(sw->del_rb), sens);
 +
 +    if (sw->q)
 +    {
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), FALSE);
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->narrow_rb), TRUE);
 +    }
 +
 +    if (sw->crit_list)
 +    {
 +        gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
 +        gtk_widget_hide(sw->match_all_label);
 +    }
 +    else
 +    {
 +        gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
 +        gtk_widget_show(sw->match_all_label);
 +    }
 +}
 +
 +
 +static gboolean
 +gnc_search_dialog_crit_ok (GNCSearchWindow *sw)
 +{
 +    struct _crit_data *data;
 +    GList *l;
 +    gboolean ret;
 +
 +    if (!sw->crit_list)
 +        return TRUE;
 +
 +    l = g_list_last (sw->crit_list);
 +    data = l->data;
 +    ret = gnc_search_core_type_validate (data->element);
 +
 +    if (ret)
 +        sw->last_param = data->param;
 +
 +    return ret;
 +}
 +
 +
 +static void
 +search_find_cb (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    if (!gnc_search_dialog_crit_ok (sw))
 +        return;
 +
 +    search_update_query (sw);
 +    search_clear_criteria (sw);
 +    gnc_search_dialog_reset_widgets (sw);
 +
 +    if (sw->result_cb)
 +        (sw->result_cb)(sw->q, sw->user_data, &(sw->selected_item));
 +    else
 +        gnc_search_dialog_display_results (sw);
 +}
 +
 +
 +static void
 +search_new_item_cb (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    gpointer res;
 +
 +    g_return_if_fail (sw->new_item_cb);
 +
 +    res = (sw->new_item_cb)(sw->user_data);
 +
 +    if (res)
 +    {
 +        const GncGUID *guid = (const GncGUID *) ((sw->get_guid->param_getfcn)(res, sw->get_guid));
 +        QofQueryOp op = QOF_QUERY_OR;
 +
 +        if (!sw->q)
 +        {
 +            if (!sw->start_q)
 +            {
 +                sw->start_q = qof_query_create_for (sw->search_for);
 +                qof_query_set_book (sw->start_q, gnc_get_current_book ());
 +            }
 +            sw->q = qof_query_copy (sw->start_q);
 +            op = QOF_QUERY_AND;
 +        }
 +
 +        qof_query_add_guid_match (sw->q, g_slist_prepend (NULL, QOF_PARAM_GUID),
 +                                  guid, op);
 +
 +        /* Watch this entity so we'll refresh once it's actually changed */
 +        gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY);
 +    }
 +}
 +
 +
 +static void
 +search_cancel_cb (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    /* Don't select anything */
 +    sw->selected_item = NULL;
 +    gnc_search_dialog_destroy (sw);
 +}
 +
 +
 +static void
 +search_help_cb (GtkButton *button, GNCSearchWindow *sw)
 +{
 +    gnc_gnome_help (HF_HELP, HL_FIND_TRANSACTIONS);
 +}
 +
 +
 +static void
 +remove_element (GtkWidget *button, GNCSearchWindow *sw)
 +{
 +    GtkWidget *element;
 +    struct _elem_data *data;
 +
 +    if (!sw->crit_list)
 +        return;
 +
 +    element = g_object_get_data (G_OBJECT (button), "element");
 +    data = g_object_get_data (G_OBJECT (element), "data");
 +
 +    /* remove the element from the list */
 +    sw->crit_list = g_list_remove (sw->crit_list, data);
 +
 +    /* and from the display */
 +    gtk_container_remove (GTK_CONTAINER (sw->criteria_table), element);
 +    gtk_container_remove (GTK_CONTAINER (sw->criteria_table), button);
 +
 +    /* disable match-type menu when there is no criterion */
 +    if (!sw->crit_list)
 +    {
 +        gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
 +        gtk_widget_show(sw->match_all_label);
 +    }
 +}
 +
 +
 +static void
 +attach_element (GtkWidget *element, GNCSearchWindow *sw, int row)
 +{
 +    GtkWidget *remove;
 +    struct _crit_data *data;
 +
 +    data = g_object_get_data (G_OBJECT (element), "data");
 +
 +    gtk_grid_attach (GTK_GRID (sw->criteria_table), element, 0, row, 1, 1);
 +    gtk_widget_set_hexpand (element, TRUE);
 +    gtk_widget_set_halign (element, GTK_ALIGN_FILL);
 +    g_object_set (element, "margin", 0, NULL);
 +
 +    remove = gtk_button_new_with_mnemonic (_("_Remove"));
 +    g_object_set_data (G_OBJECT (remove), "element", element);
 +    g_signal_connect (G_OBJECT (remove), "clicked", G_CALLBACK (remove_element), sw);
 +
 +    gtk_grid_attach (GTK_GRID (sw->criteria_table), remove, 1, row, 1, 1);
 +    gtk_widget_set_hexpand (remove, FALSE);
 +    gtk_widget_set_halign (remove, GTK_ALIGN_CENTER);
 +    g_object_set (remove, "margin", 0, NULL);
 +
 +    gtk_widget_show (remove);
 +    data->button = remove;	/* Save the button for later */
 +}
 +
 +
 +static void
 +combo_box_changed (GtkComboBox *combo_box, struct _crit_data *data)
 +{
 +    GNCSearchParam *param;
 +    GNCSearchCoreType *newelem;
 +    GtkTreeModel *model;
 +    GtkTreeIter iter;
 +
 +    if (!gtk_combo_box_get_active_iter(combo_box, &iter))
 +        return;
 +    model = gtk_combo_box_get_model(combo_box);
 +    gtk_tree_model_get(model, &iter, SEARCH_COL_POINTER, &param, -1);
 +
 +    if (gnc_search_param_type_match (param, data->param))
 +    {
 +        /* The param type is the same, just save the new param */
 +        data->param = param;
 +        return;
 +    }
 +    data->param = param;
 +
 +    /* OK, let's do a widget shuffle, throw away the old widget/element,
 +     * and create another one here.  No need to change the crit_list --
 +     * the pointer to data stays the same.
 +     */
 +    if (data->elemwidget)
 +        gtk_container_remove (GTK_CONTAINER (data->container), data->elemwidget);
 +    g_object_unref (G_OBJECT (data->element));
 +
 +    newelem = gnc_search_core_type_new_type_name
 +              (gnc_search_param_get_param_type (param));
 +    data->element = newelem;
 +    data->elemwidget = gnc_search_core_type_get_widget (newelem);
 +    if (data->elemwidget)
 +    {
 +        gtk_box_pack_start (GTK_BOX (data->container), data->elemwidget,
 +                            FALSE, FALSE, 0);
 +    }
 +
 +    /* Make sure it's visible */
 +    gtk_widget_show_all (data->container);
 +
 +    /* Make sure we widen up if necessary */
 +    gtk_widget_queue_resize (GTK_WIDGET (data->dialog));
 +
 +    /* And grab focus */
 +    gnc_search_core_type_grab_focus (newelem);
 +    gnc_search_core_type_editable_enters (newelem);
 +}
 +
 +
 +static void
 +search_clear_criteria (GNCSearchWindow *sw)
 +{
 +    GList *node;
 +
 +    for (node = sw->crit_list; node; )
 +    {
 +        GList *tmp = node->next;
 +        struct _crit_data *data = node->data;
 +        g_object_ref (data->button);
 +        remove_element (data->button, sw);
 +        node = tmp;
 +    }
 +}
 +
 +
 +static GtkWidget *
 +get_comb_box_widget (GNCSearchWindow *sw, struct _crit_data *data)
 +{
 +    GtkWidget *combo_box;
 +    GtkListStore *store;
 +    GtkTreeIter iter;
 +    GtkCellRenderer *cell;
 +    GList *l;
 +    int index = 0, current = 0;
 +
 +    store = gtk_list_store_new(NUM_SEARCH_COLS, G_TYPE_STRING, G_TYPE_POINTER);
 +    combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
 +    g_object_unref(store);
 +
 +    cell = gtk_cell_renderer_text_new ();
 +    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell, TRUE);
 +    gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell,
 +                                    "text", SEARCH_COL_NAME,
 +                                    NULL);
 +
 +    for (l = sw->params_list; l; l = l->next)
 +    {
 +        GNCSearchParam *param = l->data;
 +
 +        gtk_list_store_append(store, &iter);
 +        gtk_list_store_set(store, &iter,
 +                           SEARCH_COL_NAME, _(param->title),
 +                           SEARCH_COL_POINTER, param,
 +                           -1);
 +
 +        if (param == sw->last_param) /* is this the right parameter to start? */
 +            current = index;
 +
 +        index++;
 +    }
 +
 +    gtk_combo_box_set_active (GTK_COMBO_BOX(combo_box), current);
 +    g_signal_connect (combo_box, "changed", G_CALLBACK (combo_box_changed), data);
 +
 +    return combo_box;
 +}
 +
 +static GtkWidget *
 +get_element_widget (GNCSearchWindow *sw, GNCSearchCoreType *element)
 +{
 +    GtkWidget *combo_box, *hbox, *p;
 +    struct _crit_data *data;
 +
 +    data = g_new0 (struct _crit_data, 1);
 +    data->element = element;
 +    data->dialog = GTK_DIALOG (sw->dialog);
 +
 +    hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 +    gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
 +
 +    /* only set to automatically clean up the memory */
 +    g_object_set_data_full (G_OBJECT (hbox), "data", data, g_free);
 +
 +    p = gnc_search_core_type_get_widget (element);
 +    data->elemwidget = p;
 +    data->container = hbox;
 +    data->param = sw->last_param;
 +
 +    combo_box = get_comb_box_widget (sw, data);
 +    gtk_box_pack_start (GTK_BOX (hbox), combo_box, FALSE, FALSE, 0);
 +    if (p)
 +        gtk_box_pack_start (GTK_BOX (hbox), p, FALSE, FALSE, 0);
 +    gtk_widget_show_all (hbox);
 +
 +    return hbox;
 +}
 +
 +static void
 +gnc_search_dialog_book_option_changed (gpointer new_val, gpointer user_data)
 +{
 +    GList *l;
 +    GNCSearchWindow *sw = user_data;
 +    gboolean *new_data = (gboolean*)new_val;
 +    /* Save current dialog focus */
 +    GtkWidget *focused_widget = gtk_window_get_focus(GTK_WINDOW(sw->dialog));
 +
 +    g_return_if_fail (sw);
 +    if (strcmp (sw->search_for, GNC_ID_SPLIT) != 0)
 +        return;
 +
 +    /* Adjust labels for future added search criteria */
 +    for (l = sw->params_list; l; l = l->next)
 +    {
 +        GNCSearchParam *param = l->data;
 +
 +        if (*new_data)
 +        {
 +            if (strcmp (param->title, N_("Action")) == 0)
 +                gnc_search_param_set_title (param, N_("Number/Action"));
 +            if (strcmp (param->title, N_("Number")) == 0)
 +                gnc_search_param_set_title (param, N_("Transaction Number"));
 +        }
 +        else
 +        {
 +            if (strcmp (param->title, N_("Number/Action")) == 0)
 +                gnc_search_param_set_title (param, N_("Action"));
 +            if (strcmp (param->title, N_("Transaction Number")) == 0)
 +                gnc_search_param_set_title (param, N_("Number"));
 +        }
 +    }
 +    /* Adjust labels for existing search criteria; walk the list of criteria */
 +    for (l = sw->crit_list; l; l = l->next)
 +    {
 +        struct _crit_data *data = l->data;
 +        GList *children;
 +
 +        /* For each, walk the list of container children to get combo_box */
 +        for (children = gtk_container_get_children(GTK_CONTAINER(data->container));
 +                children; children = children->next)
 +        {
 +            GtkWidget *combo_box = children->data;
 +
 +            /* Get current active item if combo_box */
 +            if (GTK_IS_COMBO_BOX(combo_box))
 +            {
 +                GtkWidget *new_combo_box;
 +                gint index;
 +
 +                /* Set index to current active item */
 +                index = gtk_combo_box_get_active(GTK_COMBO_BOX(combo_box));
 +                /* Create new combo_box to replace existing one */
 +                new_combo_box = get_comb_box_widget (sw, data);
 +                /* If current combo_box has focus, point to new_combo-box */
 +                if (focused_widget == combo_box)
 +                    focused_widget = new_combo_box;
 +                gtk_widget_destroy(combo_box);
 +                /* Set new combo_box to current active item */
 +                gtk_combo_box_set_active(GTK_COMBO_BOX(new_combo_box), index);
 +                gtk_box_pack_start (GTK_BOX (data->container), new_combo_box,
 +                                                               FALSE, FALSE, 0);
 +                gtk_box_reorder_child(GTK_BOX (data->container), new_combo_box, 0);
 +                gtk_widget_show_all (data->container);
 +            }
 +        }
 +    }
 +    gtk_widget_grab_focus(focused_widget);
 +}
 +
 +struct grid_size
 +{
 +    /** The grid being sized. */
 +    GtkGrid *grid;
 +    /** The number of columns and rows in the grid. */
 +    gint cols, rows;
 +};
 +
 +static void
 +get_grid_size (GtkWidget *child, gpointer data)
 +{
 +    struct grid_size *gridsize = data;
 +    gint top, left, height, width;
 +
 +    gtk_container_child_get(GTK_CONTAINER(gridsize->grid), child,
 +                            "left-attach", &left,
 +                            "top-attach", &top,
 +                            "height", &height,
 +                            "width", &width,
 +                            NULL);
 +
 +    if (left + width >= gridsize->cols)
 +        gridsize->cols = left + width;
 +
 +    if (top + height >= gridsize->rows)
 +        gridsize->rows = top + height;
 +}
 +
 +static void
 +gnc_search_dialog_add_criterion (GNCSearchWindow *sw)
 +{
 +    GNCSearchCoreType *new_sct;
 +    struct grid_size gridsize;
 +
 +    gridsize.cols = 0;
 +    gridsize.rows = 0;
 +
 +    /* First, make sure that the last criterion is ok */
 +    if (sw->crit_list)
 +    {
 +        if (!gnc_search_dialog_crit_ok (sw))
 +            return;
 +    }
 +    else
 +    {
 +        sw->last_param = sw->params_list->data;
 +
 +        /* no match-all situation anymore */
 +        gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
 +        gtk_widget_hide(sw->match_all_label);
 +    }
 +    /* create a new criterion element */
 +    new_sct = gnc_search_core_type_new_type_name
 +          (gnc_search_param_get_param_type (sw->last_param));
 +
 +    if (new_sct)
 +    {
 +        struct _crit_data *data;
 +        GtkWidget *w;
 +
 +        w = get_element_widget (sw, new_sct);
 +        data = g_object_get_data (G_OBJECT (w), "data");
 +        sw->crit_list = g_list_append (sw->crit_list, data);
 +
 +        gridsize.grid = GTK_GRID (sw->criteria_table);
 +        gtk_container_foreach(GTK_CONTAINER(sw->criteria_table), get_grid_size, &gridsize);
 +
 +        attach_element (w, sw, gridsize.rows);
 +
 +        gnc_search_core_type_grab_focus (new_sct);
 +        gnc_search_core_type_editable_enters (new_sct);
 +    }
 +}
 +
 +
 +static void
 +add_criterion (GtkWidget *button, GNCSearchWindow *sw)
 +{
 +    gnc_search_dialog_add_criterion (sw);
 +}
 +
 +
 +static int
 +gnc_search_dialog_close_cb (GtkDialog *dialog, GNCSearchWindow *sw)
 +{
 +    g_return_val_if_fail (sw, TRUE);
 +
 +    /* Unregister callback on book option changes originally registered
 +     * if searching for splits */
 +    if (strcmp (sw->search_for, GNC_ID_SPLIT) == 0)
 +        gnc_book_option_remove_cb(OPTION_NAME_NUM_FIELD_SOURCE,
 +                                    gnc_search_dialog_book_option_changed, sw);
 +
 +    gnc_unregister_gui_component (sw->component_id);
 +
 +    /* Clear the crit list */
 +    g_list_free (sw->crit_list);
 +
 +    /* Clear the button list */
 +    g_list_free (sw->button_list);
 +
 +    /* Destroy the queries */
 +    if (sw->q) qof_query_destroy (sw->q);
 +    if (sw->start_q) qof_query_destroy (sw->start_q);
 +
 +    /* Destroy the user_data */
 +    if (sw->free_cb)
 +        (sw->free_cb)(sw->user_data);
 +
 +    /* Destroy and exit */
 +    g_free (sw);
 +    return FALSE;
 +}
 +
 +
 +static void
 +refresh_handler (GHashTable *changes, gpointer data)
 +{
 +    GNCSearchWindow * sw = data;
 +
 +    g_return_if_fail (sw);
 +    /* This assumes that results_cb will refresh itself which is the case with
 +     * registers. Also, only refresh if you are already displaying results */
 +    if (!sw->result_cb && (sw->result_view != NULL))
 +       gnc_search_dialog_display_results (sw);
 +}
 +
 +
 +static void
 +close_handler (gpointer data)
 +{
 +    GNCSearchWindow * sw = data;
 +
 +    g_return_if_fail (sw);
 +    gtk_widget_destroy (sw->dialog);
 +    /* DRH: should sw be freed here? */
 +}
 +
 +
 +static const gchar *
 +type_label_to_new_button(const gchar* type_label)
 +{
 +    if (g_strcmp0(type_label, _("Bill")) == 0)
 +    {
 +        return _("New Bill");
 +    }
 +    else if (g_strcmp0(type_label, _("Customer")) == 0)
 +    {
 +        return _("New Customer");
 +    }
 +    else if (g_strcmp0(type_label, _("Employee")) == 0)
 +    {
 +        return _("New Employee");
 +    }
 +    else if (g_strcmp0(type_label, _("Expense Voucher")) == 0)
 +    {
 +        return _("New Expense Voucher");
 +    }
 +    else if (g_strcmp0(type_label, _("Invoice")) == 0)
 +    {
 +        return _("New Invoice");
 +    }
 +    else if (g_strcmp0(type_label, _("Job")) == 0)
 +    {
 +        return _("New Job");
 +    }
 +    else if (g_strcmp0(type_label, _("Order")) == 0)
 +    {
 +        return _("New Order");
 +    }
 +    else if (g_strcmp0(type_label, _("Transaction")) == 0)
 +    {
 +        return _("New Transaction");
 +    }
 +    else if (g_strcmp0(type_label, _("Split")) == 0)
 +    {
 +        return _("New Split");
 +    }
 +    else if (g_strcmp0(type_label, _("Vendor")) == 0)
 +    {
 +        return _("New Vendor");
 +    }
 +    else
 +    {
 +        PWARN("No translatable new-button label found for search type \"%s\", please add one into dialog-search.c!", type_label);
++        /* Translators: This string has a disambiguation prefix. Translate only the part behind '|' */
 +        return Q_("Item represents an unknown object type (in the sense of bill, customer, invoice, transaction, split,...)|New item");
 +    }
 +}
 +
 +
 +static void
 +gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
 +{
 +    GtkBuilder        *builder;
 +    GtkWidget         *label, *add, *box;
 +    GtkComboBoxText   *combo_box;
 +    GtkWidget         *widget;
 +    GtkWidget         *new_item_button;
 +    const char        *type_label;
 +    gboolean           active;
 +
 +    builder = gtk_builder_new();
 +    gnc_builder_add_from_file (builder, "dialog-search.glade", "search_dialog");
 +
 +    /* Grab the dialog, save the dialog info */
 +    sw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "search_dialog"));
 +    gtk_window_set_title(GTK_WINDOW(sw->dialog), title);
 +    g_object_set_data (G_OBJECT (sw->dialog), "dialog-info", sw);
 +
 +    // Set the style context for this dialog so it can be easily manipulated with css
 +    gnc_widget_set_style_context (GTK_WIDGET(sw->dialog), "GncSearchDialog");
 +
 +    /* Grab the result hbox */
 +    sw->result_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "result_hbox"));
 +
 +    /* Grab the search-table widget */
 +    sw->criteria_table = GTK_WIDGET(gtk_builder_get_object (builder, "criteria_table"));
 +
 +    /* Set the type label */
 +    label = GTK_WIDGET(gtk_builder_get_object (builder, "type_label"));
 +    if (sw->type_label)
 +        type_label = sw->type_label;
 +    else
 +        type_label = _(qof_object_get_type_label (sw->search_for));
 +    gtk_label_set_text (GTK_LABEL (label), type_label);
 +
 +    /* Set the 'add criterion' button */
 +    add = gtk_button_new_with_mnemonic (_("_Add"));
 +
 +    g_signal_connect (G_OBJECT (add), "clicked", G_CALLBACK (add_criterion), sw);
 +    box = GTK_WIDGET(gtk_builder_get_object (builder, "add_button_box"));
 +    gtk_box_pack_start (GTK_BOX (box), add, FALSE, FALSE, 3);
 +    gtk_widget_show (add);
 +
 +    /* Set the match-type menu */
 +    sw->grouping_combo = gtk_combo_box_text_new();
 +    combo_box = GTK_COMBO_BOX_TEXT(sw->grouping_combo);
 +    gtk_combo_box_text_append_text(combo_box, _("all criteria are met"));
 +    gtk_combo_box_text_append_text(combo_box, _("any criteria are met"));
 +    gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), sw->grouping);
 +    g_signal_connect(combo_box, "changed", G_CALLBACK (match_combo_changed), sw);
 +
 +    box = GTK_WIDGET(gtk_builder_get_object (builder, "type_menu_box"));
 +    gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(combo_box), FALSE, FALSE, 3);
 +    gtk_widget_show(GTK_WIDGET(combo_box));
 +
 +    /* Grab the 'all items match' label */
 +    sw->match_all_label = GTK_WIDGET(gtk_builder_get_object (builder, "match_all_label"));
 +
 +    /* if there's no original query, make the narrow, add, delete buttons inaccessible */
 +    sw->new_rb = GTK_WIDGET(gtk_builder_get_object (builder, "new_search_radiobutton"));
 +    g_signal_connect (sw->new_rb, "toggled",
 +                      G_CALLBACK (search_type_cb), sw);
 +    sw->narrow_rb = GTK_WIDGET(gtk_builder_get_object (builder, "narrow_search_radiobutton"));
 +    g_signal_connect (sw->narrow_rb, "toggled",
 +                      G_CALLBACK (search_type_cb), sw);
 +    sw->add_rb = GTK_WIDGET(gtk_builder_get_object (builder, "add_search_radiobutton"));
 +    g_signal_connect (sw->add_rb, "toggled",
 +                      G_CALLBACK (search_type_cb), sw);
 +    sw->del_rb = GTK_WIDGET(gtk_builder_get_object (builder, "delete_search_radiobutton"));
 +    g_signal_connect (sw->del_rb, "toggled",
 +                      G_CALLBACK (search_type_cb), sw);
 +
 +    active = gnc_prefs_get_bool(sw->prefs_group, GNC_PREF_ACTIVE_ONLY);
 +    sw->active_only_check = GTK_WIDGET(gtk_builder_get_object (builder, "active_only_check"));
 +    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sw->active_only_check), active);
 +    g_signal_connect (sw->active_only_check, "toggled",
 +                      G_CALLBACK (search_active_only_cb), sw);
 +
 +    /* Figure out if we this object-type has an "active" parameter, and
 +     * if not, then set the active-check button insensitive
 +     */
 +    if (qof_class_get_parameter (sw->search_for, QOF_PARAM_ACTIVE) == NULL)
 +        gtk_widget_set_sensitive (sw->active_only_check, FALSE);
 +
 +    /* Deal with the find button */
 +    widget = GTK_WIDGET(gtk_builder_get_object (builder, "find_button"));
 +    g_signal_connect (widget, "clicked",
 +                      G_CALLBACK (search_find_cb), sw);
 +
 +    /* Deal with the cancel button */
 +    sw->cancel_button = GTK_WIDGET(gtk_builder_get_object (builder, "cancel_button"));
 +    g_signal_connect (sw->cancel_button, "clicked",
 +                      G_CALLBACK (search_cancel_cb), sw);
 +
 +    /* Deal with the close button */
 +    sw->close_button = GTK_WIDGET(gtk_builder_get_object (builder, "close_button"));
 +    g_signal_connect (sw->close_button, "clicked",
 +                      G_CALLBACK (search_cancel_cb), sw);
 +
 +    /* Deal with the new_item button */
 +    new_item_button = GTK_WIDGET(gtk_builder_get_object (builder, "new_item_button"));
 +    gtk_button_set_label (GTK_BUTTON(new_item_button),
 +                          type_label_to_new_button(type_label));
 +    g_signal_connect (new_item_button, "clicked",
 +                      G_CALLBACK (search_new_item_cb), sw);
 +
 +    /* Deal with the help button */
 +    widget = GTK_WIDGET(gtk_builder_get_object (builder, "help_button"));
 +    g_signal_connect (widget, "clicked",
 +                      G_CALLBACK (search_help_cb), sw);
 +
 +    /* add the first criterion */
 +    gnc_search_dialog_add_criterion (sw);
 +
 +    /* register to update criterion/criteria labels based on book option changes
 +     * if searching for splits */
 +    if (strcmp (sw->search_for, GNC_ID_SPLIT) == 0)
 +        gnc_book_option_register_cb(OPTION_NAME_NUM_FIELD_SOURCE,
 +                                    gnc_search_dialog_book_option_changed, sw);
 +
 +    /* Hide the 'new' button if there is no new_item_cb */
 +    if (!sw->new_item_cb)
 +        gtk_widget_hide (new_item_button);
 +
 +    /* Connect all the signals */
 +    gtk_builder_connect_signals (builder, sw);
 +
 +    /* Register ourselves */
 +    sw->component_id = gnc_register_gui_component (DIALOG_SEARCH_CM_CLASS,
 +                       refresh_handler,
 +                       close_handler, sw);
 +    gnc_gui_component_set_session (sw->component_id,
 +                                   gnc_get_current_session());
 +
 +    /* And setup the close callback */
 +    g_signal_connect (G_OBJECT (sw->dialog), "destroy",
 +                      G_CALLBACK (gnc_search_dialog_close_cb), sw);
 +
 +    gnc_search_dialog_reset_widgets (sw);
 +    gnc_search_dialog_show_close_cancel (sw);
 +
 +    g_object_unref(G_OBJECT(builder));
 +}
 +
 +
 +void
 +gnc_search_dialog_destroy (GNCSearchWindow *sw)
 +{
 +    if (!sw) return;
 +    if (sw->prefs_group)
 +        gnc_save_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
 +    gnc_close_gui_component (sw->component_id);
 +}
 +
 +
 +void
 +gnc_search_dialog_raise (GNCSearchWindow *sw)
 +{
 +    if (!sw) return;
 +    gtk_window_present (GTK_WINDOW(sw->dialog));
 +}
 +
 +GNCSearchWindow *
 +gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
 +                          GList *param_list,
 +                          GList *display_list,
 +                          QofQuery *start_query, QofQuery *show_start_query,
 +                          GNCSearchCallbackButton *callbacks,
 +                          GNCSearchResultCB result_callback,
 +                          GNCSearchNewItemCB new_item_cb,
 +                          gpointer user_data, GNCSearchFree free_cb,
 +                          const gchar *prefs_group,
 +                          const gchar *type_label,
 +                          const gchar *style_class)
 +{
 +    GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1);
 +
 +    g_return_val_if_fail (obj_type, NULL);
 +    g_return_val_if_fail (*obj_type != '\0', NULL);
 +    g_return_val_if_fail (param_list, NULL);
 +
 +    /* Make sure the caller supplies callbacks xor result_callback */
 +    g_return_val_if_fail ((callbacks && !result_callback) ||
 +                          (!callbacks && result_callback), NULL);
 +
 +    if (callbacks)
 +        g_return_val_if_fail (display_list, NULL);
 +
 +    sw->search_for = obj_type;
 +    sw->params_list = param_list;
 +    sw->display_list = display_list;
 +    sw->buttons = callbacks;
 +    sw->result_cb = result_callback;
 +    sw->new_item_cb = new_item_cb;
 +    sw->user_data = user_data;
 +    sw->free_cb = free_cb;
 +    sw->prefs_group = prefs_group;
 +    sw->type_label = type_label;
 +
 +    /* Grab the get_guid function */
 +    sw->get_guid = qof_class_get_parameter (sw->search_for, QOF_PARAM_GUID);
 +    if (start_query)
 +        sw->start_q = qof_query_copy (start_query);
 +    sw->q = show_start_query;
 +
 +    gnc_search_dialog_init_widgets (sw, title);
 +    if (sw->prefs_group)
 +        gnc_restore_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
 +    gtk_widget_show(sw->dialog);
 +
 +    // Set the style context for this dialog so it can be easily manipulated with css
 +    if (style_class == NULL)
 +        gnc_widget_set_style_context (GTK_WIDGET(sw->dialog), "GncSearchDialog");
 +    else
 +        gnc_widget_set_style_context (GTK_WIDGET(sw->dialog), style_class);
 +
 +    /* Maybe display the original query results? */
 +    if (callbacks && show_start_query)
 +    {
 +        gnc_search_dialog_reset_widgets (sw);
 +        gnc_search_dialog_display_results (sw);
 +    }
 +
 +    return sw;
 +}
 +
 +
 +/* Register an on-close signal with the Search Dialog */
 +guint gnc_search_dialog_connect_on_close (GNCSearchWindow *sw,
 +        GCallback func,
 +        gpointer user_data)
 +{
 +    g_return_val_if_fail (sw, 0);
 +    g_return_val_if_fail (func, 0);
 +    g_return_val_if_fail (user_data, 0);
 +
 +    return g_signal_connect (G_OBJECT (sw->dialog), "destroy",
 +                             func, user_data);
 +
 +}
 +
 +
 +/* Un-register the signal handlers with the Search Dialog */
 +void gnc_search_dialog_disconnect (GNCSearchWindow *sw, gpointer user_data)
 +{
 +    g_return_if_fail (sw);
 +    g_return_if_fail (user_data);
 +
 +    g_signal_handlers_disconnect_matched (sw->dialog, G_SIGNAL_MATCH_DATA,
 +                                          0, 0, NULL, NULL, user_data);
 +}
 +
 +
 +/* Clear all callbacks with this Search Window */
 +void gnc_search_dialog_set_select_cb (GNCSearchWindow *sw,
 +                                      GNCSearchSelectedCB selected_cb,
 +                                      gpointer user_data,
 +                                      gboolean allow_clear)
 +{
 +    g_return_if_fail (sw);
 +
 +    sw->selected_cb = selected_cb;
 +    sw->select_arg = user_data;
 +    sw->allow_clear = allow_clear;
 +
 +    /* Show or hide the select button */
 +    if (sw->select_button)
 +    {
 +        if (selected_cb)
 +            gtk_widget_show (sw->select_button);
 +        else
 +            gtk_widget_hide (sw->select_button);
 +    }
 +
 +    /* Show the proper close/cancel button */
 +    gnc_search_dialog_show_close_cancel (sw);
 +}
 +
 +
 +/* TEST CODE BELOW HERE */
 +
 +static GList *
 +get_params_list (QofIdTypeConst type)
 +{
 +    GList *list = NULL;
 +
 +    list = gnc_search_param_prepend (list, "Txn: All Accounts",
 +                                     ACCOUNT_MATCH_ALL_TYPE,
 +                                     type, SPLIT_TRANS, TRANS_SPLITLIST,
 +                                     SPLIT_ACCOUNT_GUID, NULL);
 +    list = gnc_search_param_prepend (list, "Split Account", GNC_ID_ACCOUNT,
 +                                     type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
 +                                     NULL);
 +    list = gnc_search_param_prepend (list, "Split->Txn->Void?", NULL, type,
 +                                     SPLIT_TRANS, TRANS_VOID_STATUS, NULL);
 +    list = gnc_search_param_prepend (list, "Split Int64", NULL, type,
 +                                     "d-share-int64", NULL);
 +    list = gnc_search_param_prepend (list, "Split Amount (double)", NULL, type,
 +                                     "d-share-amount", NULL);
 +    list = gnc_search_param_prepend (list, "Split Value (debcred)", NULL, type,
 +                                     SPLIT_VALUE, NULL);
 +    list = gnc_search_param_prepend (list, "Split Amount (numeric)", NULL, type,
 +                                     SPLIT_AMOUNT, NULL);
 +    list = gnc_search_param_prepend (list, "Date Reconciled (date)", NULL, type,
 +                                     SPLIT_DATE_RECONCILED, NULL);
 +    list = gnc_search_param_prepend (list, "Split Memo (string)", NULL, type,
 +                                     SPLIT_MEMO, NULL);
 +
 +    return list;
 +}
 +
 +
 +static GList *
 +get_display_list (QofIdTypeConst type)
 +{
 +    GList *list = NULL;
 +
 +    list = gnc_search_param_prepend (list, "Amount", NULL, type, SPLIT_AMOUNT,
 +                                     NULL);
 +    list = gnc_search_param_prepend (list, "Memo", NULL, type, SPLIT_MEMO, NULL);
 +    list = gnc_search_param_prepend (list, "Date", NULL, type, SPLIT_TRANS,
 +                                     TRANS_DATE_POSTED, NULL);
 +
 +    return list;
 +}
 +
 +
 +static void
 +do_nothing (gpointer *a, gpointer b)
 +{
 +    return;
 +}
 +
 +
 +void
 +gnc_search_dialog_test (void)
 +{
 +    static GList *params = NULL;
 +    static GList *display = NULL;
 +    static GNCSearchCallbackButton buttons[] =
 +    {
 +        /* Don't mark these as translatable since these are only test strings! */
 +        { ("View Split"), do_nothing, NULL, TRUE },
 +        { ("New Split"), do_nothing, NULL, TRUE },
 +        { ("Do Something"), do_nothing, NULL, TRUE },
 +        { ("Do Nothing"), do_nothing, NULL, TRUE },
 +        { ("Who Cares?"), do_nothing, NULL, FALSE },
 +        { NULL }
 +    };
 +
 +    if (params == NULL)
 +        params = get_params_list (GNC_ID_SPLIT);
 +
 +    if (display == NULL)
 +        display = get_display_list (GNC_ID_SPLIT);
 +
 +/* FIXME: All this does is leak. */
 +    gnc_search_dialog_create (GNC_ID_SPLIT, _("Find Transaction"),
 +			      params, display,
 +			      NULL, NULL, buttons, NULL, NULL, NULL, NULL,
 +			      NULL, NULL, NULL);
 +}
 +
diff --cc gnucash/gnome-utils/gnc-tree-control-split-reg.c
index ea00d88,0000000..4bf3c1b
mode 100644,000000..100644
--- a/gnucash/gnome-utils/gnc-tree-control-split-reg.c
+++ b/gnucash/gnome-utils/gnc-tree-control-split-reg.c
@@@ -1,2173 -1,0 +1,2174 @@@
 +/********************************************************************\
 + * gnc-tree-control-split-reg.c -- GtkTreeView implementation       *
 + *                     to display registers in a GtkTreeView.       *
 + *                                                                  *
 + * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
 + * Copyright (C) 2012 Robert Fewell                                 *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 + *                                                                  *
 +\********************************************************************/
 +
 +#include <config.h>
 +
 +#include <gtk/gtk.h>
 +#include <glib/gi18n.h>
 +#include <stdlib.h>
 +#include <string.h>
 +
 +#include "gnc-tree-control-split-reg.h"
 +#include "gnc-tree-model-split-reg.h"
 +#include "gnc-tree-util-split-reg.h"
 +#include "gnc-tree-view-split-reg.h"
 +#include "gnc-component-manager.h"
 +#include "gnc-date.h"
 +#include "gnc-ui.h"
 +#include "gnc-prefs.h"
 +#include "gnc-warnings.h"
 +#include "dialog-utils.h"
 +#include "dialog-dup-trans.h"
 +#include "dialog-account.h"
 +
 +#include "Transaction.h"
 +#include "engine-helpers.h"
 +#include "gnc-event.h"
 +#include "Scrub.h"
 +
 +/** Static Globals *******************************************************/
 +static QofLogModule log_module = GNC_MOD_LEDGER;
 +
 +/*****************************************************************************/
 +/*****************************************************************************/
 +
 +/* Read only dialog */
 +static gboolean
 +gtc_sr_is_trans_readonly_and_warn (GncTreeViewSplitReg *view, Transaction *trans)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkWidget *window;
 +    GtkWidget *dialog;
 +    const gchar *reason;
 +    const gchar *title = _("Cannot modify or delete this transaction.");
 +    const gchar *message_reason =
 +        _("This transaction is marked read-only with the comment: '%s'");
 +
 +    if (!trans) return FALSE;
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    if (xaccTransIsReadonlyByPostedDate (trans))
 +    {
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        0,
 +                                        GTK_MESSAGE_ERROR,
 +                                        GTK_BUTTONS_OK,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                "%s", _("The date of this transaction is older than the \"Read-Only Threshold\" set for this book. "
 +                        "This setting can be changed in File -> Properties -> Accounts."));
 +        gtk_dialog_run (GTK_DIALOG (dialog));
 +        gtk_widget_destroy (dialog);
 +        return TRUE;
 +    }
 +
 +    reason = xaccTransGetReadOnly (trans);
 +    if (reason)
 +    {
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        0,
 +                                        GTK_MESSAGE_ERROR,
 +                                        GTK_BUTTONS_OK,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                message_reason, reason);
 +        gtk_dialog_run (GTK_DIALOG (dialog));
 +        gtk_widget_destroy (dialog);
 +        return TRUE;
 +    }
 +
 +    if (gnc_tree_model_split_reg_get_read_only (model, trans))
 +    {
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        0,
 +                                        GTK_MESSAGE_ERROR,
 +                                        GTK_BUTTONS_OK,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                "%s", _("You can not change this transaction, the Book or Register is set to Read Only."));
 +        gtk_dialog_run (GTK_DIALOG (dialog));
 +        gtk_widget_destroy (dialog);
 +        return TRUE;
 +    }
 +    return FALSE;
 +}
 +
 +
 +/* Transaction is being edited dialog */
 +#define gtc_sr_trans_open_and_warn gnc_tree_control_split_reg_trans_open_and_warn
 +gboolean
 +gnc_tree_control_split_reg_trans_open_and_warn (GncTreeViewSplitReg *view, Transaction *trans)
 +{
 +    Transaction *dirty_trans;
 +    GtkWidget *window;
 +    GtkWidget *dialog;
 +    gint response;
 +    const char *title = _("Save Transaction before proceeding?");
 +    const char *message =
 +            _("The current transaction has been changed. Would you like to "
 +              "record the changes before proceeding, or cancel?");
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
 +
 +    if (trans == dirty_trans)
 +    {
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_QUESTION,
 +                                        GTK_BUTTONS_CANCEL,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                "%s", message);
 +        gtk_dialog_add_button (GTK_DIALOG (dialog),
 +                              _("_Record"), GTK_RESPONSE_ACCEPT);
 +        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_TRANS_MOD);
 +        gtk_widget_destroy (dialog);
 +
 +        if (response != GTK_RESPONSE_ACCEPT)
 +            return TRUE;
 +
 +        xaccTransCommitEdit (trans);
 +        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +
 +        return FALSE;
 +    }
 +    else
 +        return FALSE;
 +}
 +
 +
 +#define gtc_sr_trans_test_for_edit gnc_tree_control_split_reg_trans_test_for_edit
 +gboolean
 +gtc_sr_trans_test_for_edit (GncTreeViewSplitReg *view, Transaction *trans)
 +{
 +    GtkWidget *window;
 +    Transaction *dirty_trans;
 +
 +    /* Make sure we have stopped editing */
 +    gnc_tree_view_split_reg_finish_edit (view);
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    /* Get dirty_trans */
 +    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
 +
 +    /* We are being edited in a different register */
 +    if (xaccTransIsOpen (trans) && (dirty_trans != trans))
 +    {
 +        gnc_error_dialog (window, "%s",
 +                         _("This transaction is being edited in a different register."));
 +        return TRUE;
 +    }
 +    return FALSE;
 +}
 +
 +/*****************************************************************************/
 +/*****************************************************************************/
 +
 +gboolean
 +gnc_tree_control_split_reg_balance_trans (GncTreeViewSplitReg *view, Transaction *trans)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkWidget *window;
 +    int choice;
 +    int default_value;
 +    Account *default_account;
 +    Account *other_account;
 +    Account *root;
 +    GList *radio_list = NULL;
 +    const char *title   = _("Rebalance Transaction");
 +    const char *message = _("The current transaction is not balanced.");
 +    Split *split;
 +    Split *other_split;
 +    gboolean two_accounts;
 +    gboolean multi_currency;
 +
 +
 +    if (xaccTransIsBalanced (trans))
 +        return FALSE;
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    if (xaccTransUseTradingAccounts (trans))
 +    {
 +        MonetaryList *imbal_list;
 +        gnc_monetary *imbal_mon;
 +        imbal_list = xaccTransGetImbalance (trans);
 +
 +        /* See if the imbalance is only in the transaction's currency */
 +        if (!imbal_list)
 +            /* Value imbalance, but not commodity imbalance.  This shouldn't
 +               be something that scrubbing can cause to happen.  Perhaps someone
 +               entered invalid splits.  */
 +            multi_currency = TRUE;
 +        else
 +        {
 +            imbal_mon = imbal_list->data;
 +            if (!imbal_list->next &&
 +                    gnc_commodity_equiv(gnc_monetary_commodity(*imbal_mon),
 +                                        xaccTransGetCurrency(trans)))
 +                multi_currency = FALSE;
 +            else
 +                multi_currency = TRUE;
 +        }
 +
 +        /* We're done with the imbalance list, the real work will be done
 +           by xaccTransScrubImbalance which will get it again. */
 +        gnc_monetary_list_free(imbal_list);
 +    }
 +    else
 +        multi_currency = FALSE;
 +
 +    split = xaccTransGetSplit (trans, 0);
 +    other_split = xaccSplitGetOtherSplit (split);
 +
 +    if (other_split == NULL)
 +    {
 +        /* Attempt to handle the inverted many-to-one mapping */
 +        split = xaccTransGetSplit (trans, 1);
 +        if (split) other_split = xaccSplitGetOtherSplit (split);
 +        else split = xaccTransGetSplit (trans, 0);
 +    }
 +    if (other_split == NULL || multi_currency)
 +    {
 +        two_accounts = FALSE;
 +        other_account = NULL;
 +    }
 +    else
 +    {
 +        two_accounts = TRUE;
 +        other_account = xaccSplitGetAccount (other_split);
 +    }
 +
 +    default_account = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    /* If the two pointers are the same, the account from other_split
 +     * is actually the default account. We must make other_account
 +     * the account from split instead.   */
 +
 +    if (default_account == other_account)
 +        other_account = xaccSplitGetAccount (split);
 +
 +    /*  If the two pointers are still the same, we have two splits, but
 +     *  they both refer to the same account. While non-sensical, we don't
 +     *  object.   */
 +
 +    if (default_account == other_account)
 +        two_accounts = FALSE;
 +
 +    radio_list = g_list_append (radio_list,
 +                                _("Balance it _manually"));
 +    radio_list = g_list_append (radio_list,
 +                                _("Let GnuCash _add an adjusting split"));
 +
 +    if (model->type < NUM_SINGLE_REGISTER_TYPES2 && !multi_currency)
 +    {
 +        radio_list = g_list_append (radio_list,
 +                                    _("Adjust current account _split total"));
 +
 +        default_value = 2;
 +        if (two_accounts)
 +        {
 +            radio_list = g_list_append (radio_list,
 +                                        _("Adjust _other account split total"));
 +            default_value = 3;
 +        }
 +    }
 +    else
 +        default_value = 0;
 +
 +    choice = gnc_choose_radio_option_dialog
 +             (window,
 +              title,
 +              message,
 +              _("_Rebalance"),
 +              default_value,
 +              radio_list);
 +
 +    g_list_free (radio_list);
 +
 +    root = gnc_account_get_root(default_account);
 +    switch (choice)
 +    {
 +    default:
 +    case 0:
 +        return TRUE;
 +        break;
 +
 +    case 1:
 +        xaccTransScrubImbalance (trans, root, NULL);
 +        break;
 +
 +    case 2:
 +        xaccTransScrubImbalance (trans, root, default_account);
 +        break;
 +
 +    case 3:
 +        xaccTransScrubImbalance (trans, root, other_account);
 +        break;
 +    }
 +    return FALSE;
 +}
 +
 +
 +/* Cancel the edit and Rollback */
 +void
 +gnc_tree_control_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing)
 +{
 +    /* Make sure we have stopped editing */
 +    gnc_tree_view_split_reg_finish_edit (view);
 +
 +    gnc_tree_view_split_reg_cancel_edit (view, reg_closing);
 +}
 +
 +
 +/* Amend the Exchange Rate of the transaction */
 +void
 +gnc_tree_control_split_reg_exchange_rate (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkWidget *window;
 +    Account *anchor;
 +    Transaction *trans;
 +    Split *split = NULL;
 +    Split *osplit = NULL;
 +    gnc_numeric value;
 +    gboolean expanded;
 +    gint depth;
 +    gint num_splits;
 +    const char *message;
 +    gnc_commodity *txn_com;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    trans = gnc_tree_view_split_reg_get_current_trans (view);
 +    expanded = gnc_tree_view_split_reg_trans_expanded (view, NULL);
 +    depth = gnc_tree_view_reg_get_selected_row_depth (view);
 +    num_splits = xaccTransCountSplits (trans);
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +    txn_com = xaccTransGetCurrency (trans);
 +
 +    if (trans == NULL)
 +        return;
 +
 +    /* See if we were asked to change a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +        return;
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +        return;
 +
 +    /* Make sure we ask to commit any changes before we proceed */
 +    if (gtc_sr_trans_open_and_warn (view, trans))
 +        return;
 +
 +    if (num_splits < 2)
 +        return;
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    /* Make sure we NEED this for this type of register */
 +    if (!gnc_tree_util_split_reg_has_rate (view))
 +    {
 +        message = _("This register does not support editing exchange rates.");
 +        gnc_error_dialog(window, "%s", message);
 +        return;
 +    }
 +
 +    /* If the anchor commodity is not a currency, cancel */
 +    if (anchor && !gnc_commodity_is_currency (xaccAccountGetCommodity (anchor)))
 +    {
 +        message = _("This register does not support editing exchange rates.");
 +        gnc_error_dialog (window, "%s", message);
 +        return;
 +    }
 +
 +    /* If we're not expanded AND number of splits greater than two, nothing to do */
 +    if ((gnc_tree_util_split_reg_is_multi (xaccTransGetSplit (trans, 0))) && !expanded)
 +    {
 +        message = _("You need to expand the transaction in order to modify its "
 +                    "exchange rates.");
 +        gnc_error_dialog (window, "%s", message);
 +        return;
 +    }
 +
 +    if (!gnc_tree_util_split_reg_is_multi (xaccTransGetSplit (trans, 0)) && anchor != NULL && !expanded)
 +    {
 +        split = gnc_tree_control_split_reg_get_current_trans_split (view);
 +
 +        if (xaccAccountGetType (xaccSplitGetAccount (split)) == ACCT_TYPE_TRADING) // trading split
 +            return;
 +
 +        osplit = xaccSplitGetOtherSplit (split);
 +
 +        value = xaccSplitGetValue (split);
 +
 +        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +        xaccTransBeginEdit (trans);
 +
 +        if (txn_com == xaccAccountGetCommodity (xaccSplitGetAccount(split)))
 +           gnc_tree_util_split_reg_set_value_for (view, trans, osplit, gnc_numeric_neg (value), TRUE);
 +        else
 +           gnc_tree_util_split_reg_set_value_for (view, trans, split, value, TRUE);
 +
 +        xaccTransCommitEdit (trans);
 +        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +    }
 +
 +    if (num_splits > 1 && expanded && depth == 3)
 +    {
 +        split = gnc_tree_view_split_reg_get_current_split (view);
 +
 +        if (xaccAccountGetType (xaccSplitGetAccount (split)) == ACCT_TYPE_TRADING) // trading split
 +            return;
 +
 +        value = xaccSplitGetValue (split);
 +
 +        if (txn_com == xaccAccountGetCommodity (xaccSplitGetAccount(split)))
 +        {
 +            message = _("The two currencies involved equal each other.");
 +            gnc_error_dialog (window, "%s", message);
 +            return;
 +        }
 +        else
 +        {
 +            gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +            xaccTransBeginEdit (trans);
 +
 +            gnc_tree_util_split_reg_set_value_for (view, trans, split, value, TRUE);
 +
 +            xaccTransCommitEdit (trans);
 +            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +        }
 +    }
 +}
 +
 +
 +/* Void current transaction */
 +void
 +gnc_tree_control_split_reg_void_current_trans (GncTreeViewSplitReg *view, const char *reason)
 +{
 +    Transaction *trans;
 +    Split *blank_split;
 +    Split *split;
 +
 +    if (!view) return;
 +
 +    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
 +
 +    /* get the current split */
 +    split = gnc_tree_view_split_reg_get_current_split (view);
 +    if (split == NULL)
 +        return;
 +
 +    /* Bail if trying to void the blank split. */
 +    if (split == blank_split)
 +        return;
 +
 +    /* already voided. */
 +    if (xaccSplitGetReconcile (split) == VREC)
 +        return;
 +
 +    trans = xaccSplitGetParent (split);
 +
 +    if (trans == NULL)
 +        return;
 +
 +    /* See if we were asked to change a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +        return;
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +        return;
 +
 +    /* Make sure we ask to commit any changes before we proceed */
 +    if (gtc_sr_trans_open_and_warn (view, trans))
 +        return;
 +
 +    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +
 +    xaccTransVoid (trans, reason);
 +
 +    if (xaccTransIsOpen (trans))
 +    {
 +        PERR("We should not be voiding an open transaction.");
 +        xaccTransCommitEdit (trans);
 +    }
 +    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +}
 +
 +
 +/* Unvoid current transaction */
 +void
 +gnc_tree_control_split_reg_unvoid_current_trans (GncTreeViewSplitReg *view)
 +{
 +    Transaction *trans;
 +    Split *blank_split;
 +    Split *split;
 +
 +    if (!view) return;
 +
 +    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
 +
 +    /* get the current split based on cursor position */
 +    split = gnc_tree_view_split_reg_get_current_split (view);
 +    if (split == NULL)
 +        return;
 +
 +    /* Bail if trying to unvoid the blank split. */
 +    if (split == blank_split)
 +        return;
 +
 +    /* not voided. */
 +    if (xaccSplitGetReconcile (split) != VREC)
 +        return;
 +
 +    trans = xaccSplitGetParent (split);
 +
 +    if (trans == NULL)
 +        return;
 +
 +    /* See if we were asked to change a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +        return;
 +
 +    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +
 +    xaccTransUnvoid (trans);
 +
 +    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +}
 +
 +
 +/* Jump to the Blank transaction */
 +gboolean
 +gnc_tree_control_split_reg_jump_to_blank (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath, *spath;
 +    Transaction *btrans;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    btrans = gnc_tree_model_split_get_blank_trans (model);
 +
 +    model->current_trans = btrans;
 +
 +    if (!gnc_tree_model_split_reg_trans_is_in_view (model, btrans))
 +        g_signal_emit_by_name (model, "refresh_trans");
 +    else
 +    {
 +        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, btrans);
 +
 +        spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
 +
 +        /* Set cursor to new spath */
 +        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
 +
 +        gtk_tree_path_free (spath);
 +        gtk_tree_path_free (mpath);
 +
 +        /* scroll when view idle */
 +        g_idle_add ((GSourceFunc)gnc_tree_view_split_reg_scroll_to_cell, view );
 +    }
 +    return FALSE;
 +}
 +
 +
 +/* Jump to transaction or split */
 +void
 +gnc_tree_control_split_reg_jump_to (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean amount)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath, *spath;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    if (split)
 +        trans = NULL;
 +
 +    mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, split, trans);
 +
 +    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
 +
 +    if (split)
 +        gnc_tree_view_split_reg_expand_trans (view, xaccSplitGetParent (split));
 +
 +    /* Set cursor to new spath, if amount, cursor is set to correct column ready for editing */
 +    if (amount)
 +    {
 +        GtkCellRenderer *cr0;
 +        GList *renderers;
 +        GList *columns;
 +        GList  *column;
 +        gint i;
 +
 +        columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
 +
 +        for (column = columns, i = 1; column; column = g_list_next (column), i++)
 +        {
 +            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_DEBIT && gnc_numeric_positive_p (xaccSplitGetAmount (split)))
 +                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
 +
 +            if (viewcol == COL_CREDIT && gnc_numeric_negative_p (xaccSplitGetAmount (split)))
 +                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
 +        }
 +        g_list_free (columns);
 +    }
 +    else
 +        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
 +
 +    /* Scroll to cell, mid view */
 +    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), spath, NULL, TRUE, 0.5, 0.0);
 +
 +    gtk_tree_path_free (spath);
 +    gtk_tree_path_free (mpath);
 +}
 +
 +
 +/* Returns the Blank Transaction */
 +Transaction *
 +gnc_tree_control_split_reg_get_blank_trans (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    return gnc_tree_model_split_get_blank_trans (model);
 +}
 +
 +
 +/* Return the Split for the current Transaction */
 +Split *
 +gnc_tree_control_split_reg_get_current_trans_split (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath;
 +    GtkTreeIter m_iter;
 +    Split *split = NULL;
 +    Transaction *trans = NULL;
 +    Account *anchor;
 +    gboolean is_trow1, is_trow2, is_split, is_blank;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    mpath = gnc_tree_view_split_reg_get_current_path (view);
 +
 +    gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath);
 +
 +    gnc_tree_model_split_reg_get_split_and_trans (
 +            GNC_TREE_MODEL_SPLIT_REG (model), &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    split = gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (trans, anchor);
 +
 +    gtk_tree_path_free (mpath);
 +
 +    return split;
 +}
 +
 +
 +/* Returns the Blank Split */
 +Split *
 +gnc_tree_control_split_reg_get_blank_split (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    return gnc_tree_model_split_get_blank_split (model);
 +}
 +
 +
 +/* Move to the relative transaction */
 +void
 +gnc_tree_control_split_reg_goto_rel_trans_row (GncTreeViewSplitReg *view, gint relative)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath, *spath;
 +    GtkTreePath  *new_mpath, *new_spath;
 +    gint *indices, sort_direction;
 +    gchar *sstring;
 +
 +    ENTER("Move relative, view is %p, relative is %d", view, relative);
 +
 +//FIXME Do we need to do some checks on relative maybe  -1,0,1 ??
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    mpath = gnc_tree_view_split_reg_get_current_path (view);
 +
 +    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
 +
 +    indices = gtk_tree_path_get_indices (spath);
 +
 +    if (model->sort_direction == GTK_SORT_DESCENDING)
 +        sort_direction = -1;
 +    else
 +        sort_direction = 1;
 +
 +    new_spath = gtk_tree_path_new_from_indices (indices[0] + (relative * sort_direction), -1);
 +
 +    // if relative == 0 we block all selection changes
 +    gnc_tree_view_split_reg_block_selection (view, TRUE);
 +    gtk_tree_selection_unselect_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), spath);
 +
 +    if (relative != 0)
 +        gnc_tree_view_split_reg_block_selection (view, FALSE);
 +
 +    /* Set cursor to new spath */
 +    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), new_spath, NULL, FALSE);
 +
 +    if (relative == 0)
 +    {
 +        gnc_tree_view_split_reg_block_selection (view, FALSE);
 +
 +        /* Get the new model path we are pointing at */
 +        new_mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, new_spath);
 +
 +        /* As we are not emitting selection change, we need to save the current path ref */
 +        gnc_tree_view_split_reg_set_current_path (view, new_mpath);
 +        gtk_tree_path_free (new_mpath);
 +    }
 +
 +    sstring = gtk_tree_path_to_string (new_spath);
 +    LEAVE("new_spath is %s", sstring);
 +    g_free (sstring);
 +
 +    gtk_tree_path_free (new_spath);
 +    gtk_tree_path_free (mpath);
 +    gtk_tree_path_free (spath);
 +}
 +
 +
 +/* Enter the transaction */
 +void
 +gnc_tree_control_split_reg_enter (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    Transaction *btrans, *ctrans;
 +    gboolean goto_blank = FALSE;
 +    gboolean next_trans = TRUE;
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    goto_blank = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
 +                                     GNC_PREF_ENTER_MOVES_TO_END);
 +
 +    ENTER("view=%p, goto_blank = %s", view, goto_blank ? "TRUE" : "FALSE");
 +
 +    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);
 +    }
 +    LEAVE(" ");
 +}
 +
 +
 +/* Reinit the transaction */
 +void
 +gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data)
 +{
 +    Transaction *trans;
 +    GtkWidget *dialog, *window;
 +    gint response;
 +    const gchar *warning;
 +
 +    const char *title = _("Remove the splits from this transaction?");
 +    const char *recn_warn = _("This transaction contains reconciled splits. "
 +                              "Modifying it is not a good idea because that will "
 +                              "cause your reconciled balance to be off.");
 +
 +    trans = gnc_tree_view_split_reg_get_current_trans (view);
 +
 +    if (trans == NULL)
 +        return;
 +
 +    /* See if we were asked to change a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +        return;
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +        return;
 +
 +    /* Make sure we ask to commit any changes before we proceed */
 +    if (gtc_sr_trans_open_and_warn (view, trans))
 +        return;
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                    GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                    GTK_MESSAGE_WARNING,
 +                                    GTK_BUTTONS_NONE,
 +                                    "%s", title);
 +
 +    if (xaccTransHasReconciledSplits (trans))
 +    {
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                "%s", recn_warn);
 +        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL_RECD;
 +    }
 +    else
 +    {
 +        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL;
 +    }
 +
 +    gtk_dialog_add_button (GTK_DIALOG (dialog),
 +                          _("_Cancel"), GTK_RESPONSE_CANCEL);
 +    gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
 +                              "edit-delete", GTK_RESPONSE_ACCEPT);
 +    response = gnc_dialog_run (GTK_DIALOG(dialog), warning);
 +    gtk_widget_destroy (dialog);
 +    if (response != GTK_RESPONSE_ACCEPT)
 +        return;
 +
 +    gnc_tree_view_split_reg_reinit_trans (view);
 +}
 +
 +
 +/* Delete the currently selected item */
 +void
 +gnc_tree_control_split_reg_delete (GncTreeViewSplitReg *view, gpointer data)
 +{
 +    GncTreeModelSplitReg *model;
 +    Account *anchor;
 +    RowDepth depth;
 +    Transaction *trans;
 +    Split *split;
 +    GtkWidget *dialog, *window;
 +    gint response;
 +    const gchar *warning;
 +
 +    /* get the current split based on cursor position */
 +    split = gnc_tree_view_split_reg_get_current_split (view);
 +    if (split == NULL)
 +    {
 +        split = gnc_tree_control_split_reg_get_current_trans_split (view);
 +        if (split == NULL)
 +        {
 +            LEAVE("split is NULL");
 +            return;
 +        }
 +    }
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    trans = xaccSplitGetParent (split);
 +
 +    if (trans == NULL)
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +        return;
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +        return;
 +
 +    depth = gnc_tree_view_reg_get_selected_row_depth (view);
 +
 +    /* Deleting the blank split just cancels */
 +    {
 +        Split *blank_split = gnc_tree_control_split_reg_get_blank_split (view);
 +
 +        if (split == blank_split)
 +            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. */
 +    if (depth == SPLIT3)
 +    {
 +        const char *format = _("Delete the split '%s' from the transaction '%s'?");
 +        const char *recn_warn = _("You would be deleting a reconciled split! "
 +                                  "This is not a good idea as it will cause your "
 +                                  "reconciled balance to be off.");
 +        const char *anchor_error = _("You cannot delete this split.");
 +        const char *anchor_split = _("This is the split anchoring this transaction "
 +                                     "to the register. You may not delete it from "
 +                                     "this register window. You may delete the "
 +                                     "entire transaction from this window, or you "
 +                                     "may navigate to a register that shows "
 +                                     "another side of this same transaction and "
 +                                     "delete the split from that register.");
 +        char *buf = NULL;
 +        const char *memo;
 +        const char *desc;
 +        char recn;
 +        if ((split == gnc_tree_control_split_reg_get_current_trans_split (view)) ||
 +            (split == gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (trans, anchor)))
 +        {
 +            dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                            GTK_DIALOG_MODAL
 +                                            | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                            GTK_MESSAGE_ERROR,
 +                                            GTK_BUTTONS_OK,
 +                                            "%s", anchor_error);
 +            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                    "%s", anchor_split);
 +            gtk_dialog_run (GTK_DIALOG (dialog));
 +            gtk_widget_destroy (dialog);
 +            return;
 +        }
 +
 +        memo = xaccSplitGetMemo (split);
 +        memo = (memo && *memo) ? memo : _("(no memo)");
 +
 +        desc = xaccTransGetDescription (trans);
 +        desc = (desc && *desc) ? desc : _("(no description)");
 +
 +        /* ask for user confirmation before performing permanent damage */
 +        buf = g_strdup_printf (format, memo, desc);
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        GTK_DIALOG_MODAL
 +                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_QUESTION,
 +                                        GTK_BUTTONS_NONE,
 +                                        "%s", buf);
 +        g_free(buf);
 +        recn = xaccSplitGetReconcile (split);
 +        if (recn == YREC || recn == FREC)
 +        {
 +            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                    "%s", recn_warn);
 +            warning = GNC_PREF_WARN_REG_SPLIT_DEL_RECD;
 +        }
 +        else
 +        {
 +            warning = GNC_PREF_WARN_REG_SPLIT_DEL;
 +        }
 +
 +        gtk_dialog_add_button (GTK_DIALOG (dialog),
 +                              _("_Cancel"), GTK_RESPONSE_CANCEL);
 +        gnc_gtk_dialog_add_button (dialog, _("_Delete Split"),
 +                                  "edit-delete", GTK_RESPONSE_ACCEPT);
 +        response = gnc_dialog_run (GTK_DIALOG (dialog), warning);
 +        gtk_widget_destroy (dialog);
 +        if (response != GTK_RESPONSE_ACCEPT)
 +            return;
 +
 +        gnc_tree_view_split_reg_delete_current_split (view);
 +        return;
 +    }
 +
 +    g_return_if_fail (depth == TRANS1 || depth == TRANS2);
 +
 +    /* On a transaction cursor with 2 or fewer splits in single or double
 +     * mode, we just delete the whole transaction, kerblooie */
 +    {
 +        const char *title = _("Delete the current transaction?");
 +        const char *recn_warn = _("You would be deleting a transaction "
 +                                  "with reconciled splits! "
 +                                  "This is not a good idea as it will cause your "
 +                                  "reconciled balance to be off.");
 +
 +        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        GTK_DIALOG_MODAL
 +                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_WARNING,
 +                                        GTK_BUTTONS_NONE,
 +                                        "%s", title);
 +        if (xaccTransHasReconciledSplits (trans))
 +        {
 +            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                    "%s", recn_warn);
 +            warning = GNC_PREF_WARN_REG_TRANS_DEL_RECD;
 +        }
 +        else
 +        {
 +            warning = GNC_PREF_WARN_REG_TRANS_DEL;
 +        }
 +        gtk_dialog_add_button (GTK_DIALOG (dialog),
 +                              _("_Cancel"), GTK_RESPONSE_CANCEL);
 +        gnc_gtk_dialog_add_button (dialog, _("_Delete Transaction"),
 +                                  "edit-delete", GTK_RESPONSE_ACCEPT);
 +        response =  gnc_dialog_run (GTK_DIALOG (dialog), warning);
 +        gtk_widget_destroy (dialog);
 +        if (response != GTK_RESPONSE_ACCEPT)
 +            return;
 +
 +        gnc_tree_view_split_reg_delete_current_trans (view);
 +        return;
 +    }
 +}
 +
 +
 +/* Add Reverse Transaction */
 +void
 +gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view)
 +{
 +    GtkWidget *window;
 +    Transaction *trans = NULL, *new_trans = NULL;
 +    GList *snode = NULL;
 +
 +    ENTER(" ");
 +
 +    trans = gnc_tree_view_split_reg_get_current_trans (view);
 +
 +    if (trans == NULL)
 +    {
 +        LEAVE("Trans is Null");
 +        return;
 +    }
 +
 +    /* See if we were asked to reverse a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +    {
 +        LEAVE("Skip blank trans");
 +        return;
 +    }
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +    {
 +        LEAVE("Read only");
 +        return;
 +    }
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +    {
 +        LEAVE("Open in different register");
 +        return;
 +    }
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    if (xaccTransGetReversedBy (trans))
 +    {
 +        gnc_error_dialog (window, "%s",
 +                         _("A reversing entry has already been created for this transaction."));
 +        LEAVE("Already have reversing transaction");
 +        return;
 +    }
 +
 +    /* Make sure we ask to commit any changes before we add reverse transaction */
 +    if (gtc_sr_trans_open_and_warn (view, trans))
 +    {
 +        LEAVE("save cancelled");
 +        return;
 +    }
 +
 +    /* Create reverse transaction */
 +    new_trans = xaccTransReverse (trans);
 +
 +    xaccTransBeginEdit (new_trans);
 +
 +    /* Clear transaction level info */
 +    xaccTransSetDatePostedSecsNormalized (new_trans, gnc_time (NULL));
 +    xaccTransSetDateEnteredSecs (new_trans, gnc_time (NULL));
 +
 +    xaccTransCommitEdit (new_trans);
 +
 +    // We need to loop through the splits and send an event to update the register.
 +    for (snode = xaccTransGetSplitList (new_trans); snode; snode = snode->next)
 +    {
 +        if (xaccTransStillHasSplit (new_trans, snode->data))
 +        {
 +           /* Send an event based on the split account */
 +           qof_event_gen (QOF_INSTANCE (xaccSplitGetAccount(snode->data)), GNC_EVENT_ITEM_ADDED, snode->data);
 +        }
 +    }
 +
 +    /* give gtk+ a chance to handle pending events */
 +    while (gtk_events_pending ())
 +        gtk_main_iteration ();
 +
 +    /* Now jump to new trans */
 +    gnc_tree_control_split_reg_jump_to (view, NULL, xaccTransGetSplit (new_trans, 0), FALSE);
 +
 +    LEAVE("Reverse transaction created");
 +}
 +
 +
 +/* Duplicate the current selection */
 +gboolean
 +gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkWidget *window;
 +    RowDepth depth;
 +    Transaction *trans;
 +    Split *blank_split;
 +    Split *split, *trans_split;
 +    gboolean use_split_action_for_num_field = FALSE;
 +
 +    ENTER("");
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
 +    split = gnc_tree_view_split_reg_get_current_split (view);
 +    trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
 +
 +
 +    depth = gnc_tree_view_reg_get_selected_row_depth (view);
 +
 +    use_split_action_for_num_field = qof_book_use_split_action_for_num_field (gnc_get_current_book());
 +
 +    trans = gnc_tree_view_split_reg_get_current_trans (view);
 +
 +    /* This shouldn't happen, but be paranoid. */
 +    if (trans == NULL)
 +        return FALSE;
 +
 +    /* See if we were asked to change a blank trans. */
 +    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
 +    {
 +        LEAVE("Skip blank trans");
 +        return FALSE;
 +    }
 +
 +    /* See if we were asked to change a blank split. */
 +    if (split == blank_split)
 +    {
 +        LEAVE("Skip blank split");
 +        return FALSE;
 +    }
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
 +    {
 +        LEAVE("Read only");
 +        return FALSE;
 +    }
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, trans))
 +    {
 +        LEAVE("Open in different register");
 +        return FALSE;
 +    }
 +
 +    /* Make sure we ask to commit any changes before we proceed */
 +    if (gtc_sr_trans_open_and_warn (view, trans))
 +    {
 +        LEAVE("save cancelled");
 +        return FALSE;
 +    }
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    /* Ok, we are now ready to make the copy. */
 +    if (depth == SPLIT3)
 +    {
 +        Split *new_split;
 +        gboolean new_act_num = FALSE;
 +        char *out_num;
 +        time64 date;
 +
 +        /* We are on a split in an expanded transaction.
 +         * Just copy the split and add it to the transaction.
 +         * However, if the split-action field is being used as the register 
 +         * number, and the action field is a number, request a new value or
 +         * cancel. Need to get next number and update account last num from
 +         * split account not register account, which may be the same or not */
 +
 +        if (split != trans_split)
 +        {
 +            if (use_split_action_for_num_field && gnc_strisnum (gnc_get_num_action (NULL, split)))
 +            {
 +                Account *account = xaccSplitGetAccount (split);
 +                const char* title = _("New Split Information");
 +                const char *in_num = NULL;
 +                date = time (0);
 +
 +                if (account)
 +                    in_num = xaccAccountGetLastNum (account);
 +                else
 +                    in_num = gnc_get_num_action (NULL, split);
 +
 +                if (!gnc_dup_trans_dialog (window, title, FALSE,
 +                                           &date, in_num, &out_num, NULL, NULL))
 +                {
 +                    LEAVE("dup cancelled");
 +                    return FALSE;
 +                }
 +                new_act_num = TRUE;
 +            }
 +
 +            new_split = xaccMallocSplit (gnc_get_current_book ());
 +
 +            // Remove the blank split
 +            gnc_tree_model_split_reg_set_blank_split_parent (model, trans, TRUE);
 +
 +            if (!xaccTransIsOpen (trans))
 +                xaccTransBeginEdit (trans);
 +            gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +
 +            xaccSplitCopyOnto (split, new_split);
 +            xaccSplitSetParent (new_split, trans);
 +
 +            // Add the blank split
 +            gnc_tree_model_split_reg_set_blank_split_parent (model, trans, FALSE);
 +
 +            if (new_act_num) /* if new number supplied by user dialog */
 +                gnc_set_num_action (NULL, new_split, out_num, NULL);
 +
 +            if (new_act_num && gnc_strisnum (out_num))
 +            {
 +                Account *account = xaccSplitGetAccount (new_split);
 +
 +                /* If current register is for account, set last num */
 +                if (account == gnc_tree_model_split_reg_get_anchor (model))
 +                    xaccAccountSetLastNum (account, out_num);
 +            }
 +            if (new_act_num)
 +                g_free (out_num);
 +        }
 +        else
 +        {
 +            gnc_error_dialog (window, "%s",
 +                         _("This is the split anchoring this transaction to the register."
 +                           " You can not duplicate it from this register window."));
 +            LEAVE("split anchoring this transaction");
 +            return FALSE;
 +        }
 +    }
 +    else
 +    {
 +        Transaction *new_trans;
 +        int trans_split_index;
 +        const char *in_num = NULL;
 +        const char *in_tnum = NULL;
 +        char *out_num;
 +        char *out_tnum;
 +        time64 date;
 +        gboolean use_autoreadonly = qof_book_uses_autoreadonly (gnc_get_current_book());
 +
 +        /* We are on a transaction row. Copy the whole transaction. */
 +
 +        date = time (0);
 +        if (gnc_strisnum (gnc_get_num_action (trans, trans_split)))
 +        {
 +            Account *account = gnc_tree_model_split_reg_get_anchor (model);
 +
 +            if (account)
 +                in_num = xaccAccountGetLastNum (account);
 +            else
 +                in_num = gnc_get_num_action (trans, trans_split);
 +        }
 +
 +        in_tnum = (use_split_action_for_num_field
 +                                        ? gnc_get_num_action (trans, NULL)
 +                                        : NULL);
 +
 +        if (!gnc_dup_trans_dialog (window, NULL, TRUE,
 +                                   &date, in_num, &out_num, in_tnum, &out_tnum))
 +        {
 +            LEAVE("dup cancelled");
 +            return FALSE;
 +        }
 +
 +        if (use_autoreadonly)
 +        {
 +            GDate d;
 +            GDate *readonly_threshold = qof_book_get_autoreadonly_gdate (gnc_get_current_book());
 +            gnc_gdate_set_time64 (&d, date);
 +            if (g_date_compare (&d, readonly_threshold) < 0)
 +            {
 +                GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                    0,
 +                                    GTK_MESSAGE_ERROR,
 +                                    GTK_BUTTONS_OK,
 +                                    "%s", _("Cannot store a transaction at this date"));
 +                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                        "%s", _("The entered date of the duplicated transaction is older than the \"Read-Only Threshold\" set for this book. "
 +                                "This setting can be changed in File -> Properties -> Accounts."));
 +                gtk_dialog_run (GTK_DIALOG (dialog));
 +                gtk_widget_destroy (dialog);
 +
 +                g_date_free (readonly_threshold);
 +                LEAVE("entered date older than read-only threshold");
 +                return FALSE;
 +            }
 +            g_date_free (readonly_threshold);
 +        }
 +
 +        trans_split_index = xaccTransGetSplitIndex (trans, trans_split);
 +
 +        new_trans = xaccMallocTransaction (gnc_get_current_book ());
 +
 +        xaccTransBeginEdit (new_trans);
 +
 +        xaccTransCopyOnto (trans, new_trans);
 +
 +        xaccTransSetDatePostedSecsNormalized (new_trans, date);
 +
 +        /* We also must set a new DateEntered on the new entry
 +         * because otherwise the ordering is not deterministic */
 +        xaccTransSetDateEnteredSecs(new_trans, gnc_time(NULL));
 +
 +        /* set per book option */
 +        gnc_set_num_action (new_trans, NULL, out_num, out_tnum);
 +
 +        if (gnc_strisnum (out_num))
 +        {
 +            Account *account = gnc_tree_model_split_reg_get_anchor (model);
 +
 +            /* If current register is for account, set last num */
 +            if (account)
 +                xaccAccountSetLastNum (account, out_num);
 +        }
 +
 +        if (use_split_action_for_num_field)
 +        {
 +            /* find split in new_trans that equals trans_split and set
 +             * split_action to out_num */
 +            gnc_set_num_action (NULL,
 +                                xaccTransGetSplit (new_trans, trans_split_index),
 +                                out_num, NULL);
 +            /* note that if the transaction has multiple splits to the register
 +             * account, only the anchor split will be set with user input. The
 +             * user will have to adjust other splits manually. */
 +        }
 +
 +        xaccTransCommitEdit (new_trans);
 +
 +        if (out_num != NULL)
 +           g_free (out_num);
 +
 +        if (use_split_action_for_num_field && out_tnum != NULL)
 +            g_free (out_tnum);
 +    }
 +    LEAVE(" ");
 +    return TRUE;
 +}
 +
 +
 +static gboolean gtcsr_move_current_entry_updown(GncTreeViewSplitReg *view,
 +                                                gboolean move_up, gboolean really_do_it)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath = NULL, *spath = NULL, *spath_target = NULL, *mpath_target = NULL;
 +    GtkTreeIter m_iter, m_iter_target;
 +    gboolean resultvalue = FALSE;
 +    g_return_val_if_fail(view, FALSE);
 +
 +    ENTER("");
 +
 +    // The allocated memory references will all be cleaned up in the
 +    // updown_finish: label.
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +    g_return_val_if_fail(model, FALSE);
 +
 +    if (model->sort_col != COL_DATE)
 +    {
 +        LEAVE("Not sorted by date - no up/down move available");
 +        return FALSE;
 +    }
 +
 +    mpath = gnc_tree_view_split_reg_get_current_path (view);
 +    if (!mpath)
 +    {
 +        LEAVE("No current path available - probably on the blank split.");
 +        goto updown_finish;
 +    }
 +
 +    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
 +    g_return_val_if_fail(spath, FALSE);
 +
 +    spath_target = gtk_tree_path_copy(spath);
 +    if (move_up)
 +    {
 +        gboolean move_was_made = gtk_tree_path_prev(spath_target);
 +        if (!move_was_made)
 +        {
 +            LEAVE("huh, no path_prev() possible");
 +            goto updown_finish;
 +        }
 +    }
 +    else
 +    {
 +        gtk_tree_path_next(spath_target);
 +        // The path_next() function does not give a return value, see
 +        // https://mail.gnome.org/archives/gtk-list/2010-January/msg00171.html
 +    }
 +
 +    if (gtk_tree_path_compare(spath, spath_target) == 0)
 +    {
 +        LEAVE("oops, paths are equal");
 +        goto updown_finish;
 +    }
 +
 +    mpath_target = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath_target);
 +    if (!mpath_target)
 +    {
 +        LEAVE("no path to target row");
 +        goto updown_finish;
 +    }
 +
 +    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
 +    {
 +        LEAVE("No iter for current row");
 +        goto updown_finish;
 +    }
 +    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter_target, mpath_target))
 +    {
 +        LEAVE("No iter for target row");
 +        goto updown_finish;
 +    }
 +
 +    {
 +        gboolean is_blank, is_blank_target;
 +        Split *current_split, *target_split;
 +        Transaction *current_trans, *target_trans;
 +        gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
 +                                                      NULL, NULL, NULL, &is_blank,
 +                                                      &current_split, &current_trans);
 +        gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter_target,
 +                                                      NULL, NULL, NULL, &is_blank_target,
 +                                                      &target_split, &target_trans);
 +        if (is_blank || is_blank_target)
 +        {
 +            LEAVE("blank split involved, ignored.");
 +            goto updown_finish;
 +        }
 +        if (xaccTransEqual(current_trans, target_trans, TRUE, FALSE, FALSE, FALSE))
 +        {
 +            LEAVE("two times the same txn, ignored.");
 +            goto updown_finish;
 +        }
 +        if (xaccTransGetIsClosingTxn(current_trans)
 +                || xaccTransGetIsClosingTxn(target_trans))
 +        {
 +            LEAVE("One of the txn is book-closing - no re-ordering allowed.");
 +            goto updown_finish;
 +        }
 +
 +        /* Only continue if both have the same date and num, because the
 +         * "standard ordering" is tied to the date anyway. */
 +        {
 +            Timespec t1, t2;
 +            GDate d1 = xaccTransGetDatePostedGDate(current_trans),
 +                  d2 = xaccTransGetDatePostedGDate(target_trans);
 +            if (g_date_compare(&d1, &d2) != 0)
 +            {
 +                LEAVE("unequal DatePosted, ignoring");
 +                goto updown_finish;
 +            }
 +            if (g_strcmp0(xaccTransGetNum(current_trans),
 +                          xaccTransGetNum(target_trans)) != 0)
 +            {
 +                LEAVE("unequal Num, ignoring");
 +                goto updown_finish;
 +            }
 +
 +            /* Special treatment if the equality doesn't hold if we access the
 +            dates as timespec. See the comment in gncEntrySetDateGDate() for the
 +            reason: Some code used the timespec at noon for the EntryDate, other
 +            code used the timespec at the start of day. */
 +            t1 = xaccTransRetDatePostedTS(current_trans);
 +            t2 = xaccTransRetDatePostedTS(target_trans);
 +            if (really_do_it && !timespec_equal(&t1, &t2))
 +            {
 +                /* Timespecs are not equal, even though the GDates were equal? Then
 +                we set the GDates again. This will force the timespecs to be equal
 +                as well. */
 +                xaccTransSetDatePostedGDate(current_trans, d1);
 +                xaccTransSetDatePostedGDate(target_trans, d2);
 +            }
 +        }
 +
 +        // Check whether any of the two splits are frozen
 +        if (xaccSplitGetReconcile(current_split) == FREC
 +                || xaccSplitGetReconcile(target_split) == FREC)
 +        {
 +            LEAVE("either current or target split is frozen. No modification allowed.");
 +            goto updown_finish;
 +        }
 +
 +        // If really_do_it is FALSE, we are only in query mode and shouldn't
 +        // modify anything. But if it is TRUE, please go ahead and do the move.
 +        if (really_do_it)
 +        {
 +            // Check whether any of the two splits are reconciled
 +            if (xaccSplitGetReconcile(current_split) == YREC
 +                    && !gnc_tree_control_split_reg_recn_test(view, spath))
 +            {
 +                LEAVE("current split is reconciled and user chose not to modify it");
 +                goto updown_finish;
 +            }
 +            if (xaccSplitGetReconcile(target_split) == YREC
 +                    && !gnc_tree_control_split_reg_recn_test(view, spath_target))
 +            {
 +                LEAVE("target split is reconciled and user chose not to modify it");
 +                goto updown_finish;
 +            }
 +
 +            PINFO("Ok, about to switch ordering for current desc='%s' target desc='%s'",
 +                  xaccTransGetDescription(current_trans),
 +                  xaccTransGetDescription(target_trans));
 +
 +            gnc_suspend_gui_refresh ();
 +
 +            /* Swap the date-entered of both entries. That's already
 +             * sufficient! */
 +            {
 +                Timespec time_current = xaccTransRetDateEnteredTS(current_trans);
 +                Timespec time_target = xaccTransRetDateEnteredTS(target_trans);
 +
 +                /* Special treatment for identical times (potentially caused
 +                 * by the "duplicate entry" command) */
 +                if (timespec_equal(&time_current, &time_target))
 +                {
 +                    g_warning("Surprise - both DateEntered are equal.");
 +                    /* We just increment the DateEntered of the previously
 +                     * lower of the two by one second. This might still cause
 +                     * issues if multiple entries had this problem, but
 +                     * whatever. */
 +                    if (move_up)
 +                        time_current.tv_sec++;
 +                    else
 +                        time_target.tv_sec++;
 +                }
 +
 +                /* Write the new DateEntered. */
 +                xaccTransSetDateEnteredTS(current_trans, &time_target);
 +                xaccTransSetDateEnteredTS(target_trans, &time_current);
 +
 +                /* FIXME: Do we need to notify anyone about the changed ordering? */
 +            }
 +
 +            gnc_resume_gui_refresh ();
 +
 +            LEAVE("two txn switched, done.");
 +        }
 +        resultvalue = TRUE;
 +        goto updown_finish;
 +    }
 +updown_finish:
 +    // memory cleanup
 +    //gtk_tree_path_free (mpath); // Should this be freed??
 +    gtk_tree_path_free(spath);
 +    gtk_tree_path_free(spath_target);
 +    gtk_tree_path_free(mpath_target);
 +    return resultvalue;
 +}
 +
 +gboolean gnc_tree_control_split_reg_move_current_entry_updown (GncTreeViewSplitReg *view,
 +                                                            gboolean move_up)
 +{
 +    return gtcsr_move_current_entry_updown(view, move_up, TRUE);
 +}
 +
 +gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitReg *view,
 +                                                               gboolean move_up)
 +{
 +    return gtcsr_move_current_entry_updown(view, move_up, FALSE);
 +}
 +
 +
 +/* Save any open edited transactions on closing register */
 +gboolean
 +gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing)
 +{
 +    Transaction *dirty_trans;
 +    Transaction *blank_trans;
 +    Transaction *trans;
 +//    Split *split;
 +//    Split *current_trans_split;
 +
 +    ENTER("view=%p, reg_closing=%s", view, reg_closing ? "TRUE" : "FALSE");
 +
 +    if (!view)
 +    {
 +        LEAVE("no view");
 +        return FALSE;
 +    }
 +
 +    /* Make sure we have stopped editing */
 +    gnc_tree_view_split_reg_finish_edit (view);
 +
 +    if (reg_closing)
 +        view->reg_closing = TRUE;
 +
 +    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
 +    blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
 +
 +    /* get the handle to the current split and transaction */
 +//    split = gnc_tree_view_split_reg_get_current_split (view);
 +    trans = gnc_tree_view_split_reg_get_current_trans (view);
 +
 +//    current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
 +
 +    if (trans == NULL)
 +    {
 +        LEAVE("no transaction");
 +        return FALSE;
 +    }
 +
 +    if (!xaccTransIsOpen (trans))
 +    {
 +        LEAVE("transaction not open");
 +        return FALSE;
 +    }
 +
 +    if (trans == dirty_trans )
 +    {
 +        if (trans != blank_trans)
 +        {
 +           /* Existing Transaction, we are going to commit. */
 +
 +            PINFO("committing trans (%p)", trans);
 +            xaccTransCommitEdit (trans);
 +            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +
 +            LEAVE("Existing Transaction committed");
 +            return TRUE;
 +        }
 +        else
 +        {
 +           /* Blank Transaction, we are going to commit. */
 +
 +            PINFO("start committing blank trans (%p)", trans);
 +//FIXME More stuff ?
 +
 +            if (xaccTransCountSplits (trans) == 0)
 +            {
 +                GtkWidget *dialog, *window;
 +                gint response;
 +                /* Translators: This message will be presented when a user *
 +                 * attempts to record a transaction without splits        */
 +                const char *title = _("Not enough information for Blank Transaction?");
 +                const char *message =
 +                    _("The blank transaction does not have enough information to save it. Would you like to "
 +                      "return to the transaction to update, or cancel the save?");
 +                window = gnc_tree_view_split_reg_get_parent (view);
 +                dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 +                                        GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_QUESTION,
 +                                        GTK_BUTTONS_CANCEL,
 +                                        "%s", title);
 +                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                        "%s", message);
 +                gtk_dialog_add_button (GTK_DIALOG (dialog),
++                              /* Translators: Return to the transaction to update */
 +                              _("_Return"), GTK_RESPONSE_ACCEPT);
 +
 +                gtk_widget_grab_focus (gtk_dialog_get_widget_for_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT));
 +
 +                response = gtk_dialog_run (GTK_DIALOG (dialog));
 +//                response = gnc_dialog_run (GTK_DIALOG (dialog), "transaction_incomplete");
 +                gtk_widget_destroy (dialog);
 +
 +                if (response != GTK_RESPONSE_ACCEPT)
 +                {
 +                    LEAVE("save cancelled");
 +                    return TRUE;
 +                }
 +                LEAVE("return to transaction");
 +                return FALSE;
 +            }
 +
 +            xaccTransCommitEdit (trans);
 +            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
 +
 +            LEAVE("Blank Transaction committed");
 +            return TRUE;
 +        }
 +    }
 +
 +    LEAVE(" ");
 +    return TRUE;
 +}
 +
 +
 +/* Allow the reconcile flag to be changed */
 +gboolean
 +gnc_tree_control_split_reg_recn_change (GncTreeViewSplitReg *view, GtkTreePath *spath)
 +{
 +    GtkWidget *dialog, *window;
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath;
 +    GtkTreeIter m_iter;
 +    Split *split = NULL;
 +    Transaction *trans = NULL;
 +    gboolean is_trow1, is_trow2, is_split, is_blank;
 +    Account *anchor;
 +    char rec;
 +    const gchar *title = _("Mark split as unreconciled?");
 +    const gchar *message =
 +        _("You are about to mark a reconciled split as unreconciled. Doing "
 +          "so might make future reconciliation difficult! Continue "
 +          "with this change?");
 +    gint response;
 +
 +    ENTER(" ");
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath);
 +
 +    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
 +    {
 +        gtk_tree_path_free (mpath);
 +        return FALSE;
 +    }
 +
 +    gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
 +                                 &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
 +
 +    if (is_trow1 || is_trow2)
 +        split = xaccTransFindSplitByAccount (trans, anchor);
 +
 +    rec = xaccSplitGetReconcile (split);
 +
 +    if (rec != YREC)
 +    {
 +        gtk_tree_path_free (mpath);
 +        LEAVE("Not reconciled");
 +        return TRUE;
 +    }
 +
 +    /* Does the user want to be warned? */
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +    dialog =
 +        gtk_message_dialog_new (GTK_WINDOW (window),
 +                               GTK_DIALOG_DESTROY_WITH_PARENT,
 +                               GTK_MESSAGE_WARNING,
 +                               GTK_BUTTONS_CANCEL,
 +                               "%s", title);
 +    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +            "%s", message);
 +    gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Unreconcile"),
 +                          GTK_RESPONSE_YES);
 +    response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_UNREC);
 +    gtk_widget_destroy (dialog);
 +
 +    if (response == GTK_RESPONSE_YES)
 +    {
 +        char rec = 'n';
 +        trans = xaccSplitGetParent (split);
 +
 +        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
 +        if (!xaccTransIsOpen (trans))
 +            xaccTransBeginEdit (trans);
 +
 +        xaccSplitSetReconcile (split, rec);
 +
 +        gtk_tree_path_free (mpath);
 +        LEAVE("mark split unreconciled");
 +        return TRUE;
 +    }
 +    gtk_tree_path_free (mpath);
 +    LEAVE("Canceled split unreconciled");
 +    return FALSE;
 +}
 +
 +
 +/* Test for splits being reconciled and decide to allow changes */
 +gboolean
 +gnc_tree_control_split_reg_recn_test (GncTreeViewSplitReg *view, GtkTreePath *spath)
 +{
 +    GncTreeModelSplitReg *model;
 +    GtkTreePath *mpath;
 +    GtkTreeIter m_iter;
 +    Split *split = NULL;
 +    Transaction *trans = NULL;
 +    gboolean is_trow1, is_trow2, is_split, is_blank;
 +    Account *anchor;
 +    char recn;
 +
 +    ENTER(" ");
 +
 +    /* This assumes we reset the flag whenever we change splits. */
 +    if (view->change_allowed)
 +    {
 +        LEAVE("change allowed is set");
 +        return TRUE;
 +    }
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath);
 +
 +    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
 +    {
 +        gtk_tree_path_free (mpath);
 +        LEAVE("No path");
 +        return TRUE;
 +    }
 +
 +    gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
 +                                 &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
 +
 +    if (is_trow1 || is_trow2)
 +        split = xaccTransFindSplitByAccount (trans, anchor);
 +
 +    if (!split)
 +    {
 +        gtk_tree_path_free (mpath);
 +        LEAVE("No split");
 +        return TRUE;
 +    }
 +
 +    recn = xaccSplitGetReconcile (split);
 +
 +    if (recn == YREC || xaccTransHasReconciledSplits (trans))
 +    {
 +        GtkWidget *dialog, *window;
 +        gint response;
 +        const gchar *title;
 +        const gchar *message;
 +
 +        if(recn == YREC)
 +        {
 +            title = _("Change reconciled split?");
 +            message =
 +             _("You are about to change a reconciled split. Doing so might make "
 +               "future reconciliation difficult! Continue with this change?");
 +        }
 +        else
 +        {
 +            title = _("Change split linked to a reconciled split?");
 +            message =
 +            _("You are about to change a split that is linked to a reconciled split. "
 +              "Doing so might make future reconciliation difficult! Continue with this change?");
 +        }
 +
 +        /* Does the user want to be warned? */
 +        window = gnc_tree_view_split_reg_get_parent (view);
 +        dialog =
 +            gtk_message_dialog_new (GTK_WINDOW (window),
 +                                   GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                   GTK_MESSAGE_WARNING,
 +                                   GTK_BUTTONS_CANCEL,
 +                                   "%s", title);
 +        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 +                "%s", message);
 +        gtk_dialog_add_button (GTK_DIALOG (dialog), _("Chan_ge Split"),
 +                              GTK_RESPONSE_YES);
 +        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_MOD);
 +        gtk_widget_destroy (dialog);
 +
 +        if (response != GTK_RESPONSE_YES)
 +        {
 +            gtk_tree_path_free (mpath);
 +            LEAVE("cancel reconciled split");
 +            return FALSE;
 +        }
 +    }
 +    view->change_allowed = TRUE;
 +    gtk_tree_path_free (mpath);
 +    LEAVE(" ");
 +    return TRUE;
 +}
 +
 +
 +/* Return the account for name given or create it */ 
 +Account *
 +gnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const char *name)
 +{
 +    GtkWidget *window;
 +    const char *placeholder = _("The account %s does not allow transactions.");
 +    const char *missing = _("The account %s does not exist. "
 +                            "Would you like to create it?");
 +    Account *account;
 +
 +    if (!name || (strlen(name) == 0))
 +        return NULL;
 +
 +    /* Find the account */
 +    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_LEAF_ACCT_NAMES))
 +        account = gnc_account_lookup_by_name (gnc_get_current_root_account(), name);
 +    else
 +        account = gnc_account_lookup_by_full_name (gnc_get_current_root_account(), name);
 +
 +    if (!account)
 +        account = gnc_account_lookup_by_code (gnc_get_current_root_account(), name);
 +
 +    window = gnc_tree_view_split_reg_get_parent (view);
 +
 +    if (!account)
 +    {
 +        /* Ask if they want to create a new one. */
 +        if (!gnc_verify_dialog (window, TRUE, missing, name))
 +            return NULL;
 +
 +        /* User said yes, they want to create a new account. */
 +        account = gnc_ui_new_accounts_from_name_window (name);
 +        if (!account)
 +            return NULL;
 +    }
 +    /* Now have the account. */
 +
 +    /* See if the account (either old or new) is a placeholder. */
 +    if (xaccAccountGetPlaceholder (account))
 +        gnc_error_dialog (window, placeholder, name);
 +
 +    /* Be seeing you. */
 +    return account;
 +}
 +
 +/*****************************************************************************
 + *                         ClipBoard Functions                               *
 + *****************************************************************************/
 +static Transaction *clipboard_trans = NULL;
 +/* Must never dereference. */
 +static const Account *clipboard_acct = NULL;
 +
 +
 +/* Return the split account for which ancestor is it's parent */
 +static Account *
 +gtc_sr_get_account_for_trans_ancestor (const Transaction *trans, const Account *ancestor)
 +{
 +    GList *node;
 +
 +    for (node = xaccTransGetSplitList (trans); node; node = node->next)
 +    {
 +        Split *split = node->data;
 +        Account *split_acc = xaccSplitGetAccount (split);
 +
 +        if (!xaccTransStillHasSplit (trans, split))
 +            continue;
 +
 +        if (ancestor == split_acc)
 +            return split_acc;
 +
 +        if (ancestor && xaccAccountHasAncestor (split_acc, ancestor))
 +            return split_acc;
 +    }
 +    return NULL;
 +}
 +
 +
 +void
 +gnc_tree_control_split_reg_cut_trans (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    Transaction *from_trans;
 +    Account *anchor;
 +
 +    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    from_trans = gnc_tree_view_split_reg_get_current_trans (view);
 +    if (!from_trans)
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, from_trans))
 +        return;
 +
 +    if (!xaccTransIsOpen (clipboard_trans))
 +        xaccTransBeginEdit (clipboard_trans);
 +    if (clipboard_trans)
 +        xaccTransDestroy (clipboard_trans);
 +
 +    clipboard_trans = xaccTransCopyToClipBoard (from_trans);
 +    clipboard_acct = gtc_sr_get_account_for_trans_ancestor (from_trans, anchor);
 +
 +    gnc_tree_view_split_reg_delete_current_trans (view);
 +}
 +
 +
 +void
 +gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    Transaction *from_trans;
 +    Account *anchor;
 +
 +    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    from_trans = gnc_tree_view_split_reg_get_current_trans (view);
 +    if (!from_trans)
 +        return;
 +
 +    anchor = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    clipboard_acct = gtc_sr_get_account_for_trans_ancestor (from_trans, anchor);
 +
 +    if (!xaccTransIsOpen (clipboard_trans))
 +        xaccTransBeginEdit (clipboard_trans);
 +    if (clipboard_trans)
 +        xaccTransDestroy (clipboard_trans);
 +
 +    clipboard_trans = xaccTransCopyToClipBoard (from_trans);
 +}
 +
 +void
 +gnc_tree_control_split_reg_paste_trans (GncTreeViewSplitReg *view)
 +{
 +    GncTreeModelSplitReg *model;
 +    Account *anchor_acct;
 +    Transaction *to_trans;
 +
 +    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +    anchor_acct = gnc_tree_model_split_reg_get_anchor (model);
 +
 +    to_trans = gnc_tree_view_split_reg_get_current_trans (view);
 +    if (!to_trans || !clipboard_trans)
 +        return;
 +
 +    /* See if we are being edited in another register */
 +    if (gtc_sr_trans_test_for_edit (view, to_trans))
 +        return;
 +
 +    /* Test for read only */
 +    if (gtc_sr_is_trans_readonly_and_warn (view, to_trans))
 +        return;
 +
 +    //FIXME You can not paste from gl to a register, is this too simplistic
 +    if (clipboard_acct == NULL && anchor_acct != NULL)
 +    {
 +        GtkWidget *window;
 +
 +        window = gnc_tree_view_split_reg_get_parent (view);
 +        gnc_error_dialog (window, "%s",
 +                         _("You can not paste from the general journal to a register."));
 +        return;
 +    }
 +
 +    gnc_tree_view_split_reg_set_dirty_trans (view, to_trans);
 +    if (!xaccTransIsOpen (to_trans))
 +        xaccTransBeginEdit (to_trans);
 +
 +    // Remove the blank split
 +    gnc_tree_model_split_reg_set_blank_split_parent (model, to_trans, TRUE);
 +
 +    xaccTransCopyFromClipBoard (clipboard_trans, to_trans, clipboard_acct, anchor_acct, FALSE);
 +
 +    // Add the blank split back
 +    gnc_tree_model_split_reg_set_blank_split_parent (model, to_trans, FALSE);
 +
 +    // Refresh the view
 +    g_signal_emit_by_name (model, "refresh_trans", NULL);
 +}
 +
 +void
 +gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans,  const gchar *new_text)
 +{
 +    GncTreeModelSplitReg *model;
 +    Transaction          *btrans;
 +    GtkListStore         *desc_list;
 +    GtkTreeIter           iter;
 +    gboolean              valid;
 +
 +    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
 +    DEBUG("auto_complete - trans %p and description '%s'", trans, new_text);
 +
 +    model = gnc_tree_view_split_reg_get_model_from_view (view);
 +
 +    btrans = gnc_tree_model_split_get_blank_trans (model);
 +
 +    // if we are not looking at the blank trans, return.
 +    if (trans != btrans)
 +       return;
 +
 +    desc_list = gnc_tree_model_split_reg_get_description_list (model);
 +
 +    valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (desc_list), &iter);
 +    while (valid)
 +    {
 +        Transaction *trans_from;
 +        gchar *text;
 +        // Walk through the list, reading each row
 +        gtk_tree_model_get (GTK_TREE_MODEL (desc_list), &iter, 0, &text, 1, &trans_from, -1);
 +
 +        if (g_strcmp0 (text, new_text) == 0)
 +        {
 +            xaccTransCopyOnto (trans_from, trans);
 +            g_free (text);
 +            break;
 +        }
 +        g_free (text);
 +
 +        valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (desc_list), &iter);
 +    }
 +}
 +
diff --cc gnucash/gnome-utils/gtkbuilder/dialog-preferences.glade
index 451b712,0000000..ce06a8f
mode 100644,000000..100644
--- a/gnucash/gnome-utils/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gnome-utils/gtkbuilder/dialog-preferences.glade
@@@ -1,3276 -1,0 +1,3278 @@@
++<?xml version="1.0" encoding="utf-8"?>
++<?xml version="1.0" encoding="utf-8"?>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!-- Generated with glade 3.20.0 -->
 +<interface>
 +  <requires lib="gtk+" version="3.10"/>
 +  <object class="GtkAdjustment" id="auto_decimal_places_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">8</property>
 +    <property name="value">2</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">4</property>
 +  </object>
 +  <object class="GtkAdjustment" id="autosave_interval_minutes_adj">
 +    <property name="upper">99999</property>
 +    <property name="value">3</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="date_backmonth_adj">
 +    <property name="upper">11</property>
 +    <property name="value">6</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">4</property>
 +  </object>
 +  <object class="GtkListStore" id="date_formats">
 +    <columns>
 +      <!-- column-name name -->
 +      <column type="gchararray"/>
 +      <!-- column-name example -->
 +      <column type="gchararray"/>
 +    </columns>
 +    <data>
 +      <row>
 +        <col id="0" translatable="yes">US</col>
 +        <col id="1" translatable="yes">07/31/2013</col>
 +      </row>
 +      <row>
 +        <col id="0" translatable="yes">UK</col>
 +        <col id="1" translatable="yes">31/07/2013</col>
 +      </row>
 +      <row>
 +        <col id="0" translatable="yes">Europe</col>
 +        <col id="1" translatable="yes">31.07.2013</col>
 +      </row>
 +      <row>
 +        <col id="0" translatable="yes">ISO</col>
 +        <col id="1" translatable="yes">2013-07-31</col>
 +      </row>
 +      <row>
 +        <col id="0" translatable="yes">Locale</col>
 +        <col id="1" translatable="yes">(dummy)</col>
 +      </row>
 +    </data>
 +  </object>
 +  <object class="GtkAdjustment" id="default_zoom_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">10</property>
 +    <property name="value">1</property>
 +    <property name="step_increment">0.10000000000000001</property>
 +    <property name="page_increment">1</property>
 +  </object>
 +  <object class="GtkAdjustment" id="key_length_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">999</property>
 +    <property name="value">2</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="max_transactions_adj">
 +    <property name="upper">999999</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="new_search_limit_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">100</property>
 +    <property name="value">1</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="retain_days_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">99999</property>
 +    <property name="value">30</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="save_on_close_adj">
 +    <property name="upper">300</property>
 +    <property name="value">20</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="tab_width_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">100</property>
 +    <property name="value">30</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkDialog" id="gnucash_preferences_dialog">
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">GnuCash Preferences</property>
 +    <property name="default_width">600</property>
 +    <property name="default_height">400</property>
 +    <property name="type_hint">normal</property>
 +    <signal name="response" handler="gnc_preferences_response_cb" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox2">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area2">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="helpbutton2">
 +                <property name="label" translatable="yes">_Help</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="closebutton2">
 +                <property name="label" translatable="yes">_Close</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkNotebook" id="notebook1">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="halign">start</property>
 +            <property name="border_width">6</property>
 +            <property name="tab_pos">left</property>
 +            <child>
 +              <object class="GtkGrid" id="table9">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <child>
 +                  <object class="GtkLabel" id="label91">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Summarybar Content</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/window.pages.account-tree.summary/grand-total">
 +                    <property name="label" translatable="yes">Include _grand total</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show a grand total of all accounts converted to the default report currency.</property>
 +                    <property name="tooltip_text" translatable="yes">Show a grand total of all accounts converted to the default report currency.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/window.pages.account-tree.summary/non-currency">
 +                    <property name="label" translatable="yes">Include _non-currency totals</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, non-currency commodities will be shown in the summary bar. If clear, only currencies will be shown.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, non-currency commodities will be shown in the summary bar. If clear, only currencies will be shown.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label93">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Start Date</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label95">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>End Date</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/window.pages.account-tree.summary/start-choice-relative">
 +                    <property name="label" translatable="yes">_Relative:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use the specified relative starting date for profit/loss calculations.</property>
 +                    <property name="tooltip_text" translatable="yes">Use the specified relative starting date for profit/loss calculations.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/window.pages.account-tree.summary/start-choice-absolute">
 +                    <property name="label" translatable="yes">_Absolute:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use the specified absolute starting date for profit/loss calculations.</property>
 +                    <property name="tooltip_text" translatable="yes">Use the specified absolute starting date for profit/loss calculations.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/window.pages.account-tree.summary/start-choice-relative</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/window.pages.account-tree.summary/end-choice-relative">
 +                    <property name="label" translatable="yes">Re_lative:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use the specified relative ending date for profit/loss calculations. Also use this date for net assets calculations.</property>
 +                    <property name="tooltip_text" translatable="yes">Use the specified relative ending date for profit/loss calculations. Also use this date for net assets calculations.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/window.pages.account-tree.summary/end-choice-absolute">
 +                    <property name="label" translatable="yes">Ab_solute:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use the specified absolute ending date for profit/loss calculations. Also use this date for net assets calculations.</property>
 +                    <property name="tooltip_text" translatable="yes">Use the specified absolute ending date for profit/loss calculations. Also use this date for net assets calculations.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/window.pages.account-tree.summary/end-choice-relative</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label94">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label92">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/window.pages.account-tree.summary/start-period">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/window.pages.account-tree.summary/start-date">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/window.pages.account-tree.summary/end-period">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/window.pages.account-tree.summary/end-date">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +              </object>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label107">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Accounting Period</property>
 +              </object>
 +              <packing>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table1">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <property name="column_spacing">12</property>
 +                <child>
 +                  <object class="GtkLabel" id="label12">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Separator Character</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/use-accounting-labels">
 +                    <property name="label" translatable="yes">Use _formal accounting labels</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use only &apos;debit&apos; and &apos;credit&apos; instead of informal synonyms.</property>
 +                    <property name="tooltip_text" translatable="yes">Use only 'debit' and 'credit' instead of informal synonyms.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label62">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Labels</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label61">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/reversed-accounts-none">
 +                    <property name="label" translatable="yes">_None</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Don&apos;t sign reverse any accounts.</property>
 +                    <property name="tooltip_text" translatable="yes">Don't sign reverse any accounts.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/reversed-accounts-credit">
 +                    <property name="label" translatable="yes">C_redit accounts</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Sign reverse balances on the following: Credit Card, Payable, Liability, Equity, and Income.</property>
 +                    <property name="tooltip_text" translatable="yes">Sign reverse balances on the following: Credit Card, Payable, Liability, Equity, and Income.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/reversed-accounts-none</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/reversed-accounts-incomeexpense">
 +                    <property name="label" translatable="yes">_Income & expense</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Sign reverse balances on income and expense accounts.</property>
 +                    <property name="tooltip_text" translatable="yes">Sign reverse balances on income and expense accounts.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/reversed-accounts-none</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label55">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Reverse Balanced Accounts</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label54">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label79">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label80">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Default Currency</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="locale_currency">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes">US Dollars (USD)</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">13</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment3">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <object class="GtkRadioButton" id="pref/general/currency-choice-other">
 +                        <property name="label" translatable="yes">Ch_oose:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Use the specified currency for all newly created accounts.</property>
 +                        <property name="tooltip_text" translatable="yes">Use the specified currency for all newly created accounts.</property>
 +                        <property name="halign">start</property>
 +                        <property name="margin_left">12</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">pref/general/currency-choice-locale</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">14</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="sample_account">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label108">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Character:</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label109">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Sample:</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/general/currency-other">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">14</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label11">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Account Color</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">16</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/show-account-color">
 +                    <property name="label" translatable="yes">Show the Account Color as background</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show the Account Color as Account Name Background.</property>
 +                    <property name="tooltip_text" translatable="yes">Show the Account Color as Account Name Background.</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">17</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label13">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">15</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/show-account-color-tabs">
 +                    <property name="label" translatable="yes">Show the Account Color on tabs</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show the Account Color as tab background.</property>
 +                    <property name="tooltip_text" translatable="yes">Show the Account Color as tab background.</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">18</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment2">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <object class="GtkRadioButton" id="pref/general/currency-choice-locale">
 +                        <property name="label" translatable="yes">Loc_ale:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Use the system locale currency for all newly created accounts.</property>
 +                        <property name="tooltip_text" translatable="yes">Use the system locale currency for all newly created accounts.</property>
 +                        <property name="halign">start</property>
 +                        <property name="margin_left">12</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="active">True</property>
 +                        <property name="draw_indicator">True</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">13</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox6">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <object class="GtkImage" id="separator_error">
 +                        <property name="can_focus">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="icon_name">dialog-warning</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkEntry" id="pref/general/account-separator">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="events">GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">The character that will be used between components of an account name. A legal value is any single character except letters and numbers, or any of the following strings: &quot;colon&quot; &quot;slash&quot;, &quot;backslash&quot;, &quot;dash&quot; and &quot;period&quot;.</property>
 +                        <property name="tooltip_text" translatable="yes">The character that will be used between components of an account name. A legal value is any single character except letters and numbers, or any of the following strings: "colon" "slash", "backslash", "dash" and "period".</property>
 +                        <property name="invisible_char">●</property>
 +                        <property name="primary_icon_activatable">False</property>
 +                        <property name="secondary_icon_activatable">False</property>
 +                        <signal name="changed" handler="gnc_account_separator_pref_changed_cb" swapped="no"/>
 +                        <signal name="focus-out-event" handler="gnc_account_separator_validate_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">True</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </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>
 +              </object>
 +              <packing>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label1">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Accounts</property>
 +              </object>
 +              <packing>
 +                <property name="position">1</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table10">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <child>
 +                  <object class="GtkLabel" id="label104">
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Fancy Date Format</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label103">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label97">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Date Format</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label106">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Time Format</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label2">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/clock-24h">
 +                    <property name="label" translatable="yes">U_se 24-hour clock</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use a 24 hour (instead of a 12 hour) time format.</property>
 +                    <property name="tooltip_text" translatable="yes">Use a 24 hour (instead of a 12 hour) time format.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label9">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Date Completion</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label10">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">When a date is entered without year, it should be taken:</property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/date-completion-thisyear">
 +                    <property name="label" translatable="yes">In the current calendar year</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Dates will be completed so that they are within the current calendar year.</property>
 +                    <property name="tooltip_text" translatable="yes">Dates will be completed so that they are within the current calendar year.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/date-completion-sliding">
 +                    <property name="label" translatable="yes">In a sliding 12-month window starting this
 +many months before the current month:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Dates will be completed so that they are close to the current date. Enter the maximum number of months to go backwards in time when completing dates.</property>
 +                    <property name="tooltip_text" translatable="yes">Dates will be completed so that they are close to the current date. Enter the maximum number of months to go backwards in time when completing dates.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/date-completion-thisyear</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="pref/general/date-backmonths">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Enter number of months.</property>
 +                    <property name="tooltip_text" translatable="yes">Enter number of months.</property>
 +                    <property name="halign">start</property>
 +                    <property name="invisible_char">●</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">date_backmonth_adj</property>
 +                    <property name="climb_rate">1</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkComboBox" id="pref/general/date-format">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Use the date format specified by the system locale.</property>
 +                    <property name="tooltip_text" translatable="yes">Use the date format specified by the system locale.</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="model">date_formats</property>
 +                    <property name="active">3</property>
 +                    <child>
 +                      <object class="GtkCellRendererText" id="format_renderer"/>
 +                      <attributes>
 +                        <attribute name="text">0</attribute>
 +                      </attributes>
 +                    </child>
 +                    <child>
 +                      <object class="GtkCellRendererText" id="example_renderer"/>
 +                      <attributes>
 +                        <attribute name="text">1</attribute>
 +                      </attributes>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </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>
 +              </object>
 +              <packing>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label105">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Date/Time</property>
 +              </object>
 +              <packing>
 +                <property name="position">2</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table2">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <child>
 +                  <object class="GtkLabel" id="label50">
 +                    <property name="visible">True</property>
-                     <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>General</b></property>
++                    <property name="label" translatable="yes"><b>General</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.new-hierarchy/show-on-new-file">
 +                    <property name="label" translatable="yes">Perform account list _setup on new file</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Present the new account list dialog when you choose File -> New File.</property>
 +                    <property name="tooltip_text" translatable="yes">Present the new account list dialog when you choose File -> New File.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/num-source">
 +                    <property name="label" translatable="yes">Set book option on new files to use split "action" field for "Num" field on registers/reports</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If selected, the default book option for new files is set so that the &quot;Num&quot; cell on registers shows/updates the split &quot;action&quot; field and the transaction &quot;num&quot; field is shown on the second line in double line mode (and is not visible in single line mode). Otherwise, the default book option for new files is set so that the &quot;Num&quot; cell on registers shows/updates the transaction &quot;num&quot; field.</property>
 +                    <property name="tooltip_text" translatable="yes">If selected, the default book option for new files is set so that the 'Num' cell on registers shows/updates the split 'action' field and the transaction 'num' field is shown on the second line in double line mode (and is not visible in single line mode). Otherwise, the default book option for new files is set so that the 'Num' cell on registers shows/updates the transaction 'num' field.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.totd/show-at-startup">
 +                    <property name="label" translatable="yes">Display "_tip of the day" dialog</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display hints for using GnuCash at startup.</property>
 +                    <property name="tooltip_text" translatable="yes">Display hints for using GnuCash at startup.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox2">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="spacing">6</property>
 +                    <child>
 +                      <object class="GtkSpinButton" id="pref/general/retain-days">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">How many days to keep old log/backup files.</property>
 +                        <property name="tooltip_text" translatable="yes">How many days to keep old log/backup files.</property>
 +                        <property name="invisible_char">●</property>
 +                        <property name="primary_icon_activatable">False</property>
 +                        <property name="secondary_icon_activatable">False</property>
 +                        <property name="adjustment">retain_days_adj</property>
 +                        <property name="climb_rate">1</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label58">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes">days</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">False</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">23</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label18">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>_Retain log/backup files:</b></property>
 +                    <property name="use_markup">True</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general/retain-days</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">21</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/file-compression">
 +                    <property name="label" translatable="yes">Com_press files</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Compress the data file with gzip when saving it to disk.</property>
 +                    <property name="tooltip_text" translatable="yes">Compress the data file with gzip when saving it to disk.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">15</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label48">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Files</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">14</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label60">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">13</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label17">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">_Decimal places:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general/auto-decimal-places</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="pref/general/auto-decimal-places">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">How many automatic decimal places will be filled in.</property>
 +                    <property name="tooltip_text" translatable="yes">How many automatic decimal places will be filled in.</property>
 +                    <property name="invisible_char">●</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">auto_decimal_places_adj</property>
 +                    <property name="climb_rate">1</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/auto-decimal-point">
 +                    <property name="label" translatable="yes">_Automatic decimal point</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Automatically insert a decimal point into values that are entered without one.</property>
 +                    <property name="tooltip_text" translatable="yes">Automatically insert a decimal point into values that are entered without one.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/negative-in-red">
 +                    <property name="label" translatable="yes">Display ne_gative amounts in red</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display negative amounts in red.</property>
 +                    <property name="tooltip_text" translatable="yes">Display negative amounts in red.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label49">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Numbers</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label51">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label78">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Search Dialog</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">28</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label44">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">New search _limit:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/dialogs.search/new-search-limit</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">29</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="pref/dialogs.search/new-search-limit">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Default to &apos;new search&apos; if fewer than this number of items is returned.</property>
 +                    <property name="tooltip_text" translatable="yes">Default to 'new search' if fewer than this number of items is returned.</property>
 +                    <property name="invisible_char">●</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">new_search_limit_adj</property>
 +                    <property name="climb_rate">1</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">29</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/show-splash-screen">
 +                    <property name="label" translatable="yes">Show splash scree_n</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show splash screen at startup.</property>
 +                    <property name="tooltip_text" translatable="yes">Show splash screen at startup.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label119">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Auto-save time _interval:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general/autosave-interval-minutes</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">17</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox4">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="spacing">6</property>
 +                    <child>
 +                      <object class="GtkSpinButton" id="pref/general/autosave-interval-minutes">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">The number of minutes until saving of the data file to harddisk will be started automatically. If zero, no saving will be started automatically.</property>
 +                        <property name="tooltip_text" translatable="yes">The number of minutes until saving of the data file to harddisk will be started automatically. If zero, no saving will be started automatically.</property>
 +                        <property name="invisible_char">●</property>
 +                        <property name="primary_icon_activatable">False</property>
 +                        <property name="secondary_icon_activatable">False</property>
 +                        <property name="adjustment">autosave_interval_minutes_adj</property>
 +                        <property name="climb_rate">1</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label120">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes">minutes</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">False</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">17</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/autosave-show-explanation">
 +                    <property name="label" translatable="yes">Show auto-save confirmation _question</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If active, GnuCash shows a confirmation question each time the auto-save feature is started. Otherwise no extra explanation is shown.</property>
 +                    <property name="tooltip_text" translatable="yes">If active, GnuCash shows a confirmation question each time the auto-save feature is started. Otherwise no extra explanation is shown.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">16</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label84">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">20</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/retain-type-never">
 +                    <property name="label" translatable="yes">Never</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Do not create log/backup files.</property>
 +                    <property name="tooltip_text" translatable="yes">Do not create log/backup files.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/retain-type-days</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">22</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/retain-type-days">
 +                    <property name="label" translatable="yes">For:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Delete old log/backup files after this many days (0 = never).</property>
 +                    <property name="tooltip_text" translatable="yes">Delete old log/backup files after this many days (0 = never).</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">23</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/retain-type-forever">
 +                    <property name="label" translatable="yes">Forever</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Do not delete log/backup files.</property>
 +                    <property name="tooltip_text" translatable="yes">Do not delete log/backup files.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/retain-type-days</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">24</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/save-on-close-expires">
 +                    <property name="label" translatable="yes">Enable timeout on "Save changes on closing" question</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="tooltip_text" translatable="yes">If enabled, the "Save changes on closing" question will only wait a limited number of seconds for an answer. If the user didn't answer within that time, the changes will be saved automatically and the question window closed.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">18</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label15">
 +                    <property name="visible">True</property>
-                     <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Time to wait for answer:</property>
++                    <property name="label" translatable="yes">Time to wait for answer:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general/autosave-interval-minutes</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">19</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox1">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="spacing">6</property>
 +                    <child>
 +                      <object class="GtkSpinButton" id="pref/general/save-on-close-wait-time">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="tooltip_text" translatable="yes">The number of seconds to wait before the question window will be closed and the changes saved automatically.</property>
 +                        <property name="invisible_char">●</property>
 +                        <property name="primary_icon_activatable">False</property>
 +                        <property name="secondary_icon_activatable">False</property>
 +                        <property name="adjustment">save_on_close_adj</property>
 +                        <property name="climb_rate">1</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label16">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes">seconds</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">False</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">19</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label19">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">25</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/general/assoc-head">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="tooltip_markup" translatable="yes">Path head for Transaction Associated files </property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">26</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="box1">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <object class="GtkLabel" id="label20">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes"><b>Path head for Transaction Association Files</b></property>
 +                        <property name="use_markup">True</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkImage" id="path_head_error">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="margin_left">12</property>
 +                        <property name="icon_name">dialog-warning</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">26</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/grid-lines-horizontal">
 +                    <property name="label" translatable="yes">Enable horizontal grid lines on table displays</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="tooltip_text" translatable="yes">Enable horizontal grid lines on table displays. These will mainly be tree views like the Accounts page.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/grid-lines-vertical">
 +                    <property name="label" translatable="yes">Enable vertical grid lines on table displays</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="tooltip_text" translatable="yes">Enable vertical grid lines on table displays. These will mainly be tree views like the Accounts page.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </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>
 +                  <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>
 +              </object>
 +              <packing>
 +                <property name="position">3</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label3">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">General</property>
 +              </object>
 +              <packing>
 +                <property name="position">3</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table11">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <property name="column_spacing">12</property>
 +                <child>
 +                  <object class="GtkLabel" id="label115">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Checks</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment7">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkCheckButton" id="pref/dialogs.checkprinting/print-date-format">
 +                        <property name="label" translatable="yes">Print _date format</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Below the actual date, print the format of that date in 8 point type.</property>
 +                        <property name="tooltip_text" translatable="yes">Below the actual date, print the format of that date in 8 point type.</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment6">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkLabel" id="label116">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="label" translatable="yes">Default _font:</property>
 +                        <property name="use_markup">True</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="mnemonic_widget">pref/dialogs.checkprinting/default-font</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkFontButton" id="pref/dialogs.checkprinting/default-font">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">The default check printing font.</property>
 +                    <property name="tooltip_text" translatable="yes">The default check printing font.</property>
 +                    <property name="font">Sans 12</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment8">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkCheckButton" id="pref/dialogs.checkprinting/blocking-chars">
 +                        <property name="label" translatable="yes">Print _blocking chars</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Print &apos;***&apos; before and after each text field on the check.</property>
 +                        <property name="tooltip_text" translatable="yes">Print '***' before and after each text field on the check.</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="position">4</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label114">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Printing</property>
 +              </object>
 +              <packing>
 +                <property name="position">4</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table3">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <property name="column_spacing">12</property>
 +                <child>
 +                  <object class="GtkLabel" id="label56">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Actions</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/enter-moves-to-end">
 +                    <property name="label" translatable="yes">'_Enter' moves to blank transaction</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, pressing the &apos;Enter&apos; key will move to the location of the blank transaction in the register. If clear, pressing the &apos;Enter&apos; key will move down one row.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, pressing the 'Enter' key will move to the location of the blank transaction in the register. If clear, pressing the 'Enter' key will move down one row.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label66">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/auto-raise-lists">
 +                    <property name="label" translatable="yes">_Auto-raise lists</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Automatically raise the list of accounts or actions during input.</property>
 +                    <property name="tooltip_text" translatable="yes">Automatically raise the list of accounts or actions during input.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label75">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Reconciling</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label76">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.reconcile/check-cleared">
 +                    <property name="label" translatable="yes">Check cleared _transactions</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Pre-check cleared transactions when creating a reconcile dialog.</property>
 +                    <property name="tooltip_text" translatable="yes">Pre-check cleared transactions when creating a reconcile dialog.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.reconcile/auto-interest-transfer">
 +                    <property name="label" translatable="yes">Automatic _interest transfer</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Prior to reconciling an account which charges or pays interest, prompt the user to enter a transaction for the interest charge or payment. Currently only enabled for Bank, Credit, Mutual, Asset, Receivable, Payable, and Liability accounts.</property>
 +                    <property name="tooltip_text" translatable="yes">Prior to reconciling an account which charges or pays interest, prompt the user to enter a transaction for the interest charge or payment. Currently only enabled for Bank, Credit, Mutual, Asset, Receivable, Payable, and Liability accounts.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.reconcile/auto-cc-payment">
 +                    <property name="label" translatable="yes">Automatic credit card _payment</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">After reconciling a credit card statement, prompt the user to enter a credit card payment.</property>
 +                    <property name="tooltip_text" translatable="yes">After reconciling a credit card statement, prompt the user to enter a credit card payment.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/dialogs.reconcile/always-reconcile-to-today">
 +                    <property name="label" translatable="yes">Always reconcile to t_oday</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Always open the reconcile dialog using today&apos;s date for the statement date, regardless of previous reconciliations.</property>
 +                    <property name="tooltip_text" translatable="yes">Always open the reconcile dialog using today's date for the statement date, regardless of previous reconciliations.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/draw-vertical-lines">
 +                    <property name="label" translatable="yes">Draw _vertical lines between columns</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show vertical borders on the cells.</property>
 +                    <property name="tooltip_text" translatable="yes">Show vertical borders on the cells.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">15</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label46">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">16</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label47">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Layout</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">17</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/future-after-blank-transaction">
 +                    <property name="label" translatable="yes">_Future transactions after blank transaction</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, transactions with a date in the future will be displayed at the bottom of the register after the blank transaction. If clear, the blank transaction will be at the bottom of the register after all transactions.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, transactions with a date in the future will be displayed at the bottom of the register after the blank transaction. If clear, the blank transaction will be at the bottom of the register after all transactions.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">18</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/draw-horizontal-lines">
 +                    <property name="label" translatable="yes">Draw hori_zontal lines between rows</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show horizontal borders on the cells.</property>
 +                    <property name="tooltip_text" translatable="yes">Show horizontal borders on the cells.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">14</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/alternate-color-by-transaction">
 +                    <property name="label" translatable="yes">Double _mode colors alternate with transactions</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
 +                    <property name="tooltip_text" translatable="yes">Alternate the primary and secondary colors by transaction instead of by alternating by row.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">13</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/use-theme-colors">
 +                    <property name="label" translatable="yes">Don't _use GnuCash built-in colors</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">GnuCash uses a yellow/green theme by default for register windows. Check this if you want to use the system color theme instead.</property>
 +                    <property name="tooltip_text" translatable="yes">GnuCash uses a yellow/green theme by default for register windows. Check this if you want to use the system color theme instead.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label45">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Graphics</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/tab-to-transfer-on-memorised">
 +                    <property name="label" translatable="yes">Tab order in_cludes Transfer on Memorised Transactions</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Move to Transfer field when memorised transaction auto filled.</property>
 +                    <property name="tooltip_text" translatable="yes">Move to Transfer field when memorised transaction auto filled.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label121">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="position">5</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label4">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Register</property>
 +              </object>
 +              <packing>
 +                <property name="position">5</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table4">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <child>
 +                  <object class="GtkLabel" id="label63">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Default Style</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label64">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label65">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Other Defaults</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general.register/default-style-ledger">
 +                    <property name="label" translatable="yes">_Basic ledger</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show all transactions on one line. (Two in double line mode.)</property>
 +                    <property name="tooltip_text" translatable="yes">Show all transactions on one line. (Two in double line mode.)</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general.register/default-style-autoledger">
 +                    <property name="label" translatable="yes">_Auto-split ledger</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Automatically expand the current transaction to show all splits. All other transactions are shown on one line. (Two in double line mode.)</property>
 +                    <property name="tooltip_text" translatable="yes">Automatically expand the current transaction to show all splits. All other transactions are shown on one line. (Two in double line mode.)</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general.register/default-style-ledger</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general.register/default-style-journal">
 +                    <property name="label" translatable="yes">Transaction _Journal</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">All transactions are expanded to show all splits.</property>
 +                    <property name="tooltip_text" translatable="yes">All transactions are expanded to show all splits.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general.register/default-style-ledger</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label59">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Number of _transactions:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general.register/max-transactions</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="pref/general.register/max-transactions">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show this many transactions in a register. A value of zero means show all transactions.</property>
 +                    <property name="tooltip_text" translatable="yes">Show this many transactions in a register. A value of zero means show all transactions.</property>
 +                    <property name="invisible_char">●</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">max_transactions_adj</property>
 +                    <property name="climb_rate">1</property>
 +                    <property name="snap_to_ticks">True</property>
 +                    <property name="numeric">True</property>
 +                    <property name="update_policy">if-valid</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/double-line-mode">
 +                    <property name="label" translatable="yes">_Double line mode</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show two lines of information for each transaction instead of one. Does not affect expanded transactions.</property>
 +                    <property name="tooltip_text" translatable="yes">Show two lines of information for each transaction instead of one. Does not affect expanded transactions.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/use-new-window">
 +                    <property name="label" translatable="yes">Register opens in a new _window</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, each register will be opened in its own top level window. If clear, the register will be opened in the current window.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, each register will be opened in its own top level window. If clear, the register will be opened in the current window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/show-leaf-account-names">
 +                    <property name="label" translatable="yes">_Only display leaf account names</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, only the names of the leaf accounts are displayed in the register and in the account selection popup. The default behaviour is to display the full name, including the path in the account tree. Checking this option implies that you use unique leaf names.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, only the names of the leaf accounts are displayed in the register and in the account selection popup. The default behaviour is to display the full name, including the path in the account tree. Checking this option implies that you use unique leaf names.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label14">
 +                    <property name="visible">True</property>
-                     <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="label" translatable="yes">Number of _characters for auto complete:</property>
++                    <property name="label" translatable="yes">Number of _characters for auto complete:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="mnemonic_widget">pref/general.register/key-length</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="pref/general.register/key-length">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
-                     <property name="tooltip_text" translatable="yes">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
++                    <property name="tooltip_text" translatable="yes" comments="Register2 feature">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
 +                    <property name="invisible_char">●</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">key_length_adj</property>
 +                    <property name="climb_rate">1</property>
 +                    <property name="snap_to_ticks">True</property>
 +                    <property name="numeric">True</property>
 +                    <property name="update_policy">if-valid</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/show-extra-dates">
-                     <property name="label" translatable="yes">Show the _entered and reconcile dates</property>
++                    <property name="label" translatable="yes" comments="Register2 feature">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 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="halign">start</property>
 +                    <property name="margin_left">12</property>
++                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/show-calendar-buttons">
-                     <property name="label" translatable="yes">Show the calendar b_uttons</property>
++                    <property name="label" translatable="yes" comments="Register2 feature">Show the calendar b_uttons</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
-                     <property name="tooltip_markup">Show the calendar buttons Cancel, Today and Select.</property>
 +                    <property name="tooltip_text" translatable="yes">Show the calendar buttons Cancel, Today and Select.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
++                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">13</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/selection-to-blank-on-expand">
-                     <property name="label" translatable="yes">_Move the selection to the blank split on expand</property>
++                    <property name="label" translatable="yes" comments="Register2 feature">_Move the selection to the blank split on expand</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
-                     <property name="tooltip_markup">This will move the selection to the blank split when the transaction is expanded.</property>
 +                    <property name="tooltip_text" translatable="yes">This will move the selection to the blank split when the transaction is expanded.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
++                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">14</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.register/show-extra-dates-on-selection">
-                     <property name="label" translatable="yes">_Show entered and reconciled dates on selection</property>
++                    <property name="label" translatable="yes" comments="Register2 feature">_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 transaction selection.</property>
 +                    <property name="tooltip_text" translatable="yes">Show the entered date and reconciled date on transaction selection.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
++                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </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>
 +              </object>
 +              <packing>
 +                <property name="position">6</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label5">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Register Defaults</property>
 +              </object>
 +              <packing>
 +                <property name="position">6</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table8">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <child>
 +                  <object class="GtkLabel" id="locale_currency2">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes">US Dollars (USD)</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment5">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkRadioButton" id="pref/general.report/currency-choice-other">
 +                        <property name="label" translatable="yes">Ch_oose:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Use the specified currency for all newly created reports.</property>
 +                        <property name="tooltip_text" translatable="yes">Use the specified currency for all newly created reports.</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="active">True</property>
 +                        <property name="draw_indicator">True</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment4">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkRadioButton" id="pref/general.report/currency-choice-locale">
 +                        <property name="label" translatable="yes">Loc_ale:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">Use the system locale currency for all newly created reports.</property>
 +                        <property name="tooltip_text" translatable="yes">Use the system locale currency for all newly created reports.</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">pref/general.report/currency-choice-other</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label86">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Default Report Currency</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label88">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label89">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Location</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general.report/use-new-window">
 +                    <property name="label" translatable="yes">Report opens in a new _window</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">If checked, each report will be opened in its own top level window. If clear, the report will be opened in the current window.</property>
 +                    <property name="tooltip_text" translatable="yes">If checked, each report will be opened in its own top level window. If clear, the report will be opened in the current window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="pref/general.report/currency-other">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label21">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Default zoom level</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox5">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="orientation">vertical</property>
 +                    <child>
 +                      <object class="GtkSpinButton" id="pref/general.report/default-zoom">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="tooltip_text" translatable="yes">On high resolution screens reports tend to be hard to read. This option allows you to scale reports up by the set factor. For example setting this to 2.0 will display reports at twice their typical size.</property>
 +                        <property name="halign">start</property>
 +                        <property name="adjustment">default_zoom_adj</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="position">7</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label6">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Reports</property>
 +              </object>
 +              <packing>
 +                <property name="position">7</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkGrid" id="table5">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">6</property>
 +                <property name="column_spacing">12</property>
 +                <child>
 +                  <object class="GtkLabel" id="label72">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Window Geometry</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label74">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/save-window-geometry">
 +                    <property name="label" translatable="yes">_Save window size and position</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Save window size and location when it is closed.</property>
 +                    <property name="tooltip_text" translatable="yes">Save window size and location when it is closed.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/tab-next-recent">
 +                    <property name="label" translatable="yes">Bring the most _recent tab to the front</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Closing a tab moves to the most recently visited tab.</property>
 +                    <property name="tooltip_text" translatable="yes">Closing a tab moves to the most recently visited tab.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">5</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label110">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">7</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label111">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Tab Position</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/tab-position-top">
 +                    <property name="label" translatable="yes">To_p</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the notebook tabs at the top of the window.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the notebook tabs at the top of the window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/tab-position-bottom">
 +                    <property name="label" translatable="yes">B_ottom</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the notebook tabs at the bottom of the window.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the notebook tabs at the bottom of the window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/tab-position-top</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/tab-position-left">
 +                    <property name="label" translatable="yes">_Left</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the notebook tabs at the left of the window.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the notebook tabs at the left of the window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/tab-position-top</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">11</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/tab-position-right">
 +                    <property name="label" translatable="yes">_Right</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the notebook tabs at the right of the window.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the notebook tabs at the right of the window.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/tab-position-top</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">12</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label7">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Summary Bar Position</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">8</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/summarybar-position-top">
 +                    <property name="label" translatable="yes">Top</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the summary bar at the top of the page.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the summary bar at the top of the page.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="active">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">9</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="pref/general/summarybar-position-bottom">
 +                    <property name="label" translatable="yes">Bottom</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Display the summary bar at the bottom of the page.</property>
 +                    <property name="tooltip_text" translatable="yes">Display the summary bar at the bottom of the page.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">pref/general/summarybar-position-top</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">10</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label112">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label113">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes"><b>Tabs</b></property>
 +                    <property name="use_markup">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">3</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="pref/general/tab-close-buttons">
 +                    <property name="label" translatable="yes">Show close button on _notebook tabs</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="has_tooltip">True</property>
 +                    <property name="tooltip_markup">Show a close button on each notebook tab. These function identically to the &apos;Close&apos; menu item.</property>
 +                    <property name="tooltip_text" translatable="yes">Show a close button on each notebook tab. These function identically to the 'Close' menu item.</property>
 +                    <property name="halign">start</property>
 +                    <property name="margin_left">12</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">4</property>
 +                    <property name="width">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkAlignment" id="alignment9">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="left_padding">12</property>
 +                    <child>
 +                      <object class="GtkLabel" id="label117">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="label" translatable="yes">_Width:</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="ellipsize">middle</property>
 +                      </object>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox3">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <object class="GtkSpinButton" id="pref/general/tab-width">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="has_tooltip">True</property>
 +                        <property name="tooltip_markup">If the text in the tab is longer than this value (the test is approximate) then the tab label will have the middle cut and replaced with an ellipsis.</property>
 +                        <property name="tooltip_text" translatable="yes">If the text in the tab is longer than this value (the test is approximate) then the tab label will have the middle cut and replaced with an ellipsis.</property>
 +                        <property name="invisible_char">●</property>
 +                        <property name="primary_icon_activatable">False</property>
 +                        <property name="secondary_icon_activatable">False</property>
 +                        <property name="adjustment">tab_width_adj</property>
 +                        <property name="climb_rate">1</property>
 +                        <property name="numeric">True</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label118">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes">characters</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">False</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">6</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +                <child>
 +                  <placeholder/>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="position">8</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label8">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Windows</property>
 +              </object>
 +              <packing>
 +                <property name="position">8</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-11">helpbutton2</action-widget>
 +      <action-widget response="-7">closebutton2</action-widget>
 +    </action-widgets>
 +  </object>
 +</interface>
diff --cc gnucash/gnome/gnc-plugin-page-register.c
index de7be81,0000000..c34dbb9
mode 100644,000000..100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@@ -1,4192 -1,0 +1,4194 @@@
 +/**********************************************************************
 + * gnc-plugin-page-register.c -- register page functions              *
 + *                                                                    *
 + * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>       *
 + * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org> *
 + * Copyright (C) 2011, Robert Fewell                                  *
 + *                                                                    *
 + * This program is free software; you can redistribute it and/or      *
 + * modify it under the terms of the GNU General Public License as     *
 + * published by the Free Software Foundation; either version 2 of     *
 + * the License, or (at your option) any later version.                *
 + *                                                                    *
 + * This program is distributed in the hope that it will be useful,    *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *
 + * GNU General Public License for more details.                       *
 + *                                                                    *
 + * You should have received a copy of the GNU General Public License  *
 + * along with this program; if not, contact:                          *
 + *                                                                    *
 + * Free Software Foundation           Voice:  +1-617-542-5942         *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652         *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                     *
 + **********************************************************************/
 +
 +/** @addtogroup ContentPlugins
 +    @{ */
 +/** @addtogroup RegisterPlugin Register Page
 +    @{ */
 +/** @file gnc-plugin-page-register.c
 +    @brief  Functions providing a register page for the GnuCash UI
 +    @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
 +    @author Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
 +*/
 +
 +#include <config.h>
 +
 +#include <libguile.h>
 +#include "guile-mappings.h"
 +#include <gtk/gtk.h>
 +#include <glib/gi18n.h>
 +#include "swig-runtime.h"
 +
 +#include "gnc-plugin-page-register.h"
 +/*################## Added for Reg2 #################*/
 +#include "gnc-plugin-page-register2.h"
 +/*################## Added for Reg2 #################*/
 +#include "gnc-plugin-register.h"
 +#include "gnc-plugin-menu-additions.h"
 +#include "gnc-plugin-page-report.h"
 +
 +#include "dialog-account.h"
 +#include "dialog-find-account.h"
 +#include "dialog-find-transactions.h"
 +#include "dialog-print-check.h"
 +#include "dialog-transfer.h"
 +#include "dialog-utils.h"
 +#include "assistant-stock-split.h"
 +#include "gnc-component-manager.h"
 +#include "gnc-date.h"
 +#include "gnc-date-edit.h"
 +#include "gnc-engine.h"
 +#include "gnc-event.h"
 +#include "gnc-gnome-utils.h"
 +#include "gnc-gobject-utils.h"
 +#include "gnc-gui-query.h"
 +#include "gnc-icons.h"
 +#include "gnc-split-reg.h"
 +#include "gnc-prefs.h"
 +#include "gnc-ui-util.h"
 +#include "gnc-window.h"
 +#include "gnc-main-window.h"
 +#include "gnc-session.h"
 +#include "gnc-warnings.h"
 +#include "gnucash-sheet.h"
 +#include "dialog-lot-viewer.h"
 +#include "Scrub.h"
 +#include "ScrubBusiness.h"
 +#include "qof.h"
 +#include "window-reconcile.h"
 +#include "window-autoclear.h"
 +#include "window-report.h"
 +#include "engine-helpers.h"
 +#include "qofbookslots.h"
 +
 +/* This static indicates the debugging module that this .o belongs to.  */
 +static QofLogModule log_module = GNC_MOD_GUI;
 +
 +#define DEFAULT_LINES_AMOUNT         50
 +
 +static void gnc_plugin_page_register_class_init (GncPluginPageRegisterClass *klass);
 +static void gnc_plugin_page_register_init (GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_finalize (GObject *object);
 +
 +/* static Account *gnc_plugin_page_register_get_current_account (GncPluginPageRegister *page); */
 +
 +static GtkWidget *gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page);
 +static void gnc_plugin_page_register_destroy_widget (GncPluginPage *plugin_page);
 +static void gnc_plugin_page_register_window_changed (GncPluginPage *plugin_page, GtkWidget *window);
 +static void gnc_plugin_page_register_save_page (GncPluginPage *plugin_page, GKeyFile *file, const gchar *group);
 +static GncPluginPage *gnc_plugin_page_register_recreate_page (GtkWidget *window, GKeyFile *file, const gchar *group);
 +static void gnc_plugin_page_register_update_edit_menu (GncPluginPage *page, gboolean hide);
 +static gboolean gnc_plugin_page_register_finish_pending (GncPluginPage *page);
 +
 +static gchar *gnc_plugin_page_register_get_tab_name (GncPluginPage *plugin_page);
 +static gchar *gnc_plugin_page_register_get_tab_color (GncPluginPage *plugin_page);
 +static gchar *gnc_plugin_page_register_get_long_name (GncPluginPage *plugin_page);
 +
 +static void gnc_plugin_page_register_summarybar_position_changed(gpointer prefs, gchar* pref, gpointer user_data);
 +
 +/* Callbacks for the "Sort By" dialog */
 +void gnc_plugin_page_register_sort_button_cb(GtkToggleButton *button, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_sort_response_cb(GtkDialog *dialog, gint response, GncPluginPageRegister *plugin_page);
 +void gnc_plugin_page_register_sort_order_save_cb(GtkToggleButton *button, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_sort_order_reverse_cb(GtkToggleButton *button, GncPluginPageRegister *page);
 +
 +static gchar *gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page);
 +void gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar *sort_order);
 +static gboolean gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page);
 +void gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean reverse_order);
 +
 +/* Callbacks for the "Filter By" dialog */
 +void gnc_plugin_page_register_filter_select_range_cb(GtkRadioButton *button, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_filter_start_cb(GtkWidget *radio, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_filter_end_cb(GtkWidget *radio, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_filter_response_cb(GtkDialog *dialog, gint response, GncPluginPageRegister *plugin_page);
 +void gnc_plugin_page_register_filter_status_all_cb(GtkButton *button, GncPluginPageRegister *plugin_page);
 +void gnc_plugin_page_register_filter_status_one_cb(GtkToggleButton *button, GncPluginPageRegister *page);
 +void gnc_plugin_page_register_filter_save_cb(GtkToggleButton *button, GncPluginPageRegister *page);
 +
 +static time64 gnc_plugin_page_register_filter_dmy2time (char *date_string);
 +static gchar *gnc_plugin_page_register_filter_time2dmy (time64 raw_time);
 +static gchar *gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page);
 +void gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter);
 +
 +static void gnc_ppr_update_status_query (GncPluginPageRegister *page);
 +static void gnc_ppr_update_date_query (GncPluginPageRegister *page);
 +
 +/* Command callbacks */
 +static void gnc_plugin_page_register_cmd_print_check (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_cut (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_copy (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_paste (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_edit_account (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_find_account (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_find_transactions (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_cut_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_copy_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_paste_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_void_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_unvoid_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_reverse_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_style_changed (GtkAction *action, GtkRadioAction *current, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_style_double_line (GtkToggleAction *action, GncPluginPageRegister *plugin_page);
 +
 +static void gnc_plugin_page_register_cmd_reconcile (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_autoclear (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_transfer (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_stock_split (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_lots (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_enter_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_cancel_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_delete_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_blank_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_duplicate_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_reinitialize_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_expand_transaction (GtkToggleAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_exchange_rate (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_jump (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_schedule (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_scrub_all (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_scrub_current (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_account_report (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_transaction_report (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_associate_file_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_associate_location_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +static void gnc_plugin_page_register_cmd_execassociated_transaction (GtkAction *action, GncPluginPageRegister *plugin_page);
 +
 +static void gnc_plugin_page_help_changed_cb( GNCSplitReg *gsr, GncPluginPageRegister *register_page );
 +static void gnc_plugin_page_register_refresh_cb (GHashTable *changes, gpointer user_data);
 +static void gnc_plugin_page_register_close_cb (gpointer user_data);
 +
 +static void gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page);
 +static void gppr_account_destroy_cb (Account *account);
 +static void gnc_plugin_page_register_event_handler (QofInstance *entity,
 +        QofEventId event_type,
 +        GncPluginPageRegister *page,
 +        GncEventData *ed);
 +
 +/************************************************************/
 +/*                          Actions                         */
 +/************************************************************/
 +
 +#define CUT_TRANSACTION_LABEL            N_("Cu_t Transaction")
 +#define COPY_TRANSACTION_LABEL           N_("_Copy Transaction")
 +#define PASTE_TRANSACTION_LABEL          N_("_Paste Transaction")
 +#define DUPLICATE_TRANSACTION_LABEL      N_("Dup_licate Transaction")
 +#define DELETE_TRANSACTION_LABEL         N_("_Delete Transaction")
 +#define ASSOCIATE_TRANSACTION_FILE_LABEL      N_("_Associate File with Transaction")
 +#define ASSOCIATE_TRANSACTION_LOCATION_LABEL  N_("_Associate Location with Transaction")
 +#define EXECASSOCIATED_TRANSACTION_LABEL N_("_Open Associated File/Location")
 +#define CUT_SPLIT_LABEL                  N_("Cu_t Split")
 +#define COPY_SPLIT_LABEL                 N_("_Copy Split")
 +#define PASTE_SPLIT_LABEL                N_("_Paste Split")
 +#define DUPLICATE_SPLIT_LABEL            N_("Dup_licate Split")
 +#define DELETE_SPLIT_LABEL               N_("_Delete Split")
 +#define CUT_TRANSACTION_TIP              N_("Cut the selected transaction into clipboard")
 +#define COPY_TRANSACTION_TIP             N_("Copy the selected transaction into clipboard")
 +#define PASTE_TRANSACTION_TIP            N_("Paste the transaction from the clipboard")
 +#define DUPLICATE_TRANSACTION_TIP        N_("Make a copy of the current transaction")
 +#define DELETE_TRANSACTION_TIP           N_("Delete the current transaction")
 +#define ASSOCIATE_TRANSACTION_FILE_TIP   N_("Associate a file with the current transaction")
 +#define ASSOCIATE_TRANSACTION_LOCATION_TIP    N_("Associate a location with the current transaction")
 +#define EXECASSOCIATED_TRANSACTION_TIP   N_("Open the associated file or location with the current transaction")
 +#define CUT_SPLIT_TIP                    N_("Cut the selected split into clipboard")
 +#define COPY_SPLIT_TIP                   N_("Copy the selected split into clipboard")
 +#define PASTE_SPLIT_TIP                  N_("Paste the split from the clipboard")
 +#define DUPLICATE_SPLIT_TIP              N_("Make a copy of the current split")
 +#define DELETE_SPLIT_TIP                 N_("Delete the current split")
 +
 +static GtkActionEntry gnc_plugin_page_register_actions [] =
 +{
 +    /* File menu */
 +
 +    {
 +        "FilePrintAction", "document-print", N_("_Print Checks..."), "<primary>p", NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_print_check)
 +    },
 +
 +    /* Edit menu */
 +
 +    {
 +        "EditCutAction", "edit-cut", N_("Cu_t"), "<primary>X",
 +        N_("Cut the current selection and copy it to clipboard"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_cut)
 +    },
 +    {
 +        "EditCopyAction", "edit-copy", N_("_Copy"), "<primary>C",
 +        N_("Copy the current selection to clipboard"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_copy)
 +    },
 +    {
 +        "EditPasteAction", "edit-paste", N_("_Paste"), "<primary>V",
 +        N_("Paste the clipboard content at the cursor position"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_paste)
 +    },
 +    {
 +        "EditEditAccountAction", GNC_ICON_EDIT_ACCOUNT, N_("Edit _Account"), "<primary>e",
 +        N_("Edit the selected account"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_edit_account)
 +    },
 +    {
 +        "EditFindAccountAction", "edit-find", N_("F_ind Account"), "<primary>i",
 +        N_("Find an account"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_find_account)
 +    },
 +    {
 +        "EditFindTransactionsAction", "edit-find", N_("_Find..."), "<primary>f",
 +        N_("Find transactions with a search"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_find_transactions)
 +    },
 +
 +    /* Transaction menu */
 +
 +    {
 +        "CutTransactionAction", "edit-cut", CUT_TRANSACTION_LABEL, "",
 +        CUT_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_cut_transaction)
 +    },
 +    {
 +        "CopyTransactionAction", "edit-copy", COPY_TRANSACTION_LABEL, "",
 +        COPY_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_copy_transaction)
 +    },
 +    {
 +        "PasteTransactionAction", "edit-paste", PASTE_TRANSACTION_LABEL, "",
 +        PASTE_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_paste_transaction)
 +    },
 +    {
 +        "DuplicateTransactionAction", "edit-copy", DUPLICATE_TRANSACTION_LABEL, "",
 +        DUPLICATE_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_duplicate_transaction)
 +    },
 +    {
 +        "DeleteTransactionAction", "edit-delete", DELETE_TRANSACTION_LABEL, NULL,
 +        DELETE_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_delete_transaction)
 +    },
 +    {
 +        "RemoveTransactionSplitsAction", "edit-clear", N_("Remo_ve Other Splits"), NULL,
 +        N_("Remove all splits in the current transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_reinitialize_transaction)
 +    },
 +    {
 +        "RecordTransactionAction", "list-add", N_("_Enter Transaction"), NULL,
 +        N_("Record the current transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_enter_transaction)
 +    },
 +    {
 +        "CancelTransactionAction", "process-stop", N_("Ca_ncel Transaction"), NULL,
 +        N_("Cancel the current transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_cancel_transaction)
 +    },
 +    {
 +        "VoidTransactionAction", NULL, N_("_Void Transaction"), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_void_transaction)
 +    },
 +    {
 +        "UnvoidTransactionAction", NULL, N_("_Unvoid Transaction"), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_unvoid_transaction)
 +    },
 +    {
 +        "ReverseTransactionAction", NULL, N_("Add _Reversing Transaction"), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_reverse_transaction)
 +    },
 +    {
 +        "AssociateTransactionFileAction", NULL, ASSOCIATE_TRANSACTION_FILE_LABEL, NULL,
 +        ASSOCIATE_TRANSACTION_FILE_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_associate_file_transaction)
 +    },
 +    {
 +        "AssociateTransactionLocationAction", NULL, ASSOCIATE_TRANSACTION_LOCATION_LABEL, NULL,
 +        ASSOCIATE_TRANSACTION_LOCATION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_associate_location_transaction)
 +    },
 +    {
 +        "ExecAssociatedTransactionAction", NULL, EXECASSOCIATED_TRANSACTION_LABEL, NULL,
 +        EXECASSOCIATED_TRANSACTION_TIP,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_execassociated_transaction)
 +    },
 +
 +    /* View menu */
 +
 +    {
 +        "ViewSortByAction", NULL, N_("_Sort By..."), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_view_sort_by)
 +    },
 +    {
 +        "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_view_filter_by)
 +    },
 +
 +    /* Actions menu */
 +
 +    {
 +        "ActionsTransferAction", GNC_ICON_TRANSFER, N_("_Transfer..."), "<primary>t",
 +        N_("Transfer funds from one account to another"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_transfer)
 +    },
 +    {
 +        "ActionsReconcileAction", "edit-select-all", N_("_Reconcile..."), NULL,
 +        N_("Reconcile the selected account"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_reconcile)
 +    },
 +    {
 +        "ActionsAutoClearAction", "edit-select-all", N_("_Auto-clear..."), NULL,
 +        N_("Automatically clear individual transactions, so as to reach a certain cleared amount"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_autoclear)
 +    },
 +    {
 +        "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
 +        N_("Record a stock split or a stock merger"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_stock_split)
 +    },
 +    {
 +        "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
 +        N_("Bring up the lot viewer/editor window"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_lots)
 +    },
 +    {
 +        "BlankTransactionAction", "go-bottom", N_("_Blank Transaction"), "<primary>Page_Down",
 +        N_("Move to the blank transaction at the bottom of the register"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_blank_transaction)
 +    },
 +    {
 +        "EditExchangeRateAction", NULL, N_("Edit E_xchange Rate"), NULL,
 +        N_("Edit the exchange rate for the current transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_exchange_rate)
 +    },
 +    {
 +        "JumpTransactionAction", GNC_ICON_JUMP_TO, N_("_Jump"), NULL,
 +        N_("Jump to the corresponding transaction in the other account"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_jump)
 +    },
 +    {
 +        "ScheduleTransactionAction", GNC_ICON_SCHEDULE, N_("Sche_dule..."), NULL,
 +        N_("Create a Scheduled Transaction with the current transaction as a template"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_schedule)
 +    },
 +    {
-         "ScrubAllAction", NULL, N_("_All transactions"), NULL, NULL,
++        "ScrubAllAction", NULL,
++		/* Translators: The following 2 are Scrub actions in register view */
++		N_("_All transactions"), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_scrub_all)
 +    },
 +    {
 +        "ScrubCurrentAction", NULL, N_("_This transaction"), NULL, NULL,
 +        G_CALLBACK (gnc_plugin_page_register_cmd_scrub_current)
 +    },
 +
 +    /* Reports menu */
 +
 +    {
 +        "ReportsAccountReportAction", NULL, N_("Account Report"), NULL,
 +        N_("Open a register report for this Account"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_account_report)
 +    },
 +    {
 +        "ReportsAcctTransReportAction", NULL, N_("Account Report - Single Transaction"), NULL,
 +        N_("Open a register report for the selected Transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_transaction_report)
 +    },
 +};
 +
 +static guint gnc_plugin_page_register_n_actions = G_N_ELEMENTS (gnc_plugin_page_register_actions);
 +
 +static GtkToggleActionEntry toggle_entries[] =
 +{
 +    {
 +        "ViewStyleDoubleLineAction", NULL, N_("_Double Line"), NULL,
 +        N_("Show two lines of information for each transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_style_double_line), FALSE
 +    },
 +
 +    {
 +        "SplitTransactionAction", GNC_ICON_SPLIT_TRANS, N_("S_plit Transaction"), NULL,
 +        N_("Show all splits in the current transaction"),
 +        G_CALLBACK (gnc_plugin_page_register_cmd_expand_transaction), FALSE
 +    },
 +};
 +
 +static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
 +
 +static GtkRadioActionEntry radio_entries_2 [] =
 +{
 +    /* Translators: This is a menu item in the View menu */
 +    {
 +        "ViewStyleBasicAction", NULL, N_("_Basic Ledger"), NULL,
 +        N_("Show transactions on one or two lines"), REG_STYLE_LEDGER
 +    },
 +    /* Translators: This is a menu item in the View menu */
 +    {
 +        "ViewStyleAutoSplitAction", NULL, N_("_Auto-Split Ledger"), NULL,
 +        N_("Show transactions on one or two lines and expand the current transaction"), REG_STYLE_AUTO_LEDGER
 +    },
 +    /* Translators: This is a menu item in the View menu */
 +    {
 +        "ViewStyleJournalAction", NULL, N_("Transaction _Journal"), NULL,
 +        N_("Show expanded transactions with all splits"), REG_STYLE_JOURNAL
 +    }
 +};
 +
 +static guint n_radio_entries_2 = G_N_ELEMENTS (radio_entries_2);
 +
 +/** These are the "important" actions provided by the register page.
 + *  Their labels will appear when the toolbar is set to "Icons and
 + *  important text" (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode. */
 +static const gchar *important_actions[] =
 +{
 +    "SplitTransactionAction",
 +    NULL,
 +};
 +
 +/** Actions that require an account to be selected before they are
 + *  enabled. */
 +static const gchar *actions_requiring_account[] =
 +{
 +    "EditEditAccountAction",
 +    "ActionsReconcileAction",
 +    "ActionsAutoClearAction",
 +    "ActionsLotsAction",
 +    NULL
 +};
 +
 +/** View Style actions */
 +static const gchar *view_style_actions[] =
 +{
 +    "ViewStyleBasicAction",
 +    "ViewStyleAutoSplitAction",
 +    "ViewStyleJournalAction",
 +    NULL
 +};
 +
 +/** Short labels for use on the toolbar buttons. */
 +static action_toolbar_labels toolbar_labels[] =
 +{
 +    { "ActionsTransferAction", 	            N_("Transfer") },
 +    { "RecordTransactionAction", 	        N_("Enter") },
 +    { "CancelTransactionAction", 	        N_("Cancel") },
 +    { "DeleteTransactionAction", 	        N_("Delete") },
 +	{ "DuplicateTransactionAction",         N_("Duplicate") },
 +    { "SplitTransactionAction",             N_("Split") },
 +    { "ScheduleTransactionAction",          N_("Schedule") },
 +    { "BlankTransactionAction",             N_("Blank") },
 +    { "ActionsReconcileAction",             N_("Reconcile") },
 +    { "ActionsAutoClearAction",             N_("Auto-clear") },
 +    { "AssociateTransactionFileAction",     N_("Associate File") },
 +    { "AssociateTransactionLocationAction", N_("Associate Location") },
 +    { "ExecAssociatedTransactionAction",    N_("Open File/Location") },
 +    { NULL, NULL },
 +};
 +
 +struct status_action
 +{
 +    const char *action_name;
 +    int value;
 +    GtkWidget *widget;
 +};
 +
 +static struct status_action status_actions[] =
 +{
 +    { "filter_status_reconciled",   CLEARED_RECONCILED, NULL },
 +    { "filter_status_cleared",      CLEARED_CLEARED, NULL },
 +    { "filter_status_voided",       CLEARED_VOIDED, NULL },
 +    { "filter_status_frozen",       CLEARED_FROZEN, NULL },
 +    { "filter_status_unreconciled", CLEARED_NO, NULL },
 +    { NULL, 0, NULL },
 +};
 +
 +#define CLEARED_VALUE "cleared_value"
 +#define DEFAULT_FILTER "0x001f"
 +#define DEFAULT_SORT_ORDER "BY_STANDARD"
 +
 +/************************************************************/
 +/*                      Data Structures                     */
 +/************************************************************/
 +
 +typedef struct GncPluginPageRegisterPrivate
 +{
 +    GNCLedgerDisplay *ledger;
 +    GNCSplitReg *gsr;
 +
 +    GtkWidget *widget;
 +
 +    gint event_handler_id;
 +    gint component_manager_id;
 +    GncGUID key;  /* The guid of the Account we're watching */
 +
 +    gint lines_default;
 +    gboolean read_only;
 +
 +    struct
 +    {
 +        GtkWidget *dialog;
 +        GtkWidget *num_radio;
 +        GtkWidget *act_radio;
 +        SortType original_sort_type;
 +        gboolean original_save_order;
 +        gboolean save_order;
 +        gboolean reverse_order;
 +        gboolean original_reverse_order;
 +    } sd;
 +
 +    struct
 +    {
 +        GtkWidget *dialog;
 +        GtkWidget *table;
 +        GtkWidget *start_date_choose;
 +        GtkWidget *start_date_today;
 +        GtkWidget *start_date;
 +        GtkWidget *end_date_choose;
 +        GtkWidget *end_date_today;
 +        GtkWidget *end_date;
 +        cleared_match_t original_cleared_match;
 +        cleared_match_t cleared_match;
 +        time64 original_start_time;
 +        time64 original_end_time;
 +        time64 start_time;
 +        time64 end_time;
 +        gboolean original_save_filter;
 +        gboolean save_filter;
 +    } fd;
 +} GncPluginPageRegisterPrivate;
 +
 +#define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o)  \
 +   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterPrivate))
 +
 +static GObjectClass *parent_class = NULL;
 +
 +/************************************************************/
 +/*                      Implementation                      */
 +/************************************************************/
 +
 +GType
 +gnc_plugin_page_register_get_type (void)
 +{
 +    static GType gnc_plugin_page_register_type = 0;
 +
 +    if (gnc_plugin_page_register_type == 0)
 +    {
 +        static const GTypeInfo our_info =
 +        {
 +            sizeof (GncPluginPageRegisterClass),
 +            NULL,
 +            NULL,
 +            (GClassInitFunc) gnc_plugin_page_register_class_init,
 +            NULL,
 +            NULL,
 +            sizeof (GncPluginPageRegister),
 +            0,
 +            (GInstanceInitFunc) gnc_plugin_page_register_init
 +        };
 +
 +        gnc_plugin_page_register_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
 +                                        GNC_PLUGIN_PAGE_REGISTER_NAME,
 +                                        &our_info, 0);
 +    }
 +
 +    return gnc_plugin_page_register_type;
 +}
 +
 +static GncPluginPage *
 +gnc_plugin_page_register_new_common (GNCLedgerDisplay *ledger)
 +{
 +    GncPluginPageRegister *register_page;
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPage *plugin_page;
 +    GNCSplitReg *gsr;
 +    const GList *item;
 +    GList *book_list;
 +    gchar *label;
 +    gchar *label_color;
 +    QofQuery *q;
 +
 +    /* Is there an existing page? */
 +    gsr = gnc_ledger_display_get_user_data (ledger);
 +    if (gsr)
 +    {
 +        item = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
 +        for ( ; item; item = g_list_next(item))
 +        {
 +            register_page = (GncPluginPageRegister *)item->data;
 +            priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
 +            if (priv->gsr == gsr)
 +                return GNC_PLUGIN_PAGE(register_page);
 +        }
 +    }
 +
 +    register_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER, NULL);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
 +    priv->ledger = ledger;
 +    priv->key = *guid_null();
 +
 +    plugin_page = GNC_PLUGIN_PAGE(register_page);
 +    label = gnc_plugin_page_register_get_tab_name(plugin_page);
 +    gnc_plugin_page_set_page_name(plugin_page, label);
 +    g_free(label);
 +
 +    label_color = gnc_plugin_page_register_get_tab_color(plugin_page);
 +    gnc_plugin_page_set_page_color(plugin_page, label_color);
 +    g_free(label_color);
 +
 +    label = gnc_plugin_page_register_get_long_name(plugin_page);
 +    gnc_plugin_page_set_page_long_name(plugin_page, label);
 +    g_free(label);
 +
 +    q = gnc_ledger_display_get_query (ledger);
 +    book_list = qof_query_get_books (q);
 +    for (item = book_list; item; item = g_list_next(item))
 +        gnc_plugin_page_add_book (plugin_page, (QofBook *)item->data);
 +    // Do not free the list. It is owned by the query.
 +
 +    priv->component_manager_id = 0;
 +    return plugin_page;
 +}
 +
 +GncPluginPage *
 +gnc_plugin_page_register_new (Account *account, gboolean subaccounts)
 +{
 +    GNCLedgerDisplay *ledger;
 +    GncPluginPage *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +/*################## Added for Reg2 #################*/
 +    const GList *item;
 +    GncPluginPageRegister2  *new_register_page;
 +/*################## Added for Reg2 #################*/
 +
 +    ENTER("account=%p, subaccounts=%s", account,
 +          subaccounts ? "TRUE" : "FALSE");
 +
 +/*################## Added for Reg2 #################*/
 +    // We test for the new register being open here, ie matching account guids
 +    item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER2_NAME);
 +    for ( ; item; item = g_list_next (item))
 +    {
 +        Account *new_account;
 +        new_register_page = (GncPluginPageRegister2 *)item->data;
 +        new_account = gnc_plugin_page_register2_get_account (new_register_page);
 +
 +        if (guid_equal (xaccAccountGetGUID (account), xaccAccountGetGUID (new_account)))
 +        {
 +            gnc_error_dialog (NULL, "%s",
 +                         _("You have tried to open an account in the old register while it is open in the new register."));
 +            return NULL;
 +        }
 +    }
 +/*################## Added for Reg2 #################*/
 +
 +    if (subaccounts)
 +        ledger = gnc_ledger_display_subaccounts (account);
 +    else
 +        ledger = gnc_ledger_display_simple (account);
 +
 +    page = gnc_plugin_page_register_new_common(ledger);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    priv->key = *xaccAccountGetGUID(account);
 +
 +    LEAVE("%p", page);
 +    return page;
 +}
 +
 +GncPluginPage *
 +gnc_plugin_page_register_new_gl (void)
 +{
 +    GNCLedgerDisplay *ledger;
 +
 +    ledger = gnc_ledger_display_gl ();
 +    return gnc_plugin_page_register_new_common(ledger);
 +}
 +
 +GncPluginPage *
 +gnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger)
 +{
 +    return gnc_plugin_page_register_new_common(ledger);
 +}
 +
 +static void
 +gnc_plugin_page_register_class_init (GncPluginPageRegisterClass *klass)
 +{
 +    GObjectClass *object_class = G_OBJECT_CLASS (klass);
 +    GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
 +
 +    parent_class = g_type_class_peek_parent (klass);
 +
 +    object_class->finalize = gnc_plugin_page_register_finalize;
 +
 +    gnc_plugin_class->tab_icon        = GNC_ICON_ACCOUNT;
 +    gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_REGISTER_NAME;
 +    gnc_plugin_class->create_widget   = gnc_plugin_page_register_create_widget;
 +    gnc_plugin_class->destroy_widget  = gnc_plugin_page_register_destroy_widget;
 +    gnc_plugin_class->window_changed  = gnc_plugin_page_register_window_changed;
 +    gnc_plugin_class->save_page       = gnc_plugin_page_register_save_page;
 +    gnc_plugin_class->recreate_page   = gnc_plugin_page_register_recreate_page;
 +    gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register_update_edit_menu;
 +    gnc_plugin_class->finish_pending  = gnc_plugin_page_register_finish_pending;
 +
 +    g_type_class_add_private(klass, sizeof(GncPluginPageRegisterPrivate));
 +
 +    gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
 +}
 +
 +static void
 +gnc_plugin_page_register_init (GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPage *parent;
 +    GtkActionGroup *action_group;
 +    gboolean use_new;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +
 +    /* Init parent declared variables */
 +    parent = GNC_PLUGIN_PAGE(plugin_page);
 +    use_new = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_NEW);
 +    g_object_set(G_OBJECT(plugin_page),
 +                 "page-name",      _("General Journal"),
 +                 "page-uri",       "default:",
 +                 "ui-description", "gnc-plugin-page-register-ui.xml",
 +                 "use-new-window", use_new,
 +                 NULL);
 +
 +    /* Create menu and toolbar information */
 +    action_group =
 +        gnc_plugin_page_create_action_group(parent,
 +                                            "GncPluginPageRegisterActions");
 +    gtk_action_group_add_actions (action_group, gnc_plugin_page_register_actions,
 +                                  gnc_plugin_page_register_n_actions, plugin_page);
 +    gtk_action_group_add_toggle_actions (action_group,
 +                                         toggle_entries, n_toggle_entries,
 +                                         plugin_page);
 +    gtk_action_group_add_radio_actions (action_group,
 +                                        radio_entries_2, n_radio_entries_2,
 +                                        REG_STYLE_LEDGER,
 +                                        G_CALLBACK(gnc_plugin_page_register_cmd_style_changed),
 +                                        plugin_page);
 +
 +    gnc_plugin_init_short_names (action_group, toolbar_labels);
 +    gnc_plugin_set_important_actions (action_group, important_actions);
 +
 +    priv->lines_default     = DEFAULT_LINES_AMOUNT;
 +    priv->read_only         = FALSE;
 +    priv->fd.cleared_match  = CLEARED_ALL;
 +}
 +
 +static void
 +gnc_plugin_page_register_finalize (GObject *object)
 +{
 +    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (object));
 +
 +    ENTER("object %p", object);
 +
 +    G_OBJECT_CLASS (parent_class)->finalize (object);
 +    LEAVE(" ");
 +}
 +
 +Account *
 +gnc_plugin_page_register_get_account (GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    Account *leader;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    ledger_type = gnc_ledger_display_type (priv->ledger);
 +    leader = gnc_ledger_display_leader (priv->ledger);
 +
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        return leader;
 +    return NULL;
 +}
 +
 +/* This is the list of actions which are switched inactive in a read-only book. */
 +static const char* readonly_inactive_actions[] =
 +{
 +    "EditCutAction",
 +    "EditPasteAction",
 +    "CutTransactionAction",
 +    "PasteTransactionAction",
 +    "DuplicateTransactionAction",
 +    "DeleteTransactionAction",
 +    "RemoveTransactionSplitsAction",
 +    "RecordTransactionAction",
 +    "CancelTransactionAction",
 +    "UnvoidTransactionAction",
 +    "VoidTransactionAction",
 +    "ReverseTransactionAction",
 +    "ActionsTransferAction",
 +    "ActionsReconcileAction",
 +    "ActionsStockSplitAction",
 +    "ScheduleTransactionAction",
 +    "ScrubAllAction",
 +    "ScrubCurrentAction",
 +    "AssociateTransactionFileAction",
 +    "AssociateTransactionLocationAction",
 +    NULL
 +};
 +
 +/* This is the list of actions whose text needs to be changed based on whether */
 +/* the current cursor class is transaction or split. */
 +static const char* tran_vs_split_actions[] =
 +{
 +    "CutTransactionAction",
 +    "CopyTransactionAction",
 +    "PasteTransactionAction",
 +    "DuplicateTransactionAction",
 +    "DeleteTransactionAction",
 +    NULL
 +};
 +
 +/* This is the list of labels for when the current cursor class is transaction. */
 +static const char* tran_action_labels[] =
 +{
 +    CUT_TRANSACTION_LABEL,
 +    COPY_TRANSACTION_LABEL,
 +    PASTE_TRANSACTION_LABEL,
 +    DUPLICATE_TRANSACTION_LABEL,
 +    DELETE_TRANSACTION_LABEL,
 +    ASSOCIATE_TRANSACTION_FILE_LABEL,
 +    ASSOCIATE_TRANSACTION_LOCATION_LABEL,
 +    EXECASSOCIATED_TRANSACTION_LABEL,
 +    NULL
 +};
 +
 +/* This is the list of tooltips for when the current cursor class is transaction. */
 +static const char* tran_action_tips[] =
 +{
 +    CUT_TRANSACTION_TIP,
 +    COPY_TRANSACTION_TIP,
 +    PASTE_TRANSACTION_TIP,
 +    DUPLICATE_TRANSACTION_TIP,
 +    DELETE_TRANSACTION_TIP,
 +    ASSOCIATE_TRANSACTION_FILE_TIP,
 +    ASSOCIATE_TRANSACTION_LOCATION_TIP,
 +    EXECASSOCIATED_TRANSACTION_TIP,
 +    NULL
 +};
 +
 +/* This is the list of labels for when the current cursor class is split. */
 +static const char* split_action_labels[] =
 +{
 +    CUT_SPLIT_LABEL,
 +    COPY_SPLIT_LABEL,
 +    PASTE_SPLIT_LABEL,
 +    DUPLICATE_SPLIT_LABEL,
 +    DELETE_SPLIT_LABEL,
 +    NULL
 +};
 +
 +/* This is the list of tooltips for when the current cursor class is split. */
 +static const char* split_action_tips[] =
 +{
 +    CUT_SPLIT_TIP,
 +    COPY_SPLIT_TIP,
 +    PASTE_SPLIT_TIP,
 +    DUPLICATE_SPLIT_TIP,
 +    DELETE_SPLIT_TIP,
 +    NULL
 +};
 +
 +static void
 +gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    GtkAction *action;
 +    gboolean expanded, voided;
 +    Transaction *trans;
 +    const char *uri;
 +
 +    /* Set 'Split Transaction' */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    expanded = gnc_split_register_current_trans_expanded(reg);
 +    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
 +                                         "SplitTransactionAction");
 +    gtk_action_set_sensitive (action, reg->style == REG_STYLE_LEDGER);
 +    g_signal_handlers_block_by_func
 +    (action, gnc_plugin_page_register_cmd_expand_transaction, page);
 +    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), expanded);
 +    g_signal_handlers_unblock_by_func
 +    (action, gnc_plugin_page_register_cmd_expand_transaction, page);
 +
 +    /* Set 'Void' and 'Unvoid' */
 +    trans = gnc_split_register_get_current_trans(reg);
 +    voided = xaccTransHasSplitsInState(trans, VREC);
 +    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
 +                                         "VoidTransactionAction");
 +    gtk_action_set_sensitive (GTK_ACTION(action), !voided);
 +
 +    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
 +                                         "UnvoidTransactionAction");
 +    gtk_action_set_sensitive (GTK_ACTION(action), voided);
 +
 +    /* Set 'ExecAssociated' */
 +    uri = xaccTransGetAssociation(trans);
 +    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
 +                                         "ExecAssociatedTransactionAction");
 +    if (g_strcmp0 (uri, "") != 0 && g_strcmp0 (uri, NULL) != 0)
 +        gtk_action_set_sensitive (GTK_ACTION(action), TRUE);
 +    else
 +        gtk_action_set_sensitive (GTK_ACTION(action), FALSE);
 +
 +    /* If we are in a readonly book, make any modifying action inactive */
 +    if (qof_book_is_readonly(gnc_get_current_book()))
 +    {
 +        const char **iter;
 +        for (iter = readonly_inactive_actions; *iter; ++iter)
 +        {
 +            /* Set the action's sensitivity */
 +            GtkAction *action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), *iter);
 +            gtk_action_set_sensitive(action, FALSE);
 +        }
 +    }
 +
 +    /* Modifying action descriptions based on cursor class */
 +    {
 +        const char **iter, **label_iter, **tooltip_iter;
 +        gboolean curr_label_trans = FALSE;
 +        CursorClass cursor_class = gnc_split_register_get_current_cursor_class (reg);
 +        iter = tran_vs_split_actions;
 +        action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), *iter);
 +        label_iter = tran_action_labels;
 +        if (g_strcmp0 (gtk_action_get_label(action), _(*label_iter)) == 0)
 +            curr_label_trans = TRUE;
 +        if ((cursor_class == CURSOR_CLASS_SPLIT) && curr_label_trans)
 +        {
 +            label_iter = split_action_labels;
 +            tooltip_iter = split_action_tips;
 +            for (iter = tran_vs_split_actions; *iter; ++iter)
 +            {
 +                /* Adjust the action's label and tooltip */
 +                action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), *iter);
 +                gtk_action_set_label(action, _(*label_iter));
 +                gtk_action_set_tooltip(action, _(*tooltip_iter));
 +                ++label_iter;
 +                ++tooltip_iter;
 +            }
 +        }
 +        else if ((cursor_class == CURSOR_CLASS_TRANS) && !curr_label_trans)
 +        {
 +            label_iter = tran_action_labels;
 +            tooltip_iter = tran_action_tips;
 +            for (iter = tran_vs_split_actions; *iter; ++iter)
 +            {
 +                /* Adjust the action's label and tooltip */
 +                action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), *iter);
 +                gtk_action_set_label(action, _(*label_iter));
 +                gtk_action_set_tooltip(action, _(*tooltip_iter));
 +                ++label_iter;
 +                ++tooltip_iter;
 +            }
 +        }
 +    }
 +}
 +
 +static void
 +gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv ;
 +    GtkActionGroup *action_group;
 +    GtkAction *action;
 +    Account *account;
 +    SplitRegister *reg;
 +    GNCLedgerDisplayType ledger_type;
 +    int i;
 +    gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    account = gnc_plugin_page_register_get_account (page);
 +    action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
 +    gnc_plugin_update_actions(action_group, actions_requiring_account,
 +                              "sensitive", is_readwrite && account != NULL);
 +
 +    /* Set "style" radio button */
 +    ledger_type = gnc_ledger_display_type(priv->ledger);
 +    gnc_plugin_update_actions(action_group, view_style_actions,
 +                              "sensitive", ledger_type == LD_SINGLE);
 +
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    for (i = n_radio_entries_2 - 1; i > 0; i--)
 +    {
 +        DEBUG(" index %d: comparing %x to %x", i, radio_entries_2[i].value,
 +              reg->style);
 +        if (radio_entries_2[i].value == reg->style)
 +        {
 +            DEBUG("match");
 +            break;
 +        }
 +    }
 +
 +    /* Either a match was found, or fell out with i = 0 */
 +    action = gtk_action_group_get_action(action_group, radio_entries_2[i].name);
 +    g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
 +    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
 +    g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_changed, page);
 +
 +    /* Set "double line" toggle button */
 +    action = gtk_action_group_get_action (action_group,
 +                                          "ViewStyleDoubleLineAction");
 +    g_signal_handlers_block_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
 +    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION(action), reg->use_double_line);
 +    g_signal_handlers_unblock_by_func(action, gnc_plugin_page_register_cmd_style_double_line, page);
 +}
 +
 +/* Virtual Functions */
 +
 +static GtkWidget *
 +gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GncWindow *gnc_window;
 +    guint numRows;
 +    GtkWidget *gsr;
 +    SplitRegister *reg;
 +    Account *acct;
 +    gchar **filter;
 +    gchar *order;
 +    int filter_changed = 0;
 +
 +    ENTER("page %p", plugin_page);
 +    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    if (priv->widget != NULL)
 +    {
 +        LEAVE("existing widget %p", priv->widget);
 +        return priv->widget;
 +    }
 +
 +    priv->widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 +    gtk_box_set_homogeneous (GTK_BOX (priv->widget), FALSE);
 +    gtk_widget_show (priv->widget);
 +
 +    // Set the style context for this page so it can be easily manipulated with css
 +    gnc_widget_set_style_context (GTK_WIDGET(priv->widget), "GncRegisterPage");
 +
 +    numRows = priv->lines_default;
 +    numRows = MIN(numRows, DEFAULT_LINES_AMOUNT);
 +
 +    gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window);
 +    gsr = gnc_split_reg_new(priv->ledger,
 +                            gnc_window_get_gtk_window(gnc_window),
 +                            numRows, priv->read_only);
 +    priv->gsr = (GNCSplitReg *)gsr;
 +    gtk_widget_show (gsr);
 +    gtk_box_pack_start (GTK_BOX (priv->widget), gsr, TRUE, TRUE, 0);
 +
 +    g_signal_connect (G_OBJECT (gsr), "help-changed",
 +                      G_CALLBACK ( gnc_plugin_page_help_changed_cb ),
 +                      page );
 +
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    gnc_split_register_config(reg, reg->type, reg->style,
 +                              reg->use_double_line);
 +    gnc_ledger_display_refresh(priv->ledger);
 +
 +    gnc_plugin_page_register_ui_initial_state (page);
 +    gnc_plugin_page_register_ui_update (NULL, page);
 +
 +    ledger_type = gnc_ledger_display_type (priv->ledger);
 +
 +    if (ledger_type == LD_SINGLE || ledger_type == LD_SUBACCOUNT)
 +    {
 +        /* Set the sort order for the split register and status of save order button */
 +        priv->sd.save_order = FALSE;
 +        order = gnc_plugin_page_register_get_sort_order(plugin_page);
 +
 +        PINFO("Loaded Sort order is %s", order);
 +
 +        gnc_split_reg_set_sort_type(priv->gsr, SortTypefromString(order));
 +
 +        if (order && (g_strcmp0 (order, DEFAULT_SORT_ORDER) != 0))
 +            priv->sd.save_order = TRUE;
 +
 +        priv->sd.original_save_order = priv->sd.save_order;
 +        g_free(order);
 +
 +        priv->sd.reverse_order = gnc_plugin_page_register_get_sort_reversed(plugin_page);
 +        gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order);
 +        if (priv->sd.reverse_order)
 +            priv->sd.save_order = TRUE;
 +
 +        priv->sd.original_reverse_order = priv->sd.reverse_order;
 +
 +        /* Set the filter for the split register and status of save filter button */
 +        priv->fd.save_filter = FALSE;
 +
 +        filter = g_strsplit(gnc_plugin_page_register_get_filter(plugin_page), ",", -1);
 +
 +        PINFO("Loaded Filter Status is %s", filter[0]);
 +
 +        priv->fd.cleared_match = (gint)g_ascii_strtoll( filter[0], NULL, 16 );
 +
 +        if (filter[0] && (g_strcmp0 (filter[0], DEFAULT_FILTER) != 0))
 +            filter_changed = filter_changed + 1;
 +
 +        if (filter[1] && (g_strcmp0 (filter[1], "0") != 0 ))
 +        {
 +            PINFO("Loaded Filter Start Date is %s", filter[1]);
 +
 +            priv->fd.start_time = gnc_plugin_page_register_filter_dmy2time (filter[1] );
 +            priv->fd.start_time = gnc_time64_get_day_start(priv->fd.start_time);
 +            filter_changed = filter_changed + 1;
 +
 +            if (filter[2] && (g_strcmp0 (filter[2], "0") != 0 ))
 +            {
 +                PINFO("Loaded Filter End Date is %s", filter[2]);
 +
 +                priv->fd.end_time = gnc_plugin_page_register_filter_dmy2time (filter[2] );
 +                priv->fd.end_time = gnc_time64_get_day_end(priv->fd.end_time);
 +                filter_changed = filter_changed + 1;
 +            }
 +        }
 +
 +        if (filter_changed != 0)
 +            priv->fd.save_filter = TRUE;
 +
 +        priv->fd.original_save_filter = priv->fd.save_filter;
 +        g_strfreev(filter);
 +
 +        /* Update Query with Filter Status and Dates */
 +        gnc_ppr_update_status_query (page);
 +        gnc_ppr_update_date_query(page);
 +    }
 +
 +    plugin_page->summarybar = gsr_create_summary_bar(priv->gsr);
 +    if (plugin_page->summarybar)
 +    {
 +        gtk_widget_show_all(plugin_page->summarybar);
 +        gtk_box_pack_start(GTK_BOX (priv->widget), plugin_page->summarybar,
 +                           FALSE, FALSE, 0);
 +
 +        gnc_plugin_page_register_summarybar_position_changed (NULL, NULL, page);
 +        gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
 +                               GNC_PREF_SUMMARYBAR_POSITION_TOP,
 +                               gnc_plugin_page_register_summarybar_position_changed,
 +                               page);
 +        gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
 +                               GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
 +                               gnc_plugin_page_register_summarybar_position_changed,
 +                               page);
 +    }
 +
 +    priv->event_handler_id = qof_event_register_handler
 +                             ((QofEventHandler)gnc_plugin_page_register_event_handler, page);
 +    priv->component_manager_id =
 +        gnc_register_gui_component(GNC_PLUGIN_PAGE_REGISTER_NAME,
 +                                   gnc_plugin_page_register_refresh_cb,
 +                                   gnc_plugin_page_register_close_cb,
 +                                   page);
 +    gnc_gui_component_set_session (priv->component_manager_id,
 +                                   gnc_get_current_session());
 +    acct = gnc_plugin_page_register_get_account(page);
 +    if (acct)
 +        gnc_gui_component_watch_entity (
 +            priv->component_manager_id, xaccAccountGetGUID(acct),
 +            QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
 +
 +    gnc_split_reg_set_moved_cb
 +    (priv->gsr, (GFunc)gnc_plugin_page_register_ui_update, page);
 +
 +    /* DRH - Probably lots of other stuff from regWindowLedger should end up here. */
 +    LEAVE(" ");
 +    return priv->widget;
 +}
 +
 +static void
 +gnc_plugin_page_register_destroy_widget (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("page %p", plugin_page);
 +    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +
 +    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
 +                                 GNC_PREF_SUMMARYBAR_POSITION_TOP,
 +                                 gnc_plugin_page_register_summarybar_position_changed,
 +                                 page);
 +    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
 +                                 GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
 +                                 gnc_plugin_page_register_summarybar_position_changed,
 +                                 page);
 +    if (priv->widget == NULL)
 +        return;
 +
 +    if (priv->component_manager_id)
 +    {
 +        gnc_unregister_gui_component(priv->component_manager_id);
 +        priv->component_manager_id = 0;
 +    }
 +
 +    if (priv->event_handler_id)
 +    {
 +        qof_event_unregister_handler(priv->event_handler_id);
 +        priv->event_handler_id = 0;
 +    }
 +
 +    if (priv->sd.dialog)
 +    {
 +        gtk_widget_destroy(priv->sd.dialog);
 +        memset(&priv->sd, 0, sizeof(priv->sd));
 +    }
 +
 +    if (priv->fd.dialog)
 +    {
 +        gtk_widget_destroy(priv->fd.dialog);
 +        memset(&priv->fd, 0, sizeof(priv->fd));
 +    }
 +
 +    gtk_widget_hide(priv->widget);
 +    gnc_ledger_display_close (priv->ledger);
 +    priv->ledger = NULL;
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_window_changed (GncPluginPage *plugin_page,
 +        GtkWidget *window)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
 +
 +    page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    priv->gsr->window =
 +        GTK_WIDGET(gnc_window_get_gtk_window(GNC_WINDOW(window)));
 +}
 +
 +static const gchar *style_names[] =
 +{
 +    "Ledger",
 +    "Auto Ledger",
 +    "Journal",
 +    NULL
 +};
 +
 +#define KEY_REGISTER_TYPE       "RegisterType"
 +#define KEY_ACCOUNT_NAME        "AccountName"
 +#define KEY_REGISTER_STYLE      "RegisterStyle"
 +#define KEY_DOUBLE_LINE         "DoubleLineMode"
 +
 +#define LABEL_ACCOUNT		"Account"
 +#define LABEL_SUBACCOUNT	"SubAccount"
 +#define LABEL_GL		"GL"
 +#define LABEL_SEARCH		"Search"
 +
 +
 +/** Save enough information about this register page that it can be
 + *  recreated next time the user starts gnucash.
 + *
 + *  @param plugin_page The page to save.
 + *
 + *  @param key_file A pointer to the GKeyFile data structure where the
 + *  page information should be written.
 + *
 + *  @param group_name The group name to use when saving data. */
 +static void
 +gnc_plugin_page_register_save_page (GncPluginPage *plugin_page,
 +                                    GKeyFile *key_file,
 +                                    const gchar *group_name)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    SplitRegister *reg;
 +    Account *leader;
 +
 +    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +    g_return_if_fail (key_file != NULL);
 +    g_return_if_fail (group_name != NULL);
 +
 +    ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
 +          group_name);
 +
 +    page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    ledger_type = gnc_ledger_display_type(priv->ledger);
 +    if (ledger_type > LD_GL)
 +    {
 +        LEAVE("Unsupported ledger type");
 +        return;
 +    }
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +    {
 +        const gchar *label;
 +        gchar* name;
 +        label = (ledger_type == LD_SINGLE) ? LABEL_ACCOUNT : LABEL_SUBACCOUNT;
 +        leader = gnc_ledger_display_leader(priv->ledger);
 +        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE, label);
 +        name = gnc_account_get_full_name(leader);
 +        g_key_file_set_string(key_file, group_name, KEY_ACCOUNT_NAME, name);
 +        g_free(name);
 +    }
 +    else if (reg->type == GENERAL_JOURNAL)
 +    {
 +        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
 +                              LABEL_GL);
 +    }
 +    else if (reg->type == SEARCH_LEDGER)
 +    {
 +        g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
 +                              LABEL_SEARCH);
 +    }
 +    else
 +    {
 +        LEAVE("Unsupported register type");
 +        return;
 +    }
 +
 +    g_key_file_set_string(key_file, group_name, KEY_REGISTER_STYLE,
 +                          style_names[reg->style]);
 +    g_key_file_set_boolean(key_file, group_name, KEY_DOUBLE_LINE,
 +                           reg->use_double_line);
 +
 +    LEAVE(" ");
 +}
 +
 +
 +/** Read and restore the edit menu settings on the specified register
 + *  page.  This function will restore the register style (ledger, auto
 + *  ledger, journal) and whether or not the register is in double line
 + *  mode.  It should eventually restore the "filter by" and "sort by
 + *  settings.
 + *
 + *  @param page The register being restored.
 + *
 + *  @param key_file A pointer to the GKeyFile data structure where the
 + *  page information should be read.
 + *
 + *  @param group_name The group name to use when restoring data. */
 +static void
 +gnc_plugin_page_register_restore_edit_menu (GncPluginPage *page,
 +        GKeyFile *key_file,
 +        const gchar *group_name)
 +{
 +    GtkAction *action;
 +    GError *error = NULL;
 +    gchar *style_name;
 +    gint i;
 +    gboolean use_double_line;
 +
 +    ENTER(" ");
 +
 +    /* Convert the style name to an index */
 +    style_name = g_key_file_get_string(key_file, group_name,
 +                                       KEY_REGISTER_STYLE, &error);
 +    for (i = 0 ; style_names[i]; i++)
 +    {
 +        if (g_ascii_strcasecmp(style_name, style_names[i]) == 0)
 +        {
 +            DEBUG("Found match for style name: %s", style_name);
 +            break;
 +        }
 +    }
 +    g_free(style_name);
 +
 +    /* Update the style menu action for this page */
 +    if (i <= REG_STYLE_JOURNAL)
 +    {
 +        DEBUG("Setting style: %d", i);
 +        action = gnc_plugin_page_get_action(page, radio_entries_2[i].name);
 +        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
 +    }
 +
 +    /* Update the  double line action on this page */
 +    use_double_line =
 +        g_key_file_get_boolean(key_file, group_name, KEY_DOUBLE_LINE, &error);
 +    DEBUG("Setting double_line_mode: %d", use_double_line);
 +    action = gnc_plugin_page_get_action(page, "ViewStyleDoubleLineAction");
 +    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), use_double_line);
 +
 +    LEAVE(" ");
 +}
 +
 +
 +/** Create a new register page based on the information saved during a
 + *  previous instantiation of gnucash.
 + *
 + *  @param window The window where this page should be installed.
 + *
 + *  @param key_file A pointer to the GKeyFile data structure where the
 + *  page information should be read.
 + *
 + *  @param group_name The group name to use when restoring data. */
 +static GncPluginPage *
 +gnc_plugin_page_register_recreate_page (GtkWidget *window,
 +                                        GKeyFile *key_file,
 +                                        const gchar *group_name)
 +{
 +    GncPluginPage *page;
 +    GError *error = NULL;
 +    gchar *reg_type, *acct_name;
 +    Account *account;
 +    QofBook *book;
 +    gboolean include_subs;
 +
 +    g_return_val_if_fail(key_file, NULL);
 +    g_return_val_if_fail(group_name, NULL);
 +    ENTER("key_file %p, group_name %s", key_file, group_name);
 +
 +    /* Create the new page. */
 +    reg_type = g_key_file_get_string(key_file, group_name,
 +                                     KEY_REGISTER_TYPE, &error);
 +    DEBUG("Page type: %s", reg_type);
 +    if ((g_ascii_strcasecmp(reg_type, LABEL_ACCOUNT) == 0) ||
 +            (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0))
 +    {
 +        include_subs = (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0);
 +        DEBUG("Include subs: %d", include_subs);
 +        acct_name = g_key_file_get_string(key_file, group_name,
 +                                          KEY_ACCOUNT_NAME, &error);
 +        book = qof_session_get_book(gnc_get_current_session());
 +        account = gnc_account_lookup_by_full_name(gnc_book_get_root_account(book),
 +                  acct_name);
 +        g_free(acct_name);
 +        if (account == NULL)
 +        {
 +            LEAVE("Bad account name");
 +            g_free(reg_type);
 +            return NULL;
 +        }
 +        page = gnc_plugin_page_register_new (account, include_subs);
 +    }
 +    else if (g_ascii_strcasecmp(reg_type, LABEL_GL) == 0)
 +    {
 +        page = gnc_plugin_page_register_new_gl();
 +    }
 +    else
 +    {
 +        LEAVE("Bad ledger type");
 +        g_free(reg_type);
 +        return NULL;
 +    }
 +    g_free(reg_type);
 +
 +    /* Recreate page in given window */
 +    gnc_plugin_page_set_use_new_window(page, FALSE);
 +
 +    /* Install it now so we can them manipulate the created widget */
 +    gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
 +
 +    /* Now update the page to the last state it was in */
 +    gnc_plugin_page_register_restore_edit_menu(page, key_file, group_name);
 +    LEAVE(" ");
 +    return page;
 +}
 +
 +
 +/*
 + * Based on code from Epiphany (src/ephy-window.c)
 + */
 +static void
 +gnc_plugin_page_register_update_edit_menu (GncPluginPage *page, gboolean hide)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPageRegister *reg_page;
 +    GtkAction *action;
 +    gboolean can_copy = FALSE, can_cut = FALSE, can_paste = FALSE;
 +    gboolean has_selection;
 +    gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
 +
 +    reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
 +    has_selection = gnucash_register_has_selection (priv->gsr->reg);
 +
 +    can_copy = has_selection;
 +    can_cut = is_readwrite && has_selection;
 +    can_paste = is_readwrite;
 +
 +    action = gnc_plugin_page_get_action (page, "EditCopyAction");
 +    gtk_action_set_sensitive (action, can_copy);
 +    gtk_action_set_visible (action, !hide || can_copy);
 +    action = gnc_plugin_page_get_action (page, "EditCutAction");
 +    gtk_action_set_sensitive (action, can_cut);
 +    gtk_action_set_visible (action, !hide || can_cut);
 +    action = gnc_plugin_page_get_action (page, "EditPasteAction");
 +    gtk_action_set_sensitive (action, can_paste);
 +    gtk_action_set_visible (action,  !hide || can_paste);
 +}
 +
 +
 +static gboolean
 +gnc_plugin_page_register_finish_pending (GncPluginPage *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPageRegister *reg_page;
 +    SplitRegister *reg;
 +    GtkWidget *dialog, *window;
 +    const gchar *name;
 +    gint response;
 +
 +    reg_page = GNC_PLUGIN_PAGE_REGISTER(page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(reg_page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +
 +    if (!reg || !gnc_split_register_changed(reg))
 +        return TRUE;
 +
 +    name = gnc_plugin_page_register_get_tab_name(page);
 +    window = gnc_plugin_page_get_window(page);
 +    dialog = gtk_message_dialog_new(GTK_WINDOW(window),
 +                                    GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                    GTK_MESSAGE_WARNING,
 +                                    GTK_BUTTONS_NONE,
 +                                    /* Translators: %s is the name
 +                                       of the tab page */
 +                                    _("Save changes to %s?"), name);
 +    gtk_message_dialog_format_secondary_text
 +    (GTK_MESSAGE_DIALOG(dialog),
 +     "%s",
 +     _("This register has pending changes to a transaction. "
 +       "Would you like to save the changes to this transaction, "
 +       "discard the transaction, or cancel the operation?"));
 +    gnc_gtk_dialog_add_button(dialog, _("_Discard Transaction"),
 +                              "edit-delete", GTK_RESPONSE_REJECT);
 +    gtk_dialog_add_button(GTK_DIALOG(dialog),
 +                          _("_Cancel"), GTK_RESPONSE_CANCEL);
 +    gnc_gtk_dialog_add_button(dialog, _("_Save Transaction"),
 +                              "document-save", GTK_RESPONSE_ACCEPT);
 +
 +    response = gtk_dialog_run(GTK_DIALOG(dialog));
 +    gtk_widget_destroy(dialog);
 +
 +    switch (response)
 +    {
 +    case GTK_RESPONSE_ACCEPT:
 +        gnc_split_register_save(reg, TRUE);
 +        return TRUE;
 +
 +    case GTK_RESPONSE_REJECT:
 +        gnc_split_register_cancel_cursor_trans_changes(reg);
 +        gnc_split_register_save (reg, TRUE);
 +        return TRUE;
 +
 +    default:
 +        return FALSE;
 +    }
 +}
 +
 +
 +static gchar *
 +gnc_plugin_page_register_get_tab_name (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    SplitRegister *reg;
 +    Account *leader;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    reg = gnc_ledger_display_get_split_register (ld);
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    switch (ledger_type)
 +    {
 +    case LD_SINGLE:
 +        return g_strdup(xaccAccountGetName (leader));
 +
 +    case LD_SUBACCOUNT:
 +        return g_strdup_printf("%s+", xaccAccountGetName (leader));
 +
 +    case LD_GL:
 +        switch (reg->type)
 +        {
 +        case GENERAL_JOURNAL:
 +        case INCOME_LEDGER:
 +            return g_strdup(_("General Journal"));
 +        case PORTFOLIO_LEDGER:
 +            return g_strdup(_("Portfolio"));
 +        case SEARCH_LEDGER:
 +            return g_strdup(_("Search Results"));
 +        default:
 +            break;
 +        }
 +        break;
 +
 +    default:
 +        break;
 +    }
 +
 +    return g_strdup(_("unknown"));
 +}
 +
 +static gchar *
 +gnc_plugin_page_register_get_tab_color (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +    const char* color;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +    color = NULL;
 +
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        color = xaccAccountGetColor (leader);
 +
 +    return g_strdup(color ? color : "Not Set");
 +}
 +
 +static gchar *
 +gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +    const char* filter;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +    filter = NULL;
 +
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        filter = xaccAccountGetFilter (leader);
 +
 +    return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
 +}
 +
 +void
 +gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter )
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +    gchar *default_filter;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    if (leader != NULL)
 +    {
 +        default_filter = g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
 +
 +        if (!filter || (g_strcmp0 (filter, default_filter) == 0))
 +            xaccAccountSetFilter (leader, NULL);
 +        else
 +            xaccAccountSetFilter (leader, filter);
 +
 +        g_free (default_filter);
 +    }
 +
 +    return;
 +}
 +
 +static gchar *
 +gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +    const char* sort_order;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +    sort_order = NULL;
 +
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        sort_order = xaccAccountGetSortOrder (leader);
 +
 +    return g_strdup(sort_order ? sort_order : DEFAULT_SORT_ORDER);
 +}
 +
 +void
 +gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar *sort_order )
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    if (leader != NULL)
 +    {
 +        if (!sort_order || (g_strcmp0 (sort_order, DEFAULT_SORT_ORDER) == 0))
 +            xaccAccountSetSortOrder (leader, NULL);
 +        else
 +            xaccAccountSetSortOrder (leader, sort_order);
 +    }
 +
 +    return;
 +}
 +
 +static gboolean
 +gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +    gboolean sort_reversed = FALSE;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), FALSE);
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        sort_reversed = xaccAccountGetSortReversed (leader);
 +
 +    return sort_reversed;
 +}
 +
 +void
 +gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean reverse_order)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    if (leader != NULL)
 +        xaccAccountSetSortReversed (leader, reverse_order);
 +
 +    return;
 +}
 +
 +static gchar *
 +gnc_plugin_page_register_get_long_name (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    GNCLedgerDisplay *ld;
 +    Account *leader;
 +
 +    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    ld = priv->ledger;
 +    ledger_type = gnc_ledger_display_type (ld);
 +    leader = gnc_ledger_display_leader (ld);
 +
 +    switch (ledger_type)
 +    {
 +    case LD_SINGLE:
 +        return gnc_account_get_full_name (leader);
 +
 +    case LD_SUBACCOUNT:
 +    {
 +        gchar *account_full_name = gnc_account_get_full_name (leader);
 +        gchar *return_string = g_strdup_printf("%s+", account_full_name);
 +        g_free ((gpointer *) account_full_name);
 +        return return_string;
 +    }
 +
 +    default:
 +        break;
 +    }
 +
 +    return NULL;
 +}
 +
 +static void
 +gnc_plugin_page_register_summarybar_position_changed (gpointer prefs, gchar* pref, gpointer user_data)
 +{
 +    GncPluginPage *plugin_page;
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +    GtkPositionType position = GTK_POS_BOTTOM;
 +
 +    g_return_if_fail (user_data != NULL);
 +
 +    if (!GNC_IS_PLUGIN_PAGE (user_data))
 +        return;
 +
 +    plugin_page = GNC_PLUGIN_PAGE (user_data);
 +    page = GNC_PLUGIN_PAGE_REGISTER (user_data);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
 +
 +    if (priv == NULL)
 +       return;
 +
 +    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_SUMMARYBAR_POSITION_TOP))
 +        position = GTK_POS_TOP;
 +
 +    gtk_box_reorder_child (GTK_BOX (priv->widget),
 +                          plugin_page->summarybar,
 +                          (position == GTK_POS_TOP ? 0 : -1) );
 +}
 +
 +/** This function is called to get the query associated with this
 + *  plugin page.
 + *
 + *  @param page A pointer to the GncPluginPage.
 + */
 +Query *
 +gnc_plugin_page_register_get_query (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
 +
 +    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    return gnc_ledger_display_get_query (priv->ledger);
 +}
 +
 +/************************************************************/
 +/*                     "Sort By" Dialog                     */
 +/************************************************************/
 +
 +/** This function is called whenever the number source book options is changed
 + *  to adjust the displayed labels. Since the book option change may change the
 + *  query sort, the gnc_split_reg_set_sort_type_force function is called to
 + *  ensure the page is refreshed.
 + *
 + *  @param new_val A pointer to the boolean for the new value of the book option.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this sort order dialog.
 + */
 +static void
 +gnc_plugin_page_register_sort_book_option_changed (gpointer new_val,
 +                                                    gpointer user_data)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPageRegister *page = user_data;
 +    gboolean *new_data = (gboolean*)new_val;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (*new_data)
 +    {
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.num_radio), _("Transaction Number"));
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.act_radio), _("Number/Action"));
 +    }
 +    else
 +    {
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.num_radio), _("Number"));
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.act_radio), _("Action"));
 +    }
 +    gnc_split_reg_set_sort_type_force (priv->gsr, priv->gsr->sort_type, TRUE);
 +}
 +
 +/** This function is called when the "Sort By..." dialog is closed.
 + *  If the dialog was closed by any method other than clicking the OK
 + *  button, the original sorting order will be restored.
 + *
 + *  @param dialog A pointer to the dialog box.
 + *
 + *  @param response A numerical value indicating why the dialog box was closed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister associated with
 + *  this dialog box.
 + */
 +void
 +gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog,
 +        gint response,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPage *plugin_page;
 +    SortType type;
 +    const gchar *order;
 +
 +    g_return_if_fail(GTK_IS_DIALOG(dialog));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER(" ");
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    plugin_page = GNC_PLUGIN_PAGE(page);
 +
 +    if (response != GTK_RESPONSE_OK)
 +    {
 +        /* Restore the original sort order */
 +        gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.original_reverse_order);
 +        priv->sd.reverse_order = priv->sd.original_reverse_order;
 +        gnc_split_reg_set_sort_type(priv->gsr, priv->sd.original_sort_type);
 +        priv->sd.save_order = priv->sd.original_save_order;
 +    }
 +    else
 +    {
 +        priv->sd.original_save_order = priv->sd.save_order;
 +
 +        if (priv->sd.save_order)
 +        {
 +            type = gnc_split_reg_get_sort_type(priv->gsr);
 +            order = SortTypeasString(type);
 +            gnc_plugin_page_register_set_sort_order (plugin_page, order);
 +            gnc_plugin_page_register_set_sort_reversed (plugin_page, priv->sd.reverse_order);
 +        }
 +    }
 +    gnc_book_option_remove_cb(OPTION_NAME_NUM_FIELD_SOURCE,
 +                                gnc_plugin_page_register_sort_book_option_changed,
 +                                page);
 +    priv->sd.dialog = NULL;
 +    priv->sd.num_radio = NULL;
 +    priv->sd.act_radio = NULL;
 +    gtk_widget_destroy(GTK_WIDGET(dialog));
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called when a radio button in the "Sort By..."
 + *  dialog is clicked.
 + *
 + *  @param button The button that was toggled.
 + *
 + *  @param page A pointer to the GncPluginPageRegister associated with
 + *  this dialog box.
 + */
 +void
 +gnc_plugin_page_register_sort_button_cb (GtkToggleButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    const gchar *name;
 +    SortType type;
 +
 +    g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    name = gtk_buildable_get_name(GTK_BUILDABLE(button));
 +    ENTER("button %s(%p), page %p", name, button, page);
 +    type = SortTypefromString(name);
 +    gnc_split_reg_set_sort_type(priv->gsr, type);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called whenever the save sort order is checked
 + *  or unchecked which allows saving of the sort order.
 + *
 + *  @param button The toggle button that was changed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this sort order dialog.
 + */
 +void
 +gnc_plugin_page_register_sort_order_save_cb (GtkToggleButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("Save toggle button (%p), plugin_page %p", button, page);
 +
 +    /* Compute the new save sort order */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    if (gtk_toggle_button_get_active(button))
 +        priv->sd.save_order = TRUE;
 +    else
 +        priv->sd.save_order = FALSE;
 +    LEAVE(" ");
 +}
 +
 +/** This function is called whenever the reverse sort order is checked
 + *  or unchecked which allows reversing of the sort order.
 + *
 + *  @param button The toggle button that was changed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this sort order dialog.
 + */
 +void
 +gnc_plugin_page_register_sort_order_reverse_cb (GtkToggleButton *button,
 +        GncPluginPageRegister *page)
 +
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("Reverse toggle button (%p), plugin_page %p", button, page);
 +
 +    /* Compute the new save sort order */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    priv->sd.reverse_order = gtk_toggle_button_get_active(button);
 +    gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order);
 +    LEAVE(" ");
 +}
 +
 +/************************************************************/
 +/*                    "Filter By" Dialog                    */
 +/************************************************************/
 +
 +/** This function updates the "cleared match" term of the register
 + *  query.  It unconditionally removes any old "cleared match" query
 + *  term, then adds back a new query term if needed.  There seems to
 + *  be a bug in the current g2 register code such that when the number
 + *  of entries in the register doesn't fill up the window, the blank
 + *  space at the end of the window isn't correctly redrawn.  This
 + *  function works around that problem, but a root cause analysis
 + *  should probably be done.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +static void
 +gnc_ppr_update_status_query (GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GSList *param_list;
 +    Query *query;
 +
 +    ENTER(" ");
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    query = gnc_ledger_display_get_query( priv->ledger );
 +    if (!query)
 +    {
 +        LEAVE("no query found");
 +        return;
 +    }
 +
 +    /* Remove the old status match */
 +    param_list = qof_query_build_param_list (SPLIT_RECONCILE, NULL);
 +    if (param_list)
 +    {
 +        qof_query_purge_terms (query, param_list);
 +        g_slist_free(param_list);
 +    }
 +
 +    /* Install the new status match */
 +    if (priv->fd.cleared_match != CLEARED_ALL)
 +        xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QOF_QUERY_AND);
 +
 +    gnc_ledger_display_refresh (priv->ledger);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function updates the "date posted" term of the register
 + *  query.  It unconditionally removes any old "date posted" query
 + *  term, then adds back a new query term if needed.  There seems to
 + *  be a bug in the current g2 register code such that when the number
 + *  of entries in the register doesn't fill up the window, the blank
 + *  space at the end of the window isn't correctly redrawn.  This
 + *  function works around that problem, but a root cause analysis
 + *  should probably be done.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +static void
 +gnc_ppr_update_date_query (GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GSList *param_list;
 +    Query *query;
 +
 +    ENTER(" ");
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (!priv->ledger)
 +    {
 +        LEAVE("no ledger");
 +        return;
 +    }
 +
 +    query = gnc_ledger_display_get_query( priv->ledger );
 +    if (!query)
 +    {
 +        LEAVE("no query");
 +        return;
 +    }
 +
 +    /* Delete any existing old date spec. */
 +    param_list = qof_query_build_param_list(SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
 +    if (param_list)
 +    {
 +        qof_query_purge_terms (query, param_list);
 +        g_slist_free(param_list);
 +    }
 +
 +    if (priv->fd.start_time || priv->fd.end_time)
 +    {
 +        /* Build a new spec */
 +        xaccQueryAddDateMatchTT(query,
 +                                priv->fd.start_time != 0, priv->fd.start_time,
 +                                priv->fd.end_time != 0,   priv->fd.end_time,
 +                                QOF_QUERY_AND);
 +    }
 +
 +    gnc_ledger_display_refresh (priv->ledger);
 +    LEAVE(" ");
 +}
 +
 +
 +/* This function converts a time64 value date to a string */
 +static gchar *
 +gnc_plugin_page_register_filter_time2dmy ( time64 raw_time)
 +{
 +    struct tm * timeinfo;
 +    gchar date_string[11];
 +
 +    timeinfo = gnc_localtime (&raw_time);
 +    strftime (date_string, 11, "%d-%m-%Y", timeinfo);
 +    PINFO("Date string is %s", date_string);
 +    gnc_tm_free (timeinfo);
 +
 +    return g_strdup(date_string);
 +}
 +
 +
 +/* This function converts a string date to a time64 value */
 +static time64
 +gnc_plugin_page_register_filter_dmy2time (char *date_string)
 +{
 +    struct tm when;
 +
 +    PINFO("Date string is %s", date_string);
 +    memset (&when, 0, sizeof (when));
 +
 +    sscanf (date_string, "%d-%d-%d", &when.tm_mday,
 +	    &when.tm_mon, &when.tm_year);
 +
 +    when.tm_mon -= 1;
 +    when.tm_year -= 1900;
 +
 +    return gnc_mktime (&when);
 +}
 +
 +
 +/** This function is called whenever one of the status entries is
 + *  checked or unchecked.  It updates the status value maintained for
 + *  the filter dialog, and calls another function to do the work of
 + *  applying the change to the register itself.
 + *
 + *  @param button The toggle button that was changed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    const gchar *name;
 +    gint i, value;
 +
 +    g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    name = gtk_buildable_get_name(GTK_BUILDABLE(button));
 +    ENTER("toggle button %s (%p), plugin_page %p", name, button, page);
 +
 +    /* Determine what status bit to change */
 +    value = CLEARED_NONE;
 +    for (i = 0; status_actions[i].action_name; i++)
 +    {
 +        if (g_strcmp0(name, status_actions[i].action_name) == 0)
 +        {
 +            value = status_actions[i].value;
 +            break;
 +        }
 +    }
 +
 +    /* Compute the new match status */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (gtk_toggle_button_get_active(button))
 +        priv->fd.cleared_match |= value;
 +    else
 +        priv->fd.cleared_match &= ~value;
 +    gnc_ppr_update_status_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called whenever the "select all" status button is
 + *  clicked.  It updates all of the checkbox widgets, then updates the
 + *  query on the register.
 + *
 + *  @param button The button that was clicked.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_status_all_cb (GtkButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GtkWidget *widget;
 +    gint i;
 +
 +    g_return_if_fail(GTK_IS_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(button %p, page %p)", button, page);
 +
 +    /* Turn on all the check menu items */
 +    for (i = 0; status_actions[i].action_name; i++)
 +    {
 +        widget = status_actions[i].widget;
 +        g_signal_handlers_block_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
 +        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), TRUE);
 +        g_signal_handlers_unblock_by_func(widget, gnc_plugin_page_register_filter_status_one_cb, page);
 +    }
 +
 +    /* Set the requested status */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    priv->fd.cleared_match = CLEARED_ALL;
 +    gnc_ppr_update_status_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function computes the starting and ending times for the
 + *  filter by examining the dialog widgets to see which ones are
 + *  selected, and will pull times out of the data entry boxes if
 + *  necessary.  This function must exist to handle the case where the
 + *  "show all" button was Selected, and the user clicks on the "select
 + *  range" button.  Since it exists, it make sense for the rest of the
 + *  callbacks to take advantage of it.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +static void
 +get_filter_times(GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    time64 time_val;
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_choose)))
 +    {
 +        time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(priv->fd.start_date));
 +        time_val = gnc_time64_get_day_start(time_val);
 +        priv->fd.start_time = time_val;
 +    }
 +    else
 +    {
 +        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_today)))
 +        {
 +            priv->fd.start_time = gnc_time64_get_today_start();
 +        }
 +        else
 +        {
 +            priv->fd.start_time = 0;
 +        }
 +    }
 +
 +    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.end_date_choose)))
 +    {
 +        time_val = gnc_date_edit_get_date(GNC_DATE_EDIT(priv->fd.end_date));
 +        time_val = gnc_time64_get_day_end(time_val);
 +        priv->fd.end_time = time_val;
 +    }
 +    else
 +    {
 +        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_today)))
 +        {
 +            priv->fd.end_time = gnc_time64_get_today_end();
 +        }
 +        else
 +        {
 +            priv->fd.end_time = 0;
 +        }
 +    }
 +}
 +
 +
 +/** This function is called when the "select range" radio button
 + *  changes state.  Since there are only two choices in this radio
 + *  group, this one signal can be used to handle all cases.  This
 + *  function is responsible for setting the sensitivity of the table
 + *  of widgets underneath the "select range" choice, and updating the
 + *  time limitation on the register query.  This is handled by a
 + *  helper function when the radio button is selected (as potentially
 + *  all the widgets in the table need to be inspected), and is trivial
 + *  for the other case.
 + *
 + *  @param button A pointer to the "select range" radio button.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    gboolean active;
 +
 +    g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(button %p, page %p)", button, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
 +    gtk_widget_set_sensitive(priv->fd.table, active);
 +    if (active)
 +    {
 +        get_filter_times(page);
 +    }
 +    else
 +    {
 +        priv->fd.start_time = 0;
 +        priv->fd.end_time = 0;
 +    }
 +    gnc_ppr_update_date_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called when one of the start date entry widgets
 + *  is updated.  It simply calls common routines to determine the
 + *  start/end times and update the register query.
 + *
 + *  @param unused A pointer to a GncDateEntry widgets, but it could be
 + *  any widget.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +static void
 +gnc_plugin_page_register_filter_gde_changed_cb (GtkWidget *unused,
 +        GncPluginPageRegister *page)
 +{
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(widget %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(unused)), unused, page);
 +    get_filter_times(page);
 +    gnc_ppr_update_date_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called when one of the start date radio buttons
 + *  is selected.  It updates the sensitivity of the date entry widget,
 + *  then calls a common routine to determine the start/end times and
 + *  update the register query.
 + *
 + *  *Note: This function is actually called twice for each new radio
 + *  button selection.  The first time call is to uncheck the old
 + *  button, and the second time to check the new button.  This does
 + *  make a kind of sense, as radio buttons are nothing more than
 + *  linked toggle buttons where only one can be active.
 + *
 + *  @param radio The button whose state is changing.  This will be
 + *  the previously selected button the first of the pair of calls to
 + *  this function, and will be the newly selected button the second
 + *  time.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_start_cb (GtkWidget *radio,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    const gchar *name;
 +    gboolean active;
 +
 +    g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(radio)), radio, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
 +    {
 +        LEAVE("1st callback of pair. Defer to 2nd callback.");
 +        return;
 +    }
 +
 +    name = gtk_buildable_get_name(GTK_BUILDABLE(radio));
 +    active = ( g_strcmp0(name, g_strdup("start_date_choose")) == 0 ? 1 : 0 );
 +    gtk_widget_set_sensitive(priv->fd.start_date, active);
 +    get_filter_times(page);
 +    gnc_ppr_update_date_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called when one of the end date radio buttons is
 + *  selected.  It updates the sensitivity of the date entry widget,
 + *  then calls a common routine to determine the start/end times and
 + *  update the register query.
 + *
 + *  *Note: This function is actually called twice for each new radio
 + *  button selection.  The first time call is to uncheck the old
 + *  button, and the second time to check the new button.  This does
 + *  make a kind of sense, as radio buttons are nothing more than
 + *  linked toggle buttons where only one can be active.
 + *
 + *  @param radio The button whose state is changing.  This will be
 + *  the previously selected button the first of the pair of calls to
 + *  this function, and will be the newly selected button the second
 + *  time.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_end_cb (GtkWidget *radio,
 +                                        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    const gchar *name;
 +    gboolean active;
 +
 +    g_return_if_fail(GTK_IS_RADIO_BUTTON(radio));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(radio)), radio, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)))
 +    {
 +        LEAVE("1st callback of pair. Defer to 2nd callback.");
 +        return;
 +    }
 +
 +    name = gtk_buildable_get_name(GTK_BUILDABLE(radio));
 +    active = ( g_strcmp0(name, g_strdup("end_date_choose")) == 0 ? 1 : 0 );
 +    gtk_widget_set_sensitive(priv->fd.end_date, active);
 +    get_filter_times(page);
 +    gnc_ppr_update_date_query(page);
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called whenever the save status is checked
 + *  or unchecked. It will allow saving of the filter if required.
 + *
 + *  @param button The toggle button that was changed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister that is
 + *  associated with this filter dialog.
 + */
 +void
 +gnc_plugin_page_register_filter_save_cb (GtkToggleButton *button,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("Save toggle button (%p), plugin_page %p", button, page);
 +
 +    /* Compute the new save filter status */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (gtk_toggle_button_get_active(button))
 +        priv->fd.save_filter = TRUE;
 +    else
 +        priv->fd.save_filter = FALSE;
 +    LEAVE(" ");
 +}
 +
 +
 +/** This function is called when the "Filter By..." dialog is closed.
 + *  If the dialog was closed by any method other than clicking the OK
 + *  button, the original sorting order will be restored.
 + *
 + *  @param dialog A pointer to the dialog box.
 + *
 + *  @param response A numerical value indicating why the dialog box was closed.
 + *
 + *  @param page A pointer to the GncPluginPageRegister associated with
 + *  this dialog box.
 + */
 +void
 +gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
 +        gint response,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPage *plugin_page;
 +
 +    g_return_if_fail(GTK_IS_DIALOG(dialog));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER(" ");
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    plugin_page = GNC_PLUGIN_PAGE(page);
 +
 +    if (response != GTK_RESPONSE_OK)
 +    {
 +        /* Remove the old status match */
 +        priv->fd.cleared_match = priv->fd.original_cleared_match;
 +        gnc_ppr_update_status_query(page);
 +        priv->fd.start_time = priv->fd.original_start_time;
 +        priv->fd.end_time = priv->fd.original_end_time;
 +        priv->fd.save_filter = priv->fd.original_save_filter;
 +        gnc_ppr_update_date_query(page);
 +    }
 +    else
 +    {
 +        priv->fd.original_save_filter = priv->fd.save_filter;
 +
 +        if (priv->fd.save_filter)
 +        {
 +            gchar* filter;
 +            filter = g_strdup_printf("0x%04x", priv->fd.cleared_match);
 +
 +            if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_choose)) && priv->fd.start_time != 0 )
 +            {
 +                gchar *timeval = gnc_plugin_page_register_filter_time2dmy(priv->fd.start_time);
 +                filter = g_strconcat ( filter, ",", timeval, NULL);
 +                g_free (timeval);
 +            }
 +            else
 +                filter = g_strconcat ( filter, ",0", NULL);
 +
 +            if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.end_date_choose)) && priv->fd.end_time != 0 )
 +            {
 +                gchar *timeval = gnc_plugin_page_register_filter_time2dmy(priv->fd.end_time);
 +                filter = g_strconcat ( filter, ",", timeval, NULL);
 +                g_free (timeval);
 +            }
 +            else
 +                filter = g_strconcat ( filter, ",0", NULL);
 +
 +            PINFO("The filter to save is %s", filter);
 +
 +            gnc_plugin_page_register_set_filter (plugin_page, filter);
 +            g_free (filter);
 +        }
 +    }
 +    priv->fd.dialog = NULL;
 +    gtk_widget_destroy(GTK_WIDGET(dialog));
 +    LEAVE(" ");
 +}
 +
 +
 +/************************************************************/
 +/*                  Report Helper Functions                 */
 +/************************************************************/
 +
 +static char *
 +gnc_reg_get_name (GNCLedgerDisplay *ledger, gboolean for_window)
 +{
 +    Account *leader;
 +    SplitRegister *reg;
 +    gchar *account_name;
 +    gchar *reg_name;
 +    gchar *name;
 +    GNCLedgerDisplayType ledger_type;
 +
 +    if (ledger == NULL)
 +        return NULL;
 +
 +    reg = gnc_ledger_display_get_split_register (ledger);
 +    ledger_type = gnc_ledger_display_type (ledger);
 +
 +    switch (reg->type)
 +    {
 +    case GENERAL_JOURNAL:
 +    case INCOME_LEDGER:
 +        if (for_window)
 +            reg_name = _("General Journal");
 +        else
 +            reg_name = _("Transaction Report");
 +        break;
 +    case PORTFOLIO_LEDGER:
 +        if (for_window)
 +            reg_name = _("Portfolio");
 +        else
 +            reg_name = _("Portfolio Report");
 +        break;
 +    case SEARCH_LEDGER:
 +        if (for_window)
 +            reg_name = _("Search Results");
 +        else
 +            reg_name = _("Search Results Report");
 +        break;
 +    default:
 +        if (for_window)
 +            reg_name = _("Register");
 +        else
 +            reg_name = _("Transaction Report");
 +        break;
 +    }
 +
 +    leader = gnc_ledger_display_leader (ledger);
 +
 +    if ((leader != NULL) && (ledger_type != LD_GL))
 +    {
 +        account_name = gnc_account_get_full_name (leader);
 +
 +        if (ledger_type == LD_SINGLE)
 +        {
 +            name = g_strconcat (account_name, " - ", reg_name, NULL);
 +        }
 +        else
 +        {
 +            name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, NULL);
 +        }
 +        g_free(account_name);
 +    }
 +    else
 +        name = g_strdup (reg_name);
 +
 +    return name;
 +}
 +
 +static int
 +report_helper (GNCLedgerDisplay *ledger, Split *split, Query *query)
 +{
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (ledger);
 +    Account *account;
 +    char *str;
 +    const char *tmp;
 +    swig_type_info * qtype;
 +    SCM args;
 +    SCM func;
 +    SCM arg;
 +
 +    args = SCM_EOL;
 +
 +    func = scm_c_eval_string ("gnc:register-report-create");
 +    g_return_val_if_fail (scm_is_procedure (func), -1);
 +
 +    tmp = gnc_split_register_get_credit_string (reg);
 +    arg = scm_from_utf8_string (tmp ? tmp : _("Credit"));
 +    args = scm_cons (arg, args);
 +
 +    tmp = gnc_split_register_get_debit_string (reg);
 +    arg = scm_from_utf8_string (tmp ? tmp : _("Debit"));
 +    args = scm_cons (arg, args);
 +
 +    str = gnc_reg_get_name (ledger, FALSE);
 +    arg = scm_from_utf8_string (str ? str : "");
 +    args = scm_cons (arg, args);
 +    g_free (str);
 +
 +    arg = SCM_BOOL (reg->use_double_line);
 +    args = scm_cons (arg, args);
 +
 +    arg = SCM_BOOL (reg->type == GENERAL_JOURNAL || reg->type == INCOME_LEDGER
 +                                                || reg->type == SEARCH_LEDGER);
 +    args = scm_cons (arg, args);
 +
 +    arg = SCM_BOOL (reg->style == REG_STYLE_JOURNAL);
 +    args = scm_cons (arg, args);
 +
 +    if (!query)
 +    {
 +        query = gnc_ledger_display_get_query (ledger);
 +        g_return_val_if_fail (query != NULL, -1);
 +    }
 +
 +    qtype = SWIG_TypeQuery ("_p__QofQuery");
 +    g_return_val_if_fail (qtype, -1);
 +
 +    arg = SWIG_NewPointerObj (query, qtype, 0);
 +    args = scm_cons (arg, args);
 +    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 +
 +
 +    if (split)
 +    {
 +        qtype = SWIG_TypeQuery ("_p_Split");
 +        g_return_val_if_fail (qtype, -1);
 +        arg = SWIG_NewPointerObj (split, qtype, 0);
 +    }
 +    else
 +    {
 +        arg = SCM_BOOL_F;
 +    }
 +    args = scm_cons (arg, args);
 +    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 +
 +
 +    qtype = SWIG_TypeQuery ("_p_Account");
 +    g_return_val_if_fail (qtype, -1);
 +
 +    account = gnc_ledger_display_leader (ledger);
 +    arg = SWIG_NewPointerObj (account, qtype, 0);
 +    args = scm_cons (arg, args);
 +    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 +
 +
 +    /* Apply the function to the args */
 +    arg = scm_apply (func, args, SCM_EOL);
 +    g_return_val_if_fail (scm_is_exact (arg), -1);
 +
 +    return scm_to_int (arg);
 +}
 +
 +/************************************************************/
 +/*                     Command callbacks                    */
 +/************************************************************/
 +
 +static void
 +gnc_plugin_page_register_cmd_print_check (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister * reg;
 +    Split         * split;
 +    Transaction   * trans;
 +    GList         * splits = NULL, *item;
 +    GNCLedgerDisplayType ledger_type;
 +    Account       * account;
 +    GtkWidget     * window;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +    ledger_type = gnc_ledger_display_type(priv->ledger);
 +    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(plugin_page));
 +    if (ledger_type == LD_SINGLE || ledger_type == LD_SUBACCOUNT)
 +    {
 +        account  = gnc_plugin_page_register_get_account (plugin_page);
 +        split    = gnc_split_register_get_current_split(reg);
 +        trans    = xaccSplitGetParent(split);
 +
 +        if (split && trans)
 +        {
 +            if (xaccSplitGetAccount(split) == account)
 +            {
 +                splits = g_list_append(splits, split);
 +                gnc_ui_print_check_dialog_create(window, splits);
 +                g_list_free(splits);
 +            }
 +            else
 +            {
 +                /* This split is not for the account shown in this register.  Get the
 +                   split that anchors the transaction to the registor */
 +                split = gnc_split_register_get_current_trans_split(reg, NULL);
 +                if (split)
 +                {
 +                    splits = g_list_append(splits, split);
 +                    gnc_ui_print_check_dialog_create(window, splits);
 +                    g_list_free(splits);
 +                }
 +            }
 +        }
 +    }
 +    else if (ledger_type == LD_GL && reg->type == SEARCH_LEDGER)
 +    {
 +        Account *common_acct = NULL;
 +        splits = qof_query_run(gnc_ledger_display_get_query(priv->ledger));
 +        /* Make sure each split is from the same account */
 +        for (item = splits; item; item = g_list_next(item))
 +        {
 +            split = (Split *) item->data;
 +            if (common_acct == NULL)
 +            {
 +                common_acct = xaccSplitGetAccount(split);
 +            }
 +            else
 +            {
 +                if (xaccSplitGetAccount(split) != common_acct)
 +                {
 +                    GtkWidget *dialog;
 +                    gint response;
 +                    const gchar *title = _("Print checks from multiple accounts?");
 +                    const gchar *message =
 +                        _("This search result contains splits from more than one account. "
 +                          "Do you want to print the checks even though they are not all "
 +                          "from the same account?");
 +                    dialog = gtk_message_dialog_new(GTK_WINDOW(window),
 +                                                    GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                                    GTK_MESSAGE_WARNING,
 +                                                    GTK_BUTTONS_CANCEL,
 +                                                    "%s", title);
 +                    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                            "%s", message);
 +                    gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Print checks"),
 +                                          GTK_RESPONSE_YES);
 +                    response = gnc_dialog_run(GTK_DIALOG(dialog),
 +                                              GNC_PREF_WARN_CHECKPRINTING_MULTI_ACCT);
 +                    gtk_widget_destroy(dialog);
 +                    if (response != GTK_RESPONSE_YES)
 +                    {
 +                        LEAVE("Multiple accounts");
 +                        return;
 +                    }
 +                    break;
 +                }
 +            }
 +        }
 +        gnc_ui_print_check_dialog_create(window, splits);
 +    }
 +    else
 +    {
 +        gnc_error_dialog(window, "%s",
 +                         _("You can only print checks from a bank account register or search results."));
 +        LEAVE("Unsupported ledger type");
 +        return;
 +    }
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_cut (GtkAction *action,
 +                                  GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    gnucash_register_cut_clipboard(priv->gsr->reg);
 +    LEAVE("");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_copy (GtkAction *action,
 +                                   GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    gnucash_register_copy_clipboard(priv->gsr->reg);
 +    LEAVE("");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_paste (GtkAction *action,
 +                                    GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    gnucash_register_paste_clipboard(priv->gsr->reg);
 +    LEAVE("");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_edit_account (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    Account *account;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    account = gnc_plugin_page_register_get_account (page);
 +    if (account)
 +        gnc_ui_edit_account_window (account);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_find_account (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GtkWidget *window;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page));
 +
 +    gnc_find_account_dialog (window, NULL);
 +}
 +
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_find_transactions (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    gnc_ui_find_transactions_dialog_create(priv->ledger);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_cut_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    gnc_split_register_cut_current(reg);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_copy_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    gnc_split_register_copy_current(reg);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_paste_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    ENTER("(action %p, page %p)", action, page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    gnc_split_register_paste_current(reg);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GtkWidget *dialog, *entry;
 +    SplitRegister *reg;
 +    Transaction *trans;
 +    GtkBuilder *builder;
 +    const char *reason;
 +    gint result;
 +
 +    ENTER("(action %p, page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    trans = gnc_split_register_get_current_trans(reg);
 +    if (trans == NULL)
 +        return;
 +    if (xaccTransHasSplitsInState(trans, VREC))
 +        return;
 +    if (xaccTransHasReconciledSplits(trans) || xaccTransHasSplitsInState(trans, CREC))
 +    {
 +        gnc_error_dialog(NULL, "%s", _("You cannot void a transaction with reconciled or cleared splits."));
 +        return;
 +    }
 +    reason = xaccTransGetReadOnly (trans);
 +    if (reason)
 +    {
 +        gnc_error_dialog(NULL, _("This transaction is marked read-only with the comment: '%s'"), reason);
 +        return;
 +    }
 +
 +    if (!gnc_plugin_page_register_finish_pending(GNC_PLUGIN_PAGE(page)))
 +        return;
 +
 +    builder = gtk_builder_new();
 +    gnc_builder_add_from_file  (builder , "gnc-plugin-page-register.glade", "void_transaction_dialog");
 +    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "void_transaction_dialog"));
 +    entry = GTK_WIDGET(gtk_builder_get_object (builder, "reason"));
 +
 +    result = gtk_dialog_run(GTK_DIALOG(dialog));
 +    if (result == GTK_RESPONSE_OK)
 +    {
 +        reason = gtk_entry_get_text(GTK_ENTRY(entry));
 +        if (reason == NULL)
 +            reason = "";
 +        gnc_split_register_void_current_trans(reg, reason);
 +    }
 +
 +    /* All done. Get rid of it. */
 +    gtk_widget_destroy(dialog);
 +    g_object_unref(G_OBJECT(builder));
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_unvoid_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    Transaction *trans;
 +
 +    ENTER("(action %p, page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    trans = gnc_split_register_get_current_trans(reg);
 +    if (!xaccTransHasSplitsInState(trans, VREC))
 +        return;
 +    gnc_split_register_unvoid_current_trans(reg);
 +    LEAVE(" ");
 +}
 +
 +
 +static void
 +gnc_plugin_page_register_cmd_reverse_transaction (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    GNCSplitReg *gsr;
 +    Transaction *trans, *new_trans;
 +
 +    ENTER("(action %p, page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    trans = gnc_split_register_get_current_trans(reg);
 +    if (trans == NULL)
 +        return;
 +
 +    if (xaccTransGetReversedBy(trans))
 +    {
 +        gnc_error_dialog(gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page)), "%s",
 +                         _("A reversing entry has already been created for this transaction."));
 +        return;
 +    }
 +
 +    qof_event_suspend();
 +    new_trans = xaccTransReverse(trans);
 +
 +    /* Clear transaction level info */
 +    xaccTransSetDatePostedSecsNormalized (new_trans, gnc_time (NULL));
 +    xaccTransSetDateEnteredSecs (new_trans, gnc_time (NULL));
 +
 +    qof_event_resume();
 +
 +    /* Now jump to new trans */
 +    gsr = gnc_plugin_page_register_get_gsr(GNC_PLUGIN_PAGE(page));
 +    gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    GtkWidget *dialog, *button;
 +    GtkBuilder *builder;
 +    SortType sort;
 +    const gchar *name;
 +    gchar *title;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +    ENTER("(action %p, page %p)", action, page);
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (priv->sd.dialog)
 +    {
 +        gtk_window_present(GTK_WINDOW(priv->sd.dialog));
 +        LEAVE("existing dialog");
 +        return;
 +    }
 +
 +    /* Create the dialog */
 +
 +    builder = gtk_builder_new();
 +    gnc_builder_add_from_file  (builder, "gnc-plugin-page-register.glade", "sort_by_dialog");
 +    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "sort_by_dialog"));
 +    priv->sd.dialog = dialog;
 +    gtk_window_set_transient_for(GTK_WINDOW(dialog),
 +                                 gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
 +    /* Translations: The %s is the name of the plugin page */
 +    title = g_strdup_printf(_("Sort %s by..."),
 +                            gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
 +    gtk_window_set_title(GTK_WINDOW(dialog), title);
 +    g_free(title);
 +
 +    /* Set the button for the current sort order */
 +    sort = gnc_split_reg_get_sort_type(priv->gsr);
 +    name = SortTypeasString(sort);
 +    button = GTK_WIDGET(gtk_builder_get_object (builder, name));
 +    DEBUG("current sort %d, button %s(%p)", sort, name, button);
 +    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +    priv->sd.original_sort_type = sort;
 +
 +    button = GTK_WIDGET(gtk_builder_get_object (builder, "sort_save"));
 +    if (priv->sd.save_order == TRUE)
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +
 +    /* Set the button for the current reverse_order order */
 +    button = GTK_WIDGET(gtk_builder_get_object (builder, "sort_reverse"));
 +    if(priv->sd.reverse_order == TRUE)
 +       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +    priv->sd.original_reverse_order = priv->sd.reverse_order;
 +
 +    priv->sd.num_radio = GTK_WIDGET(gtk_builder_get_object (builder, "BY_NUM"));
 +    priv->sd.act_radio = GTK_WIDGET(gtk_builder_get_object (builder, "BY_ACTION"));
 +    /* Adjust labels related to Num/Action radio buttons based on book option */
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    if (reg && !reg->use_tran_num_for_num_field)
 +    {
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.num_radio), _("Transaction Number"));
 +        gtk_button_set_label(GTK_BUTTON (priv->sd.act_radio), _("Number/Action"));
 +    }
 +    gnc_book_option_register_cb(OPTION_NAME_NUM_FIELD_SOURCE,
 +                                gnc_plugin_page_register_sort_book_option_changed,
 +                                page);
 +
 +     /* Wire it up */
 +    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
 +
 +    /* Show it */
 +    gtk_widget_show(dialog);
 +    g_object_unref(G_OBJECT(builder));
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GtkWidget *dialog, *toggle, *button, *table, *hbox;
 +    time64 start_time, end_time, time_val;
 +    GtkBuilder *builder;
 +    gboolean sensitive, value;
 +    Query *query;
 +    gchar *title;
 +    int i;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +    ENTER("(action %p, page %p)", action, page);
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    if (priv->fd.dialog)
 +    {
 +        gtk_window_present(GTK_WINDOW(priv->fd.dialog));
 +        LEAVE("existing dialog");
 +        return;
 +    }
 +
 +    /* Create the dialog */
 +    builder = gtk_builder_new();
 +    gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "filter_by_dialog");
 +    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "filter_by_dialog"));
 +    priv->fd.dialog = dialog;
 +    gtk_window_set_transient_for(GTK_WINDOW(dialog),
 +                                 gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window)));
 +
 +    /* Translators: The %s is the name of the plugin page */
 +    title = g_strdup_printf(_("Filter %s by..."),
 +                            gnc_plugin_page_get_page_name(GNC_PLUGIN_PAGE(page)));
 +    gtk_window_set_title(GTK_WINDOW(dialog), title);
 +    g_free(title);
 +
 +    /* Set the check buttons for the current status */
 +    for (i = 0; status_actions[i].action_name; i++)
 +    {
 +        toggle = GTK_WIDGET(gtk_builder_get_object (builder, status_actions[i].action_name));
 +        value = priv->fd.cleared_match & status_actions[i].value;
 +        status_actions[i].widget = toggle;
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), value);
 +    }
 +    priv->fd.original_cleared_match = priv->fd.cleared_match;
 +
 +    button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_save"));
 +    if (priv->fd.save_filter == TRUE)
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +
 +
 +    /* Set the date info */
 +    button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_range"));
 +    query = gnc_ledger_display_get_query (priv->ledger);
 +    xaccQueryGetDateMatchTT(query, &start_time, &end_time);
 +    priv->fd.original_start_time = start_time;
 +    priv->fd.start_time = start_time;
 +    priv->fd.original_end_time = end_time;
 +    priv->fd.end_time = end_time;
 +
 +    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), start_time || end_time);
 +    table = GTK_WIDGET(gtk_builder_get_object (builder, "select_range_table"));
 +    priv->fd.table = table;
 +    gtk_widget_set_sensitive(GTK_WIDGET(table), start_time || end_time);
 +
 +    priv->fd.start_date_choose = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_choose"));
 +    priv->fd.start_date_today = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_today"));
 +    priv->fd.end_date_choose = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_choose"));
 +    priv->fd.end_date_today = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_today"));
 +
 +    {
 +        /* Start date info */
 +        if (start_time == 0)
 +        {
 +            button = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_earliest"));
 +            time_val = xaccQueryGetEarliestDateFound (query);
 +            sensitive = FALSE;
 +        }
 +        else
 +        {
 +            time_val = start_time;
 +            if ((start_time >= gnc_time64_get_today_start()) &&
 +                    (start_time <= gnc_time64_get_today_end()))
 +            {
 +                button = priv->fd.start_date_today;
 +                sensitive = FALSE;
 +            }
 +            else
 +            {
 +                button = priv->fd.start_date_choose;
 +                sensitive = TRUE;
 +            }
 +        }
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +        priv->fd.start_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
 +        hbox = GTK_WIDGET(gtk_builder_get_object (builder, "start_date_hbox"));
 +        gtk_box_pack_start (GTK_BOX (hbox), priv->fd.start_date, TRUE, TRUE, 0);
 +        gtk_widget_show (priv->fd.start_date);
 +        gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.start_date), sensitive);
 +        gnc_date_edit_set_time (GNC_DATE_EDIT(priv->fd.start_date), time_val);
 +        g_signal_connect (G_OBJECT (priv->fd.start_date), "date-changed",
 +                          G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
 +                          page);
 +    }
 +
 +    {
 +        /* End date info */
 +        if (end_time == 0)
 +        {
 +            button = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_latest"));
 +            time_val = xaccQueryGetLatestDateFound (query);
 +            sensitive = FALSE;
 +        }
 +        else
 +        {
 +            time_val = end_time;
 +            if ((end_time >= gnc_time64_get_today_start()) &&
 +                    (end_time <= gnc_time64_get_today_end()))
 +            {
 +                button = priv->fd.end_date_today;
 +                sensitive = FALSE;
 +            }
 +            else
 +            {
 +                button = priv->fd.end_date_choose;
 +                sensitive = TRUE;
 +            }
 +        }
 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
 +        priv->fd.end_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
 +        hbox = GTK_WIDGET(gtk_builder_get_object (builder, "end_date_hbox"));
 +        gtk_box_pack_start (GTK_BOX (hbox), priv->fd.end_date, TRUE, TRUE, 0);
 +        gtk_widget_show (priv->fd.end_date);
 +        gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.end_date), sensitive);
 +        gnc_date_edit_set_time (GNC_DATE_EDIT(priv->fd.end_date), time_val);
 +        g_signal_connect (G_OBJECT (priv->fd.end_date), "date-changed",
 +                          G_CALLBACK (gnc_plugin_page_register_filter_gde_changed_cb),
 +                          page);
 +    }
 +
 +    /* Wire it up */
 +    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
 +
 +    /* Show it */
 +    gtk_widget_show_all(dialog);
 +    g_object_unref(G_OBJECT(builder));
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_style_changed (GtkAction *action,
 +        GtkRadioAction *current,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegisterStyle value;
 +
 +    ENTER("(action %p, radio action %p, plugin_page %p)",
 +          action, current, plugin_page);
 +
 +    g_return_if_fail(GTK_IS_ACTION(action));
 +    g_return_if_fail(GTK_IS_RADIO_ACTION(current));
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    value = gtk_radio_action_get_current_value(current);
 +    gnc_split_reg_change_style(priv->gsr, value);
 +
 +    gnc_plugin_page_register_ui_update (NULL, plugin_page);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_style_double_line (GtkToggleAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    gboolean use_double_line;
 +
 +    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_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +
 +    use_double_line =  gtk_toggle_action_get_active (action);
 +    if (use_double_line != reg->use_double_line)
 +    {
 +        gnc_split_register_config(reg, reg->type, reg->style, use_double_line);
 +        gnc_ledger_display_refresh(priv->ledger);
 +    }
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_transfer (GtkAction *action,
 +                                       GncPluginPageRegister *page)
 +{
 +    Account *account;
 +    GncWindow *gnc_window;
 +    GtkWidget *window;
 +
 +    ENTER("(action %p, plugin_page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    account = gnc_plugin_page_register_get_account (page);
 +    gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window);
 +    window = GTK_WIDGET(gnc_window_get_gtk_window(gnc_window));
 +    gnc_xfer_dialog (window, account);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_reconcile (GtkAction *action,
 +                                        GncPluginPageRegister *page)
 +{
 +    Account *account;
 +    GtkWindow *window;
 +    RecnWindow * recnData;
 +
 +    ENTER("(action %p, plugin_page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    account = gnc_plugin_page_register_get_account (page);
 +
 +    window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
 +    recnData = recnWindow (GTK_WIDGET(window), account);
 +    gnc_ui_reconcile_window_raise (recnData);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_autoclear (GtkAction *action,
 +                                        GncPluginPageRegister *page)
 +{
 +    Account *account;
 +    GtkWindow *window;
 +    AutoClearWindow * autoClearData;
 +
 +    ENTER("(action %p, plugin_page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    account = gnc_plugin_page_register_get_account (page);
 +
 +    window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
 +    autoClearData = autoClearWindow (GTK_WIDGET(window), account);
 +    gnc_ui_autoclear_window_raise (autoClearData);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_stock_split (GtkAction *action,
 +        GncPluginPageRegister *page)
 +{
 +    Account *account;
 +
 +    ENTER("(action %p, plugin_page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    account = gnc_plugin_page_register_get_account (page);
 +    gnc_stock_split_dialog (NULL, account);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_lots (GtkAction *action,
 +                                   GncPluginPageRegister *page)
 +{
 +    Account *account;
 +
 +    ENTER("(action %p, plugin_page %p)", action, page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +
 +    account = gnc_plugin_page_register_get_account (page);
 +    gnc_lot_viewer_dialog (account);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_enter_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gnc_split_reg_enter(priv->gsr, FALSE);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_cancel_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gnc_split_register_cancel_cursor_trans_changes
 +    (gnc_ledger_display_get_split_register(priv->ledger));
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_delete_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_delete_handler(priv->gsr, NULL);
 +    LEAVE(" ");
 +
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_associate_file_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_associate_handler (priv->gsr, TRUE);
 +    gnc_plugin_page_register_ui_update (NULL, plugin_page);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_associate_location_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_associate_handler (priv->gsr, FALSE);
 +    gnc_plugin_page_register_ui_update (NULL, plugin_page);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_execassociated_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_execassociated_handler(priv->gsr, NULL);
 +    LEAVE(" ");
 +
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_blank_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +
 +    if (gnc_split_register_save (reg, TRUE))
 +        gnc_split_register_redraw (reg);
 +
 +    gnc_split_reg_jump_to_blank (priv->gsr);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_duplicate_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gnc_split_register_duplicate_current
 +    (gnc_ledger_display_get_split_register(priv->ledger));
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_reinitialize_transaction (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_reinit_handler(priv->gsr, NULL);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_expand_transaction (GtkToggleAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    gboolean expand;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +    expand = gtk_toggle_action_get_active (action);
 +    gnc_split_register_expand_current_trans (reg, expand);
 +    LEAVE(" ");
 +}
 +
 +/** Callback for "Edit Exchange Rate" menu item.
 + */
 +static void
 +gnc_plugin_page_register_cmd_exchange_rate (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +
 +    /* XXX Ignore the return value -- we don't care if this succeeds */
 +    (void)gnc_split_register_handle_exchange (reg, TRUE);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_jump (GtkAction *action,
 +                                   GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncPluginPage *new_page;
 +    GtkWidget *window;
 +    GNCSplitReg *gsr;
 +    SplitRegister *reg;
 +    Account *account;
 +    Account *leader;
 +    Split *split;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    window = GNC_PLUGIN_PAGE (plugin_page)->window;
 +    if (window == NULL)
 +    {
 +        LEAVE("no window");
 +        return;
 +    }
 +
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +    split = gnc_split_register_get_current_split (reg);
 +    if (split == NULL)
 +    {
 +        LEAVE("no split (1)");
 +        return;
 +    }
 +
 +    account = xaccSplitGetAccount (split);
 +    if (account == NULL)
 +    {
 +        LEAVE("no account");
 +        return;
 +    }
 +
 +    leader = gnc_ledger_display_leader (priv->ledger);
 +    if (account == leader)
 +    {
 +        split = xaccSplitGetOtherSplit (split);
 +        if (split == NULL)
 +        {
 +            LEAVE("no split (2)");
 +            return;
 +        }
 +
 +        account = xaccSplitGetAccount (split);
 +        if (account == NULL)
 +        {
 +            LEAVE("no account (2)");
 +            return;
 +        }
 +
 +        if (account == leader)
 +        {
 +            LEAVE("register open for account");
 +            return;
 +        }
 +    }
 +
 +    new_page = gnc_plugin_page_register_new (account, FALSE);
 +    if (new_page == NULL)
 +    {
 +        LEAVE("couldn't create new page");
 +        return;
 +    }
 +
 +    gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
 +    gsr = gnc_plugin_page_register_get_gsr (new_page);
 +    gnc_split_reg_jump_to_split(gsr, split);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_schedule (GtkAction *action,
 +                                       GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    gsr_default_schedule_handler(priv->gsr, NULL);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_scrub_current (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    Query *query;
 +    Account *root;
 +    Transaction *trans;
 +    Split *split;
 +    GNCLot *lot;
 +    SplitRegister *reg;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    query = gnc_ledger_display_get_query( priv->ledger );
 +    if (query == NULL)
 +    {
 +        LEAVE("no query found");
 +        return;
 +    }
 +
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    trans = gnc_split_register_get_current_trans(reg);
 +    if (trans == NULL)
 +    {
 +        LEAVE("no trans found");
 +        return;
 +    }
 +
 +    gnc_suspend_gui_refresh();
 +    root = gnc_get_current_root_account();
 +    xaccTransScrubOrphans(trans);
 +    xaccTransScrubImbalance(trans, root, NULL);
 +
 +    split = gnc_split_register_get_current_split (reg);
 +    lot = xaccSplitGetLot (split);
 +    if (lot && xaccAccountIsAPARType (xaccAccountGetType (xaccSplitGetAccount (split))))
 +    {
 +        gncScrubBusinessLot (lot);
 +        gncScrubBusinessSplit (split);
 +    }
 +    gnc_resume_gui_refresh();
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_scrub_all (GtkAction *action,
 +                                        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    Query *query;
 +    Account *root;
 +    GncWindow *window;
 +    GList *node, *splits;
 +    gint split_count = 0, curr_split_no = 0;
 +    const char *message = _( "Checking splits in current register: %u of %u");
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    query = gnc_ledger_display_get_query( priv->ledger );
 +    if (!query)
 +    {
 +        LEAVE("no query found");
 +        return;
 +    }
 +
 +    gnc_suspend_gui_refresh();
 +    window = GNC_WINDOW(GNC_PLUGIN_PAGE (plugin_page)->window);
 +    gnc_window_set_progressbar_window (window);
 +
 +    root = gnc_get_current_root_account();
 +
 +    splits = qof_query_run(query);
 +    split_count = g_list_length (splits);
 +    for (node = splits; node; node = node->next)
 +    {
 +        GNCLot *lot;
 +        Split *split = node->data;
 +        Transaction *trans = xaccSplitGetParent(split);
 +
 +        if (!split) continue;
 +
 +        PINFO("Start processing split %d of %d",
 +              curr_split_no + 1, split_count);
 +
 +        if (curr_split_no % 100 == 0)
 +        {
 +            char *progress_msg = g_strdup_printf (message, curr_split_no, split_count);
 +            gnc_window_show_progress (progress_msg, (100 * curr_split_no) / split_count);
 +            g_free (progress_msg);
 +        }
 +
 +        xaccTransScrubOrphans(trans);
 +        xaccTransScrubImbalance(trans, root, NULL);
 +
 +        lot = xaccSplitGetLot (split);
 +        if (lot && xaccAccountIsAPARType (xaccAccountGetType (xaccSplitGetAccount (split))))
 +        {
 +            gncScrubBusinessLot (lot);
 +            gncScrubBusinessSplit (split);
 +        }
 +
 +        PINFO("Finished processing split %d of %d",
 +              curr_split_no + 1, split_count);
 +        curr_split_no++;
 +    }
 +
 +    gnc_window_show_progress (NULL, -1.0);
 +    gnc_resume_gui_refresh();
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_account_report (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncMainWindow *window;
 +    int id;
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    id = report_helper (priv->ledger, NULL, NULL);
 +    if (id >= 0)
 +        gnc_main_window_open_report(id, window);
 +    LEAVE(" ");
 +}
 +
 +static void
 +gnc_plugin_page_register_cmd_transaction_report (GtkAction *action,
 +        GncPluginPageRegister *plugin_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    GncMainWindow *window;
 +    SplitRegister *reg;
 +    Split *split;
 +    Query *query;
 +    int id;
 +
 +
 +    ENTER("(action %p, plugin_page %p)", action, plugin_page);
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
 +    reg = gnc_ledger_display_get_split_register (priv->ledger);
 +
 +    split = gnc_split_register_get_current_split (reg);
 +    if (!split)
 +        return;
 +
 +    query = qof_query_create_for(GNC_ID_SPLIT);
 +
 +    qof_query_set_book (query, gnc_get_current_book ());
 +
 +    xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
 +                           GNC_ID_SPLIT, QOF_QUERY_AND);
 +
 +    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
 +    id = report_helper (priv->ledger, split, query);
 +    if (id >= 0)
 +        gnc_main_window_open_report(id, window);
 +    LEAVE(" ");
 +}
 +
 +/************************************************************/
 +/*                    Auxiliary functions                   */
 +/************************************************************/
 +
 +void
 +gnc_plugin_page_register_set_options (GncPluginPage *plugin_page,
 +                                      gint lines_default,
 +                                      gboolean read_only)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
 +
 +    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +    priv->lines_default     = lines_default;
 +    priv->read_only         = read_only;
 +}
 +
 +GNCSplitReg *
 +gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
 +
 +    page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    return priv->gsr;
 +}
 +
 +static void
 +gnc_plugin_page_help_changed_cb (GNCSplitReg *gsr, GncPluginPageRegister *register_page)
 +{
 +    GncPluginPageRegisterPrivate *priv;
 +    SplitRegister *reg;
 +    GncWindow *window;
 +    char *help;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(register_page));
 +
 +    window = GNC_WINDOW(GNC_PLUGIN_PAGE(register_page)->window);
 +    if (!window)
 +    {
 +        // This routine can be called before the page is added to a
 +        // window.
 +        return;
 +    }
 +
 +    /* Get the text from the ledger */
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(register_page);
 +    reg = gnc_ledger_display_get_split_register(priv->ledger);
 +    help = gnc_table_get_help(reg->table);
 +    gnc_window_set_status(window, GNC_PLUGIN_PAGE(register_page), help);
 +    g_free(help);
 +}
 +
 +static void
 +gnc_plugin_page_register_refresh_cb (GHashTable *changes, gpointer user_data)
 +{
 +    GncPluginPageRegister *page = user_data;
 +    GncPluginPageRegisterPrivate *priv;
 +
 +    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
 +    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +
 +    if (changes)
 +    {
 +        const EventInfo* ei;
 +        ei = gnc_gui_get_entity_events(changes, &priv->key);
 +        if (ei)
 +        {
 +            if (ei->event_mask & QOF_EVENT_DESTROY)
 +            {
 +                gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
 +                return;
 +            }
 +            if (ei->event_mask & QOF_EVENT_MODIFY)
 +            {
 +            }
 +        }
 +    }
 +    else
 +    {
 +        /* forced updates */
 +        gnucash_register_refresh_from_prefs(priv->gsr->reg);
 +        gtk_widget_queue_draw(priv->widget);
 +    }
 +
 +    gnc_plugin_page_register_ui_update(NULL, page);
 +}
 +
 +static void
 +gnc_plugin_page_register_close_cb (gpointer user_data)
 +{
 +    GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
 +    gnc_main_window_close_page (plugin_page);
 +}
 +
 +/** This function is called when an account has been edited and an
 + *  "extreme" change has been made to it.  (E.G. Changing from a
 + *  credit card account to an expense account.  This rouine is
 + *  responsible for finding all open registers containing the account
 + *  and closing them.
 + *
 + *  @param account A pointer to the account that was changed.
 + */
 +static void
 +gppr_account_destroy_cb (Account *account)
 +{
 +    GncPluginPageRegister *page;
 +    GncPluginPageRegisterPrivate *priv;
 +    GNCLedgerDisplayType ledger_type;
 +    const GncGUID *acct_guid;
 +    const GList *citem;
 +    GList *item, *kill = NULL;
 +
 +    acct_guid = xaccAccountGetGUID(account);
 +
 +    /* Find all windows that need to be killed.  Don't kill them yet, as
 +     * that would affect the list being walked.*/
 +    citem = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER_NAME);
 +    for ( ; citem; citem = g_list_next(citem))
 +    {
 +        page = (GncPluginPageRegister *)citem->data;
 +        priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
 +        ledger_type = gnc_ledger_display_type (priv->ledger);
 +        if (ledger_type == LD_GL)
 +        {
 +            kill = g_list_append(kill, page);
 +            /* kill it */
 +        }
 +        else if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
 +        {
 +            if (guid_compare(acct_guid, &priv->key) == 0)
 +            {
 +                kill = g_list_append(kill, page);
 +            }
 +        }
 +    }
 +
 +    /* Now kill them. */
 +    for (item = kill; item; item = g_list_next(item))
 +    {
 +        page = (GncPluginPageRegister *)item->data;
 +        gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
 +    }
 +}
 +
 +/** This function is the handler for all event messages from the
 + *  engine.  Its purpose is to update the register page any time
 + *  an account or transaction is changed.
 + *
 + *  @internal
 + *
 + *  @param entity A pointer to the affected item.
 + *
 + *  @param event_type The type of the affected item.
 + *
 + *  @param page A pointer to the register page.
 + *
 + *  @param ed
 + */
 +static void
 +gnc_plugin_page_register_event_handler (QofInstance *entity,
 +                                        QofEventId event_type,
 +                                        GncPluginPageRegister *page,
 +                                        GncEventData *ed)
 +{
 +    Transaction *trans;
 +    QofBook *book;
 +    GncPluginPage *visible_page;
 +    GtkWidget *window;
 +    gchar *label, *color;
 +
 +    g_return_if_fail(page);	/* Required */
 +    if (!GNC_IS_TRANS(entity) && !GNC_IS_ACCOUNT(entity))
 +        return;
 +
 +    ENTER("entity %p of type %d, page %p, event data %p",
 +          entity, event_type, page, ed);
 +
 +    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
 +
 +    if (GNC_IS_ACCOUNT(entity))
 +    {
 +        if (GNC_IS_MAIN_WINDOW(window))
 +        {
 +            label = gnc_plugin_page_register_get_tab_name(GNC_PLUGIN_PAGE(page));
 +            main_window_update_page_name(GNC_PLUGIN_PAGE(page), label);
 +            color = gnc_plugin_page_register_get_tab_color(GNC_PLUGIN_PAGE(page));
 +            main_window_update_page_color(GNC_PLUGIN_PAGE(page), color);
 +            g_free(color);
 +            g_free(label);
 +        }
 +        LEAVE("tab name updated");
 +        return;
 +    }
 +
 +    if (!(event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY)))
 +    {
 +        LEAVE("not a modify");
 +        return;
 +    }
 +    trans = GNC_TRANS(entity);
 +    book = qof_instance_get_book(QOF_INSTANCE(trans));
 +    if (!gnc_plugin_page_has_book(GNC_PLUGIN_PAGE(page), book))
 +    {
 +        LEAVE("not in this book");
 +        return;
 +    }
 +
 +    if (GNC_IS_MAIN_WINDOW(window))
 +    {
 +        visible_page = gnc_main_window_get_current_page(GNC_MAIN_WINDOW(window));
 +        if (visible_page != GNC_PLUGIN_PAGE(page))
 +        {
 +            LEAVE("page not visible");
 +            return;
 +        }
 +    }
 +
 +    gnc_plugin_page_register_ui_update(NULL, page);
 +    LEAVE(" ");
 +    return;
 +}
 +
 +
 +/** @} */
 +/** @} */
diff --cc gnucash/gnome/gnc-split-reg.c
index 5e661f2,0000000..678d1b5
mode 100644,000000..100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@@ -1,2258 -1,0 +1,2260 @@@
 +/********************************************************************\
 + * gnc-split-reg.c -- A widget for the common register look-n-feel. *
 + * Copyright (C) 1997 Robin D. Clark                                *
 + * Copyright (C) 1997-1998 Linas Vepstas <linas at linas.org>          *
 + * Copyright (C) 1998 Rob Browning <rlb at cs.utexas.edu>              *
 + * Copyright (C) 1999-2000 Dave Peticolas <dave at krondo.com>         *
 + * Copyright (C) 2001 Gnumatic, Inc.                                *
 + * Copyright (C) 2002,2006 Joshua Sled <jsled at asynchronous.org>     *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 +\********************************************************************/
 +
 +#include <config.h>
 +
 +#include <gtk/gtk.h>
 +#include <glib/gi18n.h>
 +#include <time.h>
 +
 +#include "gnc-split-reg.h"
 +
 +#include "Account.h"
 +#include "qof.h"
 +#include "SX-book.h"
 +#include "dialog-account.h"
 +#include "dialog-sx-editor.h"
 +#include "dialog-sx-from-trans.h"
 +#include "gnc-component-manager.h"
 +#include "gnc-date-edit.h"
 +#include "gnc-engine.h"
 +#include "gnc-euro.h"
 +#include "gnc-prefs.h"
 +#include "gnc-gui-query.h"
 +#include "gnc-gnome-utils.h"
 +#include "gnc-ledger-display.h"
 +#include "gnc-pricedb.h"
 +#include "gnc-ui-util.h"
 +#include "gnc-ui.h"
 +#include "gnc-warnings.h"
 +#include "gnucash-sheet.h"
 +#include "gnucash-register.h"
 +#include "table-allgui.h"
 +
 +#include "dialog-utils.h"
 +
 +// static QofLogModule log_module = GNC_MOD_SX;
 +static QofLogModule log_module = GNC_MOD_GUI;
 +
 +#define STATE_SECTION_REG_PREFIX "Register"
 +
 +/***** PROTOTYPES ***************************************************/
 +void gnc_split_reg_raise( GNCSplitReg *gsr );
 +
 +static GtkWidget* add_summary_label( GtkWidget *summarybar,
 +                                     const char *label_str );
 +
 +static void gnc_split_reg_determine_read_only( GNCSplitReg *gsr );
 +
 +static GNCPlaceholderType gnc_split_reg_get_placeholder( GNCSplitReg *gsr );
 +static GtkWidget *gnc_split_reg_get_parent( GNCLedgerDisplay *ledger );
 +
 +static void gsr_create_table( GNCSplitReg *gsr );
 +static void gsr_setup_table( GNCSplitReg *gsr );
 +static void gsr_setup_status_widgets( GNCSplitReg *gsr );
 +
 +static void gsr_update_summary_label( GtkWidget *label,
 +                                      xaccGetBalanceFn getter,
 +                                      Account *leader,
 +                                      GNCPrintAmountInfo print_info,
 +                                      gnc_commodity *cmdty,
 +                                      gboolean reverse,
 +                                      gboolean euroFlag );
 +
 +static void gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data);
 +
 +static void gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger );
 +
 +static Transaction* create_balancing_transaction(QofBook *book, Account *account,
 +        time64 statement_date, gnc_numeric balancing_amount);
 +
 +void gsr_default_enter_handler    ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_cancel_handler   ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_delete_handler   ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_reinit_handler   ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_dup_handler      ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_schedule_handler ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_expand_handler   ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_blank_handler    ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_jump_handler     ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_cut_handler      ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_cut_txn_handler  ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_copy_handler     ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_copy_txn_handler ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_paste_handler    ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_paste_txn_handler( GNCSplitReg *w, gpointer ud );
 +void gsr_default_void_txn_handler ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_unvoid_txn_handler ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_reverse_txn_handler ( GNCSplitReg *w, gpointer ud );
 +void gsr_default_associate_handler ( GNCSplitReg *w, gboolean uri_is_file );
 +void gsr_default_execassociated_handler ( GNCSplitReg *w, gpointer ud );
 +
 +static void gsr_emit_simple_signal( GNCSplitReg *gsr, const char *sigName );
 +static void gsr_emit_help_changed( GnucashRegister *reg, gpointer user_data );
 +static void gsr_emit_include_date_signal( GNCSplitReg *gsr, time64 date );
 +
 +void gnc_split_reg_cut_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_copy_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_paste_cb(GtkWidget *w, gpointer data);
 +
 +void gnc_split_reg_cut_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_copy_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_paste_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_void_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_unvoid_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_reverse_trans_cb(GtkWidget *w, gpointer data);
 +
 +void gnc_split_reg_record_cb (GnucashRegister *reg, gpointer data);
 +void gnc_split_reg_reinitialize_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_delete_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_duplicate_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_recur_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_record_trans_cb(GtkWidget *w, gpointer data);
 +void gnc_split_reg_cancel_trans_cb(GtkWidget *w, gpointer data);
 +
 +void gnc_split_reg_expand_trans_menu_cb(GtkWidget *widget, gpointer data);
 +void gnc_split_reg_expand_trans_toolbar_cb(GtkWidget *widget, gpointer data);
 +void gnc_split_reg_new_trans_cb(GtkWidget *widget, gpointer data);
 +void gnc_split_reg_jump_cb(GtkWidget *widget, gpointer data);
 +
 +void gnc_split_reg_style_ledger_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_style_auto_ledger_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_style_journal_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_double_line_cb (GtkWidget *w, gpointer data);
 +
 +void gnc_split_reg_sort_standard_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_date_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_date_entered_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_date_reconciled_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_num_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_amount_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_memo_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_desc_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_action_cb (GtkWidget *w, gpointer data);
 +void gnc_split_reg_sort_notes_cb (GtkWidget *w, gpointer data);
 +
 +
 +void gnc_split_reg_destroy_cb(GtkWidget *widget, gpointer data);
 +void gnc_split_reg_size_allocate( GtkWidget *widget,
 +                                  GtkAllocation *allocation,
 +                                  gpointer user_data );
 +
 +
 +static void gnc_split_reg_class_init( GNCSplitRegClass *klass );
 +static void gnc_split_reg_init( GNCSplitReg *gsr );
 +static void gnc_split_reg_init2( GNCSplitReg *gsr );
 +
 +FROM_STRING_FUNC(SortType, ENUM_LIST_SORTTYPE)
 +AS_STRING_FUNC(SortType, ENUM_LIST_SORTTYPE)
 +
 +GType
 +gnc_split_reg_get_type( void )
 +{
 +    static GType gnc_split_reg_type = 0;
 +
 +    if (!gnc_split_reg_type)
 +    {
 +        GTypeInfo type_info =
 +        {
 +            sizeof(GNCSplitRegClass),      /* class_size */
 +            NULL,   			/* base_init */
 +            NULL,				/* base_finalize */
 +            (GClassInitFunc)gnc_split_reg_class_init,
 +            NULL,				/* class_finalize */
 +            NULL,				/* class_data */
 +            sizeof(GNCSplitReg),		/* */
 +            0,				/* n_preallocs */
 +            (GInstanceInitFunc)gnc_split_reg_init,
 +        };
 +
 +        gnc_split_reg_type = g_type_register_static( GTK_TYPE_BOX,
 +                             "GNCSplitReg",
 +                             &type_info, 0 );
 +    }
 +
 +    return gnc_split_reg_type;
 +}
 +
 +/* SIGNALS */
 +enum gnc_split_reg_signal_enum
 +{
 +    ENTER_ENT_SIGNAL,
 +    CANCEL_ENT_SIGNAL,
 +    DELETE_ENT_SIGNAL,
 +    REINIT_ENT_SIGNAL,
 +    DUP_ENT_SIGNAL,
 +    SCHEDULE_ENT_SIGNAL,
 +    EXPAND_ENT_SIGNAL,
 +    BLANK_SIGNAL,
 +    JUMP_SIGNAL,
 +    CUT_SIGNAL,
 +    CUT_TXN_SIGNAL,
 +    COPY_SIGNAL,
 +    COPY_TXN_SIGNAL,
 +    PASTE_SIGNAL,
 +    PASTE_TXN_SIGNAL,
 +    VOID_TXN_SIGNAL,
 +    UNVOID_TXN_SIGNAL,
 +    REVERSE_TXN_SIGNAL,
 +    HELP_CHANGED_SIGNAL,
 +    INCLUDE_DATE_SIGNAL,
 +    LAST_SIGNAL
 +};
 +
 +static guint gnc_split_reg_signals[LAST_SIGNAL] = { 0 };
 +
 +static void
 +gnc_split_reg_class_init( GNCSplitRegClass *klass )
 +{
 +    int i;
 +    GObjectClass *object_class;
 +    static struct similar_signal_info
 +    {
 +        enum gnc_split_reg_signal_enum s;
 +        const char *signal_name;
 +        guint defaultOffset;
 +    } signals[] =
 +    {
 +        { ENTER_ENT_SIGNAL,    "enter_ent",    G_STRUCT_OFFSET( GNCSplitRegClass, enter_ent_cb ) },
 +        { CANCEL_ENT_SIGNAL,   "cancel_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, cancel_ent_cb ) },
 +        { DELETE_ENT_SIGNAL,   "delete_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, delete_ent_cb ) },
 +        { REINIT_ENT_SIGNAL,   "reinit_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, reinit_ent_cb ) },
 +        { DUP_ENT_SIGNAL,      "dup_ent",      G_STRUCT_OFFSET( GNCSplitRegClass, dup_ent_cb ) },
 +        { SCHEDULE_ENT_SIGNAL, "schedule_ent", G_STRUCT_OFFSET( GNCSplitRegClass, schedule_ent_cb ) },
 +        { EXPAND_ENT_SIGNAL,   "expand_ent",   G_STRUCT_OFFSET( GNCSplitRegClass, expand_ent_cb ) },
 +        { BLANK_SIGNAL,        "blank",        G_STRUCT_OFFSET( GNCSplitRegClass, blank_cb ) },
 +        { JUMP_SIGNAL,         "jump",         G_STRUCT_OFFSET( GNCSplitRegClass, jump_cb ) },
 +        { CUT_SIGNAL,          "cut",          G_STRUCT_OFFSET( GNCSplitRegClass, cut_cb ) },
 +        { CUT_TXN_SIGNAL,      "cut_txn",      G_STRUCT_OFFSET( GNCSplitRegClass, cut_txn_cb ) },
 +        { COPY_SIGNAL,         "copy",         G_STRUCT_OFFSET( GNCSplitRegClass, copy_cb ) },
 +        { COPY_TXN_SIGNAL,     "copy_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, copy_txn_cb ) },
 +        { PASTE_SIGNAL,        "paste",        G_STRUCT_OFFSET( GNCSplitRegClass, paste_cb ) },
 +        { PASTE_TXN_SIGNAL,    "paste_txn",    G_STRUCT_OFFSET( GNCSplitRegClass, paste_txn_cb ) },
 +        { VOID_TXN_SIGNAL,     "void_txn",     G_STRUCT_OFFSET( GNCSplitRegClass, void_txn_cb ) },
 +        { UNVOID_TXN_SIGNAL,   "unvoid_txn",   G_STRUCT_OFFSET( GNCSplitRegClass, unvoid_txn_cb ) },
 +        { REVERSE_TXN_SIGNAL,  "reverse_txn",  G_STRUCT_OFFSET( GNCSplitRegClass, reverse_txn_cb ) },
 +        { HELP_CHANGED_SIGNAL, "help-changed", G_STRUCT_OFFSET( GNCSplitRegClass, help_changed_cb ) },
 +        { INCLUDE_DATE_SIGNAL, "include-date", G_STRUCT_OFFSET( GNCSplitRegClass, include_date_cb ) },
 +        { LAST_SIGNAL, NULL, 0 }
 +    };
 +
 +    object_class = (GObjectClass*) klass;
 +
 +    for ( i = 0; signals[i].s != INCLUDE_DATE_SIGNAL; i++ )
 +    {
 +        gnc_split_reg_signals[ signals[i].s ] =
 +            g_signal_new( signals[i].signal_name,
 +                          G_TYPE_FROM_CLASS(object_class),
 +                          G_SIGNAL_RUN_LAST,
 +                          signals[i].defaultOffset,
 +                          NULL, NULL,
 +                          g_cclosure_marshal_VOID__VOID,
 +                          G_TYPE_NONE, 0 );
 +    }
 +    /* Setup the non-default-marshalled signals; 'i' is still valid, here. */
 +    /* "include-date" */
 +    gnc_split_reg_signals[ INCLUDE_DATE_SIGNAL ] =
 +        g_signal_new( "include-date",
 +                      G_TYPE_FROM_CLASS(object_class),
 +                      G_SIGNAL_RUN_LAST,
 +                      signals[i++].defaultOffset,
 +                      NULL, NULL,
 +                      g_cclosure_marshal_VOID__INT, /* time64 == int */
 +                      G_TYPE_NONE, 1, G_TYPE_INT );
 +
 +    g_assert( i == LAST_SIGNAL );
 +
 +    /* Setup the default handlers. */
 +    klass->enter_ent_cb    = gsr_default_enter_handler;
 +    klass->cancel_ent_cb   = gsr_default_cancel_handler;
 +    klass->delete_ent_cb   = gsr_default_delete_handler;
 +    klass->reinit_ent_cb   = gsr_default_reinit_handler;
 +    klass->dup_ent_cb      = gsr_default_dup_handler;
 +    klass->schedule_ent_cb = gsr_default_schedule_handler;
 +    klass->expand_ent_cb   = gsr_default_expand_handler;
 +    klass->blank_cb        = gsr_default_blank_handler;
 +    klass->jump_cb         = gsr_default_jump_handler;
 +    klass->cut_cb          = gsr_default_cut_handler;
 +    klass->cut_txn_cb      = gsr_default_cut_txn_handler;
 +    klass->copy_cb         = gsr_default_copy_handler;
 +    klass->copy_txn_cb     = gsr_default_copy_txn_handler;
 +    klass->paste_cb        = gsr_default_paste_handler;
 +    klass->paste_txn_cb    = gsr_default_paste_txn_handler;
 +    klass->void_txn_cb     = gsr_default_void_txn_handler;
 +    klass->unvoid_txn_cb   = gsr_default_unvoid_txn_handler;
 +    klass->reverse_txn_cb  = gsr_default_reverse_txn_handler;
 +
 +    klass->help_changed_cb = NULL;
 +    klass->include_date_cb = NULL;
 +}
 +
 +GtkWidget*
 +gnc_split_reg_new( GNCLedgerDisplay *ld,
 +                   GtkWindow *parent,
 +                   gint numberOfLines,
 +                   gboolean read_only )
 +{
 +    GNCSplitReg *gsrToRet;
 +
 +    ENTER("ld=%p, parent=%p, numberOfLines=%d, read_only=%s",
 +          ld, parent, numberOfLines, read_only ? "TRUE" : "FALSE");
 +
 +    gsrToRet = g_object_new( gnc_split_reg_get_type(), NULL );
 +
 +    gsrToRet->numRows        = numberOfLines;
 +    gsrToRet->read_only      = read_only;
 +
 +    gsrToRet->ledger = ld;
 +    gsrToRet->window = GTK_WIDGET(parent);
 +
 +    gnc_split_reg_init2( gsrToRet );
 +
 +    LEAVE("%p", gsrToRet);
 +    return GTK_WIDGET( gsrToRet );
 +}
 +
 +static void
 +gnc_split_reg_init( GNCSplitReg *gsr )
 +{
 +    gtk_orientable_set_orientation (GTK_ORIENTABLE(gsr), GTK_ORIENTATION_VERTICAL);
 +
 +    gsr->sort_type = BY_STANDARD;
 +    gsr->width = -1;
 +    gsr->height = -1;
 +    gsr->numRows = 10;
 +    gsr->read_only = FALSE;
 +
 +    g_signal_connect( gsr, "destroy",
 +                      G_CALLBACK (gnc_split_reg_destroy_cb), gsr );
 +}
 +
 +static void
 +gnc_split_reg_init2( GNCSplitReg *gsr )
 +{
 +    if ( !gsr ) return;
 +
 +    gnc_split_reg_determine_read_only( gsr );
 +
 +    gsr_setup_status_widgets( gsr );
 +    /* ordering is important here... setup_status before create_table */
 +    gsr_create_table( gsr );
 +    gsr_setup_table( gsr );
 +}
 +
 +static
 +void
 +gsr_setup_table( GNCSplitReg *gsr )
 +{
 +    SplitRegister *sr;
 +
 +    ENTER("gsr=%p", gsr);
 +
 +    sr = gnc_ledger_display_get_split_register( gsr->ledger );
 +    gnc_split_register_show_present_divider( sr, TRUE );
 +    /* events should be sufficient to redraw this */
 +    /* gnc_ledger_display_refresh( gsr->ledger ); */
 +
 +    LEAVE(" ");
 +}
 +
 +static
 +void
 +gsr_create_table( GNCSplitReg *gsr )
 +{
 +    GtkWidget *register_widget = NULL;
 +    SplitRegister *sr = NULL;
 +
 +    Account * account = gnc_ledger_display_leader(gsr->ledger);
 +    const GncGUID * guid = xaccAccountGetGUID(account);
 +    gchar guidstr[GUID_ENCODING_LENGTH+1];
 +    gchar *state_section = NULL;
 +    guid_to_string_buff(guid, guidstr);
 +    state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", guidstr, NULL);
 +
 +    ENTER("gsr=%p", gsr);
 +
 +    gnc_ledger_display_set_user_data( gsr->ledger, (gpointer)gsr );
 +    gnc_ledger_display_set_handlers( gsr->ledger,
 +                                     gnc_split_reg_ld_destroy,
 +                                     gnc_split_reg_get_parent );
 +
 +    /* FIXME: We'd really rather pass this down... */
 +    sr = gnc_ledger_display_get_split_register( gsr->ledger );
 +    register_widget = gnucash_register_new( sr->table, state_section );
 +    gsr->reg = GNUCASH_REGISTER( register_widget );
 +    g_free (state_section);
 +    gtk_box_pack_start (GTK_BOX (gsr), GTK_WIDGET(gsr->reg), TRUE, TRUE, 0);
 +    gnucash_sheet_set_window (gnucash_register_get_sheet (gsr->reg), gsr->window);
 +    gtk_widget_show ( GTK_WIDGET(gsr->reg) );
 +    g_signal_connect (gsr->reg, "activate_cursor",
 +                      G_CALLBACK(gnc_split_reg_record_cb), gsr);
 +    g_signal_connect (gsr->reg, "redraw_all",
 +                      G_CALLBACK(gsr_redraw_all_cb), gsr);
 +    g_signal_connect (gsr->reg, "redraw_help",
 +                      G_CALLBACK(gsr_emit_help_changed), gsr);
 +
 +    LEAVE(" ");
 +}
 +
 +static
 +void
 +gsr_setup_status_widgets( GNCSplitReg *gsr )
 +{
 +    SplitRegister *sr;
 +    gboolean use_double_line;
 +
 +    sr = gnc_ledger_display_get_split_register( gsr->ledger );
 +    use_double_line = gnc_ledger_display_default_double_line( gsr->ledger );
 +
 +    /* be sure to initialize the gui elements associated with the cursor */
 +    gnc_split_register_config( sr, sr->type, sr->style, use_double_line );
 +}
 +
 +void
 +gnc_split_reg_destroy_cb(GtkWidget *widget, gpointer data)
 +{
 +}
 +
 +/**
 + * Raise an existing register window to the front.
 + **/
 +void
 +gnc_split_reg_raise( GNCSplitReg *gsr )
 +{
 +    if (gsr == NULL)
 +        return;
 +
 +    if (gsr->window == NULL)
 +        return;
 +
 +    gtk_window_present( GTK_WINDOW(gsr->window) );
 +}
 +
 +
 +/**
 + * Duplicate-code reduction function; retreives, formats and updates the
 + * GtkLabel with the given amount.
 + **/
 +static
 +void
 +gsr_update_summary_label( GtkWidget *label,
 +                          xaccGetBalanceFn getter,
 +                          Account *leader,
 +                          GNCPrintAmountInfo print_info,
 +                          gnc_commodity *cmdty,
 +                          gboolean reverse,
 +                          gboolean euroFlag )
 +{
 +    gnc_numeric amount;
 +    char string[256];
 +
 +    if ( label == NULL )
 +        return;
 +
 +    amount = (*getter)( leader );
 +
 +    if ( reverse )
 +    {
 +        amount = gnc_numeric_neg( amount );
 +    }
 +
 +    xaccSPrintAmount( string, amount, print_info );
 +
 +    if ( euroFlag )
 +    {
 +        strcat( string, " / " );
 +        xaccSPrintAmount( string + strlen( string ),
 +                          gnc_convert_to_euro( cmdty, amount ),
 +                          gnc_commodity_print_info( gnc_get_euro(), TRUE ) );
 +    }
 +
 +    gnc_set_label_color( label, amount );
 +    gtk_label_set_text( GTK_LABEL(label), string );
 +}
 +
 +static
 +void
 +gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_commodity * commodity;
 +    GNCPrintAmountInfo print_info;
 +    gnc_numeric amount;
 +    Account *leader;
 +    gboolean reverse;
 +    gboolean euro;
 +
 +    if ( gsr->summarybar == NULL )
 +        return;
 +
 +    leader = gnc_ledger_display_leader( gsr->ledger );
 +
 +    commodity = xaccAccountGetCommodity( leader );
 +
 +    /* no EURO converson, if account is already EURO or no EURO currency */
 +    if (commodity != NULL)
 +        euro = (gnc_is_euro_currency( commodity ) &&
 +                (strncasecmp(gnc_commodity_get_mnemonic(commodity), "EUR", 3)));
 +    else
 +        euro = FALSE;
 +
 +    print_info = gnc_account_print_info( leader, TRUE );
 +    reverse = gnc_reverse_balance( leader );
 +
 +    gsr_update_summary_label( gsr->balance_label,
 +                              xaccAccountGetPresentBalance,
 +                              leader, print_info, commodity, reverse, euro );
 +    gsr_update_summary_label( gsr->cleared_label,
 +                              xaccAccountGetClearedBalance,
 +                              leader, print_info, commodity, reverse, euro );
 +    gsr_update_summary_label( gsr->reconciled_label,
 +                              xaccAccountGetReconciledBalance,
 +                              leader, print_info, commodity, reverse, euro );
 +    gsr_update_summary_label( gsr->future_label,
 +                              xaccAccountGetBalance,
 +                              leader, print_info, commodity, reverse, euro );
 +    gsr_update_summary_label( gsr->projectedminimum_label,
 +                              xaccAccountGetProjectedMinimumBalance,
 +                              leader, print_info, commodity, reverse, euro );
 +    if (gsr->shares_label == NULL && gsr->value_label == NULL)
 +        return;
 +    amount = xaccAccountGetBalance( leader );
 +    if (reverse)
 +        amount = gnc_numeric_neg( amount );
 +
 +   /* Print the summary share amount */
 +    if (gsr->shares_label != NULL)
 +    {
 +        char string[256];
 +        print_info = gnc_account_print_info( leader, TRUE );
 +        xaccSPrintAmount( string, amount, print_info );
 +        gnc_set_label_color( gsr->shares_label, amount );
 +        gtk_label_set_text( GTK_LABEL(gsr->shares_label), string );
 +    }
 +
 +    /* Print the summary share value */
 +    if (gsr->value_label != NULL)
 +    {
 +        char string[256];
 +        QofBook *book = gnc_account_get_book (leader);
 +        GNCPriceDB *pricedb = gnc_pricedb_get_db (book);
 +        gnc_commodity *currency = gnc_default_currency ();
 +        print_info = gnc_commodity_print_info (currency, TRUE);
 +        xaccSPrintAmount (string, amount, print_info);
 +        gnc_set_label_color (gsr->value_label, amount);
 +        gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
 +
 +    }
 +}
 +
 +static void
 +gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger )
 +{
 +    GNCSplitReg *gsr = gnc_ledger_display_get_user_data( ledger );
 +
 +    Account * account = gnc_ledger_display_leader(ledger);
 +    const GncGUID * guid = xaccAccountGetGUID(account);
 +    gchar guidstr[GUID_ENCODING_LENGTH+1];
 +    gchar *state_section;
 +
 +    guid_to_string_buff(guid, guidstr);
 +
 +    state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", guidstr, NULL);
 +
 +    if (gsr)
 +    {
 +        SplitRegister *reg;
 +
 +        reg = gnc_ledger_display_get_split_register (ledger);
 +
 +        if (reg && reg->table)
 +            gnc_table_save_state (reg->table, state_section);
 +
 +        /*
 +         * Don't destroy the window here any more.  The register no longer
 +         * owns it.
 +         */
 +    }
 +    g_free (state_section);
 +    gnc_ledger_display_set_user_data (ledger, NULL);
 +}
 +
 +void
 +gsr_default_cut_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnucash_register_cut_clipboard( gsr->reg );
 +}
 +
 +/**
 + * Cut the selection to the clipboard.  This refers to the Split.
 + **/
 +void
 +gnc_split_reg_cut_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "cut" );
 +}
 +
 +void
 +gsr_default_copy_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnucash_register_copy_clipboard( gsr->reg );
 +}
 +
 +/**
 + * Copy the selection to the clipboard.  This refers to the Split.
 + **/
 +void
 +gnc_split_reg_copy_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "copy" );
 +}
 +
 +void
 +gsr_default_paste_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnucash_register_paste_clipboard( gsr->reg );
 +}
 +
 +/**
 + * Paste the clipboard to the selection.  This refers to the Split.
 + **/
 +void
 +gnc_split_reg_paste_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "paste" );
 +}
 +
 +void
 +gsr_default_cut_txn_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_register_cut_current
 +    (gnc_ledger_display_get_split_register( gsr->ledger ));
 +}
 +
 +/**
 + * Cut the current transaction  to the clipboard.
 + **/
 +void
 +gnc_split_reg_cut_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "cut_txn" );
 +}
 +
 +void
 +gsr_default_copy_txn_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_register_copy_current
 +    (gnc_ledger_display_get_split_register( gsr->ledger ));
 +}
 +
 +/**
 + * Copy the current transaction to the clipboard.
 + **/
 +void
 +gnc_split_reg_copy_trans_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "copy_txn" );
 +}
 +
 +void
 +gsr_default_paste_txn_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_register_paste_current
 +    (gnc_ledger_display_get_split_register( gsr->ledger ));
 +}
 +
 +/**
 + * Paste the transaction clipboard to the selection.
 + **/
 +void
 +gnc_split_reg_paste_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "paste_txn" );
 +}
 +
 +/********************************************************************\
 + * gnc_split_reg_void_trans_cb                                      *
 + *                                                                  *
 + * Args:   widget - the widget that called us                       *
 + *         data   - the data struct for this register               *
 + * Return: none                                                     *
 +\********************************************************************/
 +void
 +gsr_default_void_txn_handler (GNCSplitReg *gsr, gpointer data)
 +{
 +    // Override this function.
 +}
 +
 +void
 +gnc_split_reg_void_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "void_txn" );
 +}
 +
 +/********************************************************************\
 + * gnc_split_reg_unvoid_trans_cb                                      *
 + *                                                                  *
 + * Args:   widget - the widget that called us                       *
 + *         data   - the data struct for this register               *
 + * Return: none                                                     *
 +\********************************************************************/
 +void
 +gsr_default_unvoid_txn_handler (GNCSplitReg *gsr, gpointer data)
 +{
 +    // Override this function.
 +}
 +
 +void
 +gnc_split_reg_unvoid_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "unvoid_txn" );
 +}
 +
 +/********************************************************************\
 + * gnc_split_reg_reverse_trans_cb                                   *
 + *                                                                  *
 + * Args:   widget - the widget that called us                       *
 + *         data   - the data struct for this register               *
 + * Return: none                                                     *
 +\********************************************************************/
 +void
 +gsr_default_reverse_txn_handler (GNCSplitReg *gsr, gpointer data)
 +{
 +    SplitRegister *reg;
 +    Transaction *trans, *new_trans;
 +
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +    trans = gnc_split_register_get_current_trans (reg);
 +    if (trans == NULL)
 +        return;
 +
 +    if (xaccTransGetReversedBy(trans))
 +    {
 +        gnc_error_dialog(gsr->window, "%s",
 +                         _("A reversing entry has already been created for this transaction."));
 +        return;
 +    }
 +
 +    new_trans = xaccTransReverse(trans);
 +
 +    /* Clear transaction level info */
 +    xaccTransSetDatePostedSecsNormalized(new_trans, gnc_time (NULL));
 +    xaccTransSetDateEnteredSecs(new_trans, gnc_time (NULL));
 +
 +    /* Now jump to new trans */
 +    gnc_split_reg_jump_to_split(gsr, xaccTransGetSplit(new_trans, 0));
 +}
 +
 +void
 +gnc_split_reg_reverse_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "reverse_txn" );
 +}
 +
 +
 +static gboolean
 +is_trans_readonly_and_warn (const Transaction *trans)
 +{
 +    GtkWidget *dialog;
 +    const gchar *reason;
 +    const gchar *title = _("Cannot modify or delete this transaction.");
 +    const gchar *message =
 +        _("This transaction is marked read-only with the comment: '%s'");
 +
 +    if (!trans) return FALSE;
 +
 +    if (xaccTransIsReadonlyByPostedDate (trans))
 +    {
 +        dialog = gtk_message_dialog_new(NULL,
 +                                        0,
 +                                        GTK_MESSAGE_ERROR,
 +                                        GTK_BUTTONS_OK,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                "%s", _("The date of this transaction is older than the \"Read-Only Threshold\" set for this book. "
 +                        "This setting can be changed in File -> Properties -> Accounts."));
 +        gtk_dialog_run(GTK_DIALOG(dialog));
 +        gtk_widget_destroy(dialog);
 +        return TRUE;
 +    }
 +
 +    reason = xaccTransGetReadOnly (trans);
 +    if (reason)
 +    {
 +        dialog = gtk_message_dialog_new(NULL,
 +                                        0,
 +                                        GTK_MESSAGE_ERROR,
 +                                        GTK_BUTTONS_OK,
 +                                        "%s", title);
 +        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                message, reason);
 +        gtk_dialog_run(GTK_DIALOG(dialog));
 +        gtk_widget_destroy(dialog);
 +        return TRUE;
 +    }
 +    return FALSE;
 +}
 +
 +
 +void
 +gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    VirtualCellLocation vcell_loc;
 +    SplitRegister *reg;
 +    Transaction *trans;
 +    Split *split;
 +    GtkWidget *dialog;
 +    gint response;
 +    const gchar *warning;
 +
 +    const char *title = _("Remove the splits from this transaction?");
 +    const char *recn_warn = _("This transaction contains reconciled splits. "
 +                              "Modifying it is not a good idea because that will "
 +                              "cause your reconciled balance to be off.");
 +
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +
 +    trans = gnc_split_register_get_current_trans (reg);
 +    if (is_trans_readonly_and_warn(trans))
 +        return;
 +    dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
 +                                    GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                    GTK_MESSAGE_WARNING,
 +                                    GTK_BUTTONS_NONE,
 +                                    "%s", title);
 +    if (xaccTransHasReconciledSplits (trans))
 +    {
 +        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                "%s", recn_warn);
 +        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL_RECD;
 +    }
 +    else
 +    {
 +        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL;
 +    }
 +
 +    gtk_dialog_add_button(GTK_DIALOG(dialog),
 +                          _("_Cancel"), GTK_RESPONSE_CANCEL);
-     gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
++    gnc_gtk_dialog_add_button(dialog,
++                              /* Translators: This is the confirmation button in a warning dialog */
++                              _("_Remove Splits"),
 +                              "edit-delete", GTK_RESPONSE_ACCEPT);
 +    response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
 +    gtk_widget_destroy (dialog);
 +    if (response != GTK_RESPONSE_ACCEPT)
 +        return;
 +
 +    /*
 +     * Find the "transaction" split for the current transaction. This is
 +     * the split that appears at the top of the transaction in the
 +     * register.
 +     */
 +    split = gnc_split_register_get_current_split (reg);
 +    if (!gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
 +        return;
 +    split = gnc_split_register_get_current_trans_split (reg, &vcell_loc);
 +    gnc_split_register_empty_current_trans_except_split (reg, split);
 +}
 +
 +/**
 + * "Reinitializes" the current transaction.
 + **/
 +void
 +gnc_split_reg_reinitialize_trans_cb(GtkWidget *widget, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "reinit_ent" );
 +}
 +
 +static void
 +gsr_default_associate_handler_file (GNCSplitReg *gsr, Transaction *trans, gboolean have_uri)
 +{
 +    GtkWidget *dialog;
 +    gint       response;
 +    gboolean   valid_path_head = FALSE;
 +    gchar     *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, "assoc-head");
 +
 +    dialog = gtk_file_chooser_dialog_new (_("Associate File with Transaction"),
 +                                     GTK_WINDOW(gsr->window),
 +                                     GTK_FILE_CHOOSER_ACTION_OPEN,
 +                                     _("_Remove"), GTK_RESPONSE_REJECT,
 +                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
 +                                     _("_OK"), GTK_RESPONSE_ACCEPT,
 +                                     NULL);
 +
 +    gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), FALSE);
 +
 +    if ((path_head != NULL) && (g_strcmp0 (path_head, "") != 0)) // not default entry
 +        valid_path_head = TRUE;
 +
 +    if (have_uri)
 +    {
 +        gchar *new_uri;
 +        gchar *uri_label;
 +        gchar *filename;
 +
 +        const gchar *uri = xaccTransGetAssociation (trans);
 +
 +        if (valid_path_head && g_str_has_prefix (uri,"file:/") && !g_str_has_prefix (uri,"file://")) 
 +        {
 +            const gchar *part = uri + strlen ("file:");
 +            new_uri = g_strconcat (path_head, part, NULL);
 +        }
 +        else
 +            new_uri = g_strdup (uri);
 +
 +        filename = g_uri_unescape_string (new_uri, NULL);
 +        uri_label = g_strconcat (_("Existing Association is "), filename, NULL);
 +        gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(dialog), gtk_label_new (uri_label));
 +        gtk_file_chooser_set_uri (GTK_FILE_CHOOSER(dialog), new_uri);
 +
 +        g_free (uri_label);
 +        g_free (new_uri);
 +        g_free (filename);
 +    }
 +    response = gtk_dialog_run (GTK_DIALOG (dialog));
 +
 +    if (response == GTK_RESPONSE_REJECT)
 +        xaccTransSetAssociation (trans, "");
 +
 +    if (response == GTK_RESPONSE_ACCEPT)
 +    {
 +	gchar *dialog_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
 +
 +        PINFO("Dialog File URI: %s\n", dialog_uri);
 +
 +        if (valid_path_head && g_str_has_prefix (dialog_uri, path_head))
 +        {
 +            gchar *part = dialog_uri + strlen (path_head);
 +            gchar *new_uri = g_strconcat ("file:", part, NULL);
 +            xaccTransSetAssociation (trans, new_uri);
 +            g_free (new_uri);
 +        }
 +        else
 +            xaccTransSetAssociation (trans, dialog_uri);
 +
 +        g_free (dialog_uri);
 +    }
 +    g_free (path_head);
 +    gtk_widget_destroy (dialog);
 +}
 +
 +static void
 +gsr_default_associate_handler_location (GNCSplitReg *gsr, Transaction *trans, gboolean have_uri)
 +{
 +    GtkWidget *dialog, *entry, *label, *content_area;
 +    gint response;
 +
 +    dialog = gtk_dialog_new_with_buttons (_("Associate Location with Transaction"),
 +                                     GTK_WINDOW(gsr->window),
 +                                     GTK_DIALOG_MODAL,
 +                                     _("_Remove"), GTK_RESPONSE_REJECT,
 +                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
 +                                     _("_OK"), GTK_RESPONSE_ACCEPT,
 +                                     NULL);
 +
 +    content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 +
 +    // add the entry text
 +    entry = gtk_entry_new ();
 +    gtk_entry_set_width_chars (GTK_ENTRY (entry), 80);
 +    gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
 +
 +    // add a label and set entry text if required
 +    if (have_uri)
 +    {
 +        label = gtk_label_new (_("Amend URL:"));
 +        gtk_entry_set_text (GTK_ENTRY (entry), xaccTransGetAssociation (trans));
 +    }
 +    else
 +        label = gtk_label_new (_("Enter URL:"));
 +
 +    // pack label and entry to content area
 +    gnc_label_set_alignment (label, 0.0, 0.5);
 +    gtk_container_add (GTK_CONTAINER (content_area), label);
 +    gtk_container_add (GTK_CONTAINER (content_area), entry);
 +
 +    // set spacings
 +    gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
 +
 +    // set the default response
 +    gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 +
 +    gtk_widget_show_all (dialog);
 +
 +    // run the dialog
 +    response = gtk_dialog_run (GTK_DIALOG (dialog));
 +
 +    if (response == GTK_RESPONSE_REJECT)
 +        xaccTransSetAssociation (trans, "");
 +
 +    if (response == GTK_RESPONSE_ACCEPT)
 +    {
 +        const gchar *dialog_uri = gtk_entry_get_text (GTK_ENTRY (entry));
 +        DEBUG("Location URI: %s\n", dialog_uri);
 +        xaccTransSetAssociation (trans, dialog_uri);
 +    }
 +    gtk_widget_destroy (dialog);
 +}
 +
 +/**
 + * Associates a URI with the current transaction.
 + **/
 +void
 +gsr_default_associate_handler (GNCSplitReg *gsr, gboolean uri_is_file)
 +{
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +    Split *split = gnc_split_register_get_current_split (reg);
 +    Transaction *trans;
 +    CursorClass cursor_class;
 +    const gchar *uri;
 +    gboolean have_uri = FALSE;
 +
 +    /* get the current split based on cursor position */
 +    if (split == NULL)
 +    {
 +        gnc_split_register_cancel_cursor_split_changes (reg);
 +        return;
 +    }
 +
 +    trans = xaccSplitGetParent (split);
 +    cursor_class = gnc_split_register_get_current_cursor_class (reg);
 +
 +    if (cursor_class == CURSOR_CLASS_NONE)
 +        return;
 +
 +    if (is_trans_readonly_and_warn (trans))
 +        return;
 +
 +    // get the existing uri
 +    uri = xaccTransGetAssociation (trans);
 +
 +    // Check for uri is empty or NULL
 +    if (g_strcmp0 (uri, "") != 0 && g_strcmp0 (uri, NULL) != 0)
 +    {
 +        have_uri = TRUE;
 +
 +        if (g_str_has_prefix (uri, "file:")) // use the correct dialog
 +            uri_is_file = TRUE;
 +        else
 +            uri_is_file = FALSE;
 +    }
 +
 +    if (uri_is_file == TRUE)
 +        gsr_default_associate_handler_file (gsr, trans, have_uri);
 +    else
 +        gsr_default_associate_handler_location (gsr, trans, have_uri);
 +}
 +
 +/**
 + * Executes the associated link with the current transaction.
 + **/
 +void
 +gsr_default_execassociated_handler (GNCSplitReg *gsr, gpointer data)
 +{
 +    CursorClass cursor_class;
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +    Transaction *trans;
 +    Split *split = gnc_split_register_get_current_split (reg);
 +    const char *uri;
 +    const char *run_uri;
 +    gchar *uri_scheme;
 +
 +    /* get the current split based on cursor position */
 +    if (split == NULL)
 +    {
 +        gnc_split_register_cancel_cursor_split_changes (reg);
 +        return;
 +    }
 +
 +    trans = xaccSplitGetParent (split);
 +    cursor_class = gnc_split_register_get_current_cursor_class (reg);
 +
 +    if (cursor_class == CURSOR_CLASS_NONE)
 +        return;
 +
 +#ifdef DUMP_FUNCTIONS
 +    if (qof_log_check (log_module, QOF_LOG_DEBUG))
 +        xaccTransDump (trans, "ExecAssociated");
 +#endif
 +
 +    uri = xaccTransGetAssociation (trans);
 +
 +    if (g_strcmp0 (uri, "") == 0 && g_strcmp0 (uri, NULL) == 0)
 +        gnc_error_dialog (NULL, "%s", _("This transaction is not associated with a URI."));
 +    else
 +    {
 +        if (g_str_has_prefix (uri,"file:/") && !g_str_has_prefix (uri,"file://")) // Check for relative path
 +        {
 +            gchar *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, "assoc-head");
 +
 +            if ((path_head != NULL) && (g_strcmp0 (path_head, "") != 0)) // not default entry
 +            {
 +                const gchar *part = uri + strlen ("file:");
 +                run_uri = g_strconcat (path_head, part, NULL);
 +            }
 +            else
 +                run_uri = g_strdup (uri);
 +        }
 +        else
 +            run_uri = g_strdup (uri);
 +
 +        uri_scheme = g_uri_parse_scheme (run_uri);
 +
 +        if (uri_scheme != NULL) // make sure we have a scheme entry
 +        {
 +            gnc_launch_assoc (run_uri);
 +            g_free (uri_scheme);
 +        }
 +        else
 +            gnc_error_dialog (NULL, "%s", _("This transaction is not associated with a valid URI."));
 +    }
 +    return;
 +}
 +
 +void
 +gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    CursorClass cursor_class;
 +    SplitRegister *reg;
 +    Transaction *trans;
 +    Split *split;
 +    GtkWidget *dialog;
 +    gint response;
 +    const gchar *warning;
 +
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +
 +    /* get the current split based on cursor position */
 +    split = gnc_split_register_get_current_split(reg);
 +    if (split == NULL)
 +    {
 +        gnc_split_register_cancel_cursor_split_changes (reg);
 +        return;
 +    }
 +
 +    trans = xaccSplitGetParent(split);
 +    cursor_class = gnc_split_register_get_current_cursor_class (reg);
 +
 +    /* Deleting the blank split just cancels */
 +    {
 +        Split *blank_split = gnc_split_register_get_blank_split (reg);
 +
 +        if (split == blank_split)
 +        {
 +            gnc_split_register_cancel_cursor_trans_changes (reg);
 +            return;
 +        }
 +    }
 +
 +    if (cursor_class == CURSOR_CLASS_NONE)
 +        return;
 +
 +    if (is_trans_readonly_and_warn(trans))
 +        return;
 +
 +    /* On a split cursor, just delete the one split. */
 +    if (cursor_class == CURSOR_CLASS_SPLIT)
 +    {
 +        const char *format = _("Delete the split '%s' from the transaction '%s'?");
 +        const char *recn_warn = _("You would be deleting a reconciled split! "
 +                                  "This is not a good idea as it will cause your "
 +                                  "reconciled balance to be off.");
 +        const char *anchor_error = _("You cannot delete this split.");
 +        const char *anchor_split = _("This is the split anchoring this transaction "
 +                                     "to the register. You may not delete it from "
 +                                     "this register window. You may delete the "
 +                                     "entire transaction from this window, or you "
 +                                     "may navigate to a register that shows "
 +                                     "another side of this same transaction and "
 +                                     "delete the split from that register.");
 +        char *buf = NULL;
 +        const char *memo;
 +        const char *desc;
 +        char recn;
 +
 +        if (split == gnc_split_register_get_current_trans_split (reg, NULL))
 +        {
 +            dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
 +                                            GTK_DIALOG_MODAL
 +                                            | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                            GTK_MESSAGE_ERROR,
 +                                            GTK_BUTTONS_OK,
 +                                            "%s", anchor_error);
 +            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                    "%s", anchor_split);
 +            gtk_dialog_run(GTK_DIALOG(dialog));
 +            gtk_widget_destroy (dialog);
 +            return;
 +        }
 +
 +        memo = xaccSplitGetMemo (split);
 +        memo = (memo && *memo) ? memo : _("(no memo)");
 +
 +        desc = xaccTransGetDescription (trans);
 +        desc = (desc && *desc) ? desc : _("(no description)");
 +
 +        /* ask for user confirmation before performing permanent damage */
 +        buf = g_strdup_printf (format, memo, desc);
 +        dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
 +                                        GTK_DIALOG_MODAL
 +                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_QUESTION,
 +                                        GTK_BUTTONS_NONE,
 +                                        "%s", buf);
 +        g_free(buf);
 +        recn = xaccSplitGetReconcile (split);
 +        if (recn == YREC || recn == FREC)
 +        {
 +            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                    "%s", recn_warn);
 +            warning = GNC_PREF_WARN_REG_SPLIT_DEL_RECD;
 +        }
 +        else
 +        {
 +            warning = GNC_PREF_WARN_REG_SPLIT_DEL;
 +        }
 +
 +        gtk_dialog_add_button(GTK_DIALOG(dialog),
 +                              _("_Cancel"), GTK_RESPONSE_CANCEL);
 +        gnc_gtk_dialog_add_button(dialog, _("_Delete Split"),
 +                                  "edit-delete", GTK_RESPONSE_ACCEPT);
 +        response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
 +        gtk_widget_destroy (dialog);
 +        if (response != GTK_RESPONSE_ACCEPT)
 +            return;
 +
 +        gnc_split_register_delete_current_split (reg);
 +        return;
 +    }
 +
 +    g_return_if_fail(cursor_class == CURSOR_CLASS_TRANS);
 +
 +    /* On a transaction cursor with 2 or fewer splits in single or double
 +     * mode, we just delete the whole transaction, kerblooie */
 +    {
 +        const char *title = _("Delete the current transaction?");
 +        const char *recn_warn = _("You would be deleting a transaction "
 +                                  "with reconciled splits! "
 +                                  "This is not a good idea as it will cause your "
 +                                  "reconciled balance to be off.");
 +
 +        dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
 +                                        GTK_DIALOG_MODAL
 +                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                        GTK_MESSAGE_WARNING,
 +                                        GTK_BUTTONS_NONE,
 +                                        "%s", title);
 +        if (xaccTransHasReconciledSplits (trans))
 +        {
 +            gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +                    "%s", recn_warn);
 +            warning = GNC_PREF_WARN_REG_TRANS_DEL_RECD;
 +        }
 +        else
 +        {
 +            warning = GNC_PREF_WARN_REG_TRANS_DEL;
 +        }
 +        gtk_dialog_add_button(GTK_DIALOG(dialog),
 +                              _("_Cancel"), GTK_RESPONSE_CANCEL);
 +        gnc_gtk_dialog_add_button(dialog, _("_Delete Transaction"),
 +                                  "edit-delete", GTK_RESPONSE_ACCEPT);
 +        response =  gnc_dialog_run(GTK_DIALOG(dialog), warning);
 +        gtk_widget_destroy (dialog);
 +        if (response != GTK_RESPONSE_ACCEPT)
 +            return;
 +
 +        gnc_split_register_delete_current_trans (reg);
 +        return;
 +    }
 +}
 +
 +/**
 + * Deletes the current transaction.
 + **/
 +void
 +gnc_split_reg_delete_trans_cb(GtkWidget *widget, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "delete_ent" );
 +}
 +
 +void
 +gsr_default_dup_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_register_duplicate_current
 +    (gnc_ledger_display_get_split_register( gsr->ledger ));
 +}
 +
 +/**
 + * Duplicates the current transaction in the register.
 + **/
 +void
 +gnc_split_reg_duplicate_trans_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "dup_ent" );
 +}
 +
 +/**
 + * Schedules the current transaction for recurring-entry.
 + * If the selected transaction was created from a scheduled transaction,
 + * opens the editor for that Scheduled Transaction.
 + **/
 +void
 +gsr_default_schedule_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    SplitRegister *reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +    Transaction *pending_trans = gnc_split_register_get_current_trans (reg);
 +
 +    /* If the transaction has a sched-xact KVP frame, then go to the editor
 +     * for the existing SX; otherwise, do the sx-from-trans dialog. */
 +    {
 +	GncGUID *fromSXId = NULL;
 +	SchedXaction *theSX = NULL;
 +	GList *sxElts;
 +	qof_instance_get (QOF_INSTANCE (pending_trans),
 +			  "from-sched-xaction", &fromSXId,
 +			  NULL);
 +
 +	/* Get the correct SX */
 +	for ( sxElts = gnc_book_get_schedxactions (gnc_get_current_book())->sx_list;
 +	      (!theSX) && sxElts;
 +	      sxElts = sxElts->next )
 +	{
 +	    SchedXaction *sx = (SchedXaction*)sxElts->data;
 +	    theSX =
 +		((guid_equal (xaccSchedXactionGetGUID (sx), fromSXId))
 +		 ? sx : NULL);
 +	}
 +
 +	if ( theSX )
 +	{
 +	    gnc_ui_scheduled_xaction_editor_dialog_create(theSX, FALSE);
 +	    return;
 +	}
 +    }
 +
 +    gnc_sx_create_from_trans(pending_trans);
 +}
 +
 +void
 +gnc_split_reg_recur_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "schedule_ent" );
 +}
 +
 +/**
 + * Records into the books the currently-selected transaction.
 + **/
 +void
 +gnc_split_reg_record_trans_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "enter_ent" );
 +}
 +
 +void
 +gsr_default_cancel_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_register_cancel_cursor_trans_changes
 +    (gnc_ledger_display_get_split_register( gsr->ledger ));
 +}
 +
 +/**
 + * Cancels the edits of the currently-selected transaction.
 + **/
 +void
 +gnc_split_reg_cancel_trans_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "cancel_ent" );
 +}
 +
 +void
 +gsr_default_expand_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gint activeCount;
 +    gboolean expand;
 +    SplitRegister *reg;
 +
 +    if (!gsr)
 +        return;
 +
 +    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +
 +    /* These should all be in agreement. */
 +    activeCount =
 +        ( ( gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(gsr->split_menu_check)) ? 1 : -1 )
 +          + ( gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(gsr->split_popup_check)) ? 1 : -1 )
 +          + ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(gsr->split_button) )
 +              ? 1 : -1 ) );
 +
 +    /* If activeCount > 0, then there's more active than inactive; otherwise,
 +     * more inactive than active.  Both determine which state the user is
 +     * attempting to get to. */
 +    expand = ( activeCount < 0 );
 +
 +    /* The ledger's invocation of 'redraw_all' will force the agreement in the
 +     * other split state widgets, so we neglect doing it here.  */
 +    gnc_split_register_expand_current_trans (reg, expand);
 +}
 +
 +void
 +gnc_split_reg_expand_trans_menu_cb (GtkWidget *widget, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "expand_ent" );
 +}
 +
 +void
 +gnc_split_reg_expand_trans_toolbar_cb (GtkWidget *widget, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "expand_ent" );
 +}
 +
 +/**
 + * move the cursor to the split, if present in register
 +**/
 +void
 +gnc_split_reg_jump_to_split(GNCSplitReg *gsr, Split *split)
 +{
 +    Transaction *trans;
 +    VirtualCellLocation vcell_loc;
 +    SplitRegister *reg;
 +
 +    if (!gsr) return;
 +
 +    trans = xaccSplitGetParent(split);
 +
 +    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 +
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +
 +    if (gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc))
 +        gnucash_register_goto_virt_cell( gsr->reg, vcell_loc );
 +
 +    gnc_ledger_display_refresh( gsr->ledger );
 +}
 +
 +
 +/**
 + * Move the cursor to the split in the non-blank amount column.
 + **/
 +void
 +gnc_split_reg_jump_to_split_amount(GNCSplitReg *gsr, Split *split)
 +{
 +    VirtualLocation virt_loc;
 +    SplitRegister *reg;
 +    Transaction *trans;
 +
 +    if (!gsr) return;
 +
 +    trans = xaccSplitGetParent(split);
 +    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 +
 +    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +
 +    if (gnc_split_register_get_split_amount_virt_loc (reg, split, &virt_loc))
 +        gnucash_register_goto_virt_loc (gsr->reg, virt_loc);
 +
 +    gnc_ledger_display_refresh (gsr->ledger);
 +}
 +
 +void
 +gnc_split_reg_jump_to_blank (GNCSplitReg *gsr)
 +{
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +    VirtualCellLocation vcell_loc;
 +    Split *blank;
 +
 +    ENTER("gsr=%p", gsr);
 +
 +    blank = gnc_split_register_get_blank_split (reg);
 +    if (blank == NULL)
 +    {
 +        LEAVE("no blank split");
 +        return;
 +    }
 +
 +    if (gnc_split_register_get_split_virt_loc (reg, blank, &vcell_loc))
 +        gnucash_register_goto_virt_cell (gsr->reg, vcell_loc);
 +
 +    gnc_ledger_display_refresh (gsr->ledger);
 +    LEAVE(" ");
 +}
 +
 +void
 +gnc_split_reg_balancing_entry(GNCSplitReg *gsr, Account *account,
 +                              time64 statement_date, gnc_numeric balancing_amount)
 +{
 +
 +    Transaction *transaction;
 +    Split *split;
 +
 +    // create transaction
 +    transaction = create_balancing_transaction(gnc_get_current_book(),
 +                  account, statement_date, balancing_amount);
 +
 +    // jump to transaction
 +    split = xaccTransFindSplitByAccount(transaction, account);
 +    if (split == NULL)
 +    {
 +        // default behaviour: jump to blank split
 +        g_warning("create_balancing_transaction failed");
 +        gnc_split_reg_jump_to_blank(gsr);
 +    }
 +    else
 +    {
 +        // goto balancing transaction
 +        gnc_split_reg_jump_to_split(gsr, split );
 +    }
 +}
 +
 +static Transaction*
 +create_balancing_transaction(QofBook *book, Account *account,
 +                             time64 statement_date, gnc_numeric balancing_amount)
 +{
 +
 +    Transaction *trans;
 +    Split *split;
 +
 +    if (!account)
 +        return NULL;
 +    if (gnc_numeric_zero_p(balancing_amount))
 +        return NULL;
 +
 +    xaccAccountBeginEdit(account);
 +
 +    trans = xaccMallocTransaction(book);
 +
 +    xaccTransBeginEdit(trans);
 +
 +    // fill Transaction
 +    xaccTransSetCurrency(trans, gnc_account_or_default_currency(account, NULL));
 +    xaccTransSetDatePostedSecsNormalized(trans, statement_date);
 +    xaccTransSetDescription(trans, _("Balancing entry from reconciliation"));
 +    /* We also must set a new DateEntered on the new entry
 +     * because otherwise the ordering is not deterministic */
 +    xaccTransSetDateEnteredSecs(trans, gnc_time(NULL));
 +
 +    // 1. Split
 +    split = xaccMallocSplit(book);
 +    xaccTransAppendSplit(trans, split);
 +    xaccAccountInsertSplit(account, split);
 +    xaccSplitSetAmount(split, balancing_amount);
 +    xaccSplitSetValue(split, balancing_amount);
 +
 +    // 2. Split (no account is defined: split goes to orphan account)
 +    split = xaccMallocSplit(book);
 +    xaccTransAppendSplit(trans, split);
 +
 +    balancing_amount = gnc_numeric_neg(balancing_amount);
 +    xaccSplitSetAmount(split, balancing_amount);
 +    xaccSplitSetValue(split, balancing_amount);
 +
 +    xaccTransCommitEdit(trans);
 +    xaccAccountCommitEdit(account);
 +    return trans;
 +}
 +
 +void
 +gsr_default_blank_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    SplitRegister *reg;
 +
 +    ENTER("gsr=%p, gpointer=%p", gsr, data);
 +
 +    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +
 +    if (gnc_split_register_save (reg, TRUE))
 +        gnc_split_register_redraw (reg);
 +
 +    gnc_split_reg_jump_to_blank (gsr);
 +    LEAVE(" ");
 +}
 +
 +void
 +gnc_split_reg_new_trans_cb (GtkWidget *widget, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "blank" );
 +}
 +
 +void
 +gsr_default_jump_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    g_assert_not_reached();
 +}
 +
 +void
 +gnc_split_reg_jump_cb( GtkWidget *widget, gpointer data )
 +{
 +    GNCSplitReg *gsr = data;
 +    gsr_emit_simple_signal( gsr, "jump" );
 +}
 +
 +void
 +gnc_split_reg_change_style (GNCSplitReg *gsr, SplitRegisterStyle style)
 +{
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +
 +    if (style == reg->style)
 +        return;
 +
 +    gnc_split_register_config (reg, reg->type, style, reg->use_double_line);
 +    gnc_ledger_display_refresh (gsr->ledger);
 +}
 +
 +void
 +gnc_split_reg_style_ledger_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +
 +    if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
 +        return;
 +
 +    gnc_split_reg_change_style (gsr, REG_STYLE_LEDGER);
 +}
 +
 +void
 +gnc_split_reg_style_auto_ledger_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +
 +    if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
 +        return;
 +
 +    gnc_split_reg_change_style (gsr, REG_STYLE_AUTO_LEDGER);
 +}
 +
 +void
 +gnc_split_reg_style_journal_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +
 +    if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
 +        return;
 +
 +    gnc_split_reg_change_style (gsr, REG_STYLE_JOURNAL);
 +}
 +
 +void
 +gnc_split_reg_double_line_cb (GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +    gboolean use_double_line;
 +
 +    use_double_line = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w));
 +    if ( use_double_line == reg->use_double_line )
 +        return;
 +
 +    gnc_split_register_config( reg, reg->type, reg->style, use_double_line );
 +    gnc_ledger_display_refresh( gsr->ledger );
 +}
 +
 +static void
 +gnc_split_reg_sort_force( GNCSplitReg *gsr, SortType sort_code, gboolean force )
 +{
 +    Query *query = gnc_ledger_display_get_query( gsr->ledger );
 +    gboolean show_present_divider = FALSE;
 +    GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
 +    SplitRegister *reg;
 +
 +    if ((gsr->sort_type == sort_code) && !force)
 +        return;
 +
 +    standard = g_slist_prepend( NULL, QUERY_DEFAULT_SORT );
 +
 +    switch (sort_code)
 +    {
 +    case BY_STANDARD:
 +        p1 = standard;
 +        show_present_divider = TRUE;
 +        break;
 +    case BY_DATE:
 +        p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = standard;
 +        show_present_divider = TRUE;
 +        break;
 +    case BY_DATE_ENTERED:
 +        p1 = g_slist_prepend (p1, TRANS_DATE_ENTERED);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = standard;
 +        break;
 +    case BY_DATE_RECONCILED:
 +        p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
 +        p2 = g_slist_prepend (p2, SPLIT_DATE_RECONCILED);
 +        p3 = standard;
 +        break;
 +    case BY_NUM:
 +        p1 = g_slist_prepend (p1, TRANS_NUM);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = standard;
 +        break;
 +    case BY_AMOUNT:
 +        p1 = g_slist_prepend (p1, SPLIT_VALUE);
 +        p2 = standard;
 +        break;
 +    case BY_MEMO:
 +        p1 = g_slist_prepend (p1, SPLIT_MEMO);
 +        p2 = standard;
 +        break;
 +    case BY_DESC:
 +        p1 = g_slist_prepend (p1, TRANS_DESCRIPTION);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = standard;
 +        break;
 +    case BY_ACTION:
 +        p1 = g_slist_prepend (p1, SPLIT_ACTION);
 +        p2 = standard;
 +        break;
 +    case BY_NOTES:
 +        p1 = g_slist_prepend (p1, TRANS_NOTES);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = standard;
 +        break;
 +    default:
 +        g_slist_free (standard);
 +        g_return_if_fail (FALSE);
 +        break;
 +    }
 +
 +    qof_query_set_sort_order( query, p1, p2, p3 );
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +    gnc_split_register_show_present_divider( reg, show_present_divider );
 +    gsr->sort_type = sort_code;
 +    gnc_ledger_display_refresh( gsr->ledger );
 +}
 +
 +static void
 +gnc_split_reg_sort( GNCSplitReg *gsr, SortType sort_code )
 +{
 +    gnc_split_reg_sort_force( gsr, sort_code, FALSE );
 +}
 +
 +void
 +gnc_split_reg_sort_standard_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_STANDARD);
 +}
 +
 +void
 +gnc_split_reg_sort_date_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_DATE);
 +}
 +
 +void
 +gnc_split_reg_sort_date_entered_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_DATE_ENTERED);
 +}
 +
 +void
 +gnc_split_reg_sort_date_reconciled_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_DATE_RECONCILED);
 +}
 +
 +void
 +gnc_split_reg_sort_num_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_NUM);
 +}
 +
 +void
 +gnc_split_reg_sort_amount_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_AMOUNT);
 +}
 +
 +void
 +gnc_split_reg_sort_memo_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_MEMO);
 +}
 +
 +void
 +gnc_split_reg_sort_desc_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_DESC);
 +}
 +
 +void
 +gnc_split_reg_sort_action_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_ACTION);
 +}
 +
 +void
 +gnc_split_reg_sort_notes_cb(GtkWidget *w, gpointer data)
 +{
 +    GNCSplitReg *gsr = data;
 +    gnc_split_reg_sort(gsr, BY_NOTES);
 +}
 +
 +
 +void
 +gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev)
 +{
 +  /* Note: sort_reversed is the boolean opposite of sort_increasing
 +   *       so when rev == true, we're sorting decreasing
 +   *       In other words, qof_query_set_sort_increasing should
 +   *       always use the inverse of rev.
 +   */
 +  Query *query = gnc_ledger_display_get_query( gsr->ledger );
 +  qof_query_set_sort_increasing (query, !rev, !rev, !rev);
 +  gnc_ledger_display_refresh( gsr->ledger );
 +}
 +
 +static void
 +gnc_split_reg_record (GNCSplitReg *gsr)
 +{
 +    SplitRegister *reg;
 +    Transaction *trans;
 +
 +    ENTER("gsr=%p", gsr);
 +
 +    reg = gnc_ledger_display_get_split_register (gsr->ledger);
 +    trans = gnc_split_register_get_current_trans (reg);
 +
 +    if (!gnc_split_register_save (reg, TRUE))
 +    {
 +        LEAVE("no save");
 +        return;
 +    }
 +
 +    gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
 +
 +    /* Explicit redraw shouldn't be needed,
 +     * since gui_refresh events should handle this. */
 +    /* gnc_split_register_redraw (reg); */
 +    LEAVE(" ");
 +}
 +
 +static gboolean
 +gnc_split_reg_match_trans_row( VirtualLocation virt_loc,
 +                               gpointer user_data )
 +{
 +    GNCSplitReg *gsr = user_data;
 +    CursorClass cursor_class;
 +    SplitRegister *sr;
 +
 +    sr = gnc_ledger_display_get_split_register (gsr->ledger);
 +    cursor_class = gnc_split_register_get_cursor_class (sr, virt_loc.vcell_loc);
 +
 +    return (cursor_class == CURSOR_CLASS_TRANS);
 +}
 +
 +static void
 +gnc_split_reg_goto_next_trans_row (GNCSplitReg *gsr)
 +{
 +    ENTER("gsr=%p", gsr);
 +    gnucash_register_goto_next_matching_row( gsr->reg,
 +            gnc_split_reg_match_trans_row,
 +            gsr );
 +    LEAVE(" ");
 +}
 +
 +void
 +gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction )
 +{
 +    SplitRegister *sr = gnc_ledger_display_get_split_register( gsr->ledger );
 +    gboolean goto_blank;
 +
 +    ENTER("gsr=%p, next_transaction=%s", gsr, next_transaction ? "TRUE" : "FALSE");
 +
 +    goto_blank = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL_REGISTER,
 +                                    GNC_PREF_ENTER_MOVES_TO_END);
 +
 +    /* If we are in single or double line mode and we hit enter
 +     * on the blank split, go to the blank split instead of the
 +     * next row. This prevents the cursor from jumping around
 +     * when you are entering transactions. */
 +    if ( !goto_blank && !next_transaction )
 +    {
 +        SplitRegisterStyle style = sr->style;
 +
 +        if (style == REG_STYLE_LEDGER)
 +        {
 +            Split *blank_split;
 +
 +            blank_split = gnc_split_register_get_blank_split(sr);
 +            if (blank_split != NULL)
 +            {
 +                Split *current_split;
 +
 +                current_split = gnc_split_register_get_current_split(sr);
 +
 +                if (blank_split == current_split)
 +                    goto_blank = TRUE;
 +            }
 +        }
 +    }
 +
 +    /* First record the transaction. This will perform a refresh. */
 +    gnc_split_reg_record( gsr );
 +
 +    if (!goto_blank && next_transaction)
 +        gnc_split_register_expand_current_trans (sr, FALSE);
 +
 +    /* Now move. */
 +    if (goto_blank)
 +        gnc_split_reg_jump_to_blank( gsr );
 +    else if (next_transaction)
 +        gnc_split_reg_goto_next_trans_row( gsr );
 +    else
 +        gnucash_register_goto_next_virt_row( gsr->reg );
 +    LEAVE(" ");
 +}
 +
 +void
 +gsr_default_enter_handler( GNCSplitReg *gsr, gpointer data )
 +{
 +    gnc_split_reg_enter( gsr, FALSE );
 +}
 +
 +void
 +gnc_split_reg_record_cb (GnucashRegister *reg, gpointer data)
 +{
 +    gsr_emit_simple_signal( (GNCSplitReg*)data, "enter_ent" );
 +}
 +
 +void
 +gnc_split_reg_size_allocate (GtkWidget *widget,
 +                             GtkAllocation *allocation,
 +                             gpointer user_data)
 +{
 +    GNCSplitReg *gsr = user_data;
 +    gsr->width = allocation->width;
 +    gtk_window_set_default_size( GTK_WINDOW(gsr->window), gsr->width, 0 );
 +}
 +
 +static
 +GtkWidget*
 +add_summary_label (GtkWidget *summarybar, const char *label_str)
 +{
 +    GtkWidget *hbox;
 +    GtkWidget *label;
 +
 +    hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
 +    gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
 +    gtk_box_pack_start( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
 +
 +    label = gtk_label_new( label_str );
 +    gnc_label_set_alignment(label, 1.0, 0.5 );
 +    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
 +
 +    label = gtk_label_new( "" );
 +    gnc_label_set_alignment(label, 1.0, 0.5 );
 +    gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
 +
 +    return label;
 +}
 +
 +GtkWidget *
 +gsr_create_summary_bar( GNCSplitReg *gsr )
 +{
 +    GtkWidget *summarybar;
 +
 +    gsr->cleared_label    = NULL;
 +    gsr->balance_label    = NULL;
 +    gsr->reconciled_label = NULL;
 +    gsr->future_label     = NULL;
 +    gsr->projectedminimum_label  = NULL;
 +    gsr->shares_label     = NULL;
 +    gsr->value_label      = NULL;
 +
 +    if ( gnc_ledger_display_type(gsr->ledger) >= LD_SUBACCOUNT )
 +    {
 +        gsr->summarybar = NULL;
 +        return NULL;
 +    }
 +
 +    summarybar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
 +    gtk_box_set_homogeneous (GTK_BOX (summarybar), FALSE);
 +
 +    if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
 +    {
 +        gsr->balance_label    = add_summary_label (summarybar, _("Present:"));
 +        gsr->future_label     = add_summary_label (summarybar, _("Future:"));
 +        gsr->cleared_label    = add_summary_label (summarybar, _("Cleared:"));
 +        gsr->reconciled_label = add_summary_label (summarybar, _("Reconciled:"));
 +        gsr->projectedminimum_label  = add_summary_label (summarybar, _("Projected Minimum:"));
 +    }
 +    else
 +    {
 +        gsr->shares_label     = add_summary_label (summarybar, _("Shares:"));
 +        gsr->value_label      = add_summary_label (summarybar, _("Current Value:"));
 +    }
 +
 +    gsr->summarybar = summarybar;
 +
 +    /* Force the first update */
 +    gsr_redraw_all_cb(NULL, gsr);
 +    return gsr->summarybar;
 +}
 +
 +/**
 + * Opens up a register window for a group of Accounts.
 + * @param gsr the register window instance
 + * @return A GNCPlaceholderType indicating presence and type of placeholder
 + * accounts
 + **/
 +static
 +GNCPlaceholderType
 +gnc_split_reg_get_placeholder( GNCSplitReg *gsr )
 +{
 +    Account *leader;
 +    SplitRegister *reg;
 +    gboolean single_account;
 +
 +    if (gsr == NULL)
 +        return PLACEHOLDER_NONE;
 +
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +
 +    switch (reg->type)
 +    {
 +    case GENERAL_JOURNAL:
 +    case INCOME_LEDGER:
 +    case PORTFOLIO_LEDGER:
 +    case SEARCH_LEDGER:
 +        single_account = FALSE;
 +        break;
 +    default:
 +        single_account = TRUE;
 +        break;
 +    }
 +
 +    leader = gnc_ledger_display_leader( gsr->ledger );
 +
 +    if (leader == NULL)
 +        return PLACEHOLDER_NONE;
 +    if (single_account)
 +    {
 +        if (xaccAccountGetPlaceholder( leader ))
 +            return PLACEHOLDER_THIS;
 +        return PLACEHOLDER_NONE;
 +    }
 +    return xaccAccountGetDescendantPlaceholder( leader );
 +}
 +
 +/**
 + * @see gtk_callback_bug_workaround
 + **/
 +typedef struct dialog_args
 +{
 +    GNCSplitReg *gsr;
 +    gchar *string;
 +} dialog_args;
 +
 +/**
 + * Gtk has occasional problems with performing function as part of a
 + * callback.  This routine gets called via a timer callback to get it out of
 + * the data path with the problem.
 + **/
 +static
 +gboolean
 +gtk_callback_bug_workaround (gpointer argp)
 +{
 +    dialog_args *args = argp;
 +    const gchar *read_only = _("This account register is read-only.");
 +    GtkWidget *dialog;
 +
 +    dialog = gtk_message_dialog_new(GTK_WINDOW(args->gsr->window),
 +                                    GTK_DIALOG_DESTROY_WITH_PARENT,
 +                                    GTK_MESSAGE_WARNING,
 +                                    GTK_BUTTONS_CLOSE,
 +                                    "%s", read_only);
 +    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
 +            "%s", args->string);
 +    gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_IS_READ_ONLY);
 +    gtk_widget_destroy(dialog);
 +    g_free(args);
 +    return FALSE;
 +}
 +
 +/**
 + * Determines whether this register window should be read-only.
 + **/
 +static
 +void
 +gnc_split_reg_determine_read_only( GNCSplitReg *gsr )
 +{
 +    dialog_args *args = g_malloc(sizeof(dialog_args));
 +    SplitRegister *reg;
 +
 +    if (qof_book_is_readonly(gnc_get_current_book()))
 +    {
 +        /* Is the book read-only? Then for sure also make this register
 +        read-only. */
 +        gsr->read_only = TRUE;
 +    }
 +
 +    if ( !gsr->read_only )
 +    {
 +
 +        switch (gnc_split_reg_get_placeholder(gsr))
 +        {
 +        case PLACEHOLDER_NONE:
 +            /* stay as false. */
 +            return;
 +
 +        case PLACEHOLDER_THIS:
 +            args->string = _("This account may not be edited. If you want "
 +                             "to edit transactions in this register, please "
 +                             "open the account options and turn off the "
 +                             "placeholder checkbox.");
 +            break;
 +
 +        default:
 +            args->string = _("One of the sub-accounts selected may not be "
 +                             "edited. If you want to edit transactions in "
 +                             "this register, please open the sub-account "
 +                             "options and turn off the placeholder checkbox. "
 +                             "You may also open an individual account instead "
 +                             "of a set of accounts.");
 +            break;
 +        }
 +        gsr->read_only = TRUE;
 +        /* Put up a warning dialog */
 +        args->gsr = gsr;
 +        g_timeout_add (250, gtk_callback_bug_workaround, args); /* 0.25 seconds */
 +    }
 +
 +    /* Make the contents immutable */
 +    reg = gnc_ledger_display_get_split_register( gsr->ledger );
 +    gnc_split_register_set_read_only( reg, TRUE );
 +
 +}
 +
 +static
 +GtkWidget *
 +gnc_split_reg_get_parent( GNCLedgerDisplay *ledger )
 +{
 +    GNCSplitReg *gsr =
 +        GNC_SPLIT_REG(gnc_ledger_display_get_user_data( ledger ));
 +
 +    if (gsr == NULL)
 +        return NULL;
 +
 +    return gsr->window;
 +}
 +
 +static
 +void
 +gsr_emit_help_changed( GnucashRegister *reg, gpointer user_data )
 +{
 +    gsr_emit_simple_signal( (GNCSplitReg*)user_data, "help-changed" );
 +}
 +
 +static
 +void
 +gsr_emit_include_date_signal( GNCSplitReg *gsr, time64 date )
 +{
 +    g_signal_emit_by_name( gsr, "include-date", date, NULL );
 +}
 +
 +static
 +void
 +gsr_emit_simple_signal( GNCSplitReg *gsr, const char *sigName )
 +{
 +    g_signal_emit_by_name( gsr, sigName, NULL );
 +}
 +
 +GnucashRegister*
 +gnc_split_reg_get_register( GNCSplitReg *gsr )
 +{
 +    if ( !gsr )
 +        return NULL;
 +
 +    return gsr->reg;
 +}
 +
 +SortType
 +gnc_split_reg_get_sort_type( GNCSplitReg *gsr )
 +{
 +    g_assert( gsr );
 +    return gsr->sort_type;
 +}
 +
 +void
 +gnc_split_reg_set_sort_type( GNCSplitReg *gsr, SortType t )
 +{
 +    gnc_split_reg_sort( gsr, t );
 +}
 +
 +void
 +gnc_split_reg_set_sort_type_force( GNCSplitReg *gsr, SortType t, gboolean force )
 +{
 +    gnc_split_reg_sort_force( gsr, t, force );
 +}
 +
 +
 +GtkWidget*
 +gnc_split_reg_get_summarybar( GNCSplitReg *gsr )
 +{
 +    if ( !gsr ) return NULL;
 +    return gsr->summarybar;
 +}
 +
 +gboolean
 +gnc_split_reg_get_read_only( GNCSplitReg *gsr )
 +{
 +    g_assert( gsr );
 +    return gsr->read_only;
 +}
 +
 +void
 +gnc_split_reg_set_moved_cb( GNCSplitReg *gsr, GFunc cb, gpointer cb_data )
 +{
 +    gnucash_register_set_moved_cb (gsr->reg, cb, cb_data);
 +}
diff --cc gnucash/gnome/gtkbuilder/gnc-plugin-page-register.glade
index a04c1ff,0000000..ce244d0
mode 100644,000000..100644
--- a/gnucash/gnome/gtkbuilder/gnc-plugin-page-register.glade
+++ b/gnucash/gnome/gtkbuilder/gnc-plugin-page-register.glade
@@@ -1,1167 -1,0 +1,1169 @@@
++<?xml version="1.0" encoding="utf-8"?>
++<?xml version="1.0" encoding="utf-8"?>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!-- Generated with glade 3.20.0 -->
- <interface>
 +  <requires lib="gtk+" version="3.10"/>
 +  <object class="GtkDialog" id="filter_by_dialog">
++  <object class="GtkDialog" id="filter_by_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="border_width">6</property>
-     <property name="title" translatable="yes">Filter register by...</property>
++    <property name="title" translatable="yes" comments="Filter register by... Dialog">Filter register by...</property>
 +    <property name="resizable">False</property>
 +    <property name="destroy_with_parent">True</property>
 +    <property name="type_hint">dialog</property>
 +    <signal name="response" handler="gnc_plugin_page_register_filter_response_cb" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox19">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <property name="spacing">6</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area21">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="cancelbutton4">
 +                <property name="label" translatable="yes">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="okbutton4">
 +                <property name="label" translatable="yes">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="has_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkNotebook" id="notebook1">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <child>
 +              <object class="GtkBox" id="vbox103">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="border_width">12</property>
 +                <property name="orientation">vertical</property>
 +                <child>
 +                  <object class="GtkRadioButton" id="filter_show_all">
-                     <property name="label" translatable="yes">Show _All</property>
++                    <property name="label" translatable="yes" comments="Filter By Dialog, Date Tab">Show _All</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">False</property>
 +                    <property name="fill">False</property>
 +                    <property name="position">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="label847680">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">False</property>
 +                    <property name="fill">False</property>
 +                    <property name="position">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkRadioButton" id="filter_show_range">
 +                    <property name="label" translatable="yes">Select Range:</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <property name="group">filter_show_all</property>
 +                    <signal name="toggled" handler="gnc_plugin_page_register_filter_select_range_cb" swapped="no"/>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">False</property>
 +                    <property name="fill">False</property>
 +                    <property name="position">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkGrid" id="select_range_table">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="column_spacing">6</property>
 +                    <child>
 +                      <object class="GtkLabel" id="label847682">
 +                        <property name="visible">True</property>
-                         <property name="can_focus">False</property>
++                        <property name="label" translatable="yes">Start:</property>
 +                        <property name="label" translatable="yes">Start:</property>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="start_date_earliest">
 +                        <property name="label" translatable="yes">_Earliest</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_start_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="end_date_choose">
 +                        <property name="label" translatable="yes">Choo_se Date:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_end_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">6</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="end_date_today">
 +                        <property name="label" translatable="yes">Toda_y</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">end_date_choose</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_end_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">5</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="end_date_latest">
 +                        <property name="label" translatable="yes">_Latest</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">end_date_choose</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_end_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">4</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label847683">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">3</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkLabel" id="label847684">
 +                        <property name="visible">True</property>
-                         <property name="can_focus">False</property>
++                        <property name="label" translatable="yes">End:</property>
 +                        <property name="label" translatable="yes">End:</property>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">4</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="start_date_choose">
 +                        <property name="label" translatable="yes">C_hoose Date:</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">start_date_earliest</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_start_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">2</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkRadioButton" id="start_date_today">
 +                        <property name="label" translatable="yes">_Today</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <property name="group">start_date_earliest</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_start_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">1</property>
 +                        <property name="top_attach">1</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkBox" id="start_date_hbox">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <child>
 +                          <placeholder/>
 +                        </child>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">2</property>
 +                        <property name="top_attach">2</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkBox" id="end_date_hbox">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <child>
 +                          <placeholder/>
 +                        </child>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">2</property>
 +                        <property name="top_attach">6</property>
 +                      </packing>
 +                    </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>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">True</property>
 +                    <property name="fill">True</property>
 +                    <property name="position">3</property>
 +                  </packing>
 +                </child>
 +              </object>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label847678">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">Date</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkBox" id="vbox104">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="orientation">vertical</property>
 +                <child>
 +                  <object class="GtkGrid" id="table1">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="border_width">12</property>
 +                    <child>
 +                      <object class="GtkCheckButton" id="filter_status_unreconciled">
-                         <property name="label" translatable="yes">_Unreconciled</property>
++                        <property name="label" translatable="yes" comments="Filter By Dialog, State Tab">_Unreconciled</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="toggled" handler="gnc_plugin_page_register_filter_status_one_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkCheckButton" id="filter_status_reconciled">
 +                        <property name="label" translatable="yes">_Reconciled</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="toggled" handler="gnc_plugin_page_register_filter_status_one_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">1</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkCheckButton" id="filter_status_cleared">
 +                        <property name="label" translatable="yes">C_leared</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="toggled" handler="gnc_plugin_page_register_filter_status_one_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">2</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkCheckButton" id="filter_status_voided">
 +                        <property name="label" translatable="yes">_Voided</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="toggled" handler="gnc_plugin_page_register_filter_status_one_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">3</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkCheckButton" id="filter_status_frozen">
 +                        <property name="label" translatable="yes">_Frozen</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">False</property>
 +                        <property name="halign">start</property>
 +                        <property name="use_underline">True</property>
 +                        <property name="draw_indicator">True</property>
 +                        <signal name="toggled" handler="gnc_plugin_page_register_filter_status_one_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">4</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkButton" id="button84">
 +                        <property name="label" translatable="yes">Select _All</property>
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">True</property>
 +                        <property name="receives_default">True</property>
 +                        <property name="halign">center</property>
 +                        <property name="use_underline">True</property>
 +                        <signal name="clicked" handler="gnc_plugin_page_register_filter_status_all_cb" swapped="no"/>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">6</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkSeparator" id="hseparator1">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="margin_top">5</property>
 +                        <property name="margin_bottom">5</property>
 +                        <property name="hexpand">True</property>
 +                      </object>
 +                      <packing>
 +                        <property name="left_attach">0</property>
 +                        <property name="top_attach">5</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">True</property>
 +                    <property name="fill">True</property>
 +                    <property name="position">0</property>
 +                  </packing>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child type="tab">
 +              <object class="GtkLabel" id="label847679">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">Status</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="position">1</property>
 +                <property name="tab_fill">False</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">1</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkBox" id="hbox1">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <child>
 +              <object class="GtkCheckButton" id="filter_save">
-                 <property name="label" translatable="yes">Sa_ve Filter</property>
++                <property name="label" translatable="yes" comments="Filter By Dialog, below tabs">Sa_ve Filter</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_filter_save_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="padding">6</property>
 +                <property name="pack_type">end</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">False</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">cancelbutton4</action-widget>
 +      <action-widget response="-5">okbutton4</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkAdjustment" id="num_adjustment">
 +    <property name="upper">1000000000</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkDialog" id="sort_by_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="border_width">6</property>
-     <property name="title" translatable="yes">Sort register by...</property>
++    <property name="title" translatable="yes" comments="Sort register by Dialog">Sort register by...</property>
 +    <property name="resizable">False</property>
 +    <property name="window_position">center-on-parent</property>
 +    <property name="type_hint">dialog</property>
 +    <signal name="response" handler="gnc_plugin_page_register_sort_response_cb" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox17">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <property name="spacing">6</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area19">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="cancelbutton2">
 +                <property name="label" translatable="yes">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="okbutton2">
 +                <property name="label" translatable="yes">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="has_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkBox" id="vbox101">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="border_width">12</property>
 +            <property name="orientation">vertical</property>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_STANDARD">
 +                <property name="label" translatable="yes">_Standard Order</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Keep normal account order.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkSeparator" id="hseparator2">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">True</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_DATE">
 +                <property name="label" translatable="yes">_Date</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by date.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_DATE_ENTERED">
 +                <property name="label" translatable="yes">Date of _Entry</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by the date of entry.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">3</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_DATE_RECONCILED">
 +                <property name="label" translatable="yes">S_tatement Date</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by the statement date (and group by cleared, unreconciled, reconciled).</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">4</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_NUM">
 +                <property name="label" translatable="yes">Num_ber</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by number.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">5</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_AMOUNT">
 +                <property name="label" translatable="yes">Amo_unt</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by amount.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">6</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_MEMO">
 +                <property name="label" translatable="yes">_Memo</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by memo.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">7</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_DESC">
 +                <property name="label" translatable="yes">Descri_ption</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by description.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">8</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_ACTION">
 +                <property name="label" translatable="yes">_Action</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by action field.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">9</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkRadioButton" id="BY_NOTES">
 +                <property name="label" translatable="yes">_Notes</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="tooltip_text" translatable="yes">Sort by notes field.</property>
 +                <property name="halign">start</property>
 +                <property name="use_underline">True</property>
 +                <property name="draw_indicator">True</property>
 +                <property name="group">BY_STANDARD</property>
 +                <signal name="toggled" handler="gnc_plugin_page_register_sort_button_cb" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">10</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkSeparator" id="hseparator3">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">True</property>
 +                <property name="position">11</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label1">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +              </object>
 +              <packing>
 +                <property name="expand">True</property>
 +                <property name="fill">True</property>
 +                <property name="position">12</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkBox" id="hbox2">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <child>
 +                  <object class="GtkCheckButton" id="sort_save">
 +                    <property name="label" translatable="yes">Sa_ve Sort Order</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
 +                    <property name="tooltip_text" translatable="yes">Save the sort order for this register.</property>
 +                    <property name="halign">start</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="draw_indicator">True</property>
 +                    <signal name="toggled" handler="gnc_plugin_page_register_sort_order_save_cb" swapped="no"/>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">False</property>
 +                    <property name="fill">False</property>
 +                    <property name="padding">6</property>
 +                    <property name="pack_type">end</property>
 +                    <property name="position">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkCheckButton" id="sort_reverse">
-                     <property name="label" translatable="yes">Reverse Order</property>
++                    <property name="label" translatable="yes">_Reverse Order</property>
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="receives_default">False</property>
-                     <property name="tooltip_text" translatable="yes">Sort in descending order.</property>
++                    <property name="halign">start</property>
 +                    <property name="halign">start</property>
 +                    <property name="draw_indicator">True</property>
 +                    <signal name="toggled" handler="gnc_plugin_page_register_sort_order_reverse_cb" swapped="no"/>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">True</property>
 +                    <property name="fill">True</property>
 +                    <property name="position">1</property>
 +                  </packing>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="expand">True</property>
 +                <property name="fill">False</property>
 +                <property name="position">14</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">cancelbutton2</action-widget>
 +      <action-widget response="-5">okbutton2</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkAdjustment" id="tnum_adjustment">
 +    <property name="upper">1000000000</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkDialog" id="duplicate_transaction_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="border_width">6</property>
 +    <property name="title" translatable="yes">Duplicate Transaction</property>
 +    <property name="resizable">False</property>
 +    <property name="modal">True</property>
 +    <property name="type_hint">dialog</property>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox15">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <property name="spacing">6</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area15">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="button76">
 +                <property name="label" translatable="yes">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="button77">
 +                <property name="label" translatable="yes">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="has_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="duplicate_title_label">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="label" translatable="yes"><b>New Transaction Information</b></property>
 +            <property name="use_markup">True</property>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">False</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkAlignment" id="alignment1">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="left_padding">12</property>
 +            <child>
 +              <object class="GtkGrid" id="duplicate_table">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="row_spacing">6</property>
 +                <property name="column_spacing">12</property>
 +                <child>
 +                  <object class="GtkLabel" id="date_label">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes">_Date:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="justify">center</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="num_label">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes">_Number:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="justify">center</property>
 +                    <property name="mnemonic_widget">num_spin</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="num_spin">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="has_focus">True</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">num_adjustment</property>
 +                    <property name="climb_rate">1</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">1</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="date_hbox">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <child>
 +                      <placeholder/>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkLabel" id="tnum_label">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="halign">start</property>
 +                    <property name="label" translatable="yes">_Transaction Number:</property>
 +                    <property name="use_underline">True</property>
 +                    <property name="justify">center</property>
 +                    <property name="mnemonic_widget">tnum_spin</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">0</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkSpinButton" id="tnum_spin">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="primary_icon_activatable">False</property>
 +                    <property name="secondary_icon_activatable">False</property>
 +                    <property name="adjustment">tnum_adjustment</property>
 +                    <property name="climb_rate">1</property>
 +                  </object>
 +                  <packing>
 +                    <property name="left_attach">1</property>
 +                    <property name="top_attach">2</property>
 +                  </packing>
 +                </child>
 +              </object>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">3</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">button76</action-widget>
 +      <action-widget response="-5">button77</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkDialog" id="void_transaction_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="border_width">6</property>
 +    <property name="title" translatable="yes">Void Transaction</property>
 +    <property name="resizable">False</property>
 +    <property name="modal">True</property>
 +    <property name="window_position">center-on-parent</property>
 +    <property name="type_hint">dialog</property>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox16">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <property name="spacing">6</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area18">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="cancelbutton1">
 +                <property name="label" translatable="yes">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="okbutton1">
 +                <property name="label" translatable="yes">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="has_default">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkBox" id="vbox100">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="orientation">vertical</property>
 +            <child>
 +              <object class="GtkLabel" id="label847671">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">Reason for voiding transaction:</property>
 +                <property name="justify">center</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkEntry" id="reason">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="has_focus">True</property>
 +                <property name="activates_default">True</property>
 +                <property name="primary_icon_activatable">False</property>
 +                <property name="secondary_icon_activatable">False</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">cancelbutton1</action-widget>
 +      <action-widget response="-5">okbutton1</action-widget>
 +    </action-widgets>
 +  </object>
 +</interface>
diff --cc gnucash/import-export/csv-exp/csv-transactions-export.c
index 65c897d,0000000..5526362
mode 100644,000000..100644
--- a/gnucash/import-export/csv-exp/csv-transactions-export.c
+++ b/gnucash/import-export/csv-exp/csv-transactions-export.c
@@@ -1,659 -1,0 +1,662 @@@
 +/*******************************************************************\
-  * csv-transactions-export.c -- Export Transactions to a file       *
++ * csv-actions-export.c -- Export Transactions to a file       *
 + *                                                                  *
 + * Copyright (C) 2012 Robert Fewell                                 *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 +\********************************************************************/
 +/** @file csv-transactions-export.c
 +    @brief CSV Export Transactions
 +    @author Copyright (c) 2012 Robert Fewell
 +*/
- #include <config.h>
++#include "config.h"
 +
 +#include <gtk/gtk.h>
 +#include <glib/gi18n.h>
 +#include <glib/gstdio.h>
 +
 +#include "gnc-commodity.h"
 +#include "gnc-ui-util.h"
 +#include "Query.h"
 +#include "Transaction.h"
 +#include "engine-helpers.h"
 +#include "qofbookslots.h"
 +
 +#include "csv-transactions-export.h"
 +
 +/* This static indicates the debugging module that this .o belongs to. */
 +static QofLogModule log_module = GNC_MOD_ASSISTANT;
 +
 +/* CSV spec requires CRLF line endings. Tweak the end-of-line string so this
 + * true for each platform */
 +#ifdef G_OS_WIN32
 +# define EOLSTR "\n"
 +#else
 +# define EOLSTR "\r\n"
 +#endif
 +
 +
 +/*******************************************************************/
 +
 +/*******************************************************
 + * write_line_to_file
 + *
 + * write a text string to a file pointer, return TRUE if
 + * successful.
 + *******************************************************/
 +static
 +gboolean write_line_to_file (FILE *fh, char * line)
 +{
 +    int len, written;
 +    DEBUG("Account String: %s", line);
 +
 +    /* Write account line */
 +    len = strlen (line);
 +    written = fwrite (line, 1, len, fh);
 +
 +    if (written != len)
 +        return FALSE;
 +    else
 +        return TRUE;
 +}
 +
 +
 +/*******************************************************
 + * csv_txn_test_field_string
 + *
 + * Test the field string for ," and new lines
 + *******************************************************/
 +static
 +gchar *csv_txn_test_field_string (CsvExportInfo *info, const gchar *string_in)
 +{
 +    gboolean need_quote = FALSE;
 +    gchar **parts;
 +    gchar *string_parts;
 +    gchar *string_out;
 +
 +    /* Check for " and then "" them */
 +    parts = g_strsplit (string_in, "\"", -1);
 +    string_parts = g_strjoinv ("\"\"", parts);
 +    g_strfreev (parts);
 +
 +    /* Check for separator string and \n and " in field,
 +       if so quote field if not already quoted */
 +    if (g_strrstr (string_parts, info->separator_str) != NULL)
 +        need_quote = TRUE;
 +    if (g_strrstr (string_parts, "\n") != NULL)
 +        need_quote = TRUE;
 +    if (g_strrstr (string_parts, "\"") != NULL)
 +        need_quote = TRUE;
 +
 +    if (!info->use_quotes && need_quote)
 +        string_out = g_strconcat ("\"", string_parts, "\"", NULL);
 +    else
 +        string_out = g_strdup (string_parts);
 +
 +    g_free (string_parts);
 +    return string_out;
 +}
 +
 +/******************** Helper functions *********************/
 +
 +// Transaction Date
 +static gchar*
 +add_date (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    gchar *date = qof_print_date (xaccTransGetDate (trans));
 +    gchar *result = g_strconcat (so_far, info->end_sep, date, info->mid_sep, NULL);
 +    g_free (date);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +
 +// Transaction GUID
 +static gchar*
 +add_guid (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    gchar *result;
 +    gchar *guid;
 +
 +    guid = guid_to_string (xaccTransGetGUID (trans));
 +    result = g_strconcat (so_far, guid, info->mid_sep, NULL);
 +    g_free (guid);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Reconcile Date
 +static gchar*
 +add_reconcile_date (gchar *so_far, Split *split, CsvExportInfo *info)
 +{
 +    gchar *result;
 +
 +    if (xaccSplitGetReconcile (split) == YREC)
 +    {
 +        Timespec     ts = {0,0};
 +        const gchar *str_rec_date;
 +        xaccSplitGetDateReconciledTS (split, &ts);
 +        str_rec_date = gnc_print_date (ts);
 +        result = g_strconcat (so_far, str_rec_date, info->mid_sep, NULL);
 +    }
 +    else
 +        result = g_strconcat (so_far, info->mid_sep, NULL);
 +
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Account Name short or Long
 +static gchar*
 +add_account_name (gchar *so_far, Split *split, gboolean full, CsvExportInfo *info)
 +{
 +    gchar       *name = NULL;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    Account     *account = xaccSplitGetAccount (split);
 +    if (full)
 +        name = gnc_account_get_full_name (account);
 +    else
 +        name = g_strdup (xaccAccountGetName (account));
 +    conv = csv_txn_test_field_string (info, name);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (name);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Number
 +static gchar*
 +add_number (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    const gchar *num;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    num = xaccTransGetNum (trans) ? xaccTransGetNum (trans) : "" ;
 +    conv = csv_txn_test_field_string (info, num);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Description
 +static gchar*
 +add_description (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    const gchar *desc;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    desc = xaccTransGetDescription (trans) ? xaccTransGetDescription (trans) : "" ;
 +    conv = csv_txn_test_field_string (info, desc);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Notes
 +static gchar*
 +add_notes (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    const gchar *notes;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    notes = xaccTransGetNotes (trans) ? xaccTransGetNotes (trans) : "" ;
 +    conv = csv_txn_test_field_string (info, notes);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Void reason
 +static gchar*
 +add_void_reason (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    gchar       *result;
 +
 +    if (xaccTransGetVoidStatus (trans))
 +    {
 +        const gchar *void_reason = xaccTransGetVoidReason (trans);
 +        gchar *conv = csv_txn_test_field_string (info, void_reason);
 +        result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +        g_free (conv);
 +    }
 +    else
 +        result = g_strconcat (so_far, info->mid_sep, NULL);
 +
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Memo
 +static gchar*
 +add_memo (gchar *so_far, Split *split, CsvExportInfo *info)
 +{
 +    const gchar *memo;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    memo = xaccSplitGetMemo (split) ? xaccSplitGetMemo (split) : "" ;
 +    conv = csv_txn_test_field_string (info, memo);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Full Category Path or Not
 +static gchar*
 +add_category (gchar *so_far, Split *split, gboolean full, CsvExportInfo *info)
 +{
 +    gchar       *cat;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    if (full)
 +        cat = xaccSplitGetCorrAccountFullName (split);
 +    else
 +        cat = g_strdup(xaccSplitGetCorrAccountName (split));
 +
 +    conv = csv_txn_test_field_string (info, cat);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (cat);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Action
 +static gchar*
 +add_action (gchar *so_far, Split *split, CsvExportInfo *info)
 +{
 +    const gchar *action = xaccSplitGetAction (split);
 +    gchar *conv = csv_txn_test_field_string (info, action);
 +    gchar *result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Reconcile
 +static gchar*
 +add_reconcile (gchar *so_far, Split *split, CsvExportInfo *info)
 +{
 +    const gchar *recon;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    recon = gnc_get_reconcile_str (xaccSplitGetReconcile (split));
 +    conv = csv_txn_test_field_string (info, recon);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Transaction commodity
 +static gchar*
 +add_commodity (gchar *so_far, Transaction *trans, CsvExportInfo *info)
 +{
 +    const gchar *comm_m;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    comm_m = gnc_commodity_get_unique_name (xaccTransGetCurrency (trans));
 +
 +    conv = csv_txn_test_field_string (info, comm_m);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Amount with Symbol or not
 +static gchar*
 +add_amount (gchar *so_far, Split *split, gboolean t_void, gboolean symbol, CsvExportInfo *info)
 +{
 +    const gchar *amt;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    if (t_void)
 +        amt = xaccPrintAmount (xaccSplitVoidFormerAmount (split), gnc_split_amount_print_info (split, symbol));
 +    else
 +        amt = xaccPrintAmount (xaccSplitGetAmount (split), gnc_split_amount_print_info (split, symbol));
 +    conv = csv_txn_test_field_string (info, amt);
 +    result = g_strconcat (so_far, conv, info->mid_sep, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Share Price / Conversion factor
 +static gchar*
 +add_rate (gchar *so_far, Split *split, gboolean t_void, CsvExportInfo *info)
 +{
 +    const gchar *amt;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    if (t_void)
 +        amt = xaccPrintAmount (gnc_numeric_zero(), gnc_split_amount_print_info (split, FALSE));
 +    else
 +        amt = xaccPrintAmount (xaccSplitGetSharePrice (split), gnc_split_amount_print_info (split, FALSE));
 +
 +    conv = csv_txn_test_field_string (info, amt);
 +    result = g_strconcat (so_far, conv, info->end_sep, EOLSTR, NULL);
 +    g_free (conv);
 +    g_free (so_far);
 +    return result;
 +}
 +
 +// Share Price / Conversion factor
 +static gchar*
 +add_price (gchar *so_far, Split *split, gboolean t_void, CsvExportInfo *info)
 +{
 +    const gchar *string_amount;
 +    gchar       *conv;
 +    gchar       *result;
 +
 +    if (t_void)
 +    {
 +        gnc_numeric cf = gnc_numeric_div (xaccSplitVoidFormerValue (split), xaccSplitVoidFormerAmount (split), GNC_DENOM_AUTO,
 +                                                   GNC_HOW_DENOM_SIGFIGS(6) | GNC_HOW_RND_ROUND_HALF_UP);
 +        string_amount = xaccPrintAmount (cf, gnc_split_amount_print_info (split, FALSE));
 +    }
 +    else
 +        string_amount = xaccPrintAmount (xaccSplitGetSharePrice (split), gnc_split_amount_print_info (split, FALSE));
 +
 +    conv = csv_txn_test_field_string (info, string_amount);
 +    result = g_strconcat (so_far, conv, info->end_sep, EOLSTR, NULL);
 +    g_free (conv);
 +    return result;
 +}
 +
 +/******************************************************************************/
 +
 +static gchar*
 +make_simple_trans_line (Account *acc, Transaction *trans, Split *split, CsvExportInfo *info)
 +{
 +    gboolean t_void = xaccTransGetVoidStatus (trans);
 +
 +    gchar *exp_line = g_strdup("");
 +    exp_line = add_date (exp_line, trans, info);
 +    exp_line = add_account_name (exp_line, split, TRUE, info);
 +    exp_line = add_number (exp_line, trans, info);
 +    exp_line = add_description (exp_line, trans, info);
 +    exp_line = add_category (exp_line, split, TRUE, info);
 +    exp_line = add_reconcile (exp_line, split, info);
 +    exp_line = add_amount (exp_line, split, t_void, TRUE, info);
 +    exp_line = add_amount (exp_line, split, t_void, FALSE, info);
 +    exp_line = add_rate (exp_line, split, t_void, info);
 +    return exp_line;
 +}
 +
 +static gchar*
 +make_split_part (gchar* exp_line, Split *split, gboolean t_void, CsvExportInfo *info)
 +{
 +    exp_line = add_action (exp_line, split, info);
 +    exp_line = add_memo (exp_line, split, info);
 +    exp_line = add_account_name (exp_line, split, TRUE, info);
 +    exp_line = add_account_name (exp_line, split, FALSE, info);
 +    exp_line = add_amount (exp_line, split, t_void, TRUE, info);
 +    exp_line = add_amount (exp_line, split, t_void, FALSE, info);
 +    exp_line = add_reconcile (exp_line, split, info);
 +    exp_line = add_reconcile_date (exp_line, split, info);
 +    exp_line = add_price (exp_line, split, t_void, info);
 +    return exp_line;
 +}
 +
 +static gchar*
 +make_complex_trans_line (Account *acc, Transaction *trans, Split *split, CsvExportInfo *info)
 +{
 +    gchar *exp_line = g_strdup("");
 +    exp_line = add_date (exp_line, trans, info);
 +    exp_line = add_guid (exp_line, trans, info);
 +    exp_line = add_number (exp_line, trans, info);
 +    exp_line = add_description (exp_line, trans, info);
 +    exp_line = add_notes (exp_line, trans, info);
 +    exp_line = add_commodity (exp_line, trans, info);
 +    exp_line = add_void_reason (exp_line, trans, info);
 +    return make_split_part (exp_line, split, xaccTransGetVoidStatus (trans), info);
 +}
 +
 +static gchar*
 +make_complex_split_line (Transaction *trans, Split *split, CsvExportInfo *info)
 +{
 +    /* Pure split lines don't have any transaction information,
 +     * so start with empty fields for all transaction columns.
 +     */
 +    gchar *result = g_strconcat (info->end_sep, info->mid_sep, info->mid_sep, info->mid_sep,
 +            info->mid_sep, info->mid_sep, info->mid_sep, info->mid_sep, NULL);
 +    return make_split_part (result, split, xaccTransGetVoidStatus (trans), info);
 +}
 +
 +
 +/*******************************************************
 + * account_splits
 + *
 + * gather the splits / transactions for an account and
 + * send them to a file
 + *******************************************************/
 +static
 +void account_splits (CsvExportInfo *info, Account *acc, FILE *fh )
 +{
 +    GSList  *p1, *p2;
 +    GList   *splits;
 +    QofBook *book;
 +
 +    // Setup the query for normal transaction export
 +    if (info->export_type == XML_EXPORT_TRANS)
 +    {
 +        info->query = qof_query_create_for (GNC_ID_SPLIT);
 +        book = gnc_get_current_book();
 +        qof_query_set_book (info->query, book);
 +
 +        /* Sort by transaction date */
 +        p1 = g_slist_prepend (NULL, TRANS_DATE_POSTED);
 +        p1 = g_slist_prepend (p1, SPLIT_TRANS);
 +        p2 = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
 +        qof_query_set_sort_order (info->query, p1, p2, NULL);
 +
 +        xaccQueryAddSingleAccountMatch (info->query, acc, QOF_QUERY_AND);
 +        xaccQueryAddDateMatchTT (info->query, TRUE, info->csvd.start_time, TRUE, info->csvd.end_time, QOF_QUERY_AND);
 +    }
 +
 +    /* Run the query */
 +    for (splits = qof_query_run (info->query); splits; splits = splits->next)
 +    {
 +        Split       *split;
 +        Transaction *trans;
 +        SplitList   *s_list;
 +        GList       *node;
 +        Split       *t_split;
 +        int          nSplits;
 +        int          cnt;
 +        gchar       *line;
 +
 +        split = splits->data;
 +        trans = xaccSplitGetParent (split);
 +        nSplits = xaccTransCountSplits (trans);
 +        s_list = xaccTransGetSplitList (trans);
 +
 +        // Look for trans already exported in trans_list
 +        if (g_list_find (info->trans_list, trans) != NULL)
 +            continue;
 +
 +        // Look for blank split
 +        if (xaccSplitGetAccount (split) == NULL)
 +            continue;
 +
 +        // This will be a simple layout equivalent to a single line register view.
 +        if (info->simple_layout)
 +        {
 +            line = make_simple_trans_line (acc, trans, split, info);
 +
 +            /* Write to file */
 +            if (!write_line_to_file (fh, line))
 +            {
 +                info->failed = TRUE;
 +                break;
 +            }
 +            g_free (line);
 +            continue;
 +        }
 +
 +        // Complex Transaction Line.
 +        line = make_complex_trans_line (acc, trans, split, info);
 +
 +        /* Write to file */
 +        if (!write_line_to_file (fh, line))
 +        {
 +            info->failed = TRUE;
 +            break;
 +        }
 +        g_free (line);
 +
 +        /* Loop through the list of splits for the Transaction */
 +        node = s_list;
 +        cnt = 0;
 +        while ((cnt < nSplits) && (info->failed == FALSE))
 +        {
 +            t_split = node->data;
 +
 +            // base split is already written on the trans_line
 +            if (split != t_split)
 +            {
 +            // Complex Split Line.
 +                line = make_complex_split_line (trans, t_split, info);
 +
 +                if (!write_line_to_file (fh, line))
 +                    info->failed = TRUE;
 +
 +                g_free (line);
 +            }
 +
 +            cnt++;
 +            node = node->next;
 +        }
 +        info->trans_list = g_list_prepend (info->trans_list, trans); // add trans to trans_list
 +    }
 +    if (info->export_type == XML_EXPORT_TRANS)
 +        qof_query_destroy (info->query);
 +    g_list_free (splits);
 +}
 +
 +
 +/*******************************************************
 + * csv_transactions_export
 + *
 + * write a list of transactions to a text file
 + *******************************************************/
 +void csv_transactions_export (CsvExportInfo *info)
 +{
 +    FILE    *fh;
 +    Account *acc;
 +    GList   *ptr;
 +    gboolean num_action = qof_book_use_split_action_for_num_field (gnc_get_current_book());
 +
 +    ENTER("");
 +    DEBUG("File name is : %s", info->file_name);
 +
 +    info->failed = FALSE;
 +
 +    /* Set up separators */
 +    if (info->use_quotes)
 +    {
 +        info->end_sep = "\"";
 +        info->mid_sep = g_strconcat ("\"", info->separator_str, "\"", NULL);
 +    }
 +    else
 +    {
 +        info->end_sep = "";
 +        info->mid_sep = g_strconcat (info->separator_str, NULL);
 +    }
 +
 +    /* Open File for writing */
 +    fh = g_fopen (info->file_name, "w" );
 +    if (fh != NULL)
 +    {
 +        gchar *header;
 +        int i;
 +
 +        /* Header string */
 +        if (info->simple_layout)
 +        {
-             header = g_strconcat (info->end_sep, _("Date"), info->mid_sep, _("Account Name"),
++            header = g_strconcat (info->end_sep,
++                         /* Translators: The following symbols will build the *
++                          * header line of exported CSV files:                */
++                                  _("Date"), info->mid_sep, _("Account Name"),
 +                                  info->mid_sep, (num_action ? _("Transaction Number") : _("Number")),
 +                                  info->mid_sep, _("Description"), info->mid_sep, _("Full Category Path"),
 +                                  info->mid_sep, _("Reconcile"), info->mid_sep, _("Amount With Sym"),
 +                                  info->mid_sep, _("Amount Num."), info->mid_sep, _("Rate/Price"),
 +                                  info->end_sep, EOLSTR, NULL);
 +        }
 +        else
 +        {
 +            header = g_strconcat (info->end_sep, _("Date"), info->mid_sep, _("Transaction ID"),
 +                                  info->mid_sep, (num_action ? _("Transaction Number") : _("Number")),
 +                                  info->mid_sep, _("Description"), info->mid_sep, _("Notes"),
 +                                  info->mid_sep, _("Commodity/Currency"), info->mid_sep, _("Void Reason"),
 +                                  info->mid_sep, (num_action ? _("Number/Action") : _("Action")), info->mid_sep, _("Memo"),
 +                                  info->mid_sep, _("Full Account Name"), info->mid_sep, _("Account Name"),
 +                                  info->mid_sep, _("Amount With Sym"), info->mid_sep, _("Amount Num."),
 +                                  info->mid_sep, _("Reconcile"), info->mid_sep, _("Reconcile Date"), info->mid_sep, _("Rate/Price"),
 +                                  info->end_sep, EOLSTR, NULL);
 +        }
 +        DEBUG("Header String: %s", header);
 +
 +        /* Write header line */
 +        if (!write_line_to_file (fh, header))
 +        {
 +            info->failed = TRUE;
 +            g_free (header);
 +            return;
 +        }
 +        g_free (header);
 +
 +        if (info->export_type == XML_EXPORT_TRANS)
 +        {
 +            /* Go through list of accounts */
 +            for (ptr = info->csva.account_list, i = 0; ptr; ptr = g_list_next(ptr), i++)
 +            {
 +                acc = ptr->data;
 +                DEBUG("Account being processed is : %s", xaccAccountGetName (acc));
 +                account_splits (info, acc, fh);
 +            }
 +        }
 +        else
 +            account_splits (info, info->account, fh);
 +
 +        g_list_free (info->trans_list); // free trans_list
 +    }
 +    else
 +        info->failed = TRUE;
 +    if (fh)
 +        fclose (fh);
 +    LEAVE("");
 +}
 +
diff --cc gnucash/import-export/dialog-import.glade
index 05a03da9,0000000..96c39c0
mode 100644,000000..100644
--- a/gnucash/import-export/dialog-import.glade
+++ b/gnucash/import-export/dialog-import.glade
@@@ -1,1206 -1,0 +1,1208 @@@
++<?xml version="1.0" encoding="utf-8"?>
++<?xml version="1.0" encoding="utf-8"?>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!-- Generated with glade 3.20.0 -->
 +<interface>
 +  <requires lib="gtk+" version="3.10"/>
 +  <object class="GtkBox" id="account_picker_content">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="orientation">vertical</property>
 +    <child>
 +      <object class="GtkLabel" id="label847715">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="label" translatable="yes">Please select or create an appropriate GnuCash account for:</property>
 +        <property name="justify">center</property>
 +      </object>
 +      <packing>
 +        <property name="expand">False</property>
 +        <property name="fill">False</property>
 +        <property name="position">0</property>
 +      </packing>
 +    </child>
 +    <child>
 +      <object class="GtkLabel" id="online_id_label">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="label" translatable="yes">Online account ID here...</property>
 +        <property name="justify">center</property>
 +      </object>
 +      <packing>
 +        <property name="expand">False</property>
 +        <property name="fill">False</property>
 +        <property name="position">1</property>
 +      </packing>
 +    </child>
 +    <child>
 +      <object class="GtkScrolledWindow" id="account_tree_sw">
 +        <property name="visible">True</property>
 +        <property name="can_focus">True</property>
 +        <child>
 +          <placeholder/>
 +        </child>
 +      </object>
 +      <packing>
 +        <property name="expand">True</property>
 +        <property name="fill">True</property>
 +        <property name="position">2</property>
 +      </packing>
 +    </child>
 +  </object>
 +  <object class="GtkDialog" id="account_picker_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">Select Account</property>
 +    <property name="default_width">800</property>
 +    <property name="default_height">600</property>
 +    <property name="type_hint">dialog</property>
 +    <signal name="map" handler="gnc_ui_generic_account_picker_map_cb" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="account_picker_vbox">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area8">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="newbutton">
 +                <property name="label">gnc-new-account</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="cancelbutton">
 +                <property name="label">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="okbutton">
 +                <property name="label">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">False</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="1">newbutton</action-widget>
 +      <action-widget response="-6">cancelbutton</action-widget>
 +      <action-widget response="-5">okbutton</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkAdjustment" id="atm_fee_adj">
 +    <property name="upper">1000</property>
 +    <property name="value">2</property>
 +    <property name="step_increment">0.01</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="auto_add_adj">
 +    <property name="lower">1</property>
 +    <property name="upper">6</property>
 +    <property name="value">1</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkAdjustment" id="auto_clear_adj">
 +    <property name="lower">6</property>
 +    <property name="upper">12</property>
 +    <property name="value">6</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkDialog" id="format_picker_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">Choose a format</property>
 +    <property name="resizable">False</property>
 +    <property name="modal">True</property>
 +    <property name="default_width">600</property>
 +    <property name="default_height">400</property>
 +    <property name="type_hint">dialog</property>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox16">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area16">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="okbutton1">
 +                <property name="label">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkFrame" id="frame2">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="label_xalign">0</property>
 +            <child>
 +              <object class="GtkBox" id="vbox8">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="spacing">15</property>
 +                <child>
 +                  <object class="GtkLabel" id="msg_label">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="label">do not translate</property>
 +                    <property name="justify">center</property>
 +                    <property name="wrap">True</property>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">False</property>
 +                    <property name="fill">False</property>
 +                    <property name="position">0</property>
 +                  </packing>
 +                </child>
 +                <child>
 +                  <object class="GtkBox" id="hbox1">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="spacing">3</property>
 +                    <child>
 +                      <object class="GtkLabel" id="label847775">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <property name="label" translatable="yes">Format:</property>
 +                        <property name="justify">right</property>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">False</property>
 +                        <property name="fill">False</property>
 +                        <property name="position">0</property>
 +                      </packing>
 +                    </child>
 +                    <child>
 +                      <object class="GtkBox" id="menu_box">
 +                        <property name="visible">True</property>
 +                        <property name="can_focus">False</property>
 +                        <child>
 +                          <placeholder/>
 +                        </child>
 +                      </object>
 +                      <packing>
 +                        <property name="expand">True</property>
 +                        <property name="fill">True</property>
 +                        <property name="position">1</property>
 +                      </packing>
 +                    </child>
 +                  </object>
 +                  <packing>
 +                    <property name="expand">True</property>
 +                    <property name="fill">True</property>
 +                    <property name="position">1</property>
 +                  </packing>
 +                </child>
 +              </object>
 +            </child>
 +            <child type="label">
 +              <object class="GtkLabel" id="label847773">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">Choose a format</property>
 +              </object>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-5">okbutton1</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkAdjustment" id="match_adj">
 +    <property name="upper">6</property>
 +    <property name="value">1</property>
 +    <property name="step_increment">1</property>
 +    <property name="page_increment">10</property>
 +  </object>
 +  <object class="GtkWindow" id="Preferences">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">Preferences</property>
 +    <child>
 +      <object class="GtkGrid" id="matcher_prefs">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <child>
 +          <object class="GtkCheckButton" id="pref/dialogs.import.generic/enable-skip">
-             <property name="label" translatable="yes">Enable skip transaction action</property>
++            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Enable skip transaction action</property>
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="receives_default">False</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">Enable the SKIP action in the transaction matcher. If enabled, a transaction whose best match&apos;s score is in the yellow zone (above the Auto-ADD threshold but below the Auto-CLEAR threshold) will be skipped by default.</property>
 +            <property name="tooltip_text" translatable="yes">Enable the SKIP action in the transaction matcher. If enabled, a transaction whose best match's score is in the yellow zone (above the Auto-ADD threshold but below the Auto-CLEAR threshold) will be skipped by default.</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="use_underline">True</property>
 +            <property name="draw_indicator">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">1</property>
 +            <property name="width">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkCheckButton" id="pref/dialogs.import.generic/enable-update">
-             <property name="label" translatable="yes">Enable update match action</property>
++            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Enable update match action</property>
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="receives_default">False</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">Enable the UPDATE AND RECONCILE action in the transaction matcher. If enabled, a transaction whose best match&apos;s score is above the Auto-CLEAR threshold and has a different date or amount than the matching existing transaction will cause the existing transaction to be updated and cleared by default.</property>
 +            <property name="tooltip_text" translatable="yes">Enable the UPDATE AND RECONCILE action in the transaction matcher. If enabled, a transaction whose best match's score is above the Auto-CLEAR threshold and has a different date or amount than the matching existing transaction will cause the existing transaction to be updated and cleared by default.</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="use_underline">True</property>
 +            <property name="draw_indicator">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">2</property>
 +            <property name="width">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="label847785">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="label" translatable="yes"><b>Generic Importer</b></property>
 +            <property name="use_markup">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">0</property>
 +            <property name="width">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkSpinButton" id="pref/dialogs.import.generic/atm-fee-threshold">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">In some places commercial ATMs (not belonging to a financial institution) are installed in places like convenience stores. These ATMs add their fee directly to the amount instead of showing up as a separate transaction or in your monthly banking fees. For example, you withdraw $100, and you are charged $101,50 plus Interac fees. If you manually entered that $100, the amounts won&apos;t match. You should set this to whatever is the maximum such fee in your area (in units of your local currency), so the transaction will be recognised as a match.</property>
 +            <property name="tooltip_text" translatable="yes">In some places commercial ATMs (not belonging to a financial institution) are installed in places like convenience stores. These ATMs add their fee directly to the amount instead of showing up as a separate transaction or in your monthly banking fees. For example, you withdraw $100, and you are charged $101,50 plus Interac fees. If you manually entered that $100, the amounts won't match. You should set this to whatever is the maximum such fee in your area (in units of your local currency), so the transaction will be recognised as a match.</property>
 +            <property name="invisible_char">●</property>
 +            <property name="primary_icon_activatable">False</property>
 +            <property name="secondary_icon_activatable">False</property>
 +            <property name="adjustment">atm_fee_adj</property>
 +            <property name="climb_rate">1</property>
 +            <property name="digits">2</property>
 +            <property name="snap_to_ticks">True</property>
 +            <property name="numeric">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">1</property>
 +            <property name="top_attach">7</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkSpinButton" id="pref/dialogs.import.generic/auto-clear-threshold">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">A transaction whose best match&apos;s score is in the green zone (above or equal to the Auto-CLEAR threshold) will be CLEARed by default.</property>
 +            <property name="tooltip_text" translatable="yes">A transaction whose best match's score is in the green zone (above or equal to the Auto-CLEAR threshold) will be CLEARed by default.</property>
 +            <property name="invisible_char">●</property>
 +            <property name="primary_icon_activatable">False</property>
 +            <property name="secondary_icon_activatable">False</property>
 +            <property name="adjustment">auto_clear_adj</property>
 +            <property name="climb_rate">1</property>
 +            <property name="snap_to_ticks">True</property>
 +            <property name="numeric">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">1</property>
 +            <property name="top_attach">6</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkSpinButton" id="pref/dialogs.import.generic/auto-add-threshold">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">A transaction whose best match&apos;s score is in the red zone (above the display threshold but below or equal to the Auto-ADD threshold) will be ADDed by default.</property>
 +            <property name="tooltip_text" translatable="yes">A transaction whose best match's score is in the red zone (above the display threshold but below or equal to the Auto-ADD threshold) will be ADDed by default.</property>
 +            <property name="invisible_char">●</property>
 +            <property name="primary_icon_activatable">False</property>
 +            <property name="secondary_icon_activatable">False</property>
 +            <property name="adjustment">auto_add_adj</property>
 +            <property name="climb_rate">1</property>
 +            <property name="snap_to_ticks">True</property>
 +            <property name="numeric">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">1</property>
 +            <property name="top_attach">5</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkSpinButton" id="pref/dialogs.import.generic/match-threshold">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">The minimum score a potential match must have to be displayed in the match list.</property>
 +            <property name="tooltip_text" translatable="yes">The minimum score a potential match must have to be displayed in the match list.</property>
 +            <property name="invisible_char">●</property>
 +            <property name="primary_icon_activatable">False</property>
 +            <property name="secondary_icon_activatable">False</property>
 +            <property name="adjustment">match_adj</property>
 +            <property name="climb_rate">1</property>
 +            <property name="snap_to_ticks">True</property>
 +            <property name="numeric">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">1</property>
 +            <property name="top_attach">4</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="label847789">
 +            <property name="visible">True</property>
-             <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="label" translatable="yes">Commercial ATM _fees threshold</property>
++            <property name="label" translatable="yes">Commercial ATM _fees threshold</property>
 +            <property name="use_underline">True</property>
 +            <property name="mnemonic_widget">pref/dialogs.import.generic/atm-fee-threshold</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">7</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="label847788">
 +            <property name="visible">True</property>
-             <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="label" translatable="yes">Auto-c_lear threshold</property>
++            <property name="label" translatable="yes">Auto-c_lear threshold</property>
 +            <property name="use_underline">True</property>
 +            <property name="mnemonic_widget">pref/dialogs.import.generic/auto-clear-threshold</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">6</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="label847787">
 +            <property name="visible">True</property>
-             <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="label" translatable="yes">Auto-_add threshold</property>
++            <property name="label" translatable="yes">Auto-_add threshold</property>
 +            <property name="use_underline">True</property>
 +            <property name="mnemonic_widget">pref/dialogs.import.generic/auto-add-threshold</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">5</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkLabel" id="label847786">
 +            <property name="visible">True</property>
-             <property name="can_focus">False</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="label" translatable="yes">Match _display threshold</property>
++            <property name="label" translatable="yes">Match _display threshold</property>
 +            <property name="use_underline">True</property>
 +            <property name="mnemonic_widget">pref/dialogs.import.generic/match-threshold</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">4</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkCheckButton" id="pref/dialogs.import.generic/use-bayes">
-             <property name="label" translatable="yes">Use _bayesian matching</property>
++            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Use _bayesian matching</property>
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="receives_default">False</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">Use bayesian algorithms to match new transactions with existing accounts.</property>
 +            <property name="tooltip_text" translatable="yes">Use bayesian algorithms to match new transactions with existing accounts.</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="use_underline">True</property>
 +            <property name="draw_indicator">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">3</property>
 +            <property name="width">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkCheckButton" id="pref/dialogs.import.generic/auto-create-commodity">
-             <property name="label" translatable="yes">Automatically create new commodities</property>
++            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Automatically create new commodities</property>
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="receives_default">False</property>
 +            <property name="has_tooltip">True</property>
 +            <property name="tooltip_markup">Enables the automatic creation of new commodities if any unknown commodity is encountered during import. Otherwise the user will be asked what to do with each unknown commodity.</property>
 +            <property name="tooltip_text" translatable="yes">Enables the automatic creation of new commodities if any unknown commodity is encountered during import. Otherwise the user will be asked what to do with each unknown commodity.</property>
 +            <property name="halign">start</property>
 +            <property name="margin_left">12</property>
 +            <property name="draw_indicator">True</property>
 +          </object>
 +          <packing>
 +            <property name="left_attach">0</property>
 +            <property name="top_attach">9</property>
 +            <property name="width">2</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +      </object>
 +    </child>
 +  </object>
 +  <object class="GtkDialog" id="match_picker_dialog">
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">Select matching existing transaction</property>
 +    <property name="default_width">600</property>
 +    <property name="default_height">400</property>
 +    <property name="type_hint">dialog</property>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox14">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <property name="spacing">8</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area14">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkCheckButton" id="hide_reconciled_check1">
-                 <property name="label" translatable="yes">Show Reconciled</property>
++                <property name="label" translatable="yes" comments="Dialog Select matching transactions">Show Reconciled</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="receives_default">False</property>
 +                <property name="active">True</property>
 +                <property name="draw_indicator">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">True</property>
 +                <property name="fill">True</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="cancel_button1">
 +                <property name="label">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="ok_button1">
 +                <property name="label">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkBox" id="vbox7">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="orientation">vertical</property>
 +            <child>
 +              <object class="GtkLabel" id="label847772">
 +                <property name="visible">True</property>
-                 <property name="can_focus">False</property>
++                <property name="label" translatable="yes">Imported transaction's first split:</property>
 +                <property name="label" translatable="yes">Imported transaction's first split:</property>
 +                <property name="justify">center</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow30">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTreeView" id="download_view">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="rules_hint">True</property>
 +                    <child internal-child="selection">
 +                      <object class="GtkTreeSelection" id="treeview-selection1"/>
 +                    </child>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="expand">True</property>
 +                <property name="fill">True</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847766">
 +                <property name="visible">True</property>
-                 <property name="can_focus">False</property>
++                <property name="label" translatable="yes">Potential splits matching the selected transaction: </property>
 +                <property name="label" translatable="yes">Potential splits matching the selected transaction: </property>
 +                <property name="justify">center</property>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow29">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTreeView" id="matched_view">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="rules_hint">True</property>
 +                    <child internal-child="selection">
 +                      <object class="GtkTreeSelection" id="treeview-selection2"/>
 +                    </child>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="expand">True</property>
 +                <property name="fill">True</property>
 +                <property name="position">3</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">cancel_button1</action-widget>
 +      <action-widget response="-5">ok_button1</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkTextBuffer" id="textbuffer2">
 +    <property name="text" translatable="yes">This transaction probably requires your intervention or it will be imported unbalanced.</property>
 +  </object>
 +  <object class="GtkTextBuffer" id="textbuffer3">
 +    <property name="text" translatable="yes">This transaction will be imported balanced (you may still want to double check the match or destination account).</property>
 +  </object>
 +  <object class="GtkTextBuffer" id="textbuffer4">
 +    <property name="text" translatable="yes">This transaction requires your intervention or it will NOT be imported.</property>
 +  </object>
 +  <object class="GtkTextBuffer" id="textbuffer5">
 +    <property name="text" translatable="yes">Double click on the transaction to change the matching transaction to reconcile, or the destination account of the auto-balance split (if required).</property>
 +  </object>
 +  <object class="GtkDialog" id="matcher_help_dialog">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="border_width">12</property>
 +    <property name="title" translatable="yes">Transaction List Help</property>
 +    <property name="resizable">False</property>
 +    <property name="type_hint">dialog</property>
 +    <signal name="close" handler="on_matcher_help_close_clicked" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="dialog-vbox18">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area18">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="matcher_help_close">
 +                <property name="label">_Close</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +                <signal name="clicked" handler="on_matcher_help_close_clicked" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <object class="GtkGrid" id="table1">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="row_spacing">6</property>
 +            <property name="column_spacing">12</property>
 +            <child>
 +              <object class="GtkLabel" id="label847790">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes"><b>Colors</b></property>
 +                <property name="use_markup">True</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">0</property>
 +                <property name="width">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow33">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="hscrollbar_policy">never</property>
 +                <property name="vscrollbar_policy">never</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTextView" id="textview3">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="pixels_above_lines">5</property>
 +                    <property name="pixels_below_lines">5</property>
 +                    <property name="editable">False</property>
 +                    <property name="wrap_mode">word</property>
 +                    <property name="left_margin">5</property>
 +                    <property name="right_margin">5</property>
 +                    <property name="cursor_visible">False</property>
 +                    <property name="buffer">textbuffer3</property>
 +                    <property name="accepts_tab">False</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">3</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow34">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="hscrollbar_policy">never</property>
 +                <property name="vscrollbar_policy">never</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTextView" id="textview4">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="pixels_above_lines">5</property>
 +                    <property name="pixels_below_lines">5</property>
 +                    <property name="editable">False</property>
 +                    <property name="wrap_mode">word</property>
 +                    <property name="left_margin">5</property>
 +                    <property name="right_margin">5</property>
 +                    <property name="cursor_visible">False</property>
 +                    <property name="buffer">textbuffer4</property>
 +                    <property name="accepts_tab">False</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow32">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="hscrollbar_policy">never</property>
 +                <property name="vscrollbar_policy">never</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTextView" id="textview2">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="pixels_above_lines">5</property>
 +                    <property name="pixels_below_lines">5</property>
 +                    <property name="editable">False</property>
 +                    <property name="wrap_mode">word</property>
 +                    <property name="left_margin">5</property>
 +                    <property name="right_margin">5</property>
 +                    <property name="cursor_visible">False</property>
 +                    <property name="buffer">textbuffer2</property>
 +                    <property name="accepts_tab">False</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847794">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">4</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847795">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes"><b>Actions</b></property>
 +                <property name="use_markup">True</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">5</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847796">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">"A"</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">6</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847797">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">"U+R"</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">7</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847798">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">"R"</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">8</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847799">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Select "A" to add the transaction as new.</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">6</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847780">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Select "U+R" to update and reconcile a matching transaction.</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">7</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847781">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Select "R" to reconcile a matching transaction.</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">8</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847800">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="halign">start</property>
 +                <property name="label" translatable="yes">Select neither to skip the transaction (it won't be imported at all).</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">1</property>
 +                <property name="top_attach">9</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkLabel" id="label847801">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <property name="label" translatable="yes">(none)</property>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">9</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkScrolledWindow" id="scrolledwindow35">
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="vexpand">True</property>
 +                <property name="hscrollbar_policy">never</property>
 +                <property name="vscrollbar_policy">never</property>
 +                <property name="shadow_type">in</property>
 +                <child>
 +                  <object class="GtkTextView" id="textview5">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">True</property>
 +                    <property name="pixels_above_lines">5</property>
 +                    <property name="pixels_below_lines">5</property>
 +                    <property name="editable">False</property>
 +                    <property name="wrap_mode">word</property>
 +                    <property name="left_margin">5</property>
 +                    <property name="right_margin">5</property>
 +                    <property name="cursor_visible">False</property>
 +                    <property name="buffer">textbuffer5</property>
 +                    <property name="accepts_tab">False</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">10</property>
 +                <property name="width">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkEventBox" id="intervention_required_box">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <child>
 +                  <object class="GtkLabel" id="label847802">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="label" translatable="yes">Red</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkEventBox" id="intervention_probably_required_box">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <child>
 +                  <object class="GtkLabel" id="label847803">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="label" translatable="yes">Yellow</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">2</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkEventBox" id="intervention_not_required_box">
 +                <property name="visible">True</property>
 +                <property name="can_focus">False</property>
 +                <child>
 +                  <object class="GtkLabel" id="label847804">
 +                    <property name="visible">True</property>
 +                    <property name="can_focus">False</property>
 +                    <property name="label" translatable="yes">Green</property>
 +                  </object>
 +                </child>
 +              </object>
 +              <packing>
 +                <property name="left_attach">0</property>
 +                <property name="top_attach">3</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <placeholder/>
 +            </child>
 +            <child>
 +              <placeholder/>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">True</property>
 +            <property name="fill">True</property>
 +            <property name="position">2</property>
 +          </packing>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-7">matcher_help_close</action-widget>
 +    </action-widgets>
 +  </object>
 +  <object class="GtkBox" id="transaction_matcher_content">
 +    <property name="visible">True</property>
 +    <property name="can_focus">False</property>
 +    <property name="orientation">vertical</property>
 +    <child>
 +      <object class="GtkLabel" id="heading_label">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="label" translatable="yes">List of downloaded transactions (source split shown):</property>
 +        <property name="justify">center</property>
 +      </object>
 +      <packing>
 +        <property name="expand">False</property>
 +        <property name="fill">False</property>
 +        <property name="position">0</property>
 +      </packing>
 +    </child>
 +    <child>
 +      <object class="GtkScrolledWindow" id="scrolledwindow25">
 +        <property name="visible">True</property>
 +        <property name="can_focus">True</property>
 +        <property name="shadow_type">in</property>
 +        <child>
 +          <object class="GtkTreeView" id="downloaded_view">
 +            <property name="visible">True</property>
 +            <property name="can_focus">True</property>
 +            <property name="reorderable">True</property>
 +            <property name="rules_hint">True</property>
 +            <property name="enable_search">False</property>
 +            <child internal-child="selection">
 +              <object class="GtkTreeSelection" id="treeview-selection3"/>
 +            </child>
 +          </object>
 +        </child>
 +      </object>
 +      <packing>
 +        <property name="expand">True</property>
 +        <property name="fill">True</property>
 +        <property name="position">1</property>
 +      </packing>
 +    </child>
 +    <child>
 +      <placeholder/>
 +    </child>
 +  </object>
 +  <object class="GtkDialog" id="transaction_matcher_dialog">
 +    <property name="can_focus">False</property>
 +    <property name="title" translatable="yes">Generic import transaction matcher</property>
 +    <property name="default_width">600</property>
 +    <property name="default_height">400</property>
 +    <property name="type_hint">dialog</property>
 +    <signal name="close" handler="on_matcher_cancel_clicked" swapped="no"/>
 +    <child internal-child="vbox">
 +      <object class="GtkBox" id="transaction_matcher_vbox">
 +        <property name="visible">True</property>
 +        <property name="can_focus">False</property>
 +        <property name="orientation">vertical</property>
 +        <child internal-child="action_area">
 +          <object class="GtkButtonBox" id="dialog-action_area10">
 +            <property name="visible">True</property>
 +            <property name="can_focus">False</property>
 +            <property name="layout_style">end</property>
 +            <child>
 +              <object class="GtkButton" id="matcher_cancel">
 +                <property name="label">_Cancel</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +                <signal name="clicked" handler="on_matcher_cancel_clicked" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">0</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="matcher_ok">
 +                <property name="label">_OK</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="has_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +                <signal name="clicked" handler="on_matcher_ok_clicked" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">1</property>
 +              </packing>
 +            </child>
 +            <child>
 +              <object class="GtkButton" id="matcher__help">
 +                <property name="label">_Help</property>
 +                <property name="visible">True</property>
 +                <property name="can_focus">True</property>
 +                <property name="can_default">True</property>
 +                <property name="receives_default">True</property>
 +                <property name="use_underline">True</property>
 +                <signal name="clicked" handler="on_matcher_help_clicked" swapped="no"/>
 +              </object>
 +              <packing>
 +                <property name="expand">False</property>
 +                <property name="fill">False</property>
 +                <property name="position">2</property>
 +              </packing>
 +            </child>
 +          </object>
 +          <packing>
 +            <property name="expand">False</property>
 +            <property name="fill">True</property>
 +            <property name="pack_type">end</property>
 +            <property name="position">0</property>
 +          </packing>
 +        </child>
 +        <child>
 +          <placeholder/>
 +        </child>
 +      </object>
 +    </child>
 +    <action-widgets>
 +      <action-widget response="-6">matcher_cancel</action-widget>
 +      <action-widget response="-5">matcher_ok</action-widget>
 +      <action-widget response="-11">matcher__help</action-widget>
 +    </action-widgets>
 +  </object>
 +</interface>
diff --cc gnucash/register/ledger-core/split-register-layout.c
index 151a413,0000000..1553d48
mode 100644,000000..100644
--- a/gnucash/register/ledger-core/split-register-layout.c
+++ b/gnucash/register/ledger-core/split-register-layout.c
@@@ -1,871 -1,0 +1,888 @@@
 +/********************************************************************\
 + * split-register-layout.c -- split register layout object          *
 + * Copyright (C) 1998 Linas Vepstas <linas at linas.org>               *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 + *                                                                  *
 +\********************************************************************/
 +
 +#include <config.h>
 +
 +#include <glib.h>
 +#include <glib/gi18n.h>
 +
 +#include "gnc-engine.h"
 +#include "split-register-layout.h"
 +
 +
 +/* This static indicates the debugging module that this .o belongs to.  */
 +static QofLogModule log_module = GNC_MOD_REGISTER;
 +
 +
 +static void
 +gnc_register_add_cell (TableLayout *layout,
 +                       const char *cell_name,
 +                       const char *cell_type_name,
 +                       const char *sample_text,
 +                       CellAlignment alignment,
 +                       gboolean expandable,
 +                       gboolean span)
 +{
 +    BasicCell *cell;
 +
 +    g_return_if_fail (layout != NULL);
 +    g_return_if_fail (cell_type_name != NULL);
 +
 +    cell = gnc_register_make_cell (cell_type_name);
 +
 +    gnc_basic_cell_set_name (cell, cell_name);
 +    gnc_basic_cell_set_type_name (cell, cell_type_name);
 +    gnc_basic_cell_set_sample_text (cell, sample_text);
 +    gnc_basic_cell_set_alignment (cell, alignment);
 +    gnc_basic_cell_set_expandable (cell, expandable);
 +    gnc_basic_cell_set_span (cell, span);
 +
 +    gnc_table_layout_add_cell (layout, cell);
 +}
 +
 +static void
 +copy_cursor_row (TableLayout *layout, CellBlock *to, CellBlock *from, int row)
 +{
 +    int col;
 +
 +    for (col = 0; col < from->num_cols; col++)
 +    {
 +        BasicCell *cell;
 +
 +        cell = gnc_cellblock_get_cell (from, row, col);
 +        if (!cell || !cell->cell_name)
 +            continue;
 +
 +        gnc_table_layout_set_cell (layout, to, cell->cell_name, row, col);
 +    }
 +}
 +
 +static void
 +gnc_split_register_set_cells (SplitRegister *reg, TableLayout *layout)
 +{
 +    CellBlock *curs;
 +    CellBlock *curs_last;
 +
 +    switch (reg->type)
 +    {
 +    case BANK_REGISTER:
 +    case CASH_REGISTER:
 +    case ASSET_REGISTER:
 +    case CREDIT_REGISTER:
 +    case LIABILITY_REGISTER:
 +    case INCOME_REGISTER:
 +    case EXPENSE_REGISTER:
 +    case EQUITY_REGISTER:
 +    case TRADING_REGISTER:
 +    {
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_LEDGER);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL,  0, 4);
 +        if (reg->is_template)
 +        {
 +            gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
 +            gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
 +        }
 +        else
 +        {
 +            gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 5);
 +            gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 6);
 +        }
 +        gnc_table_layout_set_cell (layout, curs, BALN_CELL,  0, 7);
 +        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_JOURNAL);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 6);
 +        gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0, 7);
 +        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SPLIT);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
 +        gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
 +        if (reg->is_template)
 +        {
 +            gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
 +            gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
 +        }
 +        else
 +        {
 +            gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5);
 +            gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6);
 +        }
 +        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 +
 +        break;
 +    }
 +    /* --------------------------------------------------------- */
 +
 +    case PAYABLE_REGISTER:
 +    case RECEIVABLE_REGISTER:
 +    {
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_LEDGER);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, TYPE_CELL,  0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DDUE_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 3);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 4);
 +        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 6);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 7);
 +        gnc_table_layout_set_cell (layout, curs, BALN_CELL,  0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 3);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 3);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_JOURNAL);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, TYPE_CELL,  0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DDUE_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 3);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 4);
 +
 +        gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 6);
 +        gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 7);
 +        gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 3);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SPLIT);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 4);
 +        gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 6);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 7);
 +
 +        break;
 +    }
 +
 +    /* --------------------------------------------------------- */
 +    case INCOME_LEDGER:
 +    case GENERAL_JOURNAL:
 +    case SEARCH_LEDGER:
 +    {
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_LEDGER);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL,  0, 4);
 +        if (reg->is_template)
 +        {
 +            gnc_table_layout_set_cell (layout, curs, FDEBT_CELL,  0, 5);
 +            gnc_table_layout_set_cell (layout, curs, FCRED_CELL,  0, 6);
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,   0, 7);
 +        }
 +        else
 +        {
 +            gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 5);
 +            gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 6);
 +            gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
 +        }
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_JOURNAL);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 6);
 +        if (reg->is_template)
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 7);
 +        else
 +        {
 +            gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
 +        }
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SPLIT);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
 +        gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
 +        if (reg->is_template)
 +        {
 +            gnc_table_layout_set_cell (layout, curs, FDEBT_CELL,  0, 5);
 +            gnc_table_layout_set_cell (layout, curs, FCRED_CELL,  0, 6);
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,   0, 7);
 +        }
 +        else
 +        {
 +            gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 5);
 +            gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 6);
 +            gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
 +        }
 +
 +        break;
 +    }
 +
 +    /* --------------------------------------------------------- */
 +    case STOCK_REGISTER:
 +    case CURRENCY_REGISTER:
 +    {
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_LEDGER);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0,  0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0,  1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0,  2);
 +        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0,  3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL,  0,  4);
 +        gnc_table_layout_set_cell (layout, curs, SHRS_CELL,  0,  5);
 +        gnc_table_layout_set_cell (layout, curs, PRIC_CELL,  0,  6);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0,  7);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0,  8);
 +        gnc_table_layout_set_cell (layout, curs, BALN_CELL,  0,  9);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_JOURNAL);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0,  0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0,  1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0,  2);
 +        gnc_table_layout_set_cell (layout, curs, TSHRS_CELL, 0,  5);
 +        gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0,  7);
 +        gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0,  8);
 +        gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0,  9);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SPLIT);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
 +        gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
 +        gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
 +
 +        break;
 +    }
 +
 +    /* --------------------------------------------------------- */
 +    case PORTFOLIO_LEDGER:
 +    {
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_LEDGER);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL,  0, 4);
 +        gnc_table_layout_set_cell (layout, curs, SHRS_CELL,  0, 5);
 +        gnc_table_layout_set_cell (layout, curs, PRIC_CELL,  0, 6);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 7);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SINGLE_JOURNAL);
 +
 +        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
 +        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 1);
 +        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
 +        gnc_table_layout_set_cell (layout, curs, TSHRS_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 7);
 +        gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 8);
 +
 +        curs_last = curs;
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +
 +        copy_cursor_row (layout, curs, curs_last, 0);
 +
 +        gnc_table_layout_set_cell (layout, curs, TNUM_CELL,  1, 1);
 +        gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
 +        gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
 +        gnc_table_layout_set_cell (layout, curs, ASSOC_CELL,  1, 4);
 +
 +        curs = gnc_table_layout_get_cursor (layout,
 +                                            CURSOR_SPLIT);
 +
 +        gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
 +        gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
 +        gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
 +        gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
 +        gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
 +        gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
 +        gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
 +        gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
 +
 +        break;
 +    }
 +
 +    /* --------------------------------------------------------- */
 +    default:
 +        PERR ("unknown register type %d \n", reg->type);
 +        break;
 +    }
 +}
 +
 +static void
 +gnc_split_register_layout_add_cursors (SplitRegister *reg,
 +                                       TableLayout *layout)
 +{
 +    CellBlock *cursor;
 +    int num_cols;
 +
 +    switch (reg->type)
 +    {
 +    case BANK_REGISTER:
 +    case CASH_REGISTER:
 +    case ASSET_REGISTER:
 +    case CREDIT_REGISTER:
 +    case LIABILITY_REGISTER:
 +    case INCOME_REGISTER:
 +    case EXPENSE_REGISTER:
 +    case EQUITY_REGISTER:
 +    case TRADING_REGISTER:
 +        num_cols = 9;
 +        break;
 +
 +    case PAYABLE_REGISTER:
 +    case RECEIVABLE_REGISTER:
 +        num_cols = 9;
 +        break;
 +
 +    case INCOME_LEDGER:
 +    case GENERAL_JOURNAL:
 +    case SEARCH_LEDGER:
 +        if (reg->is_template)
 +            num_cols = 8;
 +        else
 +            num_cols = 9;
 +        break;
 +
 +    case STOCK_REGISTER:
 +    case CURRENCY_REGISTER:
 +        num_cols = 10;
 +        break;
 +
 +    case PORTFOLIO_LEDGER:
 +        num_cols = 9;
 +        break;
 +
 +    default:
 +        PERR("Bad register type");
 +        g_assert (FALSE);
 +        return;
 +    }
 +
 +    cursor = gnc_cellblock_new (1, num_cols, CURSOR_HEADER);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    /* cursors used in ledger mode */
 +    cursor = gnc_cellblock_new (1, num_cols, CURSOR_SINGLE_LEDGER);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    gnc_table_layout_set_primary_cursor (layout, cursor);
 +
 +    cursor = gnc_cellblock_new (2, num_cols, CURSOR_DOUBLE_LEDGER);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    cursor = gnc_cellblock_new (2, num_cols, CURSOR_DOUBLE_LEDGER_NUM_ACTN);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    /* cursors used for journal mode */
 +    cursor = gnc_cellblock_new (1, num_cols, CURSOR_SINGLE_JOURNAL);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    cursor = gnc_cellblock_new (2, num_cols, CURSOR_DOUBLE_JOURNAL);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    cursor = gnc_cellblock_new (2, num_cols, CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +
 +    cursor = gnc_cellblock_new (1, num_cols, CURSOR_SPLIT);
 +    gnc_table_layout_add_cursor (layout, cursor);
 +}
 +
 +static void
 +gnc_split_register_layout_add_cells (SplitRegister *reg,
 +                                     TableLayout *layout)
 +{
 +    gnc_register_add_cell (layout,
 +                           DATE_CELL,
 +                           DATE_CELL_TYPE_NAME,
++                           /* Translators: The 'sample:' items are
++                              strings which are not displayed, but only
++                              used to estimate widths. Please only
++                              translate the portion after the ':' and
++                              leave the rest ("sample:") as is. */
 +                           N_("sample:12/12/2000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           DDUE_CELL,
 +                           DATE_CELL_TYPE_NAME,
 +                           N_("sample:12/12/2000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           NUM_CELL,
 +                           NUM_CELL_TYPE_NAME,
 +                           /* Translators: The 'sample:' items are
 +                              strings which are not displayed, but only
 +                              used to estimate widths. Please only
 +                              translate the portion after the ':' and
 +                              leave the rest ("sample:") as is. */
 +                           N_("sample:99999") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TNUM_CELL,
 +                           BASIC_CELL_TYPE_NAME,
 +                           N_("sample:99999") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           DESC_CELL,
 +                           QUICKFILL_CELL_TYPE_NAME,
 +                           N_("sample:Description of a transaction") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           TRUE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           RATE_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           NULL,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           RECN_CELL,
 +                           RECN_CELL_TYPE_NAME,
-                            N_("Reconciled:R") + 11,
++	                          /* Translators: The abbreviation for 'Reconciled'
++	                              in the header row of the register. Please only
++	                              translate the portion after the ':' and
++	                              leave the rest ("Reconciled:") as is. */
++	                            N_("Reconciled:R") + 11,
 +                           CELL_ALIGN_CENTER,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           ASSOC_CELL,
 +                           RECN_CELL_TYPE_NAME,
++                           /* Translators: The abbreviation for 'Associate'
++                              in the header row of the register. Please only
++                              translate the portion after the ':' and
++                              leave the rest ("Associate:") as is. */
 +                           N_("Associate:A") + 10,
 +                           CELL_ALIGN_CENTER,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           BALN_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           XFRM_CELL,
 +                           COMBO_CELL_TYPE_NAME,
 +                           N_("Transfer"),
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           MXFRM_CELL,
 +                           COMBO_CELL_TYPE_NAME,
 +                           N_("sample:Expenses:Automobile:Gasoline") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           ACTN_CELL,
 +                           COMBO_CELL_TYPE_NAME,
 +                           N_("sample:Expenses:Automobile:Gasoline") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           MEMO_CELL,
 +                           QUICKFILL_CELL_TYPE_NAME,
 +                           N_("sample:Memo field sample text string") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           TRUE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           DEBT_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           CRED_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           SHRS_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    /* Price cell must come after shares cell, as its callback performs
 +     * a computation on the value set by the shares cell callback. */
 +    gnc_register_add_cell (layout,
 +                           PRIC_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TDEBT_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TCRED_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TSHRS_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TBALN_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           TYPE_CELL,
 +                           RECN_CELL_TYPE_NAME,
-                            N_("Type:T") + 5,
++	                          /* Translators: The abbreviation for 'Type'
++	                              in the header row of the register. Please only
++	                              translate the portion after the ':' and
++	                              leave the rest ("Type:") as is. */
++	                            N_("Type:T") + 5,
 +                           CELL_ALIGN_CENTER,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           NOTES_CELL,
 +                           QUICKFILL_CELL_TYPE_NAME,
 +                           N_("sample:Notes field sample text string") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           FALSE,
 +                           TRUE);
 +
 +    gnc_register_add_cell (layout,
 +                           VNOTES_CELL,
 +                           BASIC_CELL_TYPE_NAME,
 +                           N_("sample:No Particular Reason") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           TRUE);
 +
 +    gnc_register_add_cell (layout,
 +                           FCRED_CELL,
 +                           FORMULA_CELL_TYPE_NAME,
 +                           N_("sample:(x + 0.33 * y + (x+y) )") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           FDEBT_CELL,
 +                           FORMULA_CELL_TYPE_NAME,
 +                           N_("sample:(x + 0.33 * y + (x+y) )") + 7,
 +                           CELL_ALIGN_LEFT,
 +                           FALSE,
 +                           FALSE);
 +
 +    gnc_register_add_cell (layout,
 +                           RBALN_CELL,
 +                           PRICE_CELL_TYPE_NAME,
 +                           N_("sample:999,999.000") + 7,
 +                           CELL_ALIGN_RIGHT,
 +                           FALSE,
 +                           FALSE);
 +
 +}
 +
 +TableLayout *
 +gnc_split_register_layout_new (SplitRegister *reg)
 +{
 +    TableLayout *layout;
 +
 +    layout = gnc_table_layout_new ();
 +
 +    gnc_split_register_layout_add_cells (reg, layout);
 +    gnc_split_register_layout_add_cursors (reg, layout);
 +    gnc_split_register_set_cells (reg, layout);
 +
 +    return layout;
 +}
diff --cc libgnucash/backend/dbi/gnc-backend-dbi.cpp
index 4050046,0000000..9ea3723
mode 100644,000000..100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@@ -1,1225 -1,0 +1,1243 @@@
 +/********************************************************************
 + * gnc-backend-dbi.c: load and save data to SQL via libdbi          *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 +\********************************************************************/
 +/** @file gnc-backend-dbi.c
 + *  @brief load and save data to SQL
 + *  @author Copyright (c) 2006-2008 Phil Longstaff <plongstaff at rogers.com>
 + *
 + * This file implements the top-level QofBackend API for saving/
 + * restoring data to/from an SQL db using libdbi
 + */
 +extern "C"
 +{
- #include <config.h>
++#include "config.h"
 +
 +#include <platform.h>
 +#ifdef __STRICT_ANSI__
 +#undef __STRICT_ANSI__
 +#define __STRICT_ANSI_UNSET__ 1
 +#endif
 +#ifdef _NO_OLDNAMES
 +#undef _NO_OLDNAMES
 +#endif
 +#ifdef _UWIN
 +#undef _UWIN
 +#endif
 +#if PLATFORM(WINDOWS)
 +#include <winsock2.h>
 +#include <windows.h>
 +#define __STDC_FORMAT_MACROS 1
 +#endif
 +
 +#include <inttypes.h>
 +#include <errno.h>
 +#include <glib.h>
 +#include <glib/gstdio.h>
 +
 +#include "qof.h"
 +#include "qofquery-p.h"
 +#include "qofquerycore-p.h"
 +#include "Account.h"
 +#include "TransLog.h"
 +#include "gnc-engine.h"
 +#include "SX-book.h"
 +#include "Recurrence.h"
 +
 +#include "gnc-uri-utils.h"
 +#include "gnc-filepath-utils.h"
 +#include <gnc-path.h>
 +#include "gnc-locale-utils.h"
 +
 +#include "gnc-prefs.h"
 +
 +#ifdef S_SPLINT_S
 +#include "splint-defs.h"
 +#endif
 +
 +}
 +#include <boost/regex.hpp>
 +#include <string>
 +#include <iomanip>
 +
 +#include <gnc-backend-prov.hpp>
 +#include "gnc-backend-dbi.h"
 +#include "gnc-backend-dbi.hpp"
 +
 +#include <gnc-sql-object-backend.hpp>
 +#include "gnc-dbisqlresult.hpp"
 +#include "gnc-dbisqlconnection.hpp"
 +
 +#if PLATFORM(WINDOWS)
 +#ifdef __STRICT_ANSI_UNSET__
 +#undef __STRICT_ANSI_UNSET__
 +#define __STRICT_ANSI__ 1
 +#endif
 +#endif
 +
 +#if LIBDBI_VERSION >= 900
 +#define HAVE_LIBDBI_R 1
 +#define HAVE_LIBDBI_TO_LONGLONG 1
 +static dbi_inst dbi_instance = nullptr;
 +#else
 +#define HAVE_LIBDBI_R 0
 +#define HAVE_LIBDBI_TO_LONGLONG 0
 +#endif
 +
 +#define TRANSACTION_NAME "trans"
 +
 +static QofLogModule log_module = G_LOG_DOMAIN;
 +
 +#define FILE_URI_TYPE "file"
 +#define FILE_URI_PREFIX (FILE_URI_TYPE "://")
 +#define SQLITE3_URI_TYPE "sqlite3"
 +#define SQLITE3_URI_PREFIX (SQLITE3_URI_TYPE "://")
 +#define PGSQL_DEFAULT_PORT 5432
 +
 +static void adjust_sql_options (dbi_conn connection);
 +static bool save_may_clobber_data (dbi_conn conn, const std::string& dbname);
 +
 +template <DbType Type>
 +class QofDbiBackendProvider : public QofBackendProvider
 +{
 +public:
 +    QofDbiBackendProvider (const char* name, const char* type) :
 +        QofBackendProvider {name, type} {}
 +    QofDbiBackendProvider(QofDbiBackendProvider&) = delete;
 +    QofDbiBackendProvider operator=(QofDbiBackendProvider&) = delete;
 +    QofDbiBackendProvider(QofDbiBackendProvider&&) = delete;
 +    QofDbiBackendProvider operator=(QofDbiBackendProvider&&) = delete;
 +    ~QofDbiBackendProvider () = default;
 +    QofBackend* create_backend(void)
 +    {
 +        return new GncDbiBackend<Type>(nullptr, nullptr);
 +    }
 +    bool type_check(const char* type) { return true; }
 +};
 +
 +/* ================================================================= */
 +/* ================================================================= */
 +struct UriStrings
 +{
 +    UriStrings() = default;
 +    UriStrings(const std::string& uri);
 +    ~UriStrings() = default;
 +    std::string basename() const noexcept;
 +    const char* dbname() const noexcept;
 +    std::string quote_dbname(DbType t) const noexcept;
 +    std::string m_protocol;
 +    std::string m_host;
 +    std::string m_dbname;
 +    std::string m_username;
 +    std::string m_password;
 +    std::string m_basename;
 +    int m_portnum;
 +};
 +
 +UriStrings::UriStrings(const std::string& uri)
 +{
 +    gchar *protocol, *host, *username, *password, *dbname;
 +    int portnum;
 +    gnc_uri_get_components(uri.c_str(), &protocol, &host, &portnum, &username,
 +                           &password, &dbname);
 +    m_protocol = std::string{protocol};
 +    m_host = std::string{host};
 +    m_dbname = std::string{dbname};
 +    if (username)
 +	m_username = std::string{username};
 +    if (password)
 +	m_password = std::string{password};
 +    m_portnum = portnum;
 +    g_free(protocol);
 +    g_free(host);
 +    g_free(username);
 +    g_free(password);
 +    g_free(dbname);
 +    
 +}
 +
 +std::string
 +UriStrings::basename() const noexcept
 +{
 +    return m_protocol + "_" + m_host + "_" + m_username + "_" + m_dbname;
 +}
 +
 +const char*
 +UriStrings::dbname() const noexcept
 +{
 +    return m_dbname.c_str();
 +}
 +
 +std::string
 +UriStrings::quote_dbname(DbType t) const noexcept
 +{
 +    if (m_dbname.empty())
 +        return "";
 +    const char quote = (t == DbType::DBI_MYSQL ? '`' : '"');
 +    std::string retval(1, quote);
 +    retval += m_dbname + quote;
 +    return retval;
 +}
 +
 +static void
 +set_options(dbi_conn conn, const PairVec& options)
 +{
 +    for (auto option : options)
 +    {
 +        auto opt = option.first.c_str();
 +        auto val = option.second.c_str();
 +        auto result = dbi_conn_set_option(conn, opt, val);
 +        if (result < 0)
 +        {
 +            const char *msg = nullptr;
 +            int err = dbi_conn_error(conn, &msg);
 +            PERR("Error setting %s option to %s: %s", opt, val, msg);
 +            throw std::runtime_error(msg);
 +        }
 +    }
 +}
 +
 +/**
 + * Sets standard db options in a dbi_conn.
 + *
 + * @param conn dbi_conn connection
 + * @param uri UriStrings containing the needed parameters.
 + * @return TRUE if successful, FALSE if error
 + */
 +template <DbType Type> bool
 +GncDbiBackend<Type>::set_standard_connection_options (dbi_conn conn,
 +                                                const UriStrings& uri)
 +
 +{
 +    gint result;
 +    PairVec options;
 +    options.push_back(std::make_pair("host", uri.m_host));
 +    options.push_back(std::make_pair("dbname", uri.m_dbname));
 +    options.push_back(std::make_pair("username", uri.m_username));
 +    options.push_back(std::make_pair("password", uri.m_password));
 +    options.push_back(std::make_pair("encoding", "UTF-8"));
 +    try
 +    {
 +        set_options(conn, options);
 +        auto result = dbi_conn_set_option_numeric(conn, "port", uri.m_portnum);
 +        if (result < 0)
 +        {
 +            const char *msg = nullptr;
 +            auto err = dbi_conn_error(conn, &msg);
 +            PERR("Error setting port option to %d: %s", uri.m_portnum, msg);
 +            throw std::runtime_error(msg);
 +        }
 +    }
 +    catch (std::runtime_error& err)
 +    {
 +        set_error (ERR_BACKEND_SERVER_ERR);
 +        return false;
 +    }
 +
 +    return true;
 +}
 +
 +template <DbType Type> void error_handler(void* conn, void* data);
 +void error_handler(void* conn, void* data);
 +
 +template <DbType Type> dbi_conn
 +GncDbiBackend<Type>::conn_setup (PairVec& options, UriStrings& uri)
 +{
 +    const char* dbstr = (Type == DbType::DBI_SQLITE ? "sqlite3" :
 +                         Type == DbType::DBI_MYSQL ? "mysql" : "pgsql");
 +#if HAVE_LIBDBI_R
 +    dbi_conn conn = nullptr;
 +    if (dbi_instance)
 +        conn = dbi_conn_new_r (dbstr, dbi_instance);
 +    else
 +        PERR ("Attempt to connect with an uninitialized dbi_instance");
 +#else
 +    auto conn = dbi_conn_new (dbstr);
 +#endif
 +
 +    if (conn == nullptr)
 +    {
 +        PERR ("Unable to create %s dbi connection", dbstr);
 +        set_error (ERR_BACKEND_BAD_URL);
 +	return nullptr;
 +    }
 +
 +    dbi_conn_error_handler (conn, error_handler<Type>, this);
 +    if (!uri.m_dbname.empty() &&
 +        !set_standard_connection_options(conn, uri))
 +    {
 +        dbi_conn_close(conn);
 +        return nullptr;
 +    }
 +    if(!options.empty())
 +    {
 +        try {
 +            set_options(conn, options);
 +        }
 +        catch (std::runtime_error& err)
 +        {
 +            dbi_conn_close(conn);
 +            set_error (ERR_BACKEND_SERVER_ERR);
 +            return nullptr;
 +        }
 +    }
 +
 +    return conn;
 +}
 +
 +template <DbType Type>bool
 +GncDbiBackend<Type>::create_database(dbi_conn conn, const char* db)
 +{
 +    const char *dbname;
 +    const char *dbcreate;
 +    if (Type == DbType::DBI_MYSQL)
 +    {
 +        dbname = "mysql";
 +        dbcreate = "CREATE DATABASE %s CHARACTER SET utf8";
 +    }
 +    else
 +    {
 +        dbname = "postgres";
 +        dbcreate = "CREATE DATABASE %s WITH TEMPLATE template0 ENCODING 'UTF8'";
 +    }
 +    PairVec options;
 +    options.push_back(std::make_pair("dbname", dbname));
 +    try
 +    {
 +        set_options(conn, options);
 +    }
 +    catch (std::runtime_error& err)
 +    {
 +        set_error (ERR_BACKEND_SERVER_ERR);
 +        return false;
 +    }
 +
 +    auto result = dbi_conn_connect (conn);
 +    if (result < 0)
 +    {
 +        PERR ("Unable to connect to %s database", dbname);
 +        set_error(ERR_BACKEND_SERVER_ERR);
 +        return false;
 +    }
 +    if (Type == DbType::DBI_MYSQL)
 +        adjust_sql_options(conn);
 +    auto dresult = dbi_conn_queryf (conn, dbcreate, db);
 +    if (dresult == nullptr)
 +    {
 +        PERR ("Unable to create database '%s'\n", db);
 +        set_error (ERR_BACKEND_SERVER_ERR);
 +        return false;
 +    }
 +    if (Type == DbType::DBI_PGSQL)
 +    {
 +        const char *alterdb = "ALTER DATABASE %s SET "
 +            "standard_conforming_strings TO on";
 +        dbi_conn_queryf (conn, alterdb, db);
 +    }
 +    dbi_conn_close(conn);
 +    conn = nullptr;
 +    return true;
 +}
 +
 +template <> void
 +error_handler<DbType::DBI_SQLITE> (dbi_conn conn, void* user_data)
 +{
 +    const char* msg;
 +    GncDbiBackend<DbType::DBI_SQLITE> *dbi_be =
 +        static_cast<decltype(dbi_be)>(user_data);
-     int errnum = dbi_conn_error (conn, &msg);
++    int err_num = dbi_conn_error (conn, &msg);
++    /* BADIDX is raised if we attempt to seek outside of a result. We
++     * handle that possibility after checking the return value of the
++     * seek. Having this raise a critical error breaks looping by
++     * testing for the return value of the seek.
++     */
++    if (err_num == DBI_ERROR_BADIDX) return;
 +    PERR ("DBI error: %s\n", msg);
 +    if (dbi_be->connected())
 +        dbi_be->set_dbi_error (ERR_BACKEND_MISC, 0, false);
 +}
 +
 +template <> void
 +GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
 +                                                 const char* book_id,
 +                                                 bool ignore_lock,
 +                                                 bool create, bool force)
 +{
 +    gboolean file_exists;
 +    PairVec options;
 +
 +    g_return_if_fail (session != nullptr);
 +    g_return_if_fail (book_id != nullptr);
 +
 +    ENTER (" ");
 +
 +    /* Remove uri type if present */
 +    auto path = gnc_uri_get_path (book_id);
 +    std::string filepath{path};
 +    g_free(path);
 +    GFileTest ftest = static_cast<decltype (ftest)> (
 +        G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS) ;
 +    file_exists = g_file_test (filepath.c_str(), ftest);
 +    if (!create && !file_exists)
 +    {
 +        set_error (ERR_FILEIO_FILE_NOT_FOUND);
 +        std::string msg{"Sqlite3 file "};
 +        set_message (msg + filepath + " not found");
 +        PWARN ("Sqlite3 file %s not found", filepath.c_str());
 +        LEAVE("Error");
 +	return;
 +    }
 +
 +    if (create && !force && file_exists)
 +    {
 +        set_error (ERR_BACKEND_STORE_EXISTS);
 +        auto msg = "Might clobber, no force";
 +        PWARN ("%s", msg);
 +        LEAVE("Error");
 +	return;
 +    }
 +
 +    connect(nullptr);
 +    /* dbi-sqlite3 documentation says that sqlite3 doesn't take a "host" option */
 +    options.push_back(std::make_pair("host", "localhost"));
 +    auto dirname = g_path_get_dirname (filepath.c_str());
 +    auto basename = g_path_get_basename (filepath.c_str());
 +    options.push_back(std::make_pair("dbname", basename));
 +    options.push_back(std::make_pair("sqlite3_dbdir", dirname));
 +    if (basename != nullptr) g_free (basename);
 +    if (dirname != nullptr) g_free (dirname);
 +    UriStrings uri;
 +    auto conn = conn_setup(options, uri);
 +    if (conn == nullptr)
 +    {
 +        LEAVE("Error");
 +        return;
 +    }
 +
 +    auto result = dbi_conn_connect (conn);
 +
 +    if (result < 0)
 +    {
 +        dbi_conn_close(conn);
 +        PERR ("Unable to connect to %s: %d\n", book_id, result);
 +        set_error (ERR_BACKEND_BAD_URL);
 +        LEAVE("Error");
 +	return;
 +    }
 +
 +    if (!conn_test_dbi_library(conn))
 +    {
 +        if (create && !file_exists)
 +        {
 +         /* File didn't exist before, but it does now, and we don't want to
 +          * leave it lying around.
 +          */
 +            dbi_conn_close (conn);
 +            conn = nullptr;
 +            g_unlink (filepath.c_str());
 +        }
 +        dbi_conn_close(conn);
 +        LEAVE("Bad DBI Library");
 +        return;
 +    }
 +
 +    try
 +    {
 +        connect(new GncDbiSqlConnection(DbType::DBI_SQLITE,
 +                                            this, conn, ignore_lock));
 +    }
 +    catch (std::runtime_error& err)
 +    {
 +        return;
 +    }
 +
 +    /* We should now have a proper session set up.
 +     * Let's start logging */
 +    xaccLogSetBaseName (filepath.c_str());
 +    PINFO ("logpath=%s", filepath.c_str() ? filepath.c_str() : "(null)");
 +
 +    LEAVE ("");
 +}
 +
 +
 +template <> void
 +error_handler<DbType::DBI_MYSQL> (dbi_conn conn, void* user_data)
 +{
 +    GncDbiBackend<DbType::DBI_MYSQL>* dbi_be =
 +        static_cast<decltype(dbi_be)>(user_data);
 +    const char* msg;
 +
 +    auto err_num = dbi_conn_error (conn, &msg);
++    /* BADIDX is raised if we attempt to seek outside of a result. We
++     * handle that possibility after checking the return value of the
++     * seek. Having this raise a critical error breaks looping by
++     * testing for the return value of the seek.
++     */
++    if (err_num == DBI_ERROR_BADIDX) return;
 +
 +    /* Note: the sql connection may not have been initialized yet
 +     *       so let's be careful with using it
 +     */
 +
 +    /* Database doesn't exist. When this error is triggered the
 +     * GncDbiSqlConnection may not exist yet either, so don't use it here
 +     */
 +    if (err_num == 1049)            // Database doesn't exist
 +    {
 +        PINFO ("DBI error: %s\n", msg);
 +        dbi_be->set_exists(false);
 +        return;
 +    }
 +
 +    /* All the other error handling code assumes the GncDbiSqlConnection
 +     *  has been initialized. So let's assert it exits here, otherwise
 +     * simply return.
 +     */
 +    if (!dbi_be->connected())
 +    {
 +        PINFO ("DBI error: %s\n", msg);
 +        PINFO ("Note: GbcDbiSqlConnection not yet initialized. Skipping further error processing.");
 +        return;
 +    }
 +
 +    /* Test for other errors */
 +    if (err_num == 2006)       // Server has gone away
 +    {
 +        PINFO ("DBI error: %s - Reconnecting...\n", msg);
 +        dbi_be->set_dbi_error (ERR_BACKEND_CONN_LOST, 1, true);
 +        dbi_be->retry_connection(msg);
 +    }
 +    else if (err_num == 2003)       // Unable to connect
 +    {
 +        dbi_be->set_dbi_error (ERR_BACKEND_CANT_CONNECT, 1, true);
 +        dbi_be->retry_connection (msg);
 +    }
 +    else                            // Any other error
 +    {
 +        PERR ("DBI error: %s\n", msg);
 +        dbi_be->set_dbi_error (ERR_BACKEND_MISC, 0, FALSE);
 +    }
 +}
 +
 +#define SQL_OPTION_TO_REMOVE "NO_ZERO_DATE"
 +
 +/* Given an sql_options string returns a copy of the string adjusted as
 + * necessary.  In particular if string the contains SQL_OPTION_TO_REMOVE it is
 + * removed along with comma separator.
 + */
 +std::string
 +adjust_sql_options_string(const std::string& str)
 +{
 +/* Regex that finds the SQL_OPTION_TO_REMOVE as the first, last, or middle of a
 + * comma-delimited list.
 + */
 +    boost::regex reg{"(?:," SQL_OPTION_TO_REMOVE "$|\\b"
 +            SQL_OPTION_TO_REMOVE "\\b,?)"};
 +    return regex_replace(str, reg, std::string{""});
 +}
 +
 +/* checks mysql sql_options and adjusts if necessary */
 +static void
 +adjust_sql_options (dbi_conn connection)
 +{
 +    dbi_result result = dbi_conn_query( connection, "SELECT @@sql_mode");
 +    if (result == nullptr)
 +    {
 +        const char* errmsg;
 +        int err = dbi_conn_error(connection, &errmsg);
 +        PERR("Unable to read sql_mode %d : %s", err, errmsg);
 +        return;
 +    }
 +    dbi_result_first_row(result);
 +    std::string str{dbi_result_get_string_idx(result, 1)};
 +    dbi_result_free(result);
 +    if (str.empty())
 +    {
 +        const char* errmsg;
 +        int err = dbi_conn_error(connection, &errmsg);
 +	if (err)
 +	    PERR("Unable to get sql_mode %d : %s", err, errmsg);
 +	else
 +	    PINFO("Sql_mode isn't set.");
 +        return;
 +    }
 +    PINFO("Initial sql_mode: %s", str.c_str());
 +    if(str.find(SQL_OPTION_TO_REMOVE) == std::string::npos)
 +        return;
 +
 +    std::string adjusted_str{adjust_sql_options_string(str)};
 +    PINFO("Setting sql_mode to %s", adjusted_str.c_str());
 +    std::string set_str{"SET sql_mode=" + std::move(adjusted_str)};
 +    dbi_result set_result = dbi_conn_query(connection,
 +                                           set_str.c_str());
 +    if (set_result)
 +    {
 +        dbi_result_free(set_result);
 +    }
 +    else
 +    {
 +        const char* errmsg;
 +        int err = dbi_conn_error(connection, &errmsg);
 +        PERR("Unable to set sql_mode %d : %s", err, errmsg);
 +    }
 +}
 +
 +
 +template <DbType Type> void
 +GncDbiBackend<Type>::session_begin (QofSession* session, const char* book_id,
 +                                    bool ignore_lock, bool create, bool force)
 +{
 +    GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
 +    PairVec options;
 +
 +    g_return_if_fail (session != nullptr);
 +    g_return_if_fail (book_id != nullptr);
 +
 +    ENTER (" ");
 +
 +    /* Split the book-id
 +     * Format is protocol://username:password@hostname:port/dbname
 +     where username, password and port are optional) */
 +    UriStrings uri(book_id);
 +
 +    if (Type == DbType::DBI_PGSQL)
 +    {
 +        if (uri.m_portnum == 0)
 +            uri.m_portnum = PGSQL_DEFAULT_PORT;
 +        /* Postgres's SQL interface coerces identifiers to lower case, but the
 +         * C interface is case-sensitive. This results in a mixed-case dbname
 +         * being created (with a lower case name) but then dbi can't conect to
 +         * it. To work around this, coerce the name to lowercase first. */
 +        auto lcname = g_utf8_strdown (uri.dbname(), -1);
 +        uri.m_dbname = std::string{lcname};
 +        g_free(lcname);
 +    }
 +    connect(nullptr);
 +
 +    auto conn = conn_setup(options, uri);
 +    if (conn == nullptr)
 +    {
 +        LEAVE("Error");
 +        return;
 +    }
 +
 +    m_exists = true; //May be unset in the error handler.
 +    auto result = dbi_conn_connect (conn);
 +    if (result == 0)
 +    {
 +        if (Type == DbType::DBI_MYSQL)
 +            adjust_sql_options (conn);
 +        if(!conn_test_dbi_library(conn))
 +        {
 +            dbi_conn_close(conn);
 +            LEAVE("Error");
 +            return;
 +        }
 +        if (create && !force && save_may_clobber_data (conn,
 +                                                       uri.quote_dbname(Type)))
 +        {
 +            set_error (ERR_BACKEND_STORE_EXISTS);
 +            PWARN ("Databse already exists, Might clobber it.");
 +            dbi_conn_close(conn);
 +            LEAVE("Error");
 +            return;
 +        }
 +
 +    }
 +    else
 +    {
 +
 +        if (m_exists)
 +        {
 +            PERR ("Unable to connect to database '%s'\n", uri.dbname());
 +            set_error (ERR_BACKEND_SERVER_ERR);
 +            dbi_conn_close(conn);
 +            LEAVE("Error");
 +            return;
 +        }
 +
 +        if (create)
 +        {
 +            if (!create_database(conn, uri.quote_dbname(Type).c_str()))
 +            {
 +                dbi_conn_close(conn);
 +                LEAVE("Error");
 +                return;
 +            }
 +            conn = conn_setup(options, uri);
 +            result = dbi_conn_connect (conn);
 +            if (result < 0)
 +            {
 +                PERR ("Unable to create database '%s'\n", uri.dbname());
 +                set_error (ERR_BACKEND_SERVER_ERR);
 +                dbi_conn_close(conn);
 +                LEAVE("Error");
 +                return;
 +            }
 +            if (Type == DbType::DBI_MYSQL)
 +                adjust_sql_options (conn);
 +            if (!conn_test_dbi_library(conn))
 +            {
 +                if (Type == DbType::DBI_PGSQL)
 +                    dbi_conn_select_db (conn, "template1");
 +                dbi_conn_queryf (conn, "DROP DATABASE %s",
 +                                 uri.quote_dbname(Type).c_str());
 +                dbi_conn_close(conn);
 +                return;
 +            }
 +        }
 +        else
 +        {
 +            set_error(ERR_BACKEND_NO_SUCH_DB);
 +            std::string msg{"Database "};
 +            set_message(msg + uri.dbname() + " not found");
 +        }
 +    }
 +
 +    connect(nullptr);
 +    try
 +    {
 +        connect(new GncDbiSqlConnection(Type, this, conn, ignore_lock));
 +    }
 +    catch (std::runtime_error& err)
 +    {
 +        return;
 +    }
 +    /* We should now have a proper session set up.
 +     * Let's start logging */
 +    auto translog_path = gnc_build_translog_path (uri.basename().c_str());
 +    xaccLogSetBaseName (translog_path);
 +    PINFO ("logpath=%s", translog_path ? translog_path : "(null)");
 +    g_free (translog_path);
 +
 +    LEAVE (" ");
 +}
 +
 +template<> void
 +error_handler<DbType::DBI_PGSQL> (dbi_conn conn, void* user_data)
 +{
 +    GncDbiBackend<DbType::DBI_PGSQL>* dbi_be =
 +        static_cast<decltype(dbi_be)>(user_data);
 +    const char* msg;
 +
-     (void)dbi_conn_error (conn, &msg);
++    auto err_num = dbi_conn_error (conn, &msg);
++    /* BADIDX is raised if we attempt to seek outside of a result. We
++     * handle that possibility after checking the return value of the
++     * seek. Having this raise a critical error breaks looping by
++     * testing for the return value of the seek.
++     */
++    if (err_num == DBI_ERROR_BADIDX) return;
 +    if (g_str_has_prefix (msg, "FATAL:  database") &&
 +        g_str_has_suffix (msg, "does not exist\n"))
 +    {
 +        PINFO ("DBI error: %s\n", msg);
 +        dbi_be->set_exists(false);
 +    }
 +    else if (g_strrstr (msg,
 +                        "server closed the connection unexpectedly"))    // Connection lost
 +    {
 +        if (!dbi_be->connected())
 +        {
 +            PWARN ("DBI Error: Connection lost, connection pointer invalid");
 +            return;
 +        }
 +        PINFO ("DBI error: %s - Reconnecting...\n", msg);
 +        dbi_be->set_dbi_error (ERR_BACKEND_CONN_LOST, 1, true);
 +        dbi_be->retry_connection(msg);
 +    }
 +    else if (g_str_has_prefix (msg, "connection pointer is NULL") ||
 +             g_str_has_prefix (msg, "could not connect to server"))       // No connection
 +    {
 +
 +        if (!dbi_be->connected())
 +            qof_backend_set_error(reinterpret_cast<QofBackend*>(dbi_be),
 +                                  ERR_BACKEND_CANT_CONNECT);
 +        else
 +        {
 +            dbi_be->set_dbi_error(ERR_BACKEND_CANT_CONNECT, 1, true);
 +            dbi_be->retry_connection (msg);
 +        }
 +    }
 +    else
 +    {
 +        PERR ("DBI error: %s\n", msg);
 +        if (dbi_be->connected())
 +            dbi_be->set_dbi_error (ERR_BACKEND_MISC, 0, false);
 +    }
 +}
 +
 +/* ================================================================= */
 +
 +template <DbType Type> void
 +GncDbiBackend<Type>::session_end ()
 +{
 +    ENTER (" ");
 +
 +    finalize_version_info ();
 +    connect(nullptr);
 +
 +    LEAVE (" ");
 +}
 +
 +template <DbType Type>
 +GncDbiBackend<Type>::~GncDbiBackend()
 +{
 +    /* Stop transaction logging */
 +    xaccLogSetBaseName (nullptr);
 +}
 +
 +/* ================================================================= */
 +
 +/* GNUCASH_RESAVE_VERSION indicates the earliest database version
 + * compatible with this version of Gnucash; the stored value is the
 + * earliest version of Gnucash conpatible with the database. If the
 + * GNUCASH_RESAVE_VERSION for this Gnucash is newer than the Gnucash
 + * version which created the database, a resave is offered. If the
 + * version of this Gnucash is older than the saved resave version,
 + * then the database will be loaded read-only. A resave will update
 + * both values to match this version of Gnucash.
 + */
 +template <DbType Type> void
 +GncDbiBackend<Type>::load (QofBook* book, QofBackendLoadType loadType)
 +{
 +    g_return_if_fail (book != nullptr);
 +
 +    ENTER ("dbi_be=%p, book=%p", this, book);
 +
 +    if (loadType == LOAD_TYPE_INITIAL_LOAD)
 +    {
 +
 +        // Set up table version information
 +        init_version_info ();
 +        assert (m_book == nullptr);
 +        create_tables();
 +    }
 +
 +    GncSqlBackend::load(book, loadType);
 +
 +    if (GNUCASH_RESAVE_VERSION > get_table_version("Gnucash"))
 +    {
 +        /* The database was loaded with an older database schema or
 +         * data semantics. In order to ensure consistency, the whole
 +         * thing needs to be saved anew. */
 +        set_error(ERR_SQL_DB_TOO_OLD);
 +    }
 +    else if (GNUCASH_RESAVE_VERSION < get_table_version("Gnucash-Resave"))
 +    {
 +        /* Worse, the database was created with a newer version. We
 +         * can't safely write to this database, so the user will have
 +         * to do a "save as" to make one that we can write to.
 +         */
 +        set_error(ERR_SQL_DB_TOO_NEW);
 +    }
 +
 +
 +    LEAVE ("");
 +}
 +
 +/* ================================================================= */
 +/* This is used too early to call GncDbiProvider::get_table_list(). */
 +static bool
 +save_may_clobber_data (dbi_conn conn, const std::string& dbname)
 +{
 +
 +    /* Data may be clobbered iff the number of tables != 0 */
 +    auto result = dbi_conn_get_table_list (conn, dbname.c_str(), nullptr);
 +    bool retval = false;
 +    if (result)
 +    {
 +        retval =  dbi_result_get_numrows (result) > 0;
 +        dbi_result_free (result);
 +    }
 +    return retval;
 +}
 +
 +
 +/**
 + * Safely resave a database by renaming all of its tables, recreating
 + * everything, and then dropping the backup tables only if there were
 + * no errors. If there are errors, drop the new tables and restore the
 + * originals.
 + *
 + * @param book: QofBook to be saved in the database.
 + */
 +template <DbType Type> void
 +GncDbiBackend<Type>::safe_sync (QofBook* book)
 +{
 +    auto conn = dynamic_cast<GncDbiSqlConnection*>(m_conn);
 +
 +    g_return_if_fail (conn != nullptr);
 +    g_return_if_fail (book != nullptr);
 +
 +    ENTER ("book=%p, primary=%p", book, m_book);
 +    if (!conn->begin_transaction())
 +    {
 +        LEAVE("Failed to obtain a transaction.");
 +        return;
 +    }
 +    if (!conn->table_operation (TableOpType::backup))
 +    {
 +        conn->rollback_transaction();
 +        LEAVE ("Failed to rename tables");
 +        return;
 +    }
 +    if (!conn->drop_indexes())
 +    {
 +        conn->rollback_transaction();
 +        LEAVE ("Failed to drop indexes");
 +        return;
 +    }
 +
 +    sync(m_book);
 +    if (check_error())
 +    {
 +        conn->rollback_transaction();
 +        LEAVE ("Failed to create new database tables");
 +        return;
 +    }
 +    conn->table_operation (TableOpType::drop_backup);
 +    conn->commit_transaction();
 +    LEAVE ("book=%p", m_book);
 +}
 +/* MySQL commits the transaction and all savepoints after the first CREATE
 + * TABLE, crashing when we try to RELEASE SAVEPOINT because the savepoint
 + * doesn't exist after the commit. We must run without a wrapping transaction in
 + * that case.
 + */
 +template <> void
 +GncDbiBackend<DbType::DBI_MYSQL>::safe_sync (QofBook* book)
 +{
 +    auto conn = dynamic_cast<GncDbiSqlConnection*>(m_conn);
 +
 +    g_return_if_fail (conn != nullptr);
 +    g_return_if_fail (book != nullptr);
 +
 +    ENTER ("book=%p, primary=%p", book, m_book);
 +    if (!conn->table_operation (TableOpType::backup))
 +    {
 +        set_error(ERR_BACKEND_SERVER_ERR);
 +        conn->table_operation (TableOpType::rollback);
 +        LEAVE ("Failed to rename tables");
 +        return;
 +    }
 +    if (!conn->drop_indexes())
 +    {
 +        conn->table_operation (TableOpType::rollback);
 +        set_error (ERR_BACKEND_SERVER_ERR);
 +        set_message("Failed to drop indexes");
 +        LEAVE ("Failed to drop indexes");
 +        return;
 +    }
 +
 +    sync(m_book);
 +    if (check_error())
 +    {
 +        conn->table_operation (TableOpType::rollback);
 +        LEAVE ("Failed to create new database tables");
 +        return;
 +    }
 +    conn->table_operation (TableOpType::drop_backup);
 +    LEAVE ("book=%p", m_book);
 +}
 +/* ================================================================= */
 +
 +/*
 + * Checks to see whether the file is an sqlite file or not
 + *
 + */
 +template<> bool
 +QofDbiBackendProvider<DbType::DBI_SQLITE>::type_check(const char *uri)
 +{
 +    FILE* f;
 +    gchar buf[50];
 +    G_GNUC_UNUSED size_t chars_read;
 +    gint status;
 +    gchar* filename;
 +
 +    // BAD if the path is null
 +    g_return_val_if_fail (uri != nullptr, FALSE);
 +
 +    filename = gnc_uri_get_path (uri);
 +    f = g_fopen (filename, "r");
 +    g_free (filename);
 +
 +    // OK if the file doesn't exist - new file
 +    if (f == nullptr)
 +    {
 +        PINFO ("doesn't exist (errno=%d) -> DBI", errno);
 +        return TRUE;
 +    }
 +
 +    // OK if file has the correct header
 +    chars_read = fread (buf, sizeof (buf), 1, f);
 +    status = fclose (f);
 +    if (status < 0)
 +    {
 +        PERR ("Error in fclose(): %d\n", errno);
 +    }
 +    if (g_str_has_prefix (buf, "SQLite format 3"))
 +    {
 +        PINFO ("has SQLite format string -> DBI");
 +        return TRUE;
 +    }
 +    PINFO ("exists, does not have SQLite format string -> not DBI");
 +
 +    // Otherwise, BAD
 +    return FALSE;
 +}
 +
 +void
 +gnc_module_init_backend_dbi (void)
 +{
 +    const char* driver_dir;
 +    int num_drivers;
 +    gboolean have_sqlite3_driver = FALSE;
 +    gboolean have_mysql_driver = FALSE;
 +    gboolean have_pgsql_driver = FALSE;
 +
 +    /* Initialize libdbi and see which drivers are available.  Only register qof backends which
 +       have drivers available. */
 +    driver_dir = g_getenv ("GNC_DBD_DIR");
 +    if (driver_dir == nullptr)
 +    {
 +        PINFO ("GNC_DBD_DIR not set: using libdbi built-in default\n");
 +    }
 +
 +    /* dbi_initialize returns -1 in case of errors */
 +#if HAVE_LIBDBI_R
 +    if (dbi_instance)
 +        return;
 +    num_drivers = dbi_initialize_r (driver_dir, &dbi_instance);
 +#else
 +    num_drivers = dbi_initialize (driver_dir);
 +#endif
 +    if (num_drivers <= 0)
 +    {
 +        gchar* dir = g_build_filename (gnc_path_get_libdir (), "dbd", nullptr);
 +#if HAVE_LIBDBI_R
 +        if (dbi_instance)
 +            return;
 +        num_drivers = dbi_initialize_r (dir, &dbi_instance);
 +#else
 +        num_drivers = dbi_initialize (dir);
 +#endif
 +        g_free (dir);
 +    }
 +    if (num_drivers <= 0)
 +    {
 +        PWARN ("No DBD drivers found\n");
 +    }
 +    else
 +    {
 +        dbi_driver driver = nullptr;
 +        PINFO ("%d DBD drivers found\n", num_drivers);
 +
 +        do
 +        {
 +#if HAVE_LIBDBI_R
 +            driver = dbi_driver_list_r (driver, dbi_instance);
 +#else
 +            driver = dbi_driver_list (driver);
 +#endif
 +
 +            if (driver != nullptr)
 +            {
 +                const gchar* name = dbi_driver_get_name (driver);
 +
 +                PINFO ("Driver: %s\n", name);
 +                if (strcmp (name, "sqlite3") == 0)
 +                {
 +                    have_sqlite3_driver = TRUE;
 +                }
 +                else if (strcmp (name, "mysql") == 0)
 +                {
 +                    have_mysql_driver = TRUE;
 +                }
 +                else if (strcmp (name, "pgsql") == 0)
 +                {
 +                    have_pgsql_driver = TRUE;
 +                }
 +            }
 +        }
 +        while (driver != nullptr);
 +    }
 +
 +    if (have_sqlite3_driver)
 +    {
 +        const char* name = "GnuCash Libdbi (SQLITE3) Backend";
 +        auto prov = QofBackendProvider_ptr(new QofDbiBackendProvider<DbType::DBI_SQLITE>{name, FILE_URI_TYPE});
 +        qof_backend_register_provider(std::move(prov));
 +        prov = QofBackendProvider_ptr(new QofDbiBackendProvider<DbType::DBI_SQLITE>{name, SQLITE3_URI_TYPE});
 +        qof_backend_register_provider(std::move(prov));
 +    }
 +
 +    if (have_mysql_driver)
 +    {
 +        const char *name = "GnuCash Libdbi (MYSQL) Backend";
 +        auto prov = QofBackendProvider_ptr(new QofDbiBackendProvider<DbType::DBI_MYSQL>{name, "mysql"});
 +        qof_backend_register_provider(std::move(prov));
 +    }
 +
 +    if (have_pgsql_driver)
 +    {
 +        const char* name = "GnuCash Libdbi (POSTGRESQL) Backend";
 +        auto prov = QofBackendProvider_ptr(new QofDbiBackendProvider<DbType::DBI_PGSQL>{name, "postgres"});
 +        qof_backend_register_provider(std::move(prov));
 +    }
 +
 +    /* If needed, set log level to DEBUG so that SQl statements will be put into
 +       the gnucash.trace file. */
 +    /*    qof_log_set_level( log_module, QOF_LOG_DEBUG ); */
 +}
 +
 +#ifndef GNC_NO_LOADABLE_MODULES
 +G_MODULE_EXPORT void
 +qof_backend_module_init (void)
 +{
 +    gnc_module_init_backend_dbi ();
 +}
 +
 +G_MODULE_EXPORT void
 +qof_backend_module_finalize (void)
 +{
 +    gnc_module_finalize_backend_dbi ();
 +}
 +#endif /* GNC_NO_LOADABLE_MODULES */
 +
 +void
 +gnc_module_finalize_backend_dbi (void)
 +{
 +#if HAVE_LIBDBI_R
 +    if (dbi_instance)
 +    {
 +        dbi_shutdown_r (dbi_instance);
 +        dbi_instance = nullptr;
 +    }
 +#else
 +    dbi_shutdown ();
 +#endif
 +}
 +
 +/* --------------------------------------------------------- */
 +
 +/** Users discovered a bug in some distributions of libdbi, where if
 + * it is compiled on certain versions of gcc with the -ffast-math
 + * compiler option it fails to correctly handle saving of 64-bit
 + * values. This function tests for the problem.
 + * @param: conn: The just-opened dbi_conn
 + * @returns: GNC_DBI_PASS if the dbi library is safe to use,
 + * GNC_DBI_FAIL_SETUP if the test could not be completed, or
 + * GNC_DBI_FAIL_TEST if the bug was found.
 + */
 +static GncDbiTestResult
 +dbi_library_test (dbi_conn conn)
 +{
 +    int64_t testlonglong = -9223372036854775807LL, resultlonglong = 0;
 +    uint64_t testulonglong = 9223372036854775807LLU, resultulonglong = 0;
 +    double testdouble = 1.7976921348623157E+307, resultdouble = 0.0;
 +    dbi_result result;
 +    GncDbiTestResult retval = GNC_DBI_PASS;
 +
 +    result = dbi_conn_query (conn, "CREATE TEMPORARY TABLE numtest "
 +                             "( test_int BIGINT, test_unsigned BIGINT,"
 +                             " test_double FLOAT8 )");
 +    if (result == nullptr)
 +    {
 +        PWARN ("Test_DBI_Library: Create table failed");
 +        return GNC_DBI_FAIL_SETUP;
 +    }
 +    dbi_result_free (result);
 +    std::stringstream querystr;
 +    querystr << "INSERT INTO numtest VALUES (" << testlonglong <<
 +        ", " << testulonglong << ", " << std::setprecision(12) <<
 +        testdouble << ")";
 +    auto query = querystr.str();
 +    result = dbi_conn_query (conn, query.c_str());
 +    if (result == nullptr)
 +    {
 +        PWARN ("Test_DBI_Library: Failed to insert test row into table");
 +        return GNC_DBI_FAIL_SETUP;
 +    }
 +    dbi_result_free (result);
 +    gnc_push_locale (LC_NUMERIC, "C");
 +    result = dbi_conn_query (conn, "SELECT * FROM numtest");
 +    if (result == nullptr)
 +    {
 +        const char* errmsg;
 +        dbi_conn_error (conn, &errmsg);
 +        PWARN ("Test_DBI_Library: Failed to retrieve test row into table: %s",
 +               errmsg);
 +        dbi_conn_query (conn, "DROP TABLE numtest");
 +        gnc_pop_locale (LC_NUMERIC);
 +        return GNC_DBI_FAIL_SETUP;
 +    }
 +    while (dbi_result_next_row (result))
 +    {
 +        resultlonglong = dbi_result_get_longlong (result, "test_int");
 +        resultulonglong = dbi_result_get_ulonglong (result, "test_unsigned");
 +        resultdouble = dbi_result_get_double (result, "test_double");
 +    }
 +    dbi_conn_query (conn, "DROP TABLE numtest");
 +    gnc_pop_locale (LC_NUMERIC);
 +    if (testlonglong != resultlonglong)
 +    {
 +        PWARN ("Test_DBI_Library: LongLong Failed %" PRId64 " != % " PRId64,
 +               testlonglong, resultlonglong);
 +        retval = GNC_DBI_FAIL_TEST;
 +    }
 +    if (testulonglong != resultulonglong)
 +    {
 +        PWARN ("Test_DBI_Library: Unsigned longlong Failed %" PRIu64 " != %"
 +               PRIu64, testulonglong, resultulonglong);
 +        retval = GNC_DBI_FAIL_TEST;
 +    }
 +    /* A bug in libdbi stores only 7 digits of precision */
 +    if (testdouble >= resultdouble + 0.000001e307 ||
 +        testdouble <= resultdouble - 0.000001e307)
 +    {
 +        PWARN ("Test_DBI_Library: Double Failed %17e != %17e",
 +               testdouble, resultdouble);
 +        retval = GNC_DBI_FAIL_TEST;
 +    }
 +    return retval;
 +}
 +
 +template <DbType Type> bool
 +GncDbiBackend<Type>::conn_test_dbi_library(dbi_conn conn)
 +{
 +    auto result = dbi_library_test (conn);
 +    switch (result)
 +    {
 +        case GNC_DBI_PASS:
 +            break;
 +
 +        case GNC_DBI_FAIL_SETUP:
 +            set_error(ERR_SQL_DBI_UNTESTABLE);
 +            set_message ("DBI library large number test incomplete");
 +            break;
 +
 +        case GNC_DBI_FAIL_TEST:
 +            set_error (ERR_SQL_BAD_DBI);
 +            set_message ("DBI library fails large number test");
 +            break;
 +    }
 +    return result == GNC_DBI_PASS;
 +}
 +
 +/* ========================== END OF FILE ===================== */
diff --cc libgnucash/engine/ScrubBusiness.c
index 436ce56,0000000..2414d0e
mode 100644,000000..100644
--- a/libgnucash/engine/ScrubBusiness.c
+++ b/libgnucash/engine/ScrubBusiness.c
@@@ -1,716 -1,0 +1,716 @@@
 +/********************************************************************\
 + * ScrubBusiness.h -- Cleanup functions for the business objects.   *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 +\********************************************************************/
 +
 +/** @file ScrubBusiness.h
 + *  @brief Cleanup functions for business objects
 + *  @author Created by Geert Janssens August 2014
 + *  @author Copyright (c) 2014 Geert Janssens <geert at kobaltwit.be>
 + *
 + * Provides the high-level API for checking and repairing ('scrubbing
 + * clean') the various data objects used by the business functions.*/
 +
 +#include <config.h>
 +
 +#include <glib.h>
 +#include <glib/gi18n.h>
 +
 +#include "gnc-engine.h"
 +#include "gnc-lot.h"
 +#include "policy-p.h"
 +#include "Account.h"
 +#include "gncInvoice.h"
 +#include "gncInvoiceP.h"
 +#include "Scrub2.h"
 +#include "ScrubBusiness.h"
 +#include "Transaction.h"
 +
 +#undef G_LOG_DOMAIN
 +#define G_LOG_DOMAIN "gnc.engine.scrub"
 +
 +static QofLogModule log_module = G_LOG_DOMAIN;
 +
 +static void
 +gncScrubInvoiceState (GNCLot *lot)
 +{
 +    SplitList *ls_iter = NULL;
 +    GncInvoice *invoice = NULL;
 +    GncInvoice *lot_invoice = gncInvoiceGetInvoiceFromLot (lot);
 +
 +    for (ls_iter = gnc_lot_get_split_list (lot); ls_iter; ls_iter = ls_iter->next)
 +    {
 +        Split *split = ls_iter->data;
 +        Transaction *txn = NULL; // ll_txn = "Lot Link Transaction"
 +
 +        if (!split)
 +            continue; // next scrub lot split
 +
 +        txn = xaccSplitGetParent (split);
 +        invoice = gncInvoiceGetInvoiceFromTxn (txn);
 +        if (invoice)
 +            break;
 +
 +    }
 +
 +    if (invoice != lot_invoice)
 +    {
 +        PINFO("Correcting lot invoice associaton. Old invoice: %p, new invoice %p", lot_invoice, invoice);
 +        gncInvoiceDetachFromLot(lot);
 +
 +        if (invoice)
 +            gncInvoiceAttachToLot (invoice, lot);
 +        else
 +            gncOwnerAttachToLot (gncInvoiceGetOwner(lot_invoice), lot);
 +    }
 +}
 +
 +// A helper function that takes two splits. If the splits are  of opposite sign
 +// it reduces the biggest split to have the same value (but with opposite sign)
 +// of the smaller split.
 +// To make sure everything still continues to balance in addition a "remainder" split
 +// will be created that will be added to the same lot and transaction as the biggest
 +// split.
 +// The opposite sign restriction is because that's the only scenario that makes sense
 +// in the context of scrubbing business lots below.
 +// If we created new splits, return TRUE, otherwise FALSE
 +static gboolean reduce_biggest_split (Split *splitA, Split *splitB)
 +{
 +    gnc_numeric valA = xaccSplitGetValue (splitA);
 +    gnc_numeric valB = xaccSplitGetValue (splitB);
 +
 +    if (gnc_numeric_compare (gnc_numeric_abs (valA), gnc_numeric_abs (valB)) >= 0)
 +        return gncOwnerReduceSplitTo (splitA, gnc_numeric_neg (valB));
 +    else
 +        return gncOwnerReduceSplitTo (splitB, gnc_numeric_neg (valA));
 +}
 +
 +// Attempt to eliminate or reduce the lot link splits (ll_*_split)
 +// between from_lot and to_lot. To do so this function will attempt
 +// to move a payment split from from_lot to to_lot in order to
 +// balance the lot link split that will be deleted.
 +// To ensure everything remains balanced at most
 +// min (val-ll-*-split, val-pay-split) (in absolute values) can be moved.
 +// If any split involved has a larger value, it will be split in two
 +// and only the part matching the other splits' value will be used.
 +// The leftover splits are kept in the respective transactions/lots.
 +// A future scrub action can still act on those if needed.
 +//
 +// Note that this function assumes that ll_from_split and ll_to_split are
 +// of opposite sign. The calling function should check this.
 +
 +static gboolean
 +scrub_other_link (GNCLot *from_lot, Split *ll_from_split,
 +                  GNCLot *to_lot,   Split *ll_to_split)
 +{
 +    Split *real_from_split; // This refers to the split in the payment lot representing the payment itself
 +    gboolean modified = FALSE;
 +    gnc_numeric real_from_val;
 +    gnc_numeric from_val = xaccSplitGetValue (ll_from_split);
 +    gnc_numeric to_val = xaccSplitGetValue (ll_to_split);
 +    Transaction *ll_txn = xaccSplitGetParent (ll_to_split);
 +
 +    // Per iteration we can only scrub at most min (val-doc-split, val-pay-split)
 +    // So set the ceiling for finding a potential offsetting split in the lot
 +    if (gnc_numeric_compare (gnc_numeric_abs (from_val), gnc_numeric_abs (to_val)) >= 0)
 +        from_val = gnc_numeric_neg (to_val);
 +
 +    // Next we have to find the original payment split so we can
 +    // add (part of) it to the document lot
 +    real_from_split = gncOwnerFindOffsettingSplit (from_lot, from_val);
 +    if (!real_from_split)
 +        return FALSE; // No usable split in the payment lot
 +
 +    // We now have found 3 splits involved in the scrub action:
 +    // 2 lot link splits which we want to reduce
 +    // 1 other split to move into the original lot instead of the lot link split
 +    // As said only value of the split can be offset.
 +    // So split the bigger ones in two if needed and continue with equal valued splits only
 +    // The remainder is added to the lot link transaction and the lot to keep everything balanced
 +    // and will be processed in a future iteration
 +    modified = reduce_biggest_split (ll_from_split, ll_to_split);
 +    modified |= reduce_biggest_split (real_from_split, ll_from_split);
 +    modified |= reduce_biggest_split (ll_from_split, ll_to_split);
 +
 +    // At this point ll_to_split and real_from_split should have the same value
 +    // If not, flag a warning and skip to the next iteration
 +    to_val        = xaccSplitGetValue (ll_to_split);
 +    from_val      = xaccSplitGetValue (ll_from_split);
 +    real_from_val = xaccSplitGetValue (real_from_split);
 +    if (!gnc_numeric_equal (real_from_val, to_val))
 +    {
 +        // This is unexpected - write a warning message and skip this split
 +        PWARN("real_from_val (%s) and to_val (%s) differ. "
 +              "This is unexpected! Skip scrubbing of real_from_split %p against ll_to_split %p.",
 +              gnc_numeric_to_string (real_from_val), // gnc_numeric_denom (real_from_val),
 +              gnc_numeric_to_string (to_val), // gnc_numeric_denom (to_val),
 +              real_from_split, ll_to_split);
 +        return modified;
 +    }
 +
 +    // Now do the actual split dance
 +    // - move real payment split to doc lot
 +    // - delete both lot link splits from the lot link transaction
 +    gnc_lot_add_split (to_lot, real_from_split);
 +    xaccTransBeginEdit (ll_txn);
 +    xaccSplitDestroy (ll_to_split);
 +    xaccSplitDestroy (ll_from_split);
 +    xaccTransCommitEdit (ll_txn);
 +
 +    // Cleanup the lots
 +    xaccScrubMergeLotSubSplits (to_lot, FALSE);
 +    xaccScrubMergeLotSubSplits (from_lot, FALSE);
 +
 +    return TRUE; // We did change splits/transactions/lots...
 +}
 +
 +static gboolean
 +gncScrubLotLinks (GNCLot *scrub_lot)
 +{
 +    gboolean modified = FALSE, restart_needed = FALSE;
 +    SplitList *sls_iter = NULL;
 +
 +scrub_start:
 +    restart_needed = FALSE;
 +
 +    // Iterate over all splits in the lot
 +    for (sls_iter = gnc_lot_get_split_list (scrub_lot); sls_iter; sls_iter = sls_iter->next)
 +    {
 +        Split *sl_split = sls_iter->data;
 +        Transaction *ll_txn = NULL; // ll_txn = "Lot Link Transaction"
 +        SplitList *lts_iter = NULL;
 +
 +        if (!sl_split)
 +            continue; // next scrub lot split
 +
 +        ll_txn = xaccSplitGetParent (sl_split);
 +
 +        if (!ll_txn)
 +        {
 +            // Ooops - the split doesn't belong to any transaction !
 +            // This is not expected so issue a warning and continue with next split
 +            PWARN("Encountered a split in a business lot that's not part of any transaction. "
 +                  "This is unexpected! Skipping split %p.", sl_split);
 +            continue;
 +        }
 +
 +        // Don't scrub invoice type transactions
 +        if (xaccTransGetTxnType (ll_txn) == TXN_TYPE_INVOICE)
 +            continue; // next scrub lot split
 +
 +        // Empty splits can be removed immediately
 +        if (gnc_numeric_zero_p (xaccSplitGetValue (sl_split)) ||
 +                gnc_numeric_zero_p(xaccSplitGetValue (sl_split)))
 +        {
 +            xaccSplitDestroy (sl_split);
 +            modified = TRUE;
 +            goto scrub_start;
 +        }
 +
 +        // Iterate over all splits in the lot link transaction
 +        for (lts_iter = xaccTransGetSplitList (ll_txn); lts_iter; lts_iter = lts_iter->next)
 +        {
 +            Split *ll_txn_split = lts_iter->data; // These all refer to splits in the lot link transaction
 +            GNCLot *remote_lot = NULL; // lot at the other end of the lot link transaction
 +            gboolean sl_is_doc_lot, rl_is_doc_lot;
 +
 +            if (!ll_txn_split)
 +                continue; // next lot link transaction split
 +
 +            // Skip the split in the lot we're currently scrubbing
 +            if (sl_split == ll_txn_split)
 +                continue; // next lot link transaction split
 +
 +            // Skip empty other splits. They'll be scrubbed in the outer for loop later
 +            if (gnc_numeric_zero_p (xaccSplitGetValue (ll_txn_split)) ||
 +                    gnc_numeric_zero_p(xaccSplitGetValue (ll_txn_split)))
 +                continue;
 +
 +            // Only splits of opposite signed values can be scrubbed
 +            if (gnc_numeric_positive_p (xaccSplitGetValue (sl_split)) ==
 +                gnc_numeric_positive_p (xaccSplitGetValue (ll_txn_split)))
 +                continue; // next lot link transaction split
 +
 +            // We can only scrub if the other split is in a lot as well
 +            // Link transactions always have their other split in another lot
 +            // however ordinary payment transactions may not
 +            remote_lot = xaccSplitGetLot (ll_txn_split);
 +            if (!remote_lot)
 +                continue;
 +
 +            sl_is_doc_lot = (gncInvoiceGetInvoiceFromLot (scrub_lot) != NULL);
 +            rl_is_doc_lot = (gncInvoiceGetInvoiceFromLot (remote_lot) != NULL);
 +
 +            // Depending on the type of lots we're comparing, we need different actions
 +            // - Two document lots (an invoice and a credit note):
 +            //   Special treatment - look for all document lots linked via ll_txn
 +            //   and update the memo to be of more use to the users.
 +            // - Two payment lots:
 +            //   (Part of) the link will be eliminated and instead (part of)
 +            //   one payment will be added to the other lot to keep the balance.
 +            //   If the payments are not equal in abs value part of the bigger payment
 +            //   will be moved to the smaller payment's lot.
 +            // - A document and a payment lot:
 +            //   (Part of) the link will be eliminated and instead (part of) the real
 +            //   payment will be added to the document lot to handle the payment.
 +            if (sl_is_doc_lot && rl_is_doc_lot)
 +                gncOwnerSetLotLinkMemo (ll_txn);
 +            else if (!sl_is_doc_lot && !rl_is_doc_lot)
 +            {
 +                gint cmp = gnc_numeric_compare (gnc_numeric_abs (xaccSplitGetValue (sl_split)),
 +                                                gnc_numeric_abs (xaccSplitGetValue (ll_txn_split)));
 +                if (cmp >= 0)
 +                    restart_needed = scrub_other_link (scrub_lot, sl_split, remote_lot, ll_txn_split);
 +                else
 +                    restart_needed = scrub_other_link (remote_lot, ll_txn_split, scrub_lot, sl_split);
 +            }
 +            else
 +            {
 +                GNCLot *doc_lot = sl_is_doc_lot ? scrub_lot : remote_lot;
 +                GNCLot *pay_lot = sl_is_doc_lot ? remote_lot : scrub_lot;
 +                Split *ll_doc_split = sl_is_doc_lot ? sl_split : ll_txn_split;
 +                Split *ll_pay_split = sl_is_doc_lot ? ll_txn_split : sl_split;
 +                // Ok, let's try to move a payment from pay_lot to doc_lot
 +                restart_needed = scrub_other_link (pay_lot, ll_pay_split, doc_lot, ll_doc_split);
 +            }
 +
 +            // If we got here, the splits in our lot and ll_txn have been severely mixed up
 +            // And our iterator lists are probably no longer valid
 +            // So let's start over
 +            if (restart_needed)
 +            {
 +                modified = TRUE;
 +                goto scrub_start;
 +            }
 +
 +        }
 +    }
 +
 +    return modified;
 +}
 +
 +// Note this is a recursive function. It presumes the number of splits
 +// in avail_splits is relatively low. With many splits the performance will
 +// quickly degrade.
 +// Careful: this function assumes all splits in avail_splits to be valid
 +// and with values of opposite sign of target_value
 +// Ignoring this can cause unexpected results!
 +static SplitList *
 +gncSLFindOffsSplits (SplitList *avail_splits, gnc_numeric target_value)
 +{
 +    gint curr_recurse_level = 0;
 +    gint max_recurse_level = g_list_length (avail_splits) - 1;
 +
 +    if (!avail_splits)
 +        return NULL;
 +
 +    for (curr_recurse_level = 0;
 +         curr_recurse_level <= max_recurse_level;
 +         curr_recurse_level++)
 +    {
 +        SplitList *split_iter = NULL;
 +        for (split_iter = avail_splits; split_iter; split_iter = split_iter->next)
 +        {
 +            Split *split = split_iter->data;
 +            SplitList *match_splits = NULL;
 +            gnc_numeric split_value, remaining_value;
 +
 +            split_value = xaccSplitGetValue (split);
 +            // Attention: target_value and split_value are of opposite sign
 +            // So to get the remaining target value, they should be *added*
 +            remaining_value = gnc_numeric_add (target_value, split_value,
 +                                               GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
 +
 +            if (curr_recurse_level == 0)
 +            {
 +                if (gnc_numeric_zero_p (remaining_value))
 +                    match_splits = g_list_prepend (NULL, split);
 +            }
 +            else
 +            {
 +                if (gnc_numeric_positive_p (target_value) ==
 +                    gnc_numeric_positive_p (remaining_value))
 +                    match_splits = gncSLFindOffsSplits (split_iter->next,
 +                                                        remaining_value);
 +            }
 +
 +            if (match_splits)
 +                return g_list_prepend (match_splits, split);
 +        }
 +    }
 +
 +    return NULL;
 +}
 +
 +
 +static gboolean
 +gncScrubLotDanglingPayments (GNCLot *lot)
 +{
 +    SplitList * split_list, *filtered_list = NULL, *match_list = NULL, *node;
 +    Split *ll_split = gnc_lot_get_earliest_split (lot);
 +    Transaction *ll_trans = xaccSplitGetParent (ll_split);
 +    gnc_numeric ll_val = xaccSplitGetValue (ll_split);
 +    time64 ll_date = xaccTransGetDate (ll_trans);
 +    const char *ll_desc = xaccTransGetDescription (ll_trans);
 +
 +    // look for free splits (i.e. not in any lot) which,
 +    // compared to the lot link split
 +    // - have the same date
 +    // - have the same description
 +    // - have an opposite sign amount
 +    // - free split's abs value is less than or equal to ll split's abs value
 +    split_list = xaccAccountGetSplitList(gnc_lot_get_account (lot));
 +    for (node = split_list; node; node = node->next)
 +    {
 +        Split *free_split = node->data;
 +        Transaction *free_trans;
 +        gnc_numeric free_val;
 +
 +        if (NULL != xaccSplitGetLot(free_split))
 +            continue;
 +
 +        free_trans = xaccSplitGetParent (free_split);
 +        if (ll_date != xaccTransGetDate (free_trans))
 +            continue;
 +
 +        if (0 != g_strcmp0 (ll_desc, xaccTransGetDescription (free_trans)))
 +            continue;
 +
 +        free_val = xaccSplitGetValue (free_split);
 +        if (gnc_numeric_positive_p (ll_val) ==
 +            gnc_numeric_positive_p (free_val))
 +            continue;
 +
 +        if (gnc_numeric_compare (gnc_numeric_abs (free_val), gnc_numeric_abs (ll_val)) > 0)
 +            continue;
 +
 +        filtered_list = g_list_append(filtered_list, free_split);
 +    }
 +
 +    match_list = gncSLFindOffsSplits (filtered_list, ll_val);
 +    g_list_free (filtered_list);
 +
 +    for (node = match_list; node; node = node->next)
 +    {
 +        Split *match_split = node->data;
 +        gnc_lot_add_split (lot, match_split);
 +    }
 +
 +    if (match_list)
 +    {
 +        g_list_free (match_list);
 +        return TRUE;
 +    }
 +    else
 +        return FALSE;
 +}
 +
 +static gboolean
 +gncScrubLotIsSingleLotLinkSplit (GNCLot *lot)
 +{
 +    Split *split = NULL;
 +    Transaction *trans = NULL;
 +
 +    // Lots with a single split which is also a lot link transaction split
 +    // may be sign of a dangling payment. Let's try to fix that
 +
 +    // Only works for single split lots...
 +    if (1 != gnc_lot_count_splits (lot))
 +        return FALSE;
 +
 +    split = gnc_lot_get_earliest_split (lot);
 +    trans = xaccSplitGetParent (split);
 +
 +    if (!trans)
 +    {
 +        // Ooops - the split doesn't belong to any transaction !
 +        // This is not expected so issue a warning and continue with next split
 +        PWARN("Encountered a split in a business lot that's not part of any transaction. "
 +              "This is unexpected! Skipping split %p.", split);
 +        return FALSE;
 +    }
 +
 +    // Only works if single split belongs to a lot link transaction...
 +    if (xaccTransGetTxnType (trans) != TXN_TYPE_LINK)
 +        return FALSE;
 +
 +    return TRUE;
 +}
 +
 +gboolean
 +gncScrubBusinessLot (GNCLot *lot)
 +{
 +    gboolean splits_deleted = FALSE;
 +    gboolean dangling_payments = FALSE;
 +    gboolean dangling_lot_link = FALSE;
 +    Account *acc;
 +    gchar *lotname=NULL;
 +
 +    if (!lot) return FALSE;
 +    lotname = g_strdup (gnc_lot_get_title (lot));
 +    ENTER ("(lot=%p) %s", lot, lotname ? lotname : "(no lotname)");
 +
 +    acc = gnc_lot_get_account (lot);
 +    if (acc)
 +        xaccAccountBeginEdit(acc);
 +
 +    /* Check invoice link consistency
 +     * A lot should have both or neither of:
 +     * - one split from an invoice transaction
 +     * - an invoice-guid set
 +     */
 +    gncScrubInvoiceState (lot);
 +
 +    // Scrub lot links.
 +    // They should only remain when two document lots are linked together
 +    xaccScrubMergeLotSubSplits (lot, FALSE);
 +    splits_deleted = gncScrubLotLinks (lot);
 +
 +    // Look for dangling payments and repair if found
 +    dangling_lot_link = gncScrubLotIsSingleLotLinkSplit (lot);
 +    if (dangling_lot_link)
 +    {
 +        dangling_payments = gncScrubLotDanglingPayments (lot);
 +        if (dangling_payments)
 +            splits_deleted |= gncScrubLotLinks (lot);
 +        else
 +        {
 +            Split *split = gnc_lot_get_earliest_split (lot);
 +            Transaction *trans = xaccSplitGetParent (split);
 +            xaccTransDestroy (trans);
 +        }
 +    }
 +
 +    // If lot is empty now, delete it
 +    if (0 == gnc_lot_count_splits (lot))
 +    {
 +        PINFO("All splits were removed from lot, deleting");
 +        gnc_lot_destroy (lot);
 +    }
 +
 +    if (acc)
 +        xaccAccountCommitEdit(acc);
 +
 +    LEAVE ("(lot=%s, deleted=%d, dangling lot link=%d, dangling_payments=%d)",
 +            lotname ? lotname : "(no lotname)", splits_deleted, dangling_lot_link,
 +            dangling_payments);
 +    g_free (lotname);
 +
 +    return splits_deleted;
 +}
 +
 +gboolean
 +gncScrubBusinessSplit (Split *split)
 +{
-     const gchar *memo = _("Please delete this transaction. Explanation at http://wiki.gnucash.org/wiki/Business_Features_Issues#Double_Posting");
++    const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
 +    Transaction *txn;
 +    gboolean deleted_split = FALSE;
 +
 +    if (!split) return FALSE;
 +    ENTER ("(split=%p)", split);
 +
 +    txn = xaccSplitGetParent (split);
 +    if (txn)
 +    {
 +        gchar txntype = xaccTransGetTxnType (txn);
 +        const gchar *read_only = xaccTransGetReadOnly (txn);
 +        gboolean is_void = xaccTransGetVoidStatus (txn);
 +        GNCLot *lot = xaccSplitGetLot (split);
 +
 +        /* Look for transactions as a result of double posting an invoice or bill
 +         * Refer to https://bugzilla.gnome.org/show_bug.cgi?id=754209
 +         * to learn how this could have happened in the past.
 +         * Characteristics of such transaction are:
 +         * - read only
 +         * - not voided (to ensure read only is set by the business functions)
 +         * - transaction type is none (should be type invoice for proper post transactions)
 +         * - assigned to a lot
 +         */
 +        if ((txntype == TXN_TYPE_NONE) && read_only && !is_void && lot)
 +        {
 +            gchar *txn_date = qof_print_date (xaccTransGetDateEntered (txn));
 +            xaccTransClearReadOnly (txn);
 +            xaccSplitSetMemo (split, memo);
 +            gnc_lot_remove_split (lot, split);
 +            PWARN("Cleared double post status of transaction \"%s\", dated %s. "
 +                  "Please delete transaction and verify balance.",
 +                  xaccTransGetDescription (txn),
 +                  txn_date);
 +            g_free (txn_date);
 +        }
 +        /* Next delete any empty splits that aren't part of an invoice transaction
 +         * Such splits may be the result of scrubbing the business lots, which can
 +         * merge splits together while reducing superfluous lot links
 +         */
 +        else if (gnc_numeric_zero_p (xaccSplitGetAmount(split)) && !gncInvoiceGetInvoiceFromTxn (txn))
 +        {
 +            GNCLot *lot = xaccSplitGetLot (split);
 +            time64 pdate = xaccTransGetDate (txn);
 +            gchar *pdatestr = gnc_ctime (&pdate);
 +            PINFO ("Destroying empty split %p from transaction %s (%s)", split, pdatestr, xaccTransGetDescription(txn));
 +            xaccSplitDestroy (split);
 +
 +            // Also delete the lot containing this split if it was the last split in that lot
 +            if (lot && (gnc_lot_count_splits (lot) == 0))
 +                gnc_lot_destroy (lot);
 +
 +            deleted_split = TRUE;
 +        }
 +
 +    }
 +
 +    LEAVE ("(split=%p)", split);
 +    return deleted_split;
 +}
 +
 +/* ============================================================== */
 +
 +void
 +gncScrubBusinessAccountLots (Account *acc, QofPercentageFunc percentagefunc)
 +{
 +    LotList *lots, *node;
 +    gint lot_count = 0;
 +    gint curr_lot_no = 0;
 +    const gchar *str;
 +    const char *message = _( "Checking business lots in account %s: %u of %u");
 +
 +    if (!acc) return;
 +    if (FALSE == xaccAccountIsAPARType (xaccAccountGetType (acc))) return;
 +
 +    str = xaccAccountGetName(acc);
 +    str = str ? str : "(null)";
 +
 +    ENTER ("(acc=%s)", str);
 +    PINFO ("Cleaning up superfluous lot links in account %s \n", str);
 +    xaccAccountBeginEdit(acc);
 +
 +    lots = xaccAccountGetLotList(acc);
 +    lot_count = g_list_length (lots);
 +    for (node = lots; node; node = node->next)
 +    {
 +        GNCLot *lot = node->data;
 +
 +        PINFO("Start processing lot %d of %d",
 +              curr_lot_no + 1, lot_count);
 +
 +        if (curr_lot_no % 100 == 0)
 +        {
 +            char *progress_msg = g_strdup_printf (message, str, curr_lot_no, lot_count);
 +            (percentagefunc)(progress_msg, (100 * curr_lot_no) / lot_count);
 +            g_free (progress_msg);
 +        }
 +
 +        if (lot)
 +            gncScrubBusinessLot (lot);
 +
 +        PINFO("Finished processing lot %d of %d",
 +              curr_lot_no + 1, lot_count);
 +        curr_lot_no++;
 +    }
 +    g_list_free(lots);
 +    xaccAccountCommitEdit(acc);
 +    (percentagefunc)(NULL, -1.0);
 +    LEAVE ("(acc=%s)", str);
 +}
 +
 +/* ============================================================== */
 +
 +void
 +gncScrubBusinessAccountSplits (Account *acc, QofPercentageFunc percentagefunc)
 +{
 +    SplitList *splits, *node;
 +    gint split_count = 0;
 +    gint curr_split_no;
 +    const gchar *str;
 +    const char *message = _( "Checking business splits in account %s: %u of %u");
 +
 +    if (!acc) return;
 +    if (FALSE == xaccAccountIsAPARType (xaccAccountGetType (acc))) return;
 +
 +    str = xaccAccountGetName(acc);
 +    str = str ? str : "(null)";
 +
 +    ENTER ("(acc=%s)", str);
 +    PINFO ("Cleaning up superfluous lot links in account %s \n", str);
 +    xaccAccountBeginEdit(acc);
 +
 +restart:
 +    curr_split_no = 0;
 +    splits = xaccAccountGetSplitList(acc);
 +    split_count = g_list_length (splits);
 +    for (node = splits; node; node = node->next)
 +    {
 +        Split *split = node->data;
 +
 +        PINFO("Start processing split %d of %d",
 +              curr_split_no + 1, split_count);
 +
 +        if (curr_split_no % 100 == 0)
 +        {
 +            char *progress_msg = g_strdup_printf (message, str, curr_split_no, split_count);
 +            (percentagefunc)(progress_msg, (100 * curr_split_no) / split_count);
 +            g_free (progress_msg);
 +        }
 +
 +        if (split)
 +            // If gncScrubBusinessSplit returns true, a split was deleted and hence
 +            // The account split list has become invalid, so we need to start over
 +            if (gncScrubBusinessSplit (split))
 +                goto restart;
 +
 +        PINFO("Finished processing split %d of %d",
 +              curr_split_no + 1, split_count);
 +        curr_split_no++;
 +    }
 +    xaccAccountCommitEdit(acc);
 +    (percentagefunc)(NULL, -1.0);
 +    LEAVE ("(acc=%s)", str);
 +}
 +
 +/* ============================================================== */
 +
 +void
 +gncScrubBusinessAccount (Account *acc, QofPercentageFunc percentagefunc)
 +{
 +    if (!acc) return;
 +    if (FALSE == xaccAccountIsAPARType (xaccAccountGetType (acc))) return;
 +
 +    gncScrubBusinessAccountLots (acc, percentagefunc);
 +    gncScrubBusinessAccountSplits (acc, percentagefunc);
 +}
 +
 +/* ============================================================== */
 +
 +static void
 +lot_scrub_cb (Account *acc, gpointer data)
 +{
 +    if (FALSE == xaccAccountIsAPARType (xaccAccountGetType (acc))) return;
 +    gncScrubBusinessAccount (acc, data);
 +}
 +
 +void
 +gncScrubBusinessAccountTree (Account *acc, QofPercentageFunc percentagefunc)
 +{
 +    if (!acc) return;
 +
 +    gnc_account_foreach_descendant(acc, lot_scrub_cb, percentagefunc);
 +    gncScrubBusinessAccount (acc, percentagefunc);
 +}
 +
 +/* ========================== END OF FILE  ========================= */

commit 45bab93613e6a93b206b74ffc18f63708b07293b
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Nov 7 18:06:04 2017 -0800

    Bug 789928 - FTBFS with libdbi 0.9.0-5 on Debian
    
    Commit 88b8477 on libdbi calls the error handler if one attempts to run
    off the end of a result set. Since we often loop on
    dbi_result_next_row() returning 0 this breaks our logic in several
    places. This change simply returns from the error handler on a
    DB_ERROR_BADIDX allowing the logic to work as before.

diff --git a/src/backend/dbi/gnc-backend-dbi.c b/src/backend/dbi/gnc-backend-dbi.c
index 912a9fa..bfb50a0 100644
--- a/src/backend/dbi/gnc-backend-dbi.c
+++ b/src/backend/dbi/gnc-backend-dbi.c
@@ -396,8 +396,13 @@ sqlite3_error_fn( dbi_conn conn, /*@ unused @*/ void* user_data )
     const gchar* msg;
     GncDbiBackend *be = (GncDbiBackend*)user_data;
     GncDbiSqlConnection *dbi_conn = (GncDbiSqlConnection*)(be->sql_be.conn);
-
-    (void)dbi_conn_error( conn, &msg );
+    int err_num = dbi_conn_error( conn, &msg );
+    /* BADIDX is raised if we attempt to seek outside of a result. We
+     * handle that possibility after checking the return value of the
+     * seek. Having this raise a critical error breaks looping by
+     * testing for the return value of the seek.
+     */
+    if (err_num == DBI_ERROR_BADIDX) return;
     PERR( "DBI error: %s\n", msg );
     gnc_dbi_set_error( dbi_conn, ERR_BACKEND_MISC, 0, FALSE );
 }
@@ -611,14 +616,18 @@ mysql_error_fn( dbi_conn conn, void* user_data )
     GncDbiBackend *be = (GncDbiBackend*)user_data;
     GncDbiSqlConnection *dbi_conn = (GncDbiSqlConnection*)be->sql_be.conn;
     const gchar* msg;
-    gint err_num;
 #ifdef G_OS_WIN32
     const guint backoff_msecs = 1;
 #else
     const guint backoff_usecs = 1000;
 #endif
-
-    err_num = dbi_conn_error( conn, &msg );
+    int err_num = dbi_conn_error( conn, &msg );
+    /* BADIDX is raised if we attempt to seek outside of a result. We
+     * handle that possibility after checking the return value of the
+     * seek. Having this raise a critical error breaks looping by
+     * testing for the return value of the seek.
+     */
+    if (err_num == DBI_ERROR_BADIDX) return;
 
     /* Note: the sql connection may not have been initialized yet
      *       so let's be careful with using it
@@ -1331,8 +1340,14 @@ pgsql_error_fn( dbi_conn conn, void* user_data )
 #else
     const guint backoff_usecs = 1000;
 #endif
+    int err_num = dbi_conn_error( conn, &msg );
+    /* BADIDX is raised if we attempt to seek outside of a result. We
+     * handle that possibility after checking the return value of the
+     * seek. Having this raise a critical error breaks looping by
+     * testing for the return value of the seek.
+     */
+    if (err_num == DBI_ERROR_BADIDX) return;
 
-    (void)dbi_conn_error( conn, &msg );
     if ( g_str_has_prefix( msg, "FATAL:  database" ) &&
             g_str_has_suffix( msg, "does not exist\n" ) )
     {

commit c19f851c2958d6006a4d972ba320bf63ad8116d2
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 20:55:15 2017 +0200

    Add a bunch of translator comments and a few accelerators to glade files

diff --git a/src/gnome-utils/gtkbuilder/dialog-preferences.glade b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
index 52060f7..1eae731 100644
--- a/src/gnome-utils/gtkbuilder/dialog-preferences.glade
+++ b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
@@ -1462,7 +1462,7 @@ many months before the current month:</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes"><b>General</b></property>
+                    <property name="label" translatable="yes" comments="Preferences Dialog, General Tab"><b>General</b></property>
                     <property name="use_markup">True</property>
                   </object>
                   <packing>
@@ -2025,7 +2025,7 @@ many months before the current month:</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Time to wait for answer:</property>
+                    <property name="label" translatable="yes">Time to _wait for answer:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">pref/general/autosave-interval-minutes</property>
                   </object>
@@ -2910,7 +2910,7 @@ many months before the current month:</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Number of _characters for auto complete:</property>
+                    <property name="label" translatable="yes" comments="Register2 feature">Number of _characters for auto complete:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">pref/general.register/key-length</property>
                   </object>
@@ -2928,7 +2928,7 @@ many months before the current month:</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_markup">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
-                    <property name="tooltip_text" translatable="yes">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
+                    <property name="tooltip_text" translatable="yes" comments="Register2 feature">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
                     <property name="invisible_char">●</property>
                     <property name="invisible_char_set">True</property>
                     <property name="primary_icon_activatable">False</property>
@@ -2952,12 +2952,12 @@ many months before the current month:</property>
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="pref/general.register/show-extra-dates">
-                    <property name="label" translatable="yes">Show the _entered and reconcile dates</property>
+                    <property name="label" translatable="yes" comments="Register2 feature">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 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="tooltip_text" translatable="yes" comments="Register2 feature">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>
@@ -2972,12 +2972,12 @@ many months before the current month:</property>
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="pref/general.register/show-calendar-buttons">
-                    <property name="label" translatable="yes">Show the calendar b_uttons</property>
+                    <property name="label" translatable="yes" comments="Register2 feature">Show the calendar b_uttons</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
                     <property name="tooltip_markup">Show the calendar buttons Cancel, Today and Select.</property>
-                    <property name="tooltip_text" translatable="yes">Show the calendar buttons Cancel, Today and Select.</property>
+                    <property name="tooltip_text" translatable="yes" comments="Register2 feature">Show the calendar buttons Cancel, Today and Select.</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
@@ -2992,12 +2992,12 @@ many months before the current month:</property>
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="pref/general.register/selection-to-blank-on-expand">
-                    <property name="label" translatable="yes">_Move the selection to the blank split on expand</property>
+                    <property name="label" translatable="yes" comments="Register2 feature">_Move the selection to the blank split on expand</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
                     <property name="tooltip_markup">This will move the selection to the blank split when the transaction is expanded.</property>
-                    <property name="tooltip_text" translatable="yes">This will move the selection to the blank split when the transaction is expanded.</property>
+                    <property name="tooltip_text" translatable="yes" comments="Register2 feature">This will move the selection to the blank split when the transaction is expanded.</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
@@ -3012,12 +3012,12 @@ many months before the current month:</property>
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="pref/general.register/show-extra-dates-on-selection">
-                    <property name="label" translatable="yes">_Show entered and reconciled dates on selection</property>
+                    <property name="label" translatable="yes" comments="Register2 feature">_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 transaction selection.</property>
-                    <property name="tooltip_text" translatable="yes">Show the entered date and reconciled date on transaction selection.</property>
+                    <property name="tooltip_text" translatable="yes" comments="Register2 feature">Show the entered date and reconciled date on transaction selection.</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
diff --git a/src/gnome/gtkbuilder/gnc-plugin-page-register.glade b/src/gnome/gtkbuilder/gnc-plugin-page-register.glade
index b6fcdab..9f1e1c4 100644
--- a/src/gnome/gtkbuilder/gnc-plugin-page-register.glade
+++ b/src/gnome/gtkbuilder/gnc-plugin-page-register.glade
@@ -5,7 +5,7 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
-    <property name="title" translatable="yes">Duplicate Transaction</property>
+    <property name="title" translatable="yes" comments="Duplicate Transaction Dialog">Duplicate Transaction</property>
     <property name="resizable">False</property>
     <property name="modal">True</property>
     <property name="type_hint">dialog</property>
@@ -207,7 +207,7 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
-    <property name="title" translatable="yes">Filter register by...</property>
+    <property name="title" translatable="yes" comments="Filter register by... Dialog">Filter register by...</property>
     <property name="resizable">False</property>
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
@@ -274,7 +274,7 @@
                 <property name="border_width">12</property>
                 <child>
                   <object class="GtkRadioButton" id="filter_show_all">
-                    <property name="label" translatable="yes">Show _All</property>
+                    <property name="label" translatable="yes" comments="Filter By Dialog, Date Tab">Show _All</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
@@ -330,7 +330,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Start:</property>
+                        <property name="label" translatable="yes" comments="Filter By Dialog, Date Tab, Start section">Start:</property>
                       </object>
                       <packing>
                         <property name="x_options">GTK_FILL</property>
@@ -436,7 +436,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">End:</property>
+                        <property name="label" translatable="yes" comments="Filter By Dialog, Date Tab, End section">End:</property>
                       </object>
                       <packing>
                         <property name="top_attach">4</property>
@@ -581,7 +581,7 @@
                     <property name="n_columns">3</property>
                     <child>
                       <object class="GtkCheckButton" id="filter_status_unreconciled">
-                        <property name="label" translatable="yes">_Unreconciled</property>
+                        <property name="label" translatable="yes" comments="Filter By Dialog, State Tab">_Unreconciled</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
@@ -746,7 +746,7 @@
             <property name="can_focus">False</property>
             <child>
               <object class="GtkCheckButton" id="filter_save">
-                <property name="label" translatable="yes">Sa_ve Filter</property>
+                <property name="label" translatable="yes" comments="Filter By Dialog, below tabs">Sa_ve Filter</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
@@ -782,7 +782,7 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
-    <property name="title" translatable="yes">Sort register by...</property>
+    <property name="title" translatable="yes" comments="Sort register by Dialog">Sort register by...</property>
     <property name="resizable">False</property>
     <property name="window_position">center-on-parent</property>
     <property name="type_hint">dialog</property>
@@ -1092,12 +1092,13 @@
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="sort_reverse">
-                    <property name="label" translatable="yes">Reverse Order</property>
+                    <property name="label" translatable="yes">_Reverse Order</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
                     <property name="tooltip_text" translatable="yes">Sort in descending order.</property>
                     <property name="use_action_appearance">False</property>
+                    <property name="use_underline">True</property>
                     <property name="xalign">0</property>
                     <property name="draw_indicator">True</property>
                     <signal name="toggled" handler="gnc_plugin_page_register_sort_order_reverse_cb" swapped="no"/>
diff --git a/src/import-export/dialog-import.glade b/src/import-export/dialog-import.glade
index 19c6be3..2e321af 100644
--- a/src/import-export/dialog-import.glade
+++ b/src/import-export/dialog-import.glade
@@ -343,7 +343,7 @@
         </child>
         <child>
           <object class="GtkCheckButton" id="pref/dialogs.import.generic/enable-skip">
-            <property name="label" translatable="yes">Enable skip transaction action</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Enable skip transaction action</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
@@ -364,7 +364,7 @@
         </child>
         <child>
           <object class="GtkCheckButton" id="pref/dialogs.import.generic/enable-update">
-            <property name="label" translatable="yes">Enable update match action</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Enable update match action</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
@@ -511,7 +511,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Commercial ATM _fees threshold</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Commercial ATM _fees threshold</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">pref/dialogs.import.generic/atm-fee-threshold</property>
           </object>
@@ -528,7 +528,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Auto-c_lear threshold</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Auto-c_lear threshold</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">pref/dialogs.import.generic/auto-clear-threshold</property>
           </object>
@@ -545,7 +545,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Auto-_add threshold</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Auto-_add threshold</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">pref/dialogs.import.generic/auto-add-threshold</property>
           </object>
@@ -562,7 +562,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Match _display threshold</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Match _display threshold</property>
             <property name="use_underline">True</property>
             <property name="mnemonic_widget">pref/dialogs.import.generic/match-threshold</property>
           </object>
@@ -576,7 +576,7 @@
         </child>
         <child>
           <object class="GtkCheckButton" id="pref/dialogs.import.generic/use-bayes">
-            <property name="label" translatable="yes">Use _bayesian matching</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Use _bayesian matching</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
@@ -597,7 +597,7 @@
         </child>
         <child>
           <object class="GtkCheckButton" id="pref/dialogs.import.generic/auto-create-commodity">
-            <property name="label" translatable="yes">Automatically create new commodities</property>
+            <property name="label" translatable="yes" comments="Preferences->Online Banking:Generic">Automatically create new commodities</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">False</property>
@@ -634,7 +634,7 @@
             <property name="layout_style">end</property>
             <child>
               <object class="GtkCheckButton" id="hide_reconciled_check1">
-                <property name="label" translatable="yes">Show Reconciled</property>
+                <property name="label" translatable="yes" comments="Dialog Select matching transactions">Show Reconciled</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
@@ -695,7 +695,7 @@
                 <property name="can_focus">False</property>
                 <property name="xpad">5</property>
                 <property name="ypad">5</property>
-                <property name="label" translatable="yes">Imported transaction's first split:</property>
+                <property name="label" translatable="yes" comments="Dialog Select matching transactions">Imported transaction's first split:</property>
                 <property name="justify">center</property>
               </object>
               <packing>
@@ -731,7 +731,7 @@
                 <property name="can_focus">False</property>
                 <property name="xpad">5</property>
                 <property name="ypad">5</property>
-                <property name="label" translatable="yes">Potential splits matching the selected transaction: </property>
+                <property name="label" translatable="yes" comments="Dialog Select matching transactions">Potential splits matching the selected transaction: </property>
                 <property name="justify">center</property>
               </object>
               <packing>

commit 90bbeac0788ec0e8b6f751d04ccb77de2da3e01a
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 20:20:20 2017 +0200

    Add a bunch of translator comments to C files

diff --git a/src/gnome-search/dialog-search.c b/src/gnome-search/dialog-search.c
index b48e477..93e22eb 100644
--- a/src/gnome-search/dialog-search.c
+++ b/src/gnome-search/dialog-search.c
@@ -1093,6 +1093,7 @@ type_label_to_new_button(const gchar* type_label)
     else
     {
         PWARN("No translatable new-button label found for search type \"%s\", please add one into dialog-search.c!", type_label);
+        /* Translators: This string has a disambiguation prefix. Translate only the part behind '|' */
         return Q_("Item represents an unknown object type (in the sense of bill, customer, invoice, transaction, split,...)|New item");
     }
 }
diff --git a/src/gnome-utils/gnc-tree-control-split-reg.c b/src/gnome-utils/gnc-tree-control-split-reg.c
index 1f07608..2fdca9d 100644
--- a/src/gnome-utils/gnc-tree-control-split-reg.c
+++ b/src/gnome-utils/gnc-tree-control-split-reg.c
@@ -1737,6 +1737,7 @@ gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing
                 gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                         "%s", message);
                 gtk_dialog_add_button (GTK_DIALOG (dialog),
+                              /* Translators: Return to the transaction to update */
                               _("_Return"), GTK_RESPONSE_ACCEPT);
 
                 gtk_widget_grab_focus (gtk_dialog_get_widget_for_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT));
diff --git a/src/gnome/gnc-plugin-page-register.c b/src/gnome/gnc-plugin-page-register.c
index 0585617..c3fe832 100644
--- a/src/gnome/gnc-plugin-page-register.c
+++ b/src/gnome/gnc-plugin-page-register.c
@@ -384,7 +384,9 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
         G_CALLBACK (gnc_plugin_page_register_cmd_schedule)
     },
     {
-        "ScrubAllAction", NULL, N_("_All transactions"), NULL, NULL,
+        "ScrubAllAction", NULL,
+		/* Translators: The following 2 are Scrub actions in register view */
+		N_("_All transactions"), NULL, NULL,
         G_CALLBACK (gnc_plugin_page_register_cmd_scrub_all)
     },
     {
diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c
index a96f4e1..31a6802 100644
--- a/src/gnome/gnc-split-reg.c
+++ b/src/gnome/gnc-split-reg.c
@@ -982,7 +982,9 @@ gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data )
 
     gtk_dialog_add_button(GTK_DIALOG(dialog),
                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-    gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
+    gnc_gtk_dialog_add_button(dialog,
+                              /* Translators: This is the confirmation button in a warning dialog */
+                               _("_Remove Splits"),
                               GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
     response = gnc_dialog_run(GTK_DIALOG(dialog), warning);
     gtk_widget_destroy (dialog);
diff --git a/src/import-export/csv-exp/csv-transactions-export.c b/src/import-export/csv-exp/csv-transactions-export.c
index bced322..f9e9fa2 100644
--- a/src/import-export/csv-exp/csv-transactions-export.c
+++ b/src/import-export/csv-exp/csv-transactions-export.c
@@ -414,15 +414,25 @@ void csv_transactions_export (CsvExportInfo *info)
         }
 
         /* Header string */
-        header = g_strconcat (end_sep, _("Date"), mid_sep, _("Account Name"), mid_sep,
+        header = g_strconcat (end_sep,
+				               /* Translators: The following symbols will build the *
+				                * header line of exported CSV files:                */
+                               _("Date"), mid_sep, _("Account Name"), mid_sep,
                                (num_action ? _("Transaction Number") : _("Number")),
                                mid_sep, _("Description"), mid_sep, _("Notes"),
                                mid_sep, _("Memo"), mid_sep, _("Category"), mid_sep,
                                _("Type"), mid_sep,
                                (num_action ? _("Number/Action") : _("Action")),
                                mid_sep, _("Reconcile"), mid_sep,
-                               _("To With Sym"), mid_sep, _("From With Sym"), mid_sep,
-                               _("To Num."), mid_sep, _("From Num."), mid_sep,
+							   /* Translators: To amount with currency symbol */
+                               _("To With Sym"), mid_sep,
+							   /* Translators: From amount with currency symbol */
+							   _("From With Sym"), mid_sep,
+							   /* Translators: To amount, numerical only */
+                               _("To Num."), mid_sep,
+							   /* Translators: From amount, numerical only */
+							   _("From Num."), mid_sep,
+							   /* Translators: Exchange rates */
                                _("To Rate/Price"), mid_sep, _("From Rate/Price"),
                                end_sep, EOLSTR, NULL);
         DEBUG("Header String: %s", header);
diff --git a/src/register/ledger-core/split-register-layout.c b/src/register/ledger-core/split-register-layout.c
index ca77059..22571f8 100644
--- a/src/register/ledger-core/split-register-layout.c
+++ b/src/register/ledger-core/split-register-layout.c
@@ -634,6 +634,11 @@ gnc_split_register_layout_add_cells (SplitRegister *reg,
     gnc_register_add_cell (layout,
                            DATE_CELL,
                            DATE_CELL_TYPE_NAME,
+                           /* Translators: The 'sample:' items are
+                              strings which are not displayed, but only
+                              used to estimate widths. Please only
+                              translate the portion after the ':' and
+                              leave the rest ("sample:") as is. */
                            N_("sample:12/12/2000") + 7,
                            CELL_ALIGN_RIGHT,
                            FALSE,
@@ -687,7 +692,11 @@ gnc_split_register_layout_add_cells (SplitRegister *reg,
     gnc_register_add_cell (layout,
                            RECN_CELL,
                            RECN_CELL_TYPE_NAME,
-                           N_("Reconciled:R") + 11,
+	                          /* Translators: The abbreviation for 'Reconciled'
+	                              in the header row of the register. Please only
+	                              translate the portion after the ':' and
+	                              leave the rest ("Reconciled:") as is. */
+	                            N_("Reconciled:R") + 11,
                            CELL_ALIGN_CENTER,
                            FALSE,
                            FALSE);
@@ -695,6 +704,10 @@ gnc_split_register_layout_add_cells (SplitRegister *reg,
     gnc_register_add_cell (layout,
                            ASSOC_CELL,
                            RECN_CELL_TYPE_NAME,
+                           /* Translators: The abbreviation for 'Associate'
+                              in the header row of the register. Please only
+                              translate the portion after the ':' and
+                              leave the rest ("Associate:") as is. */
                            N_("Associate:A") + 10,
                            CELL_ALIGN_CENTER,
                            FALSE,
@@ -809,7 +822,11 @@ gnc_split_register_layout_add_cells (SplitRegister *reg,
     gnc_register_add_cell (layout,
                            TYPE_CELL,
                            RECN_CELL_TYPE_NAME,
-                           N_("Type:T") + 5,
+	                          /* Translators: The abbreviation for 'Type'
+	                              in the header row of the register. Please only
+	                              translate the portion after the ':' and
+	                              leave the rest ("Type:") as is. */
+	                            N_("Type:T") + 5,
                            CELL_ALIGN_CENTER,
                            FALSE,
                            FALSE);

commit 97c3483e06b1d6380905b8b42d491c67f8fabee7
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 20:19:10 2017 +0200

    Improve type of bank accounts in SKR03

diff --git a/accounts/de_DE/acctchrt_skr03.gnucash-xea b/accounts/de_DE/acctchrt_skr03.gnucash-xea
index b2062a1..7573ab9 100644
--- a/accounts/de_DE/acctchrt_skr03.gnucash-xea
+++ b/accounts/de_DE/acctchrt_skr03.gnucash-xea
@@ -202,7 +202,7 @@
   <gnc:account version="2.0.0">
     <act:name>1100 Postbank</act:name>
     <act:id type="new">9fe8d61dac9cf62b3f12e6c71a4385b2</act:id>
-    <act:type>ASSET</act:type>
+    <act:type>BANK</act:type>
     <act:commodity>
       <cmdty:space>ISO4217</cmdty:space>
       <cmdty:id>EUR</cmdty:id>
@@ -214,7 +214,7 @@
   <gnc:account version="2.0.0">
     <act:name>1200 Bankkonto</act:name>
     <act:id type="new">875ec51cd332f3b75c15a2a9ca309ebd</act:id>
-    <act:type>ASSET</act:type>
+    <act:type>BANK</act:type>
     <act:commodity>
       <cmdty:space>ISO4217</cmdty:space>
       <cmdty:id>EUR</cmdty:id>

commit c71bfe8d6b6bb673a41e6c30b68ba53fe4573c29
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 19:44:10 2017 +0200

    Add "Assets & Liabilities", "Profit & Loss" to the glossary,
    
    fix a typo and update all glossary po files

diff --git a/po/glossary/ar.po b/po/glossary/ar.po
index 4df9955..d81960f 100644
--- a/po/glossary/ar.po
+++ b/po/glossary/ar.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GnuCash 2.6.8\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: \n"
 "Last-Translator: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>\n"
 "Language-Team: None\n"
@@ -42,6 +42,10 @@ msgstr ""
 msgid "account type: Asset"
 msgstr ""
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+msgid "account type: Assets & Liabilities"
+msgstr ""
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr ""
@@ -78,6 +82,10 @@ msgstr ""
 msgid "account type: Passive"
 msgstr ""
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+msgid "account type: Profit & Loss"
+msgstr ""
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr ""
@@ -150,7 +158,7 @@ msgstr ""
 msgid "action: payment"
 msgstr ""
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr ""
 
@@ -390,7 +398,7 @@ msgstr ""
 msgid "gain"
 msgstr ""
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr ""
 
@@ -410,10 +418,6 @@ msgstr ""
 msgid "invoice"
 msgstr ""
 
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr ""
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr ""
@@ -514,6 +518,10 @@ msgstr ""
 msgid "orphan"
 msgstr ""
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr ""
@@ -686,7 +694,7 @@ msgstr ""
 msgid "subtotal"
 msgstr ""
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 msgid "tax code"
 msgstr ""
 
diff --git a/po/glossary/bg.po b/po/glossary/bg.po
index 27beb17..e089bd4 100644
--- a/po/glossary/bg.po
+++ b/po/glossary/bg.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnucash 2.2.5\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2011-10-25 13:18+0200\n"
 "Last-Translator: Rosi Dimova <pocu at bk.ru>\n"
 "Language-Team: BG <bg at li.org>\n"
@@ -48,6 +48,11 @@ msgstr "account type: Актив"
 msgid "account type: Asset"
 msgstr "account type: Актив"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "account type: Пасив"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "account type: разплащателна сметка"
@@ -85,6 +90,11 @@ msgstr "account type: взаимни фондове"
 msgid "account type: Passive"
 msgstr "account type: Актив"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "account type: Актив"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "account type: спестовна сметка"
@@ -158,7 +168,7 @@ msgstr "action: заем"
 msgid "action: payment"
 msgstr "action: плащане"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "action: ПОС-терминал"
 
@@ -403,7 +413,7 @@ msgid "gain"
 msgstr "печалба"
 
 # Ausgleichskonto
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "неравнена сметка"
 
@@ -424,11 +434,6 @@ msgstr "лихва"
 msgid "invoice"
 msgstr "фактура на клиент"
 
-# (издадена фактура)
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr "получател на фактура"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "задание"
@@ -530,6 +535,10 @@ msgstr "поръчка"
 msgid "orphan"
 msgstr "изоставен"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "парола"
@@ -705,7 +714,7 @@ msgstr "таблица със стил"
 msgid "subtotal"
 msgstr "междинна сума"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 msgid "tax code"
 msgstr "данъчен код"
 
@@ -793,3 +802,7 @@ msgstr "ваучер"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "задължавам, дебитирам"
+
+# (издадена фактура)
+#~ msgid "invoice owner"
+#~ msgstr "получател на фактура"
diff --git a/po/glossary/ca.po b/po/glossary/ca.po
index b931def..ec640db 100644
--- a/po/glossary/ca.po
+++ b/po/glossary/ca.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 2.2\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2008-08-03 16:43+0200\n"
 "Last-Translator: David Planella Molas <david.planella at gmail.com>\n"
 "Language-Team: Catalan <ca at li.org>\n"
@@ -44,6 +44,11 @@ msgstr "Actiu"
 msgid "account type: Asset"
 msgstr "Actiu"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Passiu"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "compte corrent"
@@ -81,6 +86,11 @@ msgstr "Fons d'inversió"
 msgid "account type: Passive"
 msgstr "Actiu"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Actiu"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "compte d'estalvis"
@@ -154,7 +164,7 @@ msgstr "préstec"
 msgid "action: payment"
 msgstr "pagament"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "terminal punt de venda"
 
@@ -399,7 +409,7 @@ msgstr "pagaments"
 msgid "gain"
 msgstr "guany, benefici"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "desquadrament"
 
@@ -420,12 +430,6 @@ msgstr "interès"
 msgid "invoice"
 msgstr "factura"
 
-# En català generalment no es diferencia entre bill («abonaré») i invoice («pagaré»), per la qual cosa s'utilitzarà «factura» per a ambdós termes (dpm).
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "factura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "tasca"
@@ -527,6 +531,10 @@ msgstr "comanda"
 msgid "orphan"
 msgstr "orfe"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "contrasenya"
@@ -701,7 +709,7 @@ msgstr "full d'estil"
 msgid "subtotal"
 msgstr "subtotal"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "informació d'impostos"
@@ -789,3 +797,8 @@ msgstr "justificant de despesa"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "càrrec"
+
+# En català generalment no es diferencia entre bill («abonaré») i invoice («pagaré»), per la qual cosa s'utilitzarà «factura» per a ambdós termes (dpm).
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "factura"
diff --git a/po/glossary/da.po b/po/glossary/da.po
index 23588e4..7c25424 100644
--- a/po/glossary/da.po
+++ b/po/glossary/da.po
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 2.3.5\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2009-09-04 22:41+0200\n"
 "Last-Translator: Joe Hansen <joedalton2 at yahoo.dk>\n"
 "Language-Team: Danish <dansk at dansk-gruppen.dk>\n"
@@ -45,6 +45,11 @@ msgstr "kontotype: Aktiv"
 msgid "account type: Asset"
 msgstr "kontotype: Aktiv"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "kontotype: Gæld"
+
 # src/prefs.c:210
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
@@ -83,6 +88,11 @@ msgstr "kontotype: aktiefond"
 msgid "account type: Passive"
 msgstr "kontotype: Aktiv"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "kontotype: Aktiv"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "kontotype: opsparing"
@@ -156,7 +166,7 @@ msgstr "hændelse: lån"
 msgid "action: payment"
 msgstr "hændelse: betaling"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "hændelse: kasseapparat"
 
@@ -400,7 +410,7 @@ msgstr "finansiel lommeregner: betalinger"
 msgid "gain"
 msgstr "gevinst"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "ubalance"
 
@@ -420,11 +430,6 @@ msgstr "rente"
 msgid "invoice"
 msgstr "faktura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "faktura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "opgave"
@@ -528,6 +533,10 @@ msgstr "ordre"
 msgid "orphan"
 msgstr "forældreløs"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "adgangsfrase"
@@ -704,7 +713,7 @@ msgstr "stilark"
 msgid "subtotal"
 msgstr "delsum"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "skatteinformation"
@@ -796,5 +805,9 @@ msgstr "kilde"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "hævning (i afstemningsdialogen)"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "faktura"
+
 #~ msgid "Term"
 #~ msgstr "Term"
diff --git a/po/glossary/de.po b/po/glossary/de.po
index 9e192e1..ad9daf8 100644
--- a/po/glossary/de.po
+++ b/po/glossary/de.po
@@ -2,12 +2,12 @@
 # Copyright (C) 2001 Free Software Foundation, Inc.
 #
 # Christian Stimming <stimming at tuhh.de>, 2001 - 2013.
-# Frank H. Ellenberger <frank.h.ellenberger at gmail.com>, 2013, 2014.
+# Frank H. Ellenberger <frank.h.ellenberger at gmail.com>, 2013 - 2017.
 msgid ""
 msgstr ""
-"Project-Id-Version: gnucash 2.5\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
-"PO-Revision-Date: 2014-10-13 00:45+0200\n"
+"Project-Id-Version: gnucash 2.6.18\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
+"PO-Revision-Date: 2017-10-20 18:25+0200\n"
 "Last-Translator: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>\n"
 "Language-Team: German <gnucash-de at gnucash.org>\n"
 "Language: German\n"
@@ -45,6 +45,10 @@ msgstr "Aktiva"
 msgid "account type: Asset"
 msgstr "Aktiva"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+msgid "account type: Assets & Liabilities"
+msgstr "Aktiva & Passiva; Bilanz- oder Bestandskonten"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "Girokonto"
@@ -81,6 +85,10 @@ msgstr "Investmentfonds"
 msgid "account type: Passive"
 msgstr "Passiva"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+msgid "account type: Profit & Loss"
+msgstr "GuV; Gewinn- & Verlustkonten; Erfolgskonten"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "Sparkonto"
@@ -153,7 +161,7 @@ msgstr "Darlehen"
 msgid "action: payment"
 msgstr "Zahlung"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "Karten-Terminal"
 
@@ -397,7 +405,7 @@ msgstr "Raten"
 msgid "gain"
 msgstr "Wertzuwachs (Gewinn, Zunahme, Profit, Ertrag)"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "Ausgleichskonto"
 
@@ -417,10 +425,6 @@ msgstr "Zinsen"
 msgid "invoice"
 msgstr "Rechnung (Rechnungsausgang, Versandte Rechnung)"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr "Kunde, Rechnungsempfänger"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "Auftrag"
@@ -521,6 +525,10 @@ msgstr "Bestellung"
 msgid "orphan"
 msgstr "Ausbuchungskonto??"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "Passwort (Mantra, Passphrase)"
@@ -698,7 +706,7 @@ msgstr "Stilvorlage"
 msgid "subtotal"
 msgstr "Zwischensumme"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 msgid "tax code"
 msgstr "Steuerschlüssel, Steuerformularfeldnummer"
 
@@ -785,3 +793,6 @@ msgstr "Auslagenerstattung"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "Belastung"
+
+#~ msgid "invoice owner"
+#~ msgstr "Kunde, Rechnungsempfänger"
diff --git a/po/glossary/de_CH.po b/po/glossary/de_CH.po
index e52053f..ee09aa3 100644
--- a/po/glossary/de_CH.po
+++ b/po/glossary/de_CH.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash 1.7\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2008-03-03 00:47+0100\n"
 "Last-Translator: Raffael Luthiger <r.luthiger at huanga.com>\n"
 "Language-Team: DE\n"
@@ -43,6 +43,11 @@ msgstr "Aktiven"
 msgid "account type: Asset"
 msgstr "Aktiven"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Passiven"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "Girokonto"
@@ -80,6 +85,11 @@ msgstr "Investmentfonds"
 msgid "account type: Passive"
 msgstr "Aktiven"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Aktiven"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "Sparkonto"
@@ -153,7 +163,7 @@ msgstr "Darlehen"
 msgid "action: payment"
 msgstr "Zahlung"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "Kassensystem"
 
@@ -400,7 +410,7 @@ msgstr "Raten"
 msgid "gain"
 msgstr "Wertzuwachs (Gewinn, Zunahme, Profit, Ertrag)"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "Ausgleichskonto"
 
@@ -420,11 +430,6 @@ msgstr "Zinsen"
 msgid "invoice"
 msgstr "Rechnung (Rechnungsausgang, Versandte Rechnung)"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "Rechnung (Rechnungsausgang, Versandte Rechnung)"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "Auftrag"
@@ -526,6 +531,10 @@ msgstr "Bestellung"
 msgid "orphan"
 msgstr "Ausbuchungskonto??"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "Passwort (Mantra, Passphrase)"
@@ -701,7 +710,7 @@ msgstr "Stilvorlage"
 msgid "subtotal"
 msgstr "Zwischensumme"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "Steuerrelevante Informationen"
@@ -789,3 +798,7 @@ msgstr "Auslagenerstattung"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "Belastung"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "Rechnung (Rechnungsausgang, Versandte Rechnung)"
diff --git a/po/glossary/el.po b/po/glossary/el.po
index efd4f70..c82a3e5 100644
--- a/po/glossary/el.po
+++ b/po/glossary/el.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 1.0\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2001-12-28 00:17+0000\n"
 "Last-Translator: Simos Xenitellis <simos at hellug.gr>\n"
 "Language-Team: Greek <nls at tux.hellug.gr>\n"
@@ -47,6 +47,11 @@ msgstr "
 msgid "account type: Asset"
 msgstr "Åßäïò Ðáñáóêçíßïõ:"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Åßäïò Ðáñáóêçíßïõ:"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr ""
@@ -84,6 +89,11 @@ msgstr ""
 msgid "account type: Passive"
 msgstr "Åßäïò Ðáñáóêçíßïõ:"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Åßäïò Ðáñáóêçíßïõ:"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr ""
@@ -171,7 +181,7 @@ msgstr "
 msgid "action: payment"
 msgstr "Ï_íüìáôá ÓõíáñôÞóåùí"
 
-#. "-"
+#. "Point of sale"
 #, fuzzy
 msgid "action: POS"
 msgstr "Ôïðïèåóßá: "
@@ -454,7 +464,7 @@ msgstr ""
 msgid "gain"
 msgstr "Âñï÷Þ"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 #, fuzzy
 msgid "imbalance"
 msgstr "Éóïññïðßá"
@@ -479,11 +489,6 @@ msgstr "
 msgid "invoice"
 msgstr "áñ÷Üñéïò"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "áñ÷Üñéïò"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr ""
@@ -609,6 +614,10 @@ msgstr ""
 msgid "orphan"
 msgstr "ÊïñåÜôéêá"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr ""
@@ -813,7 +822,7 @@ msgstr "
 msgid "subtotal"
 msgstr "%d óõíïëéêÜ"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "ðëçñïöïñßåò çëåê. äéåýè."
@@ -922,5 +931,9 @@ msgstr "
 msgid "withdraw (in the reconcile dialog)"
 msgstr ""
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "áñ÷Üñéïò"
+
 #~ msgid "Term"
 #~ msgstr "Ïñéóìüò"
diff --git a/po/glossary/es.po b/po/glossary/es.po
index 81900eb..a006701 100644
--- a/po/glossary/es.po
+++ b/po/glossary/es.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 1.8.9\n"
 "Report-Msgid-Bugs-To: Eneko Lacunza <enlar at enlar.net>\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2004-11-23 22:19+0100\n"
 "Last-Translator: Eneko Lacunza <enlar at enlar.net>\n"
 "Language-Team: Spanish <es at li.org>\n"
@@ -47,6 +47,11 @@ msgstr "tipo de cuenta: Activo"
 msgid "account type: Asset"
 msgstr "tipo de cuenta: Activo"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "tipo de cuenta: Pasivo"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "tipo de cuenta: cuenta corriente"
@@ -84,6 +89,11 @@ msgstr "tipo de cuenta: Fondo de Inversi
 msgid "account type: Passive"
 msgstr "tipo de cuenta: Activo"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "tipo de cuenta: Activo"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "tipo de cuenta: cuenta de ahorro"
@@ -157,7 +167,7 @@ msgstr "acci
 msgid "action: payment"
 msgstr "acción: pago"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "acción: POS"
 
@@ -401,7 +411,7 @@ msgstr "calculadora financiera: pagos"
 msgid "gain"
 msgstr "ganancia, beneficio"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "descuadre"
 
@@ -421,11 +431,6 @@ msgstr "inter
 msgid "invoice"
 msgstr "factura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "factura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "trabajo/tarea"
@@ -529,6 +534,10 @@ msgstr "pedido"
 msgid "orphan"
 msgstr "huérfano"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "clave de acceso"
@@ -704,7 +713,7 @@ msgstr "hoja de estilo"
 msgid "subtotal"
 msgstr "subtotal"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "información sobre impuestos"
@@ -795,5 +804,9 @@ msgstr "fuente"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "cargo"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "factura"
+
 #~ msgid "Term"
 #~ msgstr "Condiciones (Términos) (de pago)"
diff --git a/po/glossary/fr.po b/po/glossary/fr.po
index c101c1d..527dbe9 100644
--- a/po/glossary/fr.po
+++ b/po/glossary/fr.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash 2.0\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2013-12-25 13:16+0100\n"
 "Last-Translator: Sébastien Villemot <sebastien at debian.org>\n"
 "Language-Team: FR\n"
@@ -46,6 +46,11 @@ msgstr "type de compte : actif"
 msgid "account type: Asset"
 msgstr "type de compte : actif"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "type de compte : passif"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "type de compte : compte courant"
@@ -83,6 +88,11 @@ msgstr "type de compte : fond mutuel"
 msgid "account type: Passive"
 msgstr "type de compte : actif"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "type de compte : actif"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "type de compte : épargne"
@@ -155,7 +165,7 @@ msgstr "action : emprunt"
 msgid "action: payment"
 msgstr "action : paiement"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "action : POS"
 
@@ -395,7 +405,7 @@ msgstr "calcul financier : paiements"
 msgid "gain"
 msgstr "profit"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "non soldé"
 
@@ -415,10 +425,6 @@ msgstr "intérêt"
 msgid "invoice"
 msgstr "facture"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr "destinataire de la facture"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "tâche"
@@ -519,6 +525,10 @@ msgstr "rang"
 msgid "orphan"
 msgstr "orphelin"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "mot de code"
@@ -691,7 +701,7 @@ msgstr "feuille de style"
 msgid "subtotal"
 msgstr "sous-total"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 msgid "tax code"
 msgstr "code de taxe"
 
@@ -778,3 +788,6 @@ msgstr "bon (commande)"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "retrait (dans le dialogue de rapprochement)"
+
+#~ msgid "invoice owner"
+#~ msgstr "destinataire de la facture"
diff --git a/po/glossary/gnc-glossary.txt b/po/glossary/gnc-glossary.txt
index 56449a0..7d7c79f 100644
--- a/po/glossary/gnc-glossary.txt
+++ b/po/glossary/gnc-glossary.txt
@@ -5,6 +5,7 @@
 "account name"	"-"
 "account type: Active"	"The left side of the balance sheet in T account form shows the application of funds in form of assets. Because it contains only assets use assets directly. Complement: Passive. See also: Report Form"
 "account type: Asset"	"A thing, esp. owned by a person or company, that has value and can be used or sold to pay debts. Dependent on the context you might use 'account type: Active' instead."
+"account type: Assets & Liabilities"	"in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
 "account type: checking"	"(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 "account type: currency"	"-"
 "account type: Equity"	"see: Equity, but see also 'account type: Passive'"
@@ -14,6 +15,7 @@
 "account type: money-market"	"-"
 "account type: Mutual fund"	"-"
 "account type: Passive"	"The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+"account type: Profit & Loss"	"Group of accounts tracking your success, complement of 'Assets & Liabilities'"
 "account type: saving"	"1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 "account type: Stock"	"-"
 "account type: trading"	"This account type (new in gnucash-2.4.0) is used when exchanging or trading amounts from one currency into another"
@@ -32,7 +34,7 @@
 "action: int"	"transaction comes from interest"
 "action: loan"	"-"
 "action: payment"	"see: payment 1."
-"action: POS"	"-"
+"action: POS"	"Point of sale"
 "action: rebate"	"-"
 "action: sell"	"-"
 "action: Teller"	"-"
@@ -97,7 +99,6 @@
 "income statement"	"Report that ... FIXME: add description. This report used to be called the 'Profit & Loss', but it was renamed on 2004-07-13."
 "interest"	"Money charged for borrowing money, or paid to somebody who invests money"
 "invoice"	"A list of goods sold or services provided together with the prices charged; see also: a bill. In Gnucash, an 'invoice' is a statement that we sent out (to a customer), whereas a 'bill' is one that we received (from a vendor)."
-"invoice owner"	"The customer (or vendor) to which this invoice is sent to."
 "job"	"In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 "ledger"	"A book in which a bank, business firm, etc. records its financial accounts"
 "liabilities/equity"	"The heading for the right side of the balance sheet. See also: Equity."
@@ -123,6 +124,7 @@
 "options"	"A menu choice in the graphical user interface that allows the user to specify how the application will act each time it is used. "
 "order"	"Watch out: Although this word exists in gnucash program code, all that program code in gnucash is currently not activated. In the future, it will be used in business accounting as follows: A particular request to make or supply goods, but belonging to a (larger) job. Such a request can come from a customer or be sent to a vendor. An order will probably generate one invoice or bill."
 "orphan"	"Name of an automatically created account that holds splits that have no account."
+"owner (of bill, invoice or expense voucher)"	"The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
 "passphrase"	"A secret phrase that one needs to know in order to get access to a user account "
 "Payables/Receivables"	"An amount that must be paid / An amount for which money has not yet been received"
 "payee"	"A person to whom sth is paid"
diff --git a/po/glossary/he.po b/po/glossary/he.po
index 0065e62..baa3087 100644
--- a/po/glossary/he.po
+++ b/po/glossary/he.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash 2.2\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2008-04-23 00:04+0200\n"
 "Last-Translator: Ori Hoch <ori at uumpa.com>\n"
 "Language-Team: HE\n"
@@ -44,6 +44,11 @@ msgstr "נכס"
 msgid "account type: Asset"
 msgstr "נכס"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "חוב"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "עובר ושב"
@@ -81,6 +86,11 @@ msgstr "קרן נאמנות"
 msgid "account type: Passive"
 msgstr "נכס"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "נכס"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "חיסכון"
@@ -154,7 +164,7 @@ msgstr "הלוואה"
 msgid "action: payment"
 msgstr "תשלום"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "נקודת מכירה"
 
@@ -401,7 +411,7 @@ msgstr "מקש קיצור למחשבון"
 msgid "gain"
 msgstr "רווח"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr ""
 
@@ -422,11 +432,6 @@ msgstr "ריבית"
 msgid "invoice"
 msgstr "קבלה"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "קבלה"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 #, fuzzy
 msgid "job"
@@ -534,6 +539,10 @@ msgstr "סדר"
 msgid "orphan"
 msgstr ""
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "סיסמה"
@@ -729,7 +738,7 @@ msgstr "גיליון מסוגנן"
 msgid "subtotal"
 msgstr ""
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "מידע על הפרויקט"
@@ -829,3 +838,7 @@ msgstr ""
 #, fuzzy
 msgid "withdraw (in the reconcile dialog)"
 msgstr "חלק מההגדרות בתיבת הדו-שיח מתנגשים"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "קבלה"
diff --git a/po/glossary/hu.po b/po/glossary/hu.po
index f6c4547..723d825 100644
--- a/po/glossary/hu.po
+++ b/po/glossary/hu.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: @gnucash@\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2007-07-31 22:59+0200\n"
 "Last-Translator: Kornel Tako <takokornel at gmail.com>\n"
 "Language-Team: Hungarian <gnucash-devel-request at gnucash.org>\n"
@@ -46,6 +46,11 @@ msgstr "Számla típus:Eszköz"
 msgid "account type: Asset"
 msgstr "Számla típus:Eszköz"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Számla típus: Kötelezettség"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "Számla típus: Folyószámla"
@@ -83,6 +88,11 @@ msgstr "Számla típus: Befektetési alap"
 msgid "account type: Passive"
 msgstr "Számla típus:Eszköz"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Számla típus:Eszköz"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "Számla típus: Megtakarítás"
@@ -156,7 +166,7 @@ msgstr "Végrehajtás: hitel"
 msgid "action: payment"
 msgstr "Végrehajtás: kifizetés"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "Végrhajtás: POS"
 
@@ -400,7 +410,7 @@ msgstr "Pénzügyi számológép: Kifizetés"
 msgid "gain"
 msgstr "Nyereség"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "Hiányszámla"
 
@@ -420,11 +430,6 @@ msgstr "Kamat"
 msgid "invoice"
 msgstr "Számla"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "Számla"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "Megbízás"
@@ -526,6 +531,10 @@ msgstr "Megbízás"
 msgid "orphan"
 msgstr "Árva"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "Jelszó"
@@ -701,7 +710,7 @@ msgstr "Oldal stílus"
 msgid "subtotal"
 msgstr "részösszeg "
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "adó info"
@@ -789,3 +798,7 @@ msgstr "Nyugta"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "kivét"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "Számla"
diff --git a/po/glossary/it.po b/po/glossary/it.po
index 36950ec..9a524d5 100644
--- a/po/glossary/it.po
+++ b/po/glossary/it.po
@@ -12,7 +12,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 1.7.4\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2004-01-31 15:33+0100\n"
 "Last-Translator: Lorenzo Cappelletti <lorenzo.cappelletti at email.it>\n"
 "Language-Team: Italian <tp at lists.linux.it>\n"
@@ -50,6 +50,11 @@ msgstr "tipo conto: attivo, attivit
 msgid "account type: Asset"
 msgstr "tipo conto: attivo, attività"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "tipo conto: passivo, passività, obbligazione, debito"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "tipo conto: conto corrente"
@@ -87,6 +92,11 @@ msgstr "tipo conto: fondi comuni"
 msgid "account type: Passive"
 msgstr "tipo conto: attivo, attività"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "tipo conto: attivo, attività"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "tipo conto: di risparmio"
@@ -161,7 +171,7 @@ msgstr "operazione: mutuo, prestito"
 msgid "action: payment"
 msgstr "operazione: pagamento"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "operazione: POS"
 
@@ -407,7 +417,7 @@ msgstr "calcolatrice finanziaria: pagamenti"
 msgid "gain"
 msgstr "guadagno"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "sbilancio"
 
@@ -427,11 +437,6 @@ msgstr "interesse"
 msgid "invoice"
 msgstr "fattura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "fattura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "lavoro, compito"
@@ -535,6 +540,10 @@ msgstr "ordine"
 msgid "orphan"
 msgstr "orfano"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "frase segreta"
@@ -711,7 +720,7 @@ msgstr "foglio di stile"
 msgid "subtotal"
 msgstr "subtotale"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "info imposte"
@@ -802,5 +811,9 @@ msgstr "buono, nota, garante"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "prelievo (in una finestra di riconciliazione)"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "fattura"
+
 #~ msgid "Term"
 #~ msgstr "Termine"
diff --git a/po/glossary/lt.po b/po/glossary/lt.po
index 07de7f1..28b9c9f 100644
--- a/po/glossary/lt.po
+++ b/po/glossary/lt.po
@@ -5,7 +5,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: lt\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2011-08-28 20:55+0300\n"
 "Last-Translator: Aurimas Fišeras <aurimas at members.fsf.org>\n"
 "Language-Team: komp_lt at konf.lt\n"
@@ -47,6 +47,11 @@ msgstr "sÄ…skaitos tipas: Turtas"
 msgid "account type: Asset"
 msgstr "sÄ…skaitos tipas: Turtas"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "sąskaitos tipas: Įsipareigojimas"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "sÄ…skaitos tipas: einamoji"
@@ -84,6 +89,11 @@ msgstr "sÄ…skaitos tipas: Investicinis fondas"
 msgid "account type: Passive"
 msgstr "sÄ…skaitos tipas: Turtas"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "sÄ…skaitos tipas: Turtas"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "sÄ…skaitos tipas: taupomoji"
@@ -156,7 +166,7 @@ msgstr "veiksmas: paskola"
 msgid "action: payment"
 msgstr "veiksmas: mokÄ—jimas"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "veiksmas: EKA"
 
@@ -398,7 +408,7 @@ msgstr "finansinis skaičiuotuvas: mokėjimas"
 msgid "gain"
 msgstr "pelnas"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "disbalansas"
 
@@ -418,10 +428,6 @@ msgstr "palūkanos"
 msgid "invoice"
 msgstr "sąskaita-faktūra"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr "sąskaitos-faktūros gavėjas"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "užduotis"
@@ -522,6 +528,10 @@ msgstr "užsakymas"
 msgid "orphan"
 msgstr "pamesta"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "slaptafrazÄ—"
@@ -695,7 +705,7 @@ msgstr "stiliaus aprašas"
 msgid "subtotal"
 msgstr "tarpinÄ— suma"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 msgid "tax code"
 msgstr "mokesčio kodas"
 
@@ -782,3 +792,6 @@ msgstr "kvitas"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "išėmimas (suderinimo lange)"
+
+#~ msgid "invoice owner"
+#~ msgstr "sąskaitos-faktūros gavėjas"
diff --git a/po/glossary/nb.po b/po/glossary/nb.po
index ab16f91..b1261c5 100644
--- a/po/glossary/nb.po
+++ b/po/glossary/nb.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2005-12-19 15:48+0800\n"
 "Last-Translator: Tor Harald Thorland <tortho at strigen.com>\n"
 "Language-Team: Norwegian/Bokmaal <i18n-nb at lister.ping.uio.no>\n"
@@ -47,6 +47,11 @@ msgstr "account type: Aktiva"
 msgid "account type: Asset"
 msgstr "account type: Aktiva"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "account type: Gjeld"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr ""
@@ -84,6 +89,11 @@ msgstr ""
 msgid "account type: Passive"
 msgstr "account type: Aktiva"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "account type: Aktiva"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "account type: sparekonto"
@@ -157,7 +167,7 @@ msgstr ""
 msgid "action: payment"
 msgstr "action: betaling"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr ""
 
@@ -401,7 +411,7 @@ msgstr ""
 msgid "gain"
 msgstr "fortjeneste"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "ubalanse"
 
@@ -421,11 +431,6 @@ msgstr "rente"
 msgid "invoice"
 msgstr "faktura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "faktura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "jobb"
@@ -527,6 +532,10 @@ msgstr "ordre"
 msgid "orphan"
 msgstr ""
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "passord frase"
@@ -701,7 +710,7 @@ msgstr "stilmal"
 msgid "subtotal"
 msgstr "delsum"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "MVA Informasjon"
@@ -792,5 +801,9 @@ msgstr "kilde"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "uttak"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "faktura"
+
 #~ msgid "Term"
 #~ msgstr "Definisjon"
diff --git a/po/glossary/nl.po b/po/glossary/nl.po
index 43e419e..49a91ed 100644
--- a/po/glossary/nl.po
+++ b/po/glossary/nl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNUCasg 1.9.4 svn\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2006-04-16 20:08+0200\n"
 "Last-Translator: Bernard Meens <meensb at xs4all.nl>\n"
 "Language-Team: NONE\n"
@@ -43,6 +43,11 @@ msgstr "Activa"
 msgid "account type: Asset"
 msgstr "Activa"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Passiva"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "rekening courant"
@@ -80,6 +85,11 @@ msgstr "Investeringsfonds"
 msgid "account type: Passive"
 msgstr "Activa"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Activa"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "Spaarrekening"
@@ -153,7 +163,7 @@ msgstr "lenen"
 msgid "action: payment"
 msgstr "betaling"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "betaalautomaat"
 
@@ -397,7 +407,7 @@ msgstr "betalingen"
 msgid "gain"
 msgstr "toename"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "ongebalanceerd"
 
@@ -417,11 +427,6 @@ msgstr "interest"
 msgid "invoice"
 msgstr "factuur"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "factuur"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "opdracht"
@@ -523,6 +528,10 @@ msgstr "opdracht"
 msgid "orphan"
 msgstr "wees"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "passphrase"
@@ -697,7 +706,7 @@ msgstr "stijlblad"
 msgid "subtotal"
 msgstr "subtotaal"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "belastinginfo"
@@ -785,3 +794,7 @@ msgstr "voucher"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "opname"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "factuur"
diff --git a/po/glossary/pl.po b/po/glossary/pl.po
index fd51985..3a45c0b 100644
--- a/po/glossary/pl.po
+++ b/po/glossary/pl.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: GnuCash 2.2.x\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2010-09-06 12:20+0200\n"
 "Last-Translator: Radzisław Galler <rgaller at gazeta.pl>\n"
 "Language-Team: Polish <translators at gnomepl.org>\n"
@@ -45,6 +45,11 @@ msgstr "typ konta: Aktywa"
 msgid "account type: Asset"
 msgstr "typ konta: Aktywa"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "typ konta: ZobowiÄ…zania"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "typ konta: A'vista"
@@ -82,6 +87,11 @@ msgstr "typ konta: Fundusz wzajemny"
 msgid "account type: Passive"
 msgstr "typ konta: Aktywa"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "typ konta: Aktywa"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "typ konta: oszczędności"
@@ -155,7 +165,7 @@ msgstr "akcja: pożyczka"
 msgid "action: payment"
 msgstr "akcja: płatność"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "akcja: punkt sprzedaży"
 
@@ -399,7 +409,7 @@ msgstr "kalkulator finansowy: płatności"
 msgid "gain"
 msgstr "zysk"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "niezrównoważenie"
 
@@ -419,11 +429,6 @@ msgstr "odsetki"
 msgid "invoice"
 msgstr "faktura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "faktura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "zlecenie"
@@ -525,6 +530,10 @@ msgstr "polecenie"
 msgid "orphan"
 msgstr "osierocone"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "hasło"
@@ -699,7 +708,7 @@ msgstr "arkusz stylów"
 msgid "subtotal"
 msgstr "podsuma"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "informacja o podatku"
@@ -788,5 +797,9 @@ msgstr "kwit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "obciążenie"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "faktura"
+
 #~ msgid "Term"
 #~ msgstr "Termin"
diff --git a/po/glossary/pt.po b/po/glossary/pt.po
index 6cd4c36..462ffed 100644
--- a/po/glossary/pt.po
+++ b/po/glossary/pt.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-2.4\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2011-08-17 13:23-0000\n"
 "Last-Translator: Tiago Neiva <tneiva at gmail.com>\n"
 "Language-Team: Portuguese <translation-team-pt at lists.sourceforge.net>\n"
@@ -46,6 +46,11 @@ msgstr "tipo de conta: Ativo"
 msgid "account type: Asset"
 msgstr "tipo de conta: Ativo"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "tipo de conta: Passivo"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "tipo de conta: à ordem"
@@ -84,6 +89,11 @@ msgstr "tipo de conta: Fundo de investimento"
 msgid "account type: Passive"
 msgstr "tipo de conta: Ativo"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "tipo de conta: Ativo"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "tipo de conta: a prazo"
@@ -157,7 +167,7 @@ msgstr "ação: empréstimo"
 msgid "action: payment"
 msgstr "ação: pagamento"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "ação: Terminal de Pagamento Automático"
 
@@ -405,7 +415,7 @@ msgstr "calculadora financeira: pagamentos"
 msgid "gain"
 msgstr "ganho"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 #, fuzzy
 msgid "imbalance"
 msgstr "desequilíbrio"
@@ -426,11 +436,6 @@ msgstr "juro"
 msgid "invoice"
 msgstr "fatura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "fatura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "obra"
@@ -533,6 +538,10 @@ msgstr "nota de encomenda"
 msgid "orphan"
 msgstr "orfão"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "senha"
@@ -716,7 +725,7 @@ msgstr "folha de estilo"
 msgid "subtotal"
 msgstr "subtotal"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "info impostos"
@@ -805,6 +814,10 @@ msgstr "comprovativo de despesa"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "levantamento (no diálogo de reconciliação)"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "fatura"
+
 #~ msgid ""
 #~ "account type: trading This account type (new in gnucash-2.4.0) is used "
 #~ "when exchanging or trading amounts from one currency into another"
diff --git a/po/glossary/pt_BR.po b/po/glossary/pt_BR.po
index af33c63..9f8a01c 100644
--- a/po/glossary/pt_BR.po
+++ b/po/glossary/pt_BR.po
@@ -10,7 +10,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: 1.8\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2007-07-08 00:44-0300\n"
 "Last-Translator: Leonardo Ferreira Fontenelle <leo.fontenelle at gmail.com>\n"
 "Language-Team: none\n"
@@ -48,6 +48,11 @@ msgstr "Ativo"
 msgid "account type: Asset"
 msgstr "Ativo"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Passivo"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "corrente"
@@ -85,6 +90,11 @@ msgstr "Fundo mútuo"
 msgid "account type: Passive"
 msgstr "Ativo"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Ativo"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "poupança"
@@ -158,7 +168,7 @@ msgstr "empréstimo"
 msgid "action: payment"
 msgstr "pagamento"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "POS"
 
@@ -402,7 +412,7 @@ msgstr "pagamentos"
 msgid "gain"
 msgstr "ganho"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "desequilíbrio"
 
@@ -422,11 +432,6 @@ msgstr "juros"
 msgid "invoice"
 msgstr "fatura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "fatura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "serviço"
@@ -528,6 +533,10 @@ msgstr "pedido"
 msgid "orphan"
 msgstr "órfã"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "senha"
@@ -702,7 +711,7 @@ msgstr "folha de estilo"
 msgid "subtotal"
 msgstr "subtotal"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "info de impostos"
@@ -791,6 +800,10 @@ msgstr "vale"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "saque"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "fatura"
+
 #~ msgid "transfer, to"
 #~ msgstr "transferir"
 
diff --git a/po/glossary/ru.po b/po/glossary/ru.po
index cd4e01c..6696569 100644
--- a/po/glossary/ru.po
+++ b/po/glossary/ru.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: ru\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2008-01-30 00:10+0300\n"
 "Last-Translator: Sergey Belyashov <Sergey.Belyashov at gmail.com>\n"
 "Language-Team: russian <ru at li.org>\n"
@@ -48,6 +48,11 @@ msgstr "account type: Актив"
 msgid "account type: Asset"
 msgstr "account type: Актив"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "account type: Обязательства"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "account type: чеки"
@@ -85,6 +90,11 @@ msgstr "account type: Взаимный фонд"
 msgid "account type: Passive"
 msgstr "account type: Актив"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "account type: Актив"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "account type: депозит"
@@ -158,7 +168,7 @@ msgstr "action: займ"
 msgid "action: payment"
 msgstr "action: платеж"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr ""
 
@@ -406,7 +416,7 @@ msgstr "financial calculator: платежи"
 msgid "gain"
 msgstr "прибыль"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 #, fuzzy
 msgid "imbalance"
 msgstr "несоответствие"
@@ -427,11 +437,6 @@ msgstr "процент"
 msgid "invoice"
 msgstr "счет-фактура"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "счет-фактура"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "операция"
@@ -535,6 +540,10 @@ msgstr "заказ"
 msgid "orphan"
 msgstr "упущенный"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "пароль"
@@ -709,7 +718,7 @@ msgstr "стиль оформления"
 msgid "subtotal"
 msgstr "предварительный итог"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "информация о налоге"
@@ -800,5 +809,9 @@ msgstr "товарный чек"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "снятие"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "счет-фактура"
+
 #~ msgid "Term"
 #~ msgstr "Термин"
diff --git a/po/glossary/rw.po b/po/glossary/rw.po
index 050006e..9e15457 100644
--- a/po/glossary/rw.po
+++ b/po/glossary/rw.po
@@ -14,7 +14,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 1.8.9\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2005-04-04 10:55-0700\n"
 "Last-Translator: Steven Michael Murphy <murf at e-tools.com>\n"
 "Language-Team: Kinyarwanda <translation-team-rw at lists.sourceforge.net>\n"
@@ -59,6 +59,11 @@ msgstr "Aderesi Ubwoko"
 msgid "account type: Asset"
 msgstr "Aderesi Ubwoko"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "Aderesi Ubwoko"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 #, fuzzy
 msgid "account type: checking"
@@ -104,6 +109,11 @@ msgstr "Aderesi Ubwoko"
 msgid "account type: Passive"
 msgstr "Aderesi Ubwoko"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "Aderesi Ubwoko"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 #, fuzzy
 msgid "account type: saving"
@@ -194,7 +204,7 @@ msgstr "Igikorwa"
 msgid "action: payment"
 msgstr "Igikorwa"
 
-#. "-"
+#. "Point of sale"
 #, fuzzy
 msgid "action: POS"
 msgstr "Igikorwa"
@@ -485,7 +495,7 @@ msgstr "Bijyanye n'umutungo Ubwishyu"
 msgid "gain"
 msgstr ""
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr ""
 
@@ -507,10 +517,6 @@ msgstr ""
 msgid "invoice"
 msgstr ""
 
-#. "The customer (or vendor) to which this invoice is sent to."
-msgid "invoice owner"
-msgstr ""
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr ""
@@ -626,6 +632,10 @@ msgstr "Itondekanya"
 msgid "orphan"
 msgstr ""
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr ""
@@ -836,7 +846,7 @@ msgstr "Urupapuro rw'Imisusire"
 msgid "subtotal"
 msgstr "IGITERANYOCYUNGIRIJE"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "Ibisobanuro"
diff --git a/po/glossary/sk.po b/po/glossary/sk.po
index 564abaa..653db49 100644
--- a/po/glossary/sk.po
+++ b/po/glossary/sk.po
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2008-11-14 21:02+0100\n"
 "Last-Translator: Zdenko Podobny <zdenop at gmail.com>\n"
 "Language-Team: Slovak <sk-i18n at lists.linux.sk>\n"
@@ -47,6 +47,11 @@ msgstr "account type: Aktíva"
 msgid "account type: Asset"
 msgstr "account type: Aktíva"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "account type: Záväzky"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "account type: bežný účet"
@@ -84,6 +89,11 @@ msgstr "account type: Podielový fond"
 msgid "account type: Passive"
 msgstr "account type: Aktíva"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "account type: Aktíva"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "account type: sporiaci účet"
@@ -157,7 +167,7 @@ msgstr "action: úver"
 msgid "action: payment"
 msgstr "action: platba"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "action: POS"
 
@@ -401,7 +411,7 @@ msgstr "financial calculator: platby"
 msgid "gain"
 msgstr "výnos"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "nerovnováha"
 
@@ -421,11 +431,6 @@ msgstr "úrok"
 msgid "invoice"
 msgstr "faktúra"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "faktúra"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "úloha"
@@ -527,6 +532,10 @@ msgstr "objednávka"
 msgid "orphan"
 msgstr "sirota"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "heslo"
@@ -701,7 +710,7 @@ msgstr "štýl"
 msgid "subtotal"
 msgstr "medzisúčet"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "daňové informácie"
@@ -789,3 +798,7 @@ msgstr "náhrada hotovostných výdajov"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "výber (v dialógu vysporiadania)"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "faktúra"
diff --git a/po/glossary/sv.po b/po/glossary/sv.po
index f796e67..49b0c0e 100644
--- a/po/glossary/sv.po
+++ b/po/glossary/sv.po
@@ -8,7 +8,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary 1.9.1\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2006-05-04 07:47+0200\n"
 "Last-Translator: Jonas Norling <norling at lysator.liu.se>\n"
 "Language-Team: Swedish <tp-sv at listor.tp-sv.se>\n"
@@ -46,6 +46,11 @@ msgstr "kontotyp: Tillgång"
 msgid "account type: Asset"
 msgstr "kontotyp: Tillgång"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "kontotyp: Skuld"
+
 # src/prefs.c:210
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
@@ -84,6 +89,11 @@ msgstr "kontotyp: aktiefond"
 msgid "account type: Passive"
 msgstr "kontotyp: Tillgång"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "kontotyp: Tillgång"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "kontotyp: spar"
@@ -157,7 +167,7 @@ msgstr "händelse: lån"
 msgid "action: payment"
 msgstr "händelse: betalning"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "händelse: POS"
 
@@ -401,7 +411,7 @@ msgstr "finansiell miniräknare: betalningar"
 msgid "gain"
 msgstr "vinst"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "obalans"
 
@@ -421,11 +431,6 @@ msgstr "ränta"
 msgid "invoice"
 msgstr "faktura"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "faktura"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "jobb"
@@ -529,6 +534,10 @@ msgstr "order"
 msgid "orphan"
 msgstr "föräldralös"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "lösenfras"
@@ -704,7 +713,7 @@ msgstr "stilmall"
 msgid "subtotal"
 msgstr "delsumma"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "skatteinformation"
@@ -794,5 +803,9 @@ msgstr ""
 msgid "withdraw (in the reconcile dialog)"
 msgstr "uttag (i avstämningsdialogen)"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "faktura"
+
 #~ msgid "Term"
 #~ msgstr "Term"
diff --git a/po/glossary/vi.po b/po/glossary/vi.po
index 17a6a41..ad71276 100644
--- a/po/glossary/vi.po
+++ b/po/glossary/vi.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary-1.9.1\n"
 "Report-Msgid-Bugs-To: bug-gnucash at gnu.org\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2006-03-09 22:30+1030\n"
 "Last-Translator: Clytie Siddall <clytie at riverland.net.au>\n"
 "Language-Team: Vietnamese <gnomevi-list at lists.sourceforge.net>\n"
@@ -46,6 +46,11 @@ msgstr "kiểu tài khoản: tài sản"
 msgid "account type: Asset"
 msgstr "kiểu tài khoản: tài sản"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "kiểu tài khoản: nợ"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "kiểu tài khoản: hàng ngày"
@@ -83,6 +88,11 @@ msgstr "kiểu tài khoản: quỹ lẫn nhau"
 msgid "account type: Passive"
 msgstr "kiểu tài khoản: tài sản"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "kiểu tài khoản: tài sản"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "kiểu tài khoản: tiết kiệm"
@@ -156,7 +166,7 @@ msgstr "hành động: tín dụng"
 msgid "action: payment"
 msgstr "hành động: trả tiền"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "hành động: điểm bán"
 
@@ -400,7 +410,7 @@ msgstr "máy tính tài chính: số tiền trả"
 msgid "gain"
 msgstr "lợi"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "chưa cân bằng"
 
@@ -420,11 +430,6 @@ msgstr "lãi"
 msgid "invoice"
 msgstr "hóa đơn gởi"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "hóa đơn gởi"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr "việc"
@@ -526,6 +531,10 @@ msgstr "đặt hàng"
 msgid "orphan"
 msgstr "chưa kết hợp"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "cụm từ mật khẩu"
@@ -700,7 +709,7 @@ msgstr "tờ kiểu dạng"
 msgid "subtotal"
 msgstr "tổng phụ"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "thông tin thuế"
@@ -789,5 +798,9 @@ msgstr "chứng chỉ"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "rút (trong hộp thoại điều hoà)"
 
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "hóa đơn gởi"
+
 #~ msgid "Term"
 #~ msgstr "Kỹ thuật"
diff --git a/po/glossary/zh_CN.po b/po/glossary/zh_CN.po
index e31d136..5c6bbdf 100644
--- a/po/glossary/zh_CN.po
+++ b/po/glossary/zh_CN.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2010-05-05 13:47+1000\n"
 "Last-Translator: Tao Wang <dancefire at gmail.com>\n"
 "Language-Team: Simplified Chinese <LL at li.org>\n"
@@ -48,6 +48,12 @@ msgstr "科目类型:资产"
 msgid "account type: Asset"
 msgstr "科目类型:资产"
 
+# 债务,财政义务
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "科目类型:负债"
+
 # 英国称为 current account 即,现金流账户。是指一个可以随意从银行取款而不需要事先通知的银行账户
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
@@ -89,6 +95,12 @@ msgstr "科目类型:投资基金"
 msgid "account type: Passive"
 msgstr "科目类型:资产"
 
+# 某人或某公司持有的某个事物,其有价值并且可以被使用或销售以支付债务
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "科目类型:资产"
+
 # 1. (美国) 任何赚取利息的账户类型
 # 2. (英国) 任何比现金流账户或存款账户利息更高的银行账户
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
@@ -174,7 +186,7 @@ msgstr "操作:贷款"
 msgid "action: payment"
 msgstr "操作:支付"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "操作:POS"
 
@@ -472,7 +484,7 @@ msgid "gain"
 msgstr "收益"
 
 # 自动创建科目的名字,用以将不平衡的交易恢复平衡。
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "不平衡"
 
@@ -499,15 +511,6 @@ msgstr "利息"
 msgid "invoice"
 msgstr "发票"
 
-# 一个销售的物品或提供的服务含收费价格的列表。
-# 见:账单
-# 在 GnuCash 中,“发票”是我们发出(给客户)的声明,而“账单”是我们(从厂商)收到的声明。
-# Post Invoice,应该翻译为“入账”。
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "发票"
-
 # 在商业会计中:任务是一个你可以将同一个客户或厂商的多个发票或账单合起来的一种机制。任务描述了订购过程中一(大)块工作或任务,会处理它的一个或多个发票或账单。
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
@@ -636,6 +639,10 @@ msgstr "订单"
 msgid "orphan"
 msgstr "孤立的"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 # 用于访问用户账户所需要知道的秘密用语。
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
@@ -847,7 +854,7 @@ msgid "subtotal"
 msgstr "小计"
 
 # 科目的一个字段
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "税务信息"
@@ -954,3 +961,11 @@ msgstr "凭证"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "取款 (在对账对话框)"
+
+# 一个销售的物品或提供的服务含收费价格的列表。
+# 见:账单
+# 在 GnuCash 中,“发票”是我们发出(给客户)的声明,而“账单”是我们(从厂商)收到的声明。
+# Post Invoice,应该翻译为“入账”。
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "发票"
diff --git a/po/glossary/zh_TW.po b/po/glossary/zh_TW.po
index 6d6401a..94c04bc 100644
--- a/po/glossary/zh_TW.po
+++ b/po/glossary/zh_TW.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: gnucash-glossary\n"
-"POT-Creation-Date: 2014-10-13 00:33+0200\n"
+"POT-Creation-Date: 2017-10-20 19:04+0200\n"
 "PO-Revision-Date: 2011-03-10 22:11+0800\n"
 "Last-Translator: Kuang-che Wu <kcwu at csie.org>\n"
 "Language-Team: traditional Chinese <zh-l10n at linux.org.tw>\n"
@@ -44,6 +44,11 @@ msgstr "科目類型:資產"
 msgid "account type: Asset"
 msgstr "科目類型:資產"
 
+#. "in fact: 'Active & Passive', group aka 'Balance Sheet accounts'; complement of 'Profit & Loss'"
+#, fuzzy
+msgid "account type: Assets & Liabilities"
+msgstr "科目類型:負債"
+
 #. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
 msgid "account type: checking"
 msgstr "科目類型:支票"
@@ -81,6 +86,11 @@ msgstr "科目類型:共同基金"
 msgid "account type: Passive"
 msgstr "科目類型:資產"
 
+#. "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
+#, fuzzy
+msgid "account type: Profit & Loss"
+msgstr "科目類型:資產"
+
 #. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
 msgid "account type: saving"
 msgstr "科目類型:儲蓄"
@@ -154,7 +164,7 @@ msgstr "動作:貸款"
 msgid "action: payment"
 msgstr "動作:付款"
 
-#. "-"
+#. "Point of sale"
 msgid "action: POS"
 msgstr "動作:POS"
 
@@ -397,7 +407,7 @@ msgstr "金融計算機:付款"
 msgid "gain"
 msgstr "獲利"
 
-#. "Name of an automaticly created account to get imbalanced transactions back in balance"
+#. "Name of an automatically created account to get imbalanced transactions back in balance"
 msgid "imbalance"
 msgstr "失調"
 
@@ -417,11 +427,6 @@ msgstr "利息"
 msgid "invoice"
 msgstr "發票"
 
-#. "The customer (or vendor) to which this invoice is sent to."
-#, fuzzy
-msgid "invoice owner"
-msgstr "發票"
-
 #. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
 msgid "job"
 msgstr ""
@@ -523,6 +528,10 @@ msgstr ""
 msgid "orphan"
 msgstr "無主的"
 
+#. "The customer to (or employee or vendor from) which this invoice is sent - or short your business partner."
+msgid "owner (of bill, invoice or expense voucher)"
+msgstr ""
+
 #. "A secret phrase that one needs to know in order to get access to a user account "
 msgid "passphrase"
 msgstr "通關密語"
@@ -697,7 +706,7 @@ msgstr "樣式表格"
 msgid "subtotal"
 msgstr "小計"
 
-#. "On the goverment's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
+#. "On the government's tax forms, the tax code identifies the given line or place on the form where certain amounts must be specified according to the current country's legislation"
 #, fuzzy
 msgid "tax code"
 msgstr "稅務資訊"
@@ -785,3 +794,7 @@ msgstr "憑證"
 #. "see debit"
 msgid "withdraw (in the reconcile dialog)"
 msgstr "提出(在對帳對話盒)"
+
+#, fuzzy
+#~ msgid "invoice owner"
+#~ msgstr "發票"

commit 78cd5416c11dc24d346a6c2dcf056565793447f1
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 18:05:47 2017 +0200

    Mayor overhaul of de.po
    
    Fix accelerators
    4682 translated messages, 3 untranslated messages.

diff --git a/po/de.po b/po/de.po
index a1c0f5f..8476429 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1120,7 +1120,8 @@ msgstr "Zuletzt geöffnete Datei nicht öffnen"
 msgid ""
 "Set the prefix for gsettings schemas for gsettings queries. This can be "
 "useful to have a different settings tree while debugging."
-msgstr ""
+msgstr "Setzt den Präfix für »gsettings schemas«. Das kann nützlich sein, um "
+"andere Einstellungen beim Entwanzen zu verwenden."
 
 #. Translators: Argument description for autohelp; see
 #. http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html
@@ -1169,7 +1170,7 @@ msgstr ""
 #: ../src/bin/gnucash-bin.c:159
 msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
 msgstr ""
-"Fehlerberichte können auf http://bugzilla.gnome.org eingeschickt werden."
+"Fehlerberichte können auf http://bugzilla.gnome.org eingesehen und erstellt werden."
 
 #: ../src/bin/gnucash-bin.c:160
 msgid "To find the last stable version, please refer to http://www.gnucash.org"
@@ -1250,8 +1251,11 @@ msgid ""
 "Error: could not initialize graphical user interface and option add-price-"
 "quotes was not set.\n"
 "       Perhaps you need to set the $DISPLAY environment variable ?"
-msgstr ""
-
+msgstr "Fehler: Die graphische Benutzerschnittstelle konnte nicht "
+"initialisiert werden, obwohl die Option »add-price-quotes« nicht gesetzt "
+"war.\n"
+"       Möglicherweise müssen Sie die Umgebungsvariable $DISPLAY setzen?"
+# Fixme: Source Accelerator missing in dialog-invoice?
 #: ../src/business/business-gnome/business-gnome-utils.c:73
 #: ../src/business/business-gnome/business-gnome-utils.c:260
 #: ../src/business/business-gnome/dialog-invoice.c:1315
@@ -1345,7 +1349,7 @@ msgstr "Ungültige Konto Entität: %s"
 
 #: ../src/business/business-gnome/dialog-billterms.c:265
 msgid "Discount days cannot be more than due days."
-msgstr ""
+msgstr "»Tage für Skonto« kann nicht größer als »Fälligkeitstage« sein."
 
 #: ../src/business/business-gnome/dialog-billterms.c:324
 msgid "You must provide a name for this Billing Term."
@@ -1465,6 +1469,7 @@ msgstr "Aufträge des Kunden"
 msgid "Customer's Invoices"
 msgstr "Rechnungen des Kunden"
 
+# Fixme: Source Accelerator(s) missing in dialog-invoice?
 #: ../src/business/business-gnome/dialog-customer.c:907
 #: ../src/business/business-gnome/dialog-employee.c:712
 #: ../src/business/business-gnome/dialog-invoice.c:2999
@@ -1474,7 +1479,7 @@ msgstr "Rechnungen des Kunden"
 #: ../src/business/business-gnome/dialog-job.c:549
 #: ../src/business/business-gnome/gtkbuilder/dialog-payment.glade.h:1
 msgid "Process Payment"
-msgstr "Zahlung verarbeiten"
+msgstr "_Zahlung verarbeiten"
 
 #: ../src/business/business-gnome/dialog-customer.c:917
 msgid "Shipping Contact"
@@ -1799,15 +1804,17 @@ msgstr "Datum der kopierten Einträge"
 msgid ""
 "One or more selected invoices have already been posted.\n"
 "Re-check your selection."
-msgstr ""
+msgstr "Eine oder mehrere ausgewählte Rechnungen wurden bereits gebucht.\n"
+"Überprüfen Sie Ihre Auswahl."
 
 #: ../src/business/business-gnome/dialog-invoice.c:2932
 msgid "Do you really want to post these invoices?"
 msgstr "Wollen Sie diese Rechnungen wirklich buchen?"
 
+# Fixme: Source Accelerator missing
 #: ../src/business/business-gnome/dialog-invoice.c:2998
 msgid "View/Edit Invoice"
-msgstr "Rechnung anzeigen/bearbeiten"
+msgstr "_Rechnung anzeigen/bearbeiten"
 
 #: ../src/business/business-gnome/dialog-invoice.c:3000
 #: ../src/business/business-gnome/dialog-invoice.c:3009
@@ -2339,9 +2346,10 @@ msgstr "_Zahlung verarbeiten..."
 msgid "Open the Process Payment dialog"
 msgstr "Den Dialog für das Eingeben von Zahlungen öffnen"
 
+# Fixme: Source Accelerator missing
 #: ../src/business/business-gnome/gnc-plugin-business.c:197
 msgid "Vendors Overview"
-msgstr "Lieferantenübersicht"
+msgstr "Lieferantenüber_sicht"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:198
 msgid "Open a Vendor overview page"
@@ -2371,7 +2379,7 @@ msgstr "Den Dialog für die Suche nach Lieferanten öffnen"
 #: ../src/business/business-gnome/gnc-plugin-business.c:213
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:187
 msgid "New _Bill..."
-msgstr "Neue Lieferantenrechnung..."
+msgstr "N_eue Lieferantenrechnung..."
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:214
 msgid "Open the New Bill dialog"
@@ -2387,9 +2395,10 @@ msgstr "Lieferanten_rechnung suchen..."
 msgid "Open the Find Bill dialog"
 msgstr "Den Dialog für die Suche nach Rechnungen öffnen"
 
+# Fixme: Source Accelerator missing
 #: ../src/business/business-gnome/gnc-plugin-business.c:240
 msgid "Employees Overview"
-msgstr "Mitarbeiterübersicht"
+msgstr "Mitarbeiterüber_sicht"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:241
 msgid "Open a Employee overview page"
@@ -2402,7 +2411,7 @@ msgstr "_Mitarbeiter"
 #: ../src/business/business-gnome/gnc-plugin-business.c:246
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:166
 msgid "_New Employee..."
-msgstr "Neuer Mitarbeiter..."
+msgstr "_Neuer Mitarbeiter..."
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:247
 msgid "Open the New Employee dialog"
@@ -2435,7 +2444,7 @@ msgstr "Den Dialog für die Suche nach Auslagenerstattungen öffnen"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:273
 msgid "Sales _Tax Table"
-msgstr "Steuertabelle..."
+msgstr "MwSt.-_Steuertabelle..."
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:274
 msgid "View and edit the list of Sales Tax Tables (GST/VAT)"
@@ -2443,7 +2452,7 @@ msgstr "Liste der Steuertabellen (MwSt./USt.) anzeigen und bearbeiten"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:278
 msgid "_Billing Terms Editor"
-msgstr "Zahlungsbedingungen"
+msgstr "Tabelle für _Zahlungsbedingungen"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:279
 msgid "View and edit the list of Billing Terms"
@@ -2451,7 +2460,7 @@ msgstr "Liste der Zahlungsbedingungen anzeigen und bearbeiten"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:283
 msgid "Bills _Due Reminder"
-msgstr "Erinnerung an fällige Rechnungen"
+msgstr "Erinnerung an _fällige Rechnungen"
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:284
 msgid "Open the Bills Due Reminder dialog"
@@ -2471,9 +2480,10 @@ msgstr "Den Such-Dialog testen"
 msgid "Initialize Test Data"
 msgstr "Testdaten zurücksetzen"
 
+# Fixme: Source Accelerator missing
 #: ../src/business/business-gnome/gnc-plugin-business.c:311
 msgid "Assign as payment..."
-msgstr "Als Zahlung zuweisen..."
+msgstr "Als _Zahlung zuweisen..."
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:312
 msgid "Assign the selected transaction as payment"
@@ -2518,7 +2528,7 @@ msgstr "E_infügen"
 
 #: ../src/business/business-gnome/gnc-plugin-page-invoice.c:129
 msgid "_Edit Invoice"
-msgstr "Rechnung bearbeiten"
+msgstr "Rechnung be_arbeiten"
 
 #: ../src/business/business-gnome/gnc-plugin-page-invoice.c:130
 msgid "Edit this invoice"
@@ -2552,7 +2562,7 @@ msgstr ""
 
 #: ../src/business/business-gnome/gnc-plugin-page-invoice.c:151
 msgid "_Enter"
-msgstr "Ãœbernehmen"
+msgstr "_Ãœbernehmen"
 
 #: ../src/business/business-gnome/gnc-plugin-page-invoice.c:152
 msgid "Record the current entry"
@@ -2788,19 +2798,19 @@ msgstr "_Filtern nach..."
 
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:188
 msgid "Create a new bill"
-msgstr "Eine neue Rechnung anlegen"
+msgstr "Eine neue Lieferantenrechnung erfassen"
 
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:193
 msgid "Create a new invoice"
-msgstr "Eine neue Rechnung anlegen"
+msgstr "Eine neue Kundenrechnung erstellen"
 
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:197
 msgid "New _Voucher..."
-msgstr "Neue Gutschrift..."
+msgstr "Neuer _Auslagenbeleg..."
 
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:198
 msgid "Create a new voucher"
-msgstr "Neue Gutschrift erstellen"
+msgstr "Neuen Auslagenbeleg erfassen"
 
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:202
 #: ../src/business/business-gnome/gnc-plugin-page-owner-tree.c:277
@@ -3049,6 +3059,12 @@ msgid ""
 "opposite sign. For example for a bill, vendor credit notes and negative "
 "bills are considered counter documents."
 msgstr ""
+"Während des Buchungsvorgangs wird versucht Lieferantendokumente mit bereits "
+"geleisteten Vorauszahlungen und Gegendokumenten zu verrechnen. Die "
+"Vorauszahlungen und Gegendokumente müssen natürlich denselben Lieferanten "
+"betreffen. Gegendokumente sind Dokumente mit umgekehrtem Vorzeichen. Zu "
+"einer Rechnung wären beispielsweise Gutschriften und negative Rechnungen als "
+"Gegendokumente zu betrachten."
 
 #: ../src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in.h:18
 msgid "Show bills due reminder at startup"
@@ -3210,12 +3226,12 @@ msgstr "Bericht zum _Drucken:"
 #. See the tooltip "At post time..." for details.
 #: ../src/business/business-gnome/gtkbuilder/business-prefs.glade.h:26
 msgid "_Process payments on posting"
-msgstr "Automatisch durchbuchen"
+msgstr "Automatisch _verrechnen"
 
 #. See the tooltip "At post time..." for details.
 #: ../src/business/business-gnome/gtkbuilder/business-prefs.glade.h:29
 msgid "Pro_cess payments on posting"
-msgstr "Automatisch durchbuchen"
+msgstr "Automatisch ver_rechnen"
 
 #: ../src/business/business-gnome/gtkbuilder/dialog-billterms.glade.h:1
 msgid "Cancel your changes"
@@ -3493,6 +3509,8 @@ msgstr "Rechnungsadresse"
 msgid "Notes"
 msgstr "Bemerkung"
 
+# Fixme: Source 1. Accelerator missing "assign payment"
+#   2. Comment misplaced
 #. Translators: "Markup" is profit amount divided by sales amount
 #: ../src/business/business-gnome/gtkbuilder/dialog-customer.glade.h:14
 #: ../src/business/business-gnome/gtkbuilder/dialog-invoice.glade.h:24
@@ -3632,7 +3650,7 @@ msgstr "Rechnungs-Informationen"
 #: ../src/business/business-gnome/gtkbuilder/dialog-order.glade.h:6
 #: ../src/business/business-gnome/gtkbuilder/dialog-payment.glade.h:3
 msgid "(owner)"
-msgstr "(Mandant)"
+msgstr "(Geschäftspartner)"
 
 #: ../src/business/business-gnome/gtkbuilder/dialog-invoice.glade.h:10
 #: ../src/business/business-gnome/search-owner.c:241
@@ -4087,7 +4105,7 @@ msgstr "sample(DH):+%"
 #: ../src/register/ledger-core/split-register-layout.c:722
 #: ../src/register/ledger-core/split-register-layout.c:730
 msgid "sample:Expenses:Automobile:Gasoline"
-msgstr "sample:Ausgaben:Automobil:Treibstoff"
+msgstr "sample:Aufwendungen 2/4:Reparatur/Instandhaltung:4805 Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Geschäftsausst."
 
 #: ../src/business/business-ledger/gncEntryLedgerLayout.c:125
 msgid "sample:T?"
@@ -4383,11 +4401,11 @@ msgid ""
 "Please correct the problem and restart GnuCash.\n"
 "The reported error was '%s' (errno %d).\n"
 msgstr ""
-"Ein unbekannter Fehler ist aufgetreten, als nach dem Verzeichnis\n"
+"Ein Fehler ist aufgetreten, als das Verzeichnis\n"
 "  %s\n"
-"gesucht wurde. Bitte berichten Sie den Fehler an die Programmierer und\n"
-"starten Sie GnuCash neu. \n"
-"Nennen Sie bitte diesen Fehlertext: »%s« (errno %d)\n"
+"erstellt werden sollte. Bitte beheben Sie das Problem und\n"
+"starten Sie GnuCash neu.\n"
+"Folgender Fehler wurde gemeldet: »%s« (errno %d)\n"
 
 #: ../src/core-utils/gnc-filepath-utils.c:338
 #, c-format
@@ -4415,6 +4433,7 @@ msgstr ""
 "Programm muss alle Zugriffrechte (Lesen/Schreiben/Ausführen) zu diesem\n"
 "Verzeichnis besitzen, um korrekt zu funktionieren.\n"
 
+# Fixme: Check source
 #: ../src/core-utils/gnc-filepath-utils.c:359
 #: ../src/core-utils/gnc-filepath-utils.c:381
 #, c-format
@@ -4429,6 +4448,7 @@ msgstr ""
 "existiert, ist aber kein Verzeichnis. Bitte löschen Sie diese Datei\n"
 "oder wählen einen anderen Pfad. Starten Sie dann GnuCash neu.\n"
 
+# Fixme: Source
 #: ../src/core-utils/gnc-filepath-utils.c:368
 #, c-format
 msgid ""
@@ -4438,12 +4458,11 @@ msgid ""
 "problem and restart GnuCash. The reported error \n"
 "was '%s' (errno %d)."
 msgstr ""
-"Ein unbekannter Fehler ist aufgetreten, als nach dem Verzeichnis\n"
+"Ein unbekannter Fehler ist aufgetreten, als das Verzeichnis\n"
 "  %s\n"
-"\n"
-"gesucht wurde. Bitte berichten Sie den Fehler an die Programmierer und\n"
-"starten Sie GnuCash neu. \n"
-"Nennen Sie bitte diesen Fehlertext: »%s« (errno %d)"
+"auf seine Existenz und Verwendbarkeit überprüft wurde.\n"
+"Bitte beheben Sie das Problem und starten Sie GnuCash neu.\n"
+"Der gemeldete Fehler war: »%s« (errno %d)."
 
 #: ../src/core-utils/gnc-filepath-utils.c:393
 #, c-format
@@ -4552,6 +4571,7 @@ msgstr "ALLE NICHT-WÄHRUNGEN"
 msgid "Unnamed Budget"
 msgstr "Unbenanntes Budget"
 
+# Fixme: Source
 #. Set memo.
 #: ../src/engine/gncInvoice.c:1574
 msgid "Extra to Charge Card"
@@ -4685,19 +4705,21 @@ msgstr "Jährlich"
 
 #: ../src/engine/ScrubBusiness.c:522
 msgid ""
-"Please delete this transaction. Explanation at http://wiki.gnucash.org/wiki/"
-"Business_Features_Issues#Double_Posting"
-msgstr ""
+"Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/"
+"Business_Features_Issues#Double_posting"
+msgstr "Bitte löschen sie diese Buchung. Die (englische) Erklärung befindet "
+"sich in https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting"
 
+# Fixme: Bessere Lösung für die nächsten 2?
 #: ../src/engine/ScrubBusiness.c:592
 #, c-format
 msgid "Checking business lots in account %s: %u of %u"
-msgstr ""
+msgstr "Überprüfe geschäftliche Posten in Konto %s: %u von %u"
 
 #: ../src/engine/ScrubBusiness.c:642
 #, c-format
 msgid "Checking business splits in account %s: %u of %u"
-msgstr ""
+msgstr "Überprüfe geschäftliche Buchungsteile in Konto %s: %u von %u"
 
 #. Reason 2: zero Orphan a/c
 #: ../src/engine/Scrub.c:89 ../src/report/business-reports/balsheet-eg.scm:511
@@ -4707,12 +4729,12 @@ msgstr "Ausbuchungskonto"
 #: ../src/engine/Scrub.c:106
 #, c-format
 msgid "Looking for orphans in account %s: %u of %u"
-msgstr ""
+msgstr "Suche nach verwaisten Buchungen in Konto %s: %u von %u"
 
 #: ../src/engine/Scrub.c:302
 #, c-format
 msgid "Looking for imbalances in account %s: %u of %u"
-msgstr ""
+msgstr "Suche nach unausgeglichenen Buchungen in Konto %s: %u von %u"
 
 #. (> (accrec-depth accrec) 1))
 #. Reason 1: zero Imbalance a/c
@@ -4875,7 +4897,7 @@ msgstr "Steuern"
 
 #: ../src/gnome/assistant-loan.c:115
 msgid "Tax Payment"
-msgstr "Steuern"
+msgstr "Steuerzahlungen"
 
 #: ../src/gnome/assistant-loan.c:116
 msgid "Insurance"
@@ -4883,7 +4905,7 @@ msgstr "Versicherung"
 
 #: ../src/gnome/assistant-loan.c:116
 msgid "Insurance Payment"
-msgstr "Versicherung"
+msgstr "Zahlungen für Versicherungen"
 
 #. Translators: PMI stands for Private Mortgage Insurance.
 #: ../src/gnome/assistant-loan.c:118
@@ -4892,15 +4914,15 @@ msgstr "Hypothekenversicherung"
 
 #: ../src/gnome/assistant-loan.c:118
 msgid "PMI Payment"
-msgstr "Hypothekenversicherung"
+msgstr "Zahlungen für Hypothekenversicherungen"
 
 #: ../src/gnome/assistant-loan.c:119
 msgid "Other Expense"
-msgstr "Anderes"
+msgstr "Sonstiges"
 
 #: ../src/gnome/assistant-loan.c:119
 msgid "Miscellaneous Payment"
-msgstr "Anderes"
+msgstr "Sonstige Zahlungen"
 
 #. Add payment checkbox.
 #. Translators: %s is "Taxes",
@@ -4928,7 +4950,7 @@ msgstr "Darlehensrechner-Option: \"%s\""
 
 #: ../src/gnome/assistant-loan.c:1837 ../src/gnome/assistant-loan.c:2834
 msgid "Principal"
-msgstr "Endbetrag Kapital"
+msgstr "Tilgung"
 
 #: ../src/gnome/assistant-loan.c:1843 ../src/gnome/assistant-loan.c:2854
 #: ../src/gnome-utils/gnc-tree-model-split-reg.c:2882
@@ -5064,11 +5086,11 @@ msgstr "Der Zinssatz kann nicht Null sein."
 
 #: ../src/gnome/dialog-fincalc.c:372
 msgid "The number of payments cannot be zero."
-msgstr "Die Anzahl der Zahlungen kann nicht Null sein"
+msgstr "Die Anzahl der Zahlungen kann nicht Null sein."
 
 #: ../src/gnome/dialog-fincalc.c:377
 msgid "The number of payments cannot be negative."
-msgstr "Die Anzahl der Zahlungen kann nicht negativ sein"
+msgstr "Die Anzahl der Zahlungen kann nicht negativ sein."
 
 #: ../src/gnome/dialog-find-transactions2.c:104
 #: ../src/gnome/dialog-find-transactions.c:103
@@ -5620,7 +5642,7 @@ msgstr "Summe"
 
 #: ../src/gnome/gnc-plugin-account-tree.c:59
 msgid "New Accounts _Page"
-msgstr "Neue _Kontenhierarchie"
+msgstr "Neue _Kontenübersicht"
 
 #: ../src/gnome/gnc-plugin-account-tree.c:60
 msgid "Open a new Account Tree page"
@@ -5628,7 +5650,7 @@ msgstr "Neue Ansicht der Kontenhierarchie öffnen"
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:107
 msgid "New _File"
-msgstr "Neue _Datei"
+msgstr "_Neue Datei"
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:108
 msgid "Create a new file"
@@ -5660,7 +5682,7 @@ msgstr "AKtuelle Datei mit einem neuen Namen speichern"
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:127
 msgid "Re_vert"
-msgstr "Änderungen verwerfen"
+msgstr "Änderungen ver_werfen"
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:128
 msgid "Reload the current database, reverting all unsaved changes"
@@ -5691,7 +5713,7 @@ msgstr "Finde Buchungssätze"
 #. * translation in dialog-account.glade
 #: ../src/gnome/gnc-plugin-basic-commands.c:149
 msgid "Ta_x Report Options"
-msgstr "Optionen _Steuerbericht"
+msgstr "_Optionen Steuerbericht"
 
 #. Translators: currently implemented are *
 #. * US: income tax and                     *
@@ -5706,9 +5728,10 @@ msgstr "Konten für Steuerbericht (MwSt.) einrichten"
 msgid "_Scheduled Transactions"
 msgstr "Term_inierte Buchungen"
 
+# Fixme: Source should have HEllip?
 #: ../src/gnome/gnc-plugin-basic-commands.c:162
 msgid "_Scheduled Transaction Editor"
-msgstr "Terminierte Buchungen Editor"
+msgstr "Terminierte Buchungen _Editor"
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:163
 msgid "The list of Scheduled Transactions"
@@ -5800,7 +5823,7 @@ msgstr ""
 
 #: ../src/gnome/gnc-plugin-basic-commands.c:554
 msgid "There are no Scheduled Transactions to be entered at this time."
-msgstr "Es gibt keine terminierten Buchungen, die gebucht werden sollten."
+msgstr "Es gibt derzeit keine terminierten Buchungen, die gebucht werden sollten."
 
 #. Translators: %d is the number of transactions. This is a
 #. ngettext(3) message.
@@ -5853,7 +5876,7 @@ msgstr "Ein neues Konto eröffnen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:171
 msgid "New Account _Hierarchy..."
-msgstr "Konten_hierarchie _hinzufügen"
+msgstr "Konten_hierarchie hinzufügen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:172
 msgid "Extend the current book by merging with new account type categories"
@@ -5874,14 +5897,12 @@ msgid "Open the selected account"
 msgstr "Gewähltes Konto öffnen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:182
-#, fuzzy
 msgid "Open _Old Style Register Account"
-msgstr "Gewähltes Konto öffnen"
+msgstr "Gewähltes Konto im _alten Registerstil öffnen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:183
-#, fuzzy
 msgid "Open the old style register selected account"
-msgstr "Gewähltes Konto öffnen"
+msgstr "Gewähltes Konto im alten Registerstil öffnen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:196
 #: ../src/gnome/gnc-plugin-page-account-tree.c:207
@@ -5897,14 +5918,12 @@ msgid "Open the selected account and all its subaccounts"
 msgstr "Öffne das gewählte Konto und alle Unterkonten"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:201
-#, fuzzy
 msgid "Open Old St_yle Subaccounts"
-msgstr "_Unterkonten öffnen"
+msgstr "_Unterkonten im alten Stil öffnen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:202
-#, fuzzy
 msgid "Open the old style register selected account and all its subaccounts"
-msgstr "Öffne das gewählte Konto und alle Unterkonten"
+msgstr "Öffne das gewählte Konto und alle Unterkonten in der alten Kontoansicht"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:215
 #: ../src/gnome/gnc-plugin-page-register2.c:241
@@ -5920,7 +5939,7 @@ msgstr "Ausgewähltes Konto bearbeiten"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:220
 msgid "_Delete Account..."
-msgstr "_Konto löschen..."
+msgstr "Konto _löschen..."
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:221
 msgid "Delete selected account"
@@ -5928,7 +5947,7 @@ msgstr "Ausgewähltes Konto löschen"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:225
 msgid "_Renumber Subaccounts..."
-msgstr "_Unterkonten neu nummerieren..."
+msgstr "Unterkonten neu _nummerieren..."
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:226
 msgid "Renumber the children of the selected account"
@@ -6039,9 +6058,8 @@ msgid "_Register2"
 msgstr "_Kontobuch Vers. 2"
 
 #: ../src/gnome/gnc-plugin-page-account-tree.c:342
-#, fuzzy
 msgid "Open2"
-msgstr "Öffnen"
+msgstr "Öffnen (Vers. 2)"
 
 #. FIXME this needs an indent option
 #. FIXME this could use an indent option
@@ -6205,7 +6223,7 @@ msgstr "Buchung _kopieren"
 #: ../src/gnome/gnc-plugin-page-register2.c:192
 #: ../src/gnome/gnc-plugin-page-register.c:196
 msgid "_Paste Transaction"
-msgstr "Buchung _einfügen"
+msgstr "Buchung ein_fügen"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:193
 #: ../src/gnome/gnc-plugin-page-register.c:197
@@ -6217,7 +6235,7 @@ msgstr "Buchung dupli_zieren"
 #: ../src/gnome/gnc-split-reg.c:1335
 #: ../src/gnome-utils/gnc-tree-control-split-reg.c:1065
 msgid "_Delete Transaction"
-msgstr "_Buchung löschen"
+msgstr "Buchung _löschen"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:195
 #: ../src/gnome/gnc-plugin-page-register.c:202
@@ -6292,10 +6310,11 @@ msgstr "Den Buchungsteil von der Zwischenablage einfügen"
 msgid "Make a copy of the current split"
 msgstr "Kopie des aktuellen Buchungsteils erstellen"
 
+# tritt alternativ zu "Buchung _löschen" auf
 #: ../src/gnome/gnc-plugin-page-register2.c:209
 #: ../src/gnome/gnc-plugin-page-register.c:219
 msgid "Delete the current split"
-msgstr "Aktuellen Buchungsteil löschen"
+msgstr "Aktuellen Buchungsteil _löschen"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:219
 #: ../src/gnome/gnc-plugin-page-register.c:226
@@ -6349,7 +6368,7 @@ msgstr "Alle Buchungsteile im aktuellen Buchungssatz entfernen"
 #: ../src/gnome/gnc-plugin-page-register2.c:284
 #: ../src/gnome/gnc-plugin-page-register.c:291
 msgid "_Enter Transaction"
-msgstr "Buchung eingeben"
+msgstr "Buchung ein_geben"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:285
 #: ../src/gnome/gnc-plugin-page-register.c:292
@@ -6374,7 +6393,7 @@ msgstr "Buchung _ungültig machen"
 #: ../src/gnome/gnc-plugin-page-register2.c:298
 #: ../src/gnome/gnc-plugin-page-register.c:305
 msgid "_Unvoid Transaction"
-msgstr "Ungültige Buchung wieder_herstellen"
+msgstr "Ungültige Buchung _wiederherstellen"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:302
 #: ../src/gnome/gnc-plugin-page-register.c:309
@@ -6453,7 +6472,7 @@ msgstr "Den Wechselkurs für die gewählte Buchung bearbeiten"
 #: ../src/gnome/gnc-plugin-page-register.c:377
 #: ../src/gnome-utils/gnc-icons.c:45
 msgid "_Jump"
-msgstr "Ge_genbuchung"
+msgstr "_Gegenbuchung"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:367
 #: ../src/gnome/gnc-plugin-page-register.c:378
@@ -6474,13 +6493,14 @@ msgstr "Terminierte Buchung erstellen mit aktuellem Buchungssatz als Vorlage"
 #: ../src/gnome/gnc-plugin-page-register2.c:376
 #: ../src/gnome/gnc-plugin-page-register.c:387
 msgid "_All transactions"
-msgstr "Alle Buchungssätze"
+msgstr "_Alle Buchungssätze"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:380
 #: ../src/gnome/gnc-plugin-page-register.c:391
 msgid "_This transaction"
 msgstr "_Dieser Buchungssatz"
 
+# Fixme: Source Accelerator missing
 #: ../src/gnome/gnc-plugin-page-register2.c:387
 #: ../src/gnome/gnc-plugin-page-register.c:398
 msgid "Account Report"
@@ -6491,10 +6511,11 @@ msgstr "Kontenbericht"
 msgid "Open a register report for this Account"
 msgstr "Kontobuch als Bericht für dieses Konto öffnen"
 
+# Fixme: Source Accelerator missing
 #: ../src/gnome/gnc-plugin-page-register2.c:392
 #: ../src/gnome/gnc-plugin-page-register.c:403
 msgid "Account Report - Single Transaction"
-msgstr "Kontenbuch - Einzelüberweisung"
+msgstr "Kontenbuch - Einzelbuchung"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:393
 #: ../src/gnome/gnc-plugin-page-register.c:404
@@ -6553,8 +6574,8 @@ msgstr "_Aktive vollständig"
 msgid ""
 "Show transactions on one or two lines and expand the current transaction"
 msgstr ""
-"Alle Buchungssätze außer dem aktuellen einzeilig anzeigen. Den aktuellen "
-"Buchungssatz vollständig anzeigen."
+"Alle Buchungssätze außer dem aktuellen ein- bis zweizeilig anzeigen. "
+"Den aktuellen Buchungssatz vollständig anzeigen."
 
 #: ../src/gnome/gnc-plugin-page-register2.c:437
 #: ../src/gnome/gnc-plugin-page-register.c:442
@@ -6722,7 +6743,7 @@ msgstr ""
 #: ../src/gnome/gnc-plugin-page-register2.c:2644
 #: ../src/gnome/gnc-plugin-page-register.c:2819
 msgid "_Print checks"
-msgstr "Scheck_s drucken"
+msgstr "Schec_ks drucken"
 
 #: ../src/gnome/gnc-plugin-page-register2.c:2663
 #: ../src/gnome/gnc-plugin-page-register.c:2838
@@ -6776,12 +6797,12 @@ msgstr ""
 
 #: ../src/gnome/gnc-plugin-page-register.c:286
 msgid "Remo_ve Other Splits"
-msgstr "Andere Buchungsteile löschen"
+msgstr "Andere Buchungs_teile löschen"
 
 #: ../src/gnome/gnc-plugin-page-register.c:331
 #: ../src/gnome-utils/gnc-main-window.c:328
 msgid "_Sort By..."
-msgstr "_Sortieren nach..."
+msgstr "Sortieren _nach..."
 
 #: ../src/gnome/gnc-plugin-page-register.c:491
 msgid "Associate File"
@@ -6834,7 +6855,7 @@ msgstr "%s sortieren nach..."
 #: ../src/gnome/gnc-plugin-page-register.c:3798
 #, c-format
 msgid "Checking splits in current register: %u of %u"
-msgstr ""
+msgstr "Überprüfe Buchungsteile im aktuellen Konto: %u von %u"
 
 #: ../src/gnome/gnc-plugin-page-sx-list.c:132
 msgid "_Scheduled"
@@ -7030,7 +7051,7 @@ msgstr ""
 #: ../src/gnome/gnc-split-reg.c:985
 #: ../src/gnome-utils/gnc-tree-control-split-reg.c:888
 msgid "_Remove Splits"
-msgstr "Buchungsteile entfernen"
+msgstr "Buchungsteile _entfernen"
 
 #: ../src/gnome/gnc-split-reg.c:1178
 msgid "This transaction is not associated with a URI."
@@ -7621,11 +7642,12 @@ msgstr ""
 "Die Anzahl Minuten, bis die Datei automatisch gespeichert wird (»Auto-"
 "Speichern«). Wenn Null gesetzt ist, wird nichts automatisch gespeichert."
 
+# Fixme: Source Accelerators missing
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:11
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:105
 msgid "Enable timeout on \"Save changes on closing\" question"
 msgstr ""
-"Aktiviere Wartezeit bei \"Geänderte Datei speichern\"-Frage beim Schließen"
+"Aktiviere Wartezeit bei »Geänderte Datei speichern«-Frage beim Schließen"
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:12
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:106
@@ -7635,7 +7657,7 @@ msgid ""
 "that time, the changes will be saved automatically and the question window "
 "closed."
 msgstr ""
-"Wenn aktiviert, wird die \"Geänderte Datei speichern?\"-Frage nur einige "
+"Wenn aktiviert, wird die »Geänderte Datei speichern?«-Frage nur einige "
 "Sekunden auf eine Antwort warten. Wenn der Benutzer in dieser Zeit nicht "
 "reagiert, werden die Änderungen automatisch gespeichert und die Frage "
 "verschwindet."
@@ -7707,6 +7729,7 @@ msgstr ""
 msgid "Do not create log/backup files."
 msgstr "Keine Backup- und Log-Dateien erstellen."
 
+# Fixme: Source format can be improved by linebreaks
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:23
 msgid ""
 "This setting specifies what to do with old log/backups files. \"forever\" "
@@ -7714,7 +7737,13 @@ msgid ""
 "Each time you save, older versions of the file are removed. \"days\" means "
 "keep old files for a number of days. How many days is defined in key 'retain-"
 "days'"
-msgstr ""
+msgstr "Diese Einstellung bestimmt, was mit alten Protokoll- und "
+"Backup-Dateien geschieht:\n"
+"»Immer« bedeutet, daß alle alten Dateien behalten werden.\n"
+"»Nie« bedeutet, es werden keine log/Backup-Dateien behalten. "
+"Bei jeder Speicherung werden ältere Versionen gelöscht.\n"
+"»Tage« bedeutet, daß alte Dateien eine bestimmte Anzahl Tage aufbewahrt werden.\n"
+"Diese Zahl wird im Schlüssel »retain-days« gespeichert."
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:24
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:102
@@ -8021,7 +8050,7 @@ msgstr ""
 msgid ""
 "Set book option on new files to use split \"action\" field for \"Num\" field "
 "on registers/reports"
-msgstr "Setzt die Buchungsoption "
+msgstr ""
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:69
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:73
@@ -8233,9 +8262,8 @@ msgid "Show the calendar buttons Cancel, Today and Select."
 msgstr "Zeigt die Kalenderschaltflächen Abbrechen, Heute und Auswählen an"
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:99
-#, fuzzy
 msgid "Move the selection to the blank split on expand"
-msgstr "Gewählte Überweisungsvorlage eine Zeile nach oben umsortieren"
+msgstr "Bewege die Auswahl beim Erweitern in den leeren Buchungsteil"
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:100
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:168
@@ -8243,6 +8271,8 @@ msgid ""
 "This will move the selection to the blank split when the transaction is "
 "expanded."
 msgstr ""
+"Hierdurch wird die Auswahl in den leeren Buchungsteil bewegt, wenn die "
+"Buchung erweitert wird."
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:101
 msgid "Number of transactions to show in a register."
@@ -8287,18 +8317,19 @@ msgstr ""
 msgid "Use the system locale currency for all newly created reports."
 msgstr "Die systemweit voreingestellte Währung für neue Berichte benutzen."
 
+#Fixme: Source insert line breaks
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:108
-#, fuzzy
 msgid ""
 "This setting controls the default currency used for reports. If set to "
 "\"locale\" then GnuCash will retrieve the default currency from the user's "
 "locale setting. If set to \"other\", GnuCash will use the setting specified "
 "by the currency-other key."
 msgstr ""
-"Diese Einstellung gibt die Herkunft der voreingestellten Währung für neue "
-"Berichte an. Wenn auf »locale« gesetzt, verwendet GnuCash die "
-"voreingestellte Währung der Systemeinstellungen (locale). Wenn auf »other« "
-"gesetzt, wird die Einstellung von »currency_other« verwendet."
+"Diese Einstellung bestimmt die voreingestellten Währung für Berichte an.\n"
+"Ist »choice-locale« gewählt, verwendet GnuCash die voreingestellte Währung "
+"aus den Systemeinstellungen des Benutzers (locale). \n"
+"Ist aber »choice-other« gewählt, wird die Einstellung aus »currency_other« "
+"verwendet."
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:109
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:172
@@ -8339,7 +8370,14 @@ msgid ""
 "the filename-date-format setting. (Note: Any characters that are not allowed "
 "in filenames, such as '/', will be replaced with underscores '_' in the "
 "resulting file name.)"
-msgstr ""
+msgstr "Diese Einstellung bestimmt den Dateinamen für den PDF-Export. Dies "
+"ist eine »sprintf(3)« Zeichenkette mit drei Argumenten: »%1$s« ist der "
+"Berichtsname wie etwa »Rechnung«. »%2$s« ist die Nummer des Berichts, welche "
+"bei einer Rechnung die Rechnungsnummer ist. »%3$s« ist das Datum des "
+"Berichts, formatiert entsprechend der »filename-date-format«-Einstellung. "
+"(Anmerkung: Sämtliche Zeichen, die in Dateinamen nicht erlaubt sind, wie "
+"z.B. '/', werden durch Unterstriche »_«  im resultierenden Dateinamen "
+"ersetzt.)"
 
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:116
 msgid "PDF export file name date format choice"
@@ -8483,7 +8521,6 @@ msgid "Ending time period identifier"
 msgstr "Index für relativen Endzeitpunkt"
 
 #: ../src/gnome/gschemas/org.gnucash.window.pages.account.tree.gschema.xml.in.in.h:17
-#, fuzzy
 msgid ""
 "This setting controls the ending date set in profit/loss calculations if the "
 "end-choice setting is set to anything other than \"absolute\". This field "
@@ -8491,7 +8528,7 @@ msgid ""
 msgstr ""
 "Diese Einstellung setzt das Enddatum in den Einname-/Ausgabenrechnungen, "
 "wenn die Einstellung »end_choice« auf etwas anderes als »absolute« gesetzt "
-"ist. Dann wählt diese Einstellung eines der relativen Datumsvorgaben mit dem "
+"ist. Dann wählt diese Einstellung eine der relativen Datumsvorgaben mit dem "
 "jeweiligen Index von 0 bis 8."
 
 #: ../src/gnome/gschemas/org.gnucash.window.pages.gschema.xml.in.in.h:1
@@ -8502,7 +8539,8 @@ msgstr "Diese Spalte anzeigen?"
 msgid ""
 "This setting controls whether the given column will be visible in the view. "
 "TRUE means visible, FALSE means hidden."
-msgstr ""
+msgstr "Diese Einstellung bestimmt, ob die gegebene Spalte in der Ansicht "
+"sichtbar sein wird. »TRUE« bedeutet sichtbar und »FALSE« unsichtbar."
 
 #: ../src/gnome/gschemas/org.gnucash.window.pages.gschema.xml.in.in.h:3
 msgid "Width of this column"
@@ -8532,7 +8570,6 @@ msgid "Setup Account Period"
 msgstr "Buchführungsperioden einrichten"
 
 #: ../src/gnome/gtkbuilder/assistant-acct-period.glade.h:5
-#, fuzzy
 msgid ""
 "\n"
 "Select an accounting period and the closing date which must not be in the "
@@ -8541,9 +8578,12 @@ msgid ""
 "Books will be closed at midnight on the selected date."
 msgstr ""
 "\n"
-"Wählen Sie einen Buchungszeitraum und ein Abschlussdatum für diesen "
-"Zeitraum. Der Buchabschluss wird für Mitternacht jenes Datums gespeichert."
+"Wählen Sie einen Buchungszeitraum und das Abschlußdatum, welches größer als "
+"das des vorherigen Buches sein muß und nicht in der Zukunft liegen darf.\n"
+"\n"
+"Das Buch wird um Mitternacht des gewählten Datums geschlossen."
 
+# Fixme: I don't know, how to call the "Account Period Assistant"
 #: ../src/gnome/gtkbuilder/assistant-acct-period.glade.h:9
 msgid "xxx"
 msgstr "xxx"
@@ -8704,7 +8744,6 @@ msgid "Finish Account Setup"
 msgstr "Konteneinrichten fertigstellen"
 
 #: ../src/gnome/gtkbuilder/assistant-loan.glade.h:1
-#, fuzzy
 msgid ""
 "This is a step-by-step method for creating a loan repayment within GnuCash. "
 "In this assistant, you can input the details of your loan and its repayment "
@@ -8716,11 +8755,11 @@ msgid ""
 msgstr ""
 "Dieser Assistent ist eine Schritt-für-Schritt Anleitung, um die Rückzahlung "
 "eines Darlehens in GnuCash einzurichten. Sie können die Parameter Ihres "
-"Darlehens und der Rückzahlungsraten angeben. Mit diesen Informationen werden "
-"die entsprechenden Terminierten Buchungen erstellt.\n"
+"Darlehens und der Tilgungsraten angeben. Mit diesen Informationen werden "
+"die entsprechenden terminierten Buchungen erstellt.\n"
 "\n"
-"Wenn Sie einen Irrtum machen oder später Änderungen machen möchten, können "
-"Sie die erstellte Terminierte Buchung direkt ändern."
+"Wenn Ihnen ein Fehler unterläuft oder Sie später Änderungen vornehmen möchten, können "
+"Sie die erstellte terminierte Buchung direkt ändern."
 
 #: ../src/gnome/gtkbuilder/assistant-loan.glade.h:4
 msgid "Loan / Mortgage Repayment Setup"
@@ -8733,6 +8772,7 @@ msgstr ""
 "Geben Sie die Dahrlehensangaben ein. Es werden mindestens das Darlehenskonto "
 "und der Betrag benötigt.\n"
 
+# Fixme: Source without accelerator
 #: ../src/gnome/gtkbuilder/assistant-loan.glade.h:7
 msgid "Interest Rate:"
 msgstr "Zinssatz:"
@@ -8761,13 +8801,16 @@ msgstr "Darlehenskonto:"
 msgid ""
 "Enter the number of months still to be paid off. This determines both the "
 "remaining principle and the duration of the scheduled transaction."
-msgstr ""
+msgstr "Geben sie die Anzahl der Monate an, die noch getilgt werden müssen. "
+"Daraus resultiert sowohl der noch zu tilgende Betrag als auch die Dauer der "
+"terminierten Buchung."
 
 #: ../src/gnome/gtkbuilder/assistant-loan.glade.h:13
 msgid ""
 "Enter the annual interest rate in percent. Accepts values from 0.001 - 100. "
 "The Mortgage Assistant does not support zero-interest loans."
-msgstr ""
+msgstr "Geben SIe den jährlichen Zinssatz in Prozent ein. Akzeptiert werden "
+"Werte von 0,001 - 100. Dieser Assistent unterstützt keine Null-Zins Kredite."
 
 #: ../src/gnome/gtkbuilder/assistant-loan.glade.h:16
 #: ../src/gnome/gtkbuilder/dialog-fincalc.glade.h:16
@@ -10058,7 +10101,7 @@ msgstr "Datum _wählen:"
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:12
 #: ../src/import-export/csv-exp/assistant-csv-export.glade.h:28
 msgid "Toda_y"
-msgstr "_Heute"
+msgstr "H_eute"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register2.glade.h:12
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:13
@@ -10076,7 +10119,7 @@ msgstr "Ende:"
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:15
 #: ../src/import-export/csv-exp/assistant-csv-export.glade.h:31
 msgid "C_hoose Date:"
-msgstr "Datum _wählen:"
+msgstr "Datum w_ählen:"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register2.glade.h:15
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:16
@@ -10113,12 +10156,12 @@ msgstr "_Fixiert"
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register2.glade.h:22
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:23
 msgid "Select _All"
-msgstr "Alle auswählen"
+msgstr "A_lle auswählen"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register2.glade.h:24
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:25
 msgid "Sa_ve Filter"
-msgstr "Filter speichern"
+msgstr "Filter _speichern"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register2.glade.h:25
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:51
@@ -10158,7 +10201,7 @@ msgstr "Sortiere nach Datum der Einträge"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:33
 msgid "S_tatement Date"
-msgstr "_Datum des Kontoauszugs:"
+msgstr "Datum des Kontoaus_zugs:"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:34
 msgid ""
@@ -10187,7 +10230,7 @@ msgstr "Sortieren nach Summe"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:39
 msgid "_Memo"
-msgstr "Buchungstext"
+msgstr "Buchungs_text"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:40
 #: ../src/report/standard-reports/transaction.scm:780
@@ -10211,7 +10254,7 @@ msgstr "Sortiere nach Aktionsfeld"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:45
 msgid "_Notes"
-msgstr "_Bemerkung"
+msgstr "Be_merkung"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:46
 msgid "Sort by notes field."
@@ -10219,15 +10262,16 @@ msgstr "Sortiere nach Bemerkungsfeld"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:47
 msgid "Sa_ve Sort Order"
-msgstr "Sortierreihenfolge speichern"
+msgstr "Sortierreihenfolge s_peichern"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:48
 msgid "Save the sort order for this register."
 msgstr "Sortierreihenfolge für diese Liste speichern"
 
+# Fixme: Source Accelerator missing
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:49
 msgid "Reverse Order"
-msgstr "Umgekehrte Reihenfolge"
+msgstr "_Umgekehrte Reihenfolge"
 
 #: ../src/gnome/gtkbuilder/gnc-plugin-page-register.glade.h:50
 msgid "Sort in descending order."
@@ -10264,7 +10308,8 @@ msgstr "_Unterkonten einbeziehen"
 msgid ""
 "Include all descendant accounts in the reconcile. All of them must use the "
 "same commodity as this one."
-msgstr ""
+msgstr "Schließe alle Unterkonten in den Abgleich ein. Sie müssen alle in "
+"derselben Währung geführt werden wie dieses Konto."
 
 #: ../src/gnome/gtkbuilder/window-reconcile.glade.h:7
 #: ../src/gnome/window-reconcile2.c:763 ../src/gnome/window-reconcile.c:800
@@ -10275,7 +10320,7 @@ msgstr "Zahlung Haben_zins eingeben..."
 #: ../src/register/ledger-core/split-register-layout.c:690
 #: ../src/register/ledger-core/split-register-model.c:303
 msgid "Reconciled:R"
-msgstr "Reconciled:J"
+msgstr "Reconciled:A"
 
 #: ../src/gnome-search/dialog-search.c:239
 msgid "You must select an item from the list"
@@ -10302,7 +10347,8 @@ msgstr "Neuer Buchungsteil"
 msgid ""
 "Item represents an unknown object type (in the sense of bill, customer, "
 "invoice, transaction, split,...)|New item"
-msgstr ""
+msgstr "Item represents an unknown object type (in the sense of bill, customer, "
+"invoice, transaction, split,...)|Neues Element"
 
 #: ../src/gnome-search/dialog-search.c:1145
 msgid "all criteria are met"
@@ -10969,7 +11015,8 @@ msgstr "Sie können keine neue nationale Währung erstellen."
 #: ../src/gnome-utils/dialog-commodity.c:1286
 #, c-format
 msgid "%s is a reserved commodity type. Please use something else."
-msgstr ""
+msgstr "%s ist als Typ für Währungen oder Wertpapiere reserviert. "
+"Bitte verwenden Sie eine andere Bezeichnung."
 
 #: ../src/gnome-utils/dialog-commodity.c:1301
 msgid "That commodity already exists."
@@ -10983,11 +11030,11 @@ msgstr ""
 "Sie müssen in den Feldern »Voller Name«, »Symbol/Abkürzung« und »Typ« für "
 "die Devise/Wertpapier etwas angeben."
 
+# Fixme: Wo taucht das auf?
 #. The "date" and the "tnum" fields aren't being asked for, this is a split copy
 #: ../src/gnome-utils/dialog-dup-trans.c:235
-#, fuzzy
 msgid "Action/Number:"
-msgstr "_Nummer:"
+msgstr "Aktion/_Nummer:"
 
 #: ../src/gnome-utils/dialog-file-access.c:295
 msgid "Open..."
@@ -11887,7 +11934,7 @@ msgstr "Aktuelle Seite drucken"
 
 #: ../src/gnome-utils/gnc-main-window.c:282
 msgid "Pa_ge Setup..."
-msgstr "Seite _einrichten"
+msgstr "Seite ein_richten"
 
 #: ../src/gnome-utils/gnc-main-window.c:283
 msgid "Specify the page size and orientation for printing"
@@ -12321,13 +12368,13 @@ msgid ""
 "The blank transaction does not have enough information to save it. Would you "
 "like to return to the transaction to update, or cancel the save?"
 msgstr ""
-"Die neue Buchung hat nicht genügend Informationen, gespeichert werden zu "
+"Die neue Buchung hat nicht genügend Informationen, um gespeichert werden zu "
 "können. Möchten Sie zur Bearbeitung der Buchung zurückkehren oder das "
 "Speichern abbrechen?"
 
 #: ../src/gnome-utils/gnc-tree-control-split-reg.c:1740
 msgid "_Return"
-msgstr "Kapitalertrag"
+msgstr "_Zurück"
 
 #: ../src/gnome-utils/gnc-tree-control-split-reg.c:1783
 #: ../src/register/ledger-core/split-register-control.c:1835
@@ -13809,13 +13856,14 @@ msgstr ""
 msgid "_Display symbol"
 msgstr "_Anzeigesymbol"
 
+# Fixme: Source
 #: ../src/gnome-utils/gtkbuilder/dialog-file-access.glade.h:1
 msgid "<b>Data Format:</b>"
 msgstr "<b>Dateiformat:</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-file-access.glade.h:2
 msgid "Open _Read-Only"
-msgstr "Schreib_geschützt öffnen"
+msgstr "_Schreibgeschützt öffnen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-file-access.glade.h:3
 msgid "<b>File</b>"
@@ -14118,9 +14166,11 @@ msgstr "Das Datumsformat aus den Systemeinstellungen übernehmen."
 msgid "Date/Time"
 msgstr "Datum und Zeit"
 
+# Fixme: Der Assistent ist derzeit unter Aktion->Kontenhierarchie hinzufügen
+# erreichbar. Können wir das vereinheitlichen?
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:70
 msgid "Perform account list _setup on new file"
-msgstr "Konteneinrichtung bei neuer Datei"
+msgstr "Konten_einrichtung bei neuer Datei"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:71
 msgid "Present the new account list dialog when you choose File -> New File."
@@ -14130,7 +14180,7 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:74
 msgid "Display \"_tip of the day\" dialog"
-msgstr "»Tipp des Tages« anzeigen"
+msgstr "»_Tipp des Tages« anzeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:75
 msgid "Display hints for using GnuCash at startup."
@@ -14179,7 +14229,7 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:86
 msgid "Display ne_gative amounts in red"
-msgstr "Negative Beträge in rot anzeigen"
+msgstr "Negative Beträge in _rot anzeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:87
 msgid "Display negative amounts in red."
@@ -14195,7 +14245,7 @@ msgstr "<b>Such-Dialog</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:90
 msgid "New search _limit:"
-msgstr "Ergebnisanzahl für Neue Suche:"
+msgstr "Ergebnisan_zahl für Neue Suche:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:91
 msgid "Default to 'new search' if fewer than this number of items is returned."
@@ -14221,7 +14271,7 @@ msgstr "Minuten"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:97
 msgid "Show auto-save confirmation _question"
-msgstr "Erklärung für automatisch Speichern anzeigen"
+msgstr "Erklärung für automatisch Speichern an_zeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:98
 msgid ""
@@ -14234,7 +14284,7 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:107
 msgid "Time to wait for answer:"
-msgstr "Wartezeit für Antwort:"
+msgstr "_Wartezeit für Antwort:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:109
 msgid "seconds"
@@ -14259,9 +14309,8 @@ msgid "Default _font:"
 msgstr "Voreingestellte _Schrift:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:115
-#, fuzzy
 msgid "The default check printing font."
-msgstr "Voreingestellte Schriftart zum Scheck drucken"
+msgstr "Die voreingestellte Schriftart zum Scheck drucken."
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:116
 msgid "Print _blocking chars"
@@ -14282,7 +14331,7 @@ msgstr "<b>Aktionen</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:120
 msgid "'_Enter' moves to blank transaction"
-msgstr "Mit 'Eingabe' gehen Sie zur leeren Buchung"
+msgstr "Mit »_Eingabe« gehen Sie zur leeren Buchung"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:121
 msgid ""
@@ -14290,12 +14339,12 @@ msgid ""
 "the bottom of the register. If clear, pressing the 'Enter' key will move "
 "down one row."
 msgstr ""
-"Wenn aktiviert, nach Drücken von 'Eingabe' zum leeren Buchungssatz gehen. "
-"Ansonsten nur eine Zeile nach unten gehen."
+"Wenn aktiviert, nach Drücken von »Eingabe« zum leeren Buchungssatz, "
+"ansonsten nur eine Zeile nach unten gehen."
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:122
 msgid "_Auto-raise lists"
-msgstr "Listen automatisch aufklappen"
+msgstr "_Listen automatisch aufklappen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:123
 msgid "Automatically raise the list of accounts or actions during input."
@@ -14308,7 +14357,7 @@ msgstr "<b>Kontenabgleich</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:125
 msgid "Check cleared _transactions"
-msgstr "Bestätigte Buchungen automatisch abgleichen"
+msgstr "_Bestätigte Buchungen automatisch abgleichen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:126
 msgid "Pre-check cleared transactions when creating a reconcile dialog."
@@ -14332,7 +14381,7 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:131
 msgid "Always reconcile to t_oday"
-msgstr "Immer zum heutigen Datum abgleichen"
+msgstr "Immer zum heutigen _Datum abgleichen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:132
 msgid ""
@@ -14350,9 +14399,10 @@ msgstr "_Vertikale Linien zwischen Spalten zeichnen"
 msgid "Show vertical borders on the cells."
 msgstr "Vertikale Begrenzungen anzeigen."
 
+# H und C sind in diesem Dialog durch Hilfe und Schließen belegt
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:135
 msgid "Draw hori_zontal lines between rows"
-msgstr "_Horizontale Linien zwischen Zeilen zeichnen"
+msgstr "H_orizontale Linien zwischen Zeilen zeichnen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:136
 msgid "Show horizontal borders on the cells."
@@ -14360,7 +14410,7 @@ msgstr "Horizontale Begrenzungen anzeigen."
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:137
 msgid "Double _mode colors alternate with transactions"
-msgstr "Zweizeilenstil: Farben abwechselnd pro Buchungssatz"
+msgstr "_Zweizeilenstil: Farben abwechselnd pro Buchungssatz"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:138
 msgid ""
@@ -14372,13 +14422,14 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:139
 msgid "Don't _use GnuCash built-in colors"
-msgstr "Benutzt nicht die GnuCash-eigenen Farben"
+msgstr "Benutzt nicht die GnuCash-eigenen _Farben"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:140
 msgid ""
 "GnuCash uses a yellow/green theme by default for register windows. Check "
 "this if you want to use the system color theme instead."
-msgstr ""
+msgstr "Gnucash verwendet in der Kontenansicht normalerweise ein gelb/grünes "
+"Farbthema. Wenn aktiviert, wird stattdessen das systemeigene Thema verwendet."
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:141
 msgid "<b>Graphics</b>"
@@ -14386,7 +14437,7 @@ msgstr "<b>Grafik</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:142
 msgid "Tab order in_cludes Transfer on Memorised Transactions"
-msgstr "Bei Auto-Vervollständigen zum Gegenkonto-Feld weitergehen"
+msgstr "Bei Auto-Vervollständigen zum _Gegenkonto-Feld weitergehen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:143
 msgid "Move to Transfer field when memorised transaction auto filled."
@@ -14410,7 +14461,7 @@ msgstr "_Aktive vollständig"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:153
 msgid "Number of _transactions:"
-msgstr "Anzahl Buchungen:"
+msgstr "An_zahl Buchungen:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:155
 msgid "_Double line mode"
@@ -14426,7 +14477,7 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:157
 msgid "Register opens in a new _window"
-msgstr "Kontobuch in neuem Fenster öffnen"
+msgstr "Kontobuch in neuem _Fenster öffnen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:158
 msgid ""
@@ -14455,26 +14506,26 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:161
 msgid "Number of _characters for auto complete:"
-msgstr "Anzahl Buchstaben für Auto-Vervollständigen:"
+msgstr "Anzahl Buchstaben für Auto-Vervo_llständigen:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:163
 msgid "Show the _entered and reconcile dates"
-msgstr "Datum der _Eingabe und Abgleichen anzeigen"
+msgstr "Datum von _Eingabe und Abgleich anzeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:165
 msgid "Show the calendar b_uttons"
-msgstr "Kalender-Knöpfe anzeigen"
+msgstr "_Kalender-Knöpfe anzeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:167
 msgid "_Move the selection to the blank split on expand"
 msgstr ""
-"Mit dem Cursor zum neuen Buchungsteil springen, wenn eine Buchung "
+"Mit dem Cursor zum _neuen Buchungsteil springen, wenn eine Buchung "
 "ausgeklappt wird"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:169
 msgid "_Show entered and reconciled dates on selection"
 msgstr ""
-"Datum der Eingabe und des Abgleichens bei ausgewählter Buchung anzeigen"
+"_Datum der Eingabe und des Abgleichens bei der Ausgewahl anzeigen"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:171
 msgid "Register Defaults"
@@ -14797,7 +14848,7 @@ msgstr "ISO (2001-12-31)"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:19
 msgid "UTC - Coordinated Universal Time"
-msgstr ""
+msgstr "UTC - Koordinierte Weltzeit"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:21
 msgid "No Fancy Date Format"
@@ -15231,11 +15282,11 @@ msgstr ""
 
 #: ../src/gnome-utils/gtkbuilder/gnc-tree-view-owner.glade.h:2
 msgid "Only show _active owners"
-msgstr "Nur _aktive Mandanten zeigen"
+msgstr "Nur _aktive Partner zeigen"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-tree-view-owner.glade.h:3
 msgid "Show _zero balance owners"
-msgstr "Nullsalden anzeigen"
+msgstr "Partner mit _Nullsalden anzeigen"
 
 #: ../src/gnome-utils/window-main-summarybar.c:298
 #, c-format
@@ -15762,9 +15813,8 @@ msgid "Confirm Password:"
 msgstr "Passwort bestätigen:"
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:21
-#, fuzzy
 msgid "Remember the _PIN in memory"
-msgstr "HBCI PIN im Speicher merken"
+msgstr "HBCI _PIN im Speicher merken"
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:22
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:6
@@ -15796,9 +15846,8 @@ msgstr ""
 "AqBanking-Import beendet ist. Andernfalls bleibt das Fenster geöffnet."
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:26
-#, fuzzy
 msgid "Use Non-SWIFT _transaction text"
-msgstr "Verwende das dem Buchungsdatum nächste Datum."
+msgstr "Verwende _Nicht-SWIFT Buchungstext"
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:27
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:8
@@ -15807,7 +15856,10 @@ msgid ""
 "the MT940 file. Normally GNUcash ignores this text. However by activating "
 "this option, the transaction text is used for the transaction description "
 "too."
-msgstr ""
+msgstr "Einige Banken fügen Teile des Buchungsbeschreibung als »transaction "
+"text« in MT940 Dateien ein. Normalerweise ignoriert GnuCash diesen Text. "
+"Durch Aktivierung dieser Option wird der »transaction text« zur "
+"Buchungsbeschreibung hinzugefügt."
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:28
 msgid "_Verbose debug messages"
@@ -15991,25 +16043,24 @@ msgid "Credited Account Bank Code"
 msgstr "BLZ des Auftraggebers"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:404
-#, fuzzy
 msgid "Enter a SEPA Online Direct Debit Note"
-msgstr "Online-Lastschrift eingeben"
+msgstr "SEPA Online-Lastschrift eingeben"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:409
 msgid "Debited IBAN (International Account Number)"
-msgstr "IBAN des Zahlungspflichtigen"
+msgstr "IBAN (International Account Number) des Zahlungspflichtigen"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:411
 msgid "Debited BIC (Bank Code)"
-msgstr "BIC des Zahlungspflichtigen"
+msgstr "BIC (SWIFT Bankkennzahl) des Zahlungspflichtigen"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:416
 msgid "Credited IBAN (International Account Number)"
-msgstr "IBAN des Zahlungsempfängers"
+msgstr "IBAN (International Account Number) des Zahlungsempfängers"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:418
 msgid "Credited BIC (Bank Code)"
-msgstr "BIC des Zahlungsempfängers"
+msgstr "BIC (SWIFT Bankkennzahl) des Zahlungsempfängers"
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:497
 #, c-format
@@ -16091,6 +16142,7 @@ msgstr ""
 "Sie haben keinen Verwendungszweck eingegeben. Für einen Überweisungsauftrag "
 "ist die Eingabe eines Verwendungszwecks erforderlich.\n"
 
+# Fixme: aktuellen Stand prüfen.
 #: ../src/import-export/aqb/dialog-ab-trans.c:718
 msgid ""
 "The text you entered contained at least one character that is invalid for a "
@@ -16100,7 +16152,13 @@ msgid ""
 "\n"
 "In particular, neither Umlauts nor an ampersand (&) is allowed, neither in "
 "the recipient or sender name nor in any purpose line."
-msgstr ""
+msgstr "Ihr eingegebener Text enthält mindestens ein Zeichen, das in einer "
+"SEPA-Überweisung ungültig sein kann. In der Basisversion unterstützt SEPA "
+"leider nur: a...z, A...Z, 0...9, und die folgenden Satzzeichen: "
+"' : ? , - ( + . ) / \n"
+"\n"
+"Insbesondere sind weder Umlaute, noch Et-Zeichen »&« erlaubt, weder im "
+"Sender- noch im Empfängernamen, geschweige denn im Verwendungszweck."
 
 #: ../src/import-export/aqb/dialog-ab-trans.c:1183
 msgid ""
@@ -16521,11 +16579,9 @@ msgid "Remember the PIN in memory"
 msgstr "HBCI PIN im Speicher merken"
 
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:7
-#, fuzzy
 msgid "Put the transaction text in front of the purpose of a transaction."
 msgstr ""
-"Alle Buchungssätze außer dem aktuellen einzeilig anzeigen. Den aktuellen "
-"Buchungssatz vollständig anzeigen."
+"Den »transaction text« vor dem Verwendungszweck einfügen."
 
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:9
 msgid "Verbose HBCI debug messages"
@@ -16709,7 +16765,8 @@ msgstr "Export-Einstellungen"
 
 #: ../src/import-export/csv-exp/assistant-csv-export.glade.h:13
 msgid "Select the accounts to be exported and date range if required."
-msgstr ""
+msgstr "Wählen Sie die Konten für den Export, sowie den Zeitraum, sofern "
+"gewünscht."
 
 #: ../src/import-export/csv-exp/assistant-csv-export.glade.h:22
 msgid "<b>_Dates</b>"
@@ -16737,7 +16794,8 @@ msgstr "Wählen Sie einen Dateinamen für den Export"
 msgid ""
 "Press Apply to create export file.\n"
 "Cancel to abort."
-msgstr ""
+msgstr "Drücken Sie »Anwenden«, um die Export-Datei zu erstellen,\n"
+"oder »Abbrechen«, um den Vorgang abzubrechen."
 
 #: ../src/import-export/csv-exp/assistant-csv-export.glade.h:40
 msgid "Export Now..."
@@ -16757,33 +16815,32 @@ msgstr "Kategorie"
 
 #: ../src/import-export/csv-exp/csv-transactions-export.c:424
 msgid "To With Sym"
-msgstr ""
+msgstr "Nach m. Währung"
 
 #: ../src/import-export/csv-exp/csv-transactions-export.c:424
 msgid "From With Sym"
-msgstr ""
+msgstr "Von m. Währung"
 
 #: ../src/import-export/csv-exp/csv-transactions-export.c:425
 msgid "To Num."
-msgstr "Bis Nr."
+msgstr "Nach numerisch"
 
 #: ../src/import-export/csv-exp/csv-transactions-export.c:425
 msgid "From Num."
-msgstr "Von Nr."
+msgstr "Von numerisch"
 
-# strange, had fuzzy translation Saldo (Periodenbezogen)
 #: ../src/import-export/csv-exp/csv-transactions-export.c:426
 msgid "To Rate/Price"
-msgstr "Zu Kurs/Preis"
+msgstr "Nach Kurs"
 
 #: ../src/import-export/csv-exp/csv-transactions-export.c:426
 msgid "From Rate/Price"
-msgstr "Von Kurs/Preis"
+msgstr "Von Kurs"
 
 #. Header string, 'eol = end of line marker'
 #: ../src/import-export/csv-exp/csv-tree-export.c:155
 msgid "type"
-msgstr ""
+msgstr "Typ"
 
 #: ../src/import-export/csv-exp/csv-tree-export.c:155
 msgid "full_name"
@@ -16825,13 +16882,14 @@ msgstr "Versteckt"
 msgid "tax"
 msgstr "Steuerrelevant"
 
+# Fixme: Source should be changed
 #: ../src/import-export/csv-exp/csv-tree-export.c:158
 msgid "place_holder"
 msgstr "Platzhalter"
 
 #: ../src/import-export/csv-exp/gnc-plugin-csv-export.c:47
 msgid "Export Account T_ree to CSV..."
-msgstr "_Kontenhierarchie nach CSV exportieren ..."
+msgstr "Konten_hierarchie nach CSV exportieren ..."
 
 #: ../src/import-export/csv-exp/gnc-plugin-csv-export.c:48
 msgid "Export the Account Tree to a CSV file"
@@ -16860,7 +16918,12 @@ msgid ""
 "\n"
 "You can also go back and verify your selections by clicking on 'Back' or "
 "'Cancel' to Abort Import.\n"
-msgstr ""
+msgstr "Wenn Sie auf »Anwenden« drücken, werden die Konten aus der Datei »%s« "
+"importiert.\n"
+"\n"
+"Sie können aber auch zurückgehen und ihre Angaben überprüfen, wenn sie auf "
+"»Zurück« drücken oder den Vorgang ganz abbrechen, indem Sie auf »Abbrechen« "
+"drücken.\n" 
 
 #: ../src/import-export/csv-imp/assistant-csv-account-import.c:75
 #, c-format
@@ -16874,7 +16937,18 @@ msgid ""
 "for setting book options, since these can affect how imported data are "
 "converted to GnuCash transactions. If this is an existing file, the dialog "
 "will not be shown.\n"
-msgstr ""
+msgstr "Wenn Sie auf »Anwenden« drücken, werden die Konten aus der Datei »%s« "
+"importiert.\n"
+"\n"
+"Sie können aber auch zurückgehen und ihre Angaben überprüfen, wenn sie auf "
+"»Zurück« drücken oder den Vorgang ganz abbrechen, indem Sie auf »Abbrechen« "
+"drücken.\n" 
+"\n"
+"Wenn dies Ihr erster Import in eine neue Datei ist, werden Sie zunächst "
+"einen Dialog zum Setzen der Buch-Eigenschaften sehen, da diese die Art und "
+"Weise beeinflussen können, wie Ihre importierten Daten in GnuCash Buchungen "
+"konvertiert werden. Falls diese Datei bereits existierte, wird der Dialog "
+"nicht mehr angezeigt.\n"
 
 #: ../src/import-export/csv-imp/assistant-csv-account-import.c:172
 #: ../src/plugins/bi_import/dialog-bi-import-gui.c:218
@@ -17070,24 +17144,24 @@ msgid ""
 "To Change the account, double click on the required account, click Forward "
 "to proceed."
 msgstr ""
-"Um das KOnto zu wechseln, doppleklicken Sie auf das gewünschte Konto, dann "
+"Um ein Konto zu auszutauschen, doppelklicken Sie auf das gewünschte Konto, dann "
+"»Vorwärts«, um fortzufahren."
 
 #. A list of the transactions we create
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.c:1520
 msgid "Double click on rows to change, then click on Apply to Import"
-msgstr ""
+msgstr "Doppelklicken Sie auf Zeilen für Änderungen, danach klicken Sie »Anwenden« zum Import."
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.c:1568
-#, fuzzy, c-format
+#, c-format
 msgid "The transactions were imported from the file '%s'."
-msgstr "Beim Lesen der Datei »%s« ist ein Fehler aufgetreten."
+msgstr "Die Buchungen wurden aus der Datei »%s« importiert."
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:1
 msgid "CSV Transaction Import"
 msgstr "CSV-Buchungen-Import"
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:2
-#, fuzzy
 msgid ""
 "This assistant will help you import a delimited file containing a list of "
 "transactions.\n"
@@ -17105,8 +17179,8 @@ msgid ""
 "have some header text, a points collected status row or multiple accounts in "
 "the same file."
 msgstr ""
-"Dieser Assistent möchte Ihnen helfen, Textdateien mit Buchungen zu "
-"importieren.\n"
+"Dieser Assistent möchte Ihnen helfen, Buchungen aus einer Textdateie mit "
+"Trennzeichen zu importieren.\n"
 "\n"
 "Alle importierten Buchungen eines Imports werden mit einem bestimmten Konto "
 "pro Import assoziiert. Wenn Sie eine Kontospalte wählen wird das Konto aus "
@@ -17117,8 +17191,9 @@ msgstr ""
 "auf den Balken über den dargestellten Zeilen, um die Breite festzulegen.\n"
 "\n"
 "Schließlich gibt es eine Option zur Bestimmung der ersten und letzten Zeile, "
-"welche benutzt werden kann, wenn sie einige Kopfzeilen oder mehrere Konten "
-"in einer Datei haben."
+"sowie eine Option Zeilen abwechselnd zu überspringen. Diese Optionen können "
+"benutzt werden, wenn sie einige Kopfzeilen oder mehrere Konten in einer "
+"Datei haben."
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:9
 msgid "Transaction Import Assistant"
@@ -17146,7 +17221,7 @@ msgstr " und stoppe auf Zeile "
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:16
 msgid "Skip alternate rows from the start row"
-msgstr ""
+msgstr "Ãœberspringe abwechseld Zeilen ab der Startzeile"
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:17
 msgid "Data type: "
@@ -17196,6 +17271,7 @@ msgstr "Vorschau-Einstellungen"
 msgid "Error text."
 msgstr "Fehlertext"
 
+# Fixme: Source should be more precise "in this file"
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:36
 msgid ""
 "On the following page you will be able to associate each transaction to a "
@@ -17213,7 +17289,23 @@ msgid ""
 "The confidence of a correct association is displayed as a colored bar.\n"
 "\n"
 "More information can be displayed by using the help button."
-msgstr ""
+msgstr "Auf der folgenden Seite haben Sie die Möglicjkeit, jeder Buchung eine "
+"Kategorie zuzuordnen.\n"
+"\n"
+"Wenn dies ihr erster Import in diese Datei ist, müssen Sie leider alle "
+"Zeilen manuell zuordnen. Bei späteren Importen wird das Import-Modul "
+"versuchen, die Zuordnung basierend auf den früheren Importen vorzunehmen.\n" 
+"\n"
+"Wenn dies Ihr erster Import in eine neue Datei ist, werden Sie zunächst "
+"einen Dialog zum Setzen der Buch-Eigenschaften sehen, da diese die Art und "
+"Weise beeinflussen können, wie Ihre importierten Daten in GnuCash Buchungen "
+"konvertiert werden. Falls diese Datei bereits existierte, wird der Dialog "
+"nicht mehr angezeigt.\n"
+"\n"
+"Die Zuverlässigkeit der korrekten Zuordnung wird durch einen farbigen Balken "
+"angezeigt.\n" 
+"\n"
+"Weitere Informationen sind über den »Hilfe«-Knopf abrufbar."
 
 #: ../src/import-export/csv-imp/assistant-csv-trans-import.glade.h:45
 msgid "Transaction Information"
@@ -17408,23 +17500,23 @@ msgstr ""
 
 #: ../src/import-export/dialog-import.glade.h:16
 msgid "Commercial ATM _fees threshold"
-msgstr "Auszahlungsgebühren"
+msgstr "Aus_zahlungsgebühren"
 
 #: ../src/import-export/dialog-import.glade.h:17
 msgid "Auto-c_lear threshold"
-msgstr "Entscheidungsschwelle für automatisches Abgleichen"
+msgstr "Entscheidungsschwelle für automatisches Abg_leichen"
 
 #: ../src/import-export/dialog-import.glade.h:18
 msgid "Auto-_add threshold"
-msgstr "Entscheidungsschwelle für automatisches Hinzufügen"
+msgstr "Entscheidungsschwelle für automatisches Hinzu_fügen"
 
 #: ../src/import-export/dialog-import.glade.h:19
 msgid "Match _display threshold"
-msgstr "Entscheidungsschwelle für Anzeige in Zuordnung"
+msgstr "Entscheidungsschwelle für Anzeige in Zu_ordnung"
 
 #: ../src/import-export/dialog-import.glade.h:20
 msgid "Use _bayesian matching"
-msgstr "_Bayes-Algorithmus verwenden"
+msgstr "Ba_yes-Algorithmus verwenden"
 
 #: ../src/import-export/dialog-import.glade.h:21
 msgid ""
@@ -17454,14 +17546,14 @@ msgstr ""
 msgid "Select matching existing transaction"
 msgstr "Wählen Sie die zugeordnete, schon existierende Buchung"
 
+#Fixme: Source accelerator missing
 #: ../src/import-export/dialog-import.glade.h:25
-#, fuzzy
 msgid "Show Reconciled"
-msgstr "Abgeglichen"
+msgstr "Abgeglichene anzeigen"
 
 #: ../src/import-export/dialog-import.glade.h:26
 msgid "Imported transaction's first split:"
-msgstr "Erster Teil der importierten Buchung"
+msgstr "Erster Teil der importierten Buchung:"
 
 #: ../src/import-export/dialog-import.glade.h:27
 msgid "Potential splits matching the selected transaction: "
@@ -17479,7 +17571,8 @@ msgstr ""
 msgid ""
 "This transaction will be imported balanced (you may still want to double "
 "check the match or destination account)."
-msgstr "Diese Buchung wird ausgeglichen importiert."
+msgstr "Diese Buchung wird ausgeglichen importiert. Überprüfen Sie trotzdem "
+"die Zuordnung und das Gegenkonto."
 
 #: ../src/import-export/dialog-import.glade.h:30
 msgid "This transaction requires your intervention or it will NOT be imported."
@@ -17647,15 +17740,15 @@ msgstr ""
 "zusätzlichen Auszahlungsgebühren in Ihrer lokalen Währung angeben."
 
 #: ../src/import-export/gschemas/org.gnucash.dialogs.import.generic.gschema.xml.in.in.h:19
-#, fuzzy
 msgid "Display or hide reconciled matches"
-msgstr "Anzeigen des Abgleich-Datums?"
+msgstr "Anzeigen oder verbergen abgeglichener Treffer"
 
 #: ../src/import-export/gschemas/org.gnucash.dialogs.import.generic.gschema.xml.in.in.h:20
 msgid ""
 "Shows or hides transactions from the match picker which are already of some "
 "reconciled state."
-msgstr ""
+msgstr "Zeigt oder verbirgt Buchungen, welche vom Programm bereits als "
+"einander entsprechend betrachtet werden."
 
 #: ../src/import-export/import-account-matcher.c:118
 msgid "Account ID"
@@ -17772,19 +17865,17 @@ msgid "Confidence"
 msgstr "Genauigkeit"
 
 #: ../src/import-export/import-match-picker.c:438
-#, fuzzy
 msgid "Pending Action"
-msgstr "_Online Aktionen"
+msgstr "Ausstehende Aktion"
 
 #: ../src/import-export/import-pending-matches.c:194
-#, fuzzy
 msgid "Manual"
-msgstr "Jährlich"
+msgstr "Manuell"
 
 #: ../src/import-export/import-pending-matches.c:196
 #: ../src/report/business-reports/balsheet-eg.scm:332
 msgid "Auto"
-msgstr "automatisch"
+msgstr "Automatisch"
 
 #: ../src/import-export/log-replay/gnc-log-replay.c:570
 msgid "Select a .log file to replay"
@@ -17818,12 +17909,12 @@ msgstr ""
 
 #: ../src/import-export/log-replay/gnc-plugin-log-replay.c:48
 msgid "_Replay GnuCash .log file..."
-msgstr "Einträge aus Logdatei abspielen..."
+msgstr "Einträge aus _Logdatei einspielen..."
 
 #: ../src/import-export/log-replay/gnc-plugin-log-replay.c:49
 msgid "Replay a GnuCash log file after a crash. This cannot be undone."
 msgstr ""
-"Einträge aus Logdatei nach einem Programmabsturz abspielen. Dies kann nicht "
+"Einträge aus Logdatei nach einem Programmabsturz einspielen. Dies kann nicht "
 "rückgängig gemacht werden."
 
 #. As we now have the commodity, select the account with that commodity.
@@ -18020,7 +18111,7 @@ msgid ""
 "are no errors or warnings, you will automatically proceed to the next step. "
 "Otherwise, the details will be shown below for your review."
 msgstr ""
-"Sobald Sie den »Vor«-Knopf drücken, wird GnuCash Ihre QIF-Datei laden. Wenn "
+"Sobald Sie den »Start«-Knopf drücken, wird GnuCash Ihre QIF-Datei laden. Wenn "
 "dabei keine Fehler oder Warnungen auftreten, kommt der nächste Schritt. "
 "Andernfalls werden die Meldungen unten angezeigt."
 
@@ -18146,9 +18237,10 @@ msgstr ""
 "Sie können so viele Dateien laden, wie Sie möchten. Es ist also kein "
 "Problem, falls sich Ihre Daten in mehreren Dateien befinden.\n"
 
+# A ist bereits durch _Abbrechen in den Dialogen belegt
 #: ../src/import-export/qif-imp/assistant-qif-import.glade.h:12
 msgid "_Select..."
-msgstr "_Auswählen..."
+msgstr "Aus_wählen..."
 
 #: ../src/import-export/qif-imp/assistant-qif-import.glade.h:13
 msgid "Select a QIF file to load"
@@ -18477,7 +18569,7 @@ msgstr "_Importierte Buchungen, die durchgesehen werden müssen:"
 
 #: ../src/import-export/qif-imp/assistant-qif-import.glade.h:77
 msgid "_Possible matches for the selected transaction:"
-msgstr "Mögliche Duplikate für ausgewählte neue Buchungen"
+msgstr "Mögliche _Duplikate für ausgewählte neue Buchung:"
 
 #: ../src/import-export/qif-imp/assistant-qif-import.glade.h:78
 msgid "Select possible duplicates"
@@ -18585,7 +18677,7 @@ msgstr ""
 
 #: ../src/import-export/qif-imp/dialog-account-picker.glade.h:13
 msgid "_Select or add a GnuCash account:"
-msgstr "Auswählen oder Hinzufügen eines GnuCash Kontos"
+msgstr "Aus_wählen oder Hinzufügen eines GnuCash Kontos"
 
 #: ../src/import-export/qif-imp/gnc-plugin-qif-import.c:47
 msgid "Import _QIF..."
@@ -18924,7 +19016,7 @@ msgstr "Diese Zeilen wurden beim Importieren ignoriert"
 
 #: ../src/plugins/bi_import/gnc-plugin-bi-import.c:57
 msgid "Import Bills & Invoices..."
-msgstr "Rechnungen importieren..."
+msgstr "_Rechnungen importieren..."
 
 #: ../src/plugins/bi_import/gnc-plugin-bi-import.c:57
 msgid "Import bills and invoices from a CSV text file"
@@ -19033,15 +19125,18 @@ msgstr ""
 "   %u %s neu angelegt\n"
 "   %u %s aktualisiert (gemäß ID)"
 
+# Fixme: Source
 #. Menu Items
 #: ../src/plugins/customer_import/gnc-plugin-customer_import.c:56
 msgid "I_mport"
 msgstr "I_mport"
 
+# Fixme: Source
 #: ../src/plugins/customer_import/gnc-plugin-customer_import.c:57
 msgid "Import Customers and Vendors"
-msgstr "Importiert Kunden und Lieferanten"
+msgstr "Importiert K_unden und Lieferanten"
 
+# Fixme: Source
 #: ../src/plugins/customer_import/gnc-plugin-customer_import.c:57
 msgid "customer_import tooltip"
 msgstr ""
@@ -19071,7 +19166,6 @@ msgid "<b>3. Select import options</b>"
 msgstr "<b>3. Bestimmen Sie die Importoptionen</b>"
 
 #: ../src/plugins/customer_import/gtkbuilder/dialog-customer-import-gui.glade.h:14
-#, fuzzy
 msgid "<b>4. Preview</b>"
 msgstr "<b>4. Vorschau</b>"
 
@@ -19162,9 +19256,8 @@ msgstr "sample:Beschreibungsbeispiel einer Buchung"
 
 #: ../src/register/ledger-core/split-register-layout.c:698
 #: ../src/register/ledger-core/split-register-model.c:325
-#, fuzzy
 msgid "Associate:A"
-msgstr "Datei zuordnen"
+msgstr "Associate:Z"
 
 #: ../src/register/ledger-core/split-register-layout.c:706
 #: ../src/register/ledger-core/split-register-layout.c:746
@@ -20164,9 +20257,10 @@ msgstr ""
 "Keine gültige %s gewählt. Klicken Sie auf »Optionen«, um eine Firma zu "
 "wählen."
 
+# Fixme: Source Accelerator missing
 #: ../src/report/business-reports/customer-summary.scm:1031
 msgid "Customer Summary"
-msgstr "Kundenübersicht"
+msgstr "Kundenüber_sicht"
 
 #: ../src/report/business-reports/easy-invoice.scm:114
 #: ../src/report/business-reports/easy-invoice.scm:259
@@ -21513,15 +21607,15 @@ msgstr "Spalten"
 
 #: ../src/report/report-gnome/dialog-report.glade.h:1
 msgid "<b>A_vailable reports</b>"
-msgstr "<b>Verfügbare Berichte</b>"
+msgstr "<b>_Verfügbare Berichte</b>"
 
 #: ../src/report/report-gnome/dialog-report.glade.h:2
 msgid "<b>_Selected Reports</b>"
-msgstr "<b>Gewählte Berichte</b>"
+msgstr "<b>_Gewählte Berichte</b>"
 
 #: ../src/report/report-gnome/dialog-report.glade.h:3
 msgid "A_dd  >>"
-msgstr "Hinzufügen >>"
+msgstr "Hin_zufügen >>"
 
 #: ../src/report/report-gnome/dialog-report.glade.h:4
 msgid "<< _Remove"
@@ -22276,13 +22370,17 @@ msgstr ""
 "Zeige Zwischensummen für übergeordnete Konten gemäß Rechnungswesen-Stil "
 "eingerückt an. (experimentell)."
 
+# Hier ausnahmsweise "Aktiva & Passiva", die Seiten der Bilanz, 
+# da sich auch die Reinvermögen-Berichte darin befinden
 #: ../src/report/report-system/report.scm:65
 msgid "_Assets & Liabilities"
-msgstr "_Aktiva & Verbindlichkeiten"
+msgstr "_Aktiva & Passiva"
 
+# Fell: im Deutschen ist "Aufwand & Ertrag"
+# neben "Gewinn & Verust (GuV)" gebräuchlicher
 #: ../src/report/report-system/report.scm:66
 msgid "_Income & Expense"
-msgstr "_Ertrag & Aufwand"
+msgstr "Aufwand & _Ertrag"
 
 #: ../src/report/report-system/report.scm:68
 msgid "_Taxes"
@@ -22919,7 +23017,7 @@ msgstr ""
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:96
 msgid "LIFO"
-msgstr ""
+msgstr "LiFo"
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:97
 msgid "Use last-in first-out method for basis."
@@ -22935,24 +23033,26 @@ msgstr ""
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:109
 msgid "How to report commissions and other brokerage fees."
-msgstr ""
+msgstr "Wie sollen Kommissionen und andere Vermittlungsgebühren berücksichtigt "
+"werden?"
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:111
 msgid "Include in basis"
-msgstr "Schließt Bemessungsgrundlage ein"
+msgstr "In Bemessungsgrundlage einschließen"
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:112
 msgid "Include brokerage fees in the basis for the asset."
-msgstr "Schließt die Maklergebühr in die Basis für den Gewinn ein."
+msgstr "Schließt die Vermittlungsgebühren als Beschaffungskosten in die Basis "
+"der Anlage ein."
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:114
 msgid "Include in gain"
-msgstr "Schließt Gewinn ein"
+msgstr "Im Ertrag berücksichtigen"
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:115
 msgid "Include brokerage fees in the gain and loss but not in the basis."
 msgstr ""
-"Schließt Maklergebührt in Gewinn und Verlust ein, aber nicht in der "
+"Schließe Vermittlungsgebühren in Gewinn und Verlust ein, aber nicht in der "
 "Bemessungsgrundlage."
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:117
@@ -23058,7 +23158,8 @@ msgstr ""
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:1183
 msgid "** this commodity has no price and a price of 1 has been used."
-msgstr ""
+msgstr "** dieses Wertpapier hat keinen Kurs hinterlegt, daher wird dafür 1 "
+"verwendet."
 
 #: ../src/report/standard-reports/average-balance.scm:36
 msgid "Average Balance"
@@ -23708,9 +23809,8 @@ msgid "Cash Flow"
 msgstr "Kapitalfluss"
 
 #: ../src/report/standard-reports/cash-flow.scm:57
-#, fuzzy
 msgid "Include Trading Accounts in report"
-msgstr "Summe Devisenhandel anzeigen"
+msgstr "Handelskonten in den Bericht einschließen"
 
 #: ../src/report/standard-reports/cash-flow.scm:106
 msgid "Include transfers to and from Trading Accounts in the report."
@@ -24521,10 +24621,10 @@ msgstr ""
 "Formatiert die Tabelle passend zum Kopieren/Einfügen mit zusätzlichen "
 "Tabellenzellen."
 
+# Fixme: da gibt es bestimmt was Schöneres...
 #: ../src/report/standard-reports/transaction.scm:665
-#, fuzzy
 msgid "Account Substring"
-msgstr "Kontenauswahl"
+msgstr "Teilzeichenkette Konto"
 
 #: ../src/report/standard-reports/transaction.scm:671
 msgid "Filter on these accounts."
@@ -25850,7 +25950,8 @@ msgstr "Keine Hilfe verfügbar."
 #: ../src/gnome/gnucash.appdata.xml.in.h:1
 msgid ""
 "GnuCash is a program for personal and small-business financial-accounting."
-msgstr ""
+msgstr "GnuCash ist ein Buchhaltungsprogramm Privatpersonen und kleine "
+"Unternehmen."
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:2
 msgid ""
@@ -25859,40 +25960,46 @@ msgid ""
 "use as a checkbook register, it is based on professional accounting "
 "principles like double-entry accounting to ensure balanced books and "
 "accurate reports."
-msgstr ""
+msgstr "Enworfen, um einfach im Gebrauch zu sein, aber mächtig und flexibel, "
+"erlaubt GnuCash Ihnen den Überblick über Ihre Bankkonten wie Wertpapiere, "
+"Einkünte wie Aufwendungen zu behalten. So intuitiv und schnell zu benutzen "
+" wie ein Scheckbuchregister basiert es auf professionellen Prinzipien wie "
+"der doppelten Buchführung um ausgeglichene Bücher und präzise Berichte zu "
+"gewährleisten."
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:3
 msgid "With GnuCash you can (but are not limited to):"
-msgstr ""
+msgstr "Mit GnuCash können Sie neben Anderem:"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:4
 msgid "Keep track of your day to day personal income and expenses"
-msgstr ""
+msgstr "Die Übersicht über Ihre täglichen persönlichen Einnahmen und Ausgaben bewahren"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:5
 msgid "Manage your stock, bond and mutual fund accounts with ease"
-msgstr ""
+msgstr "Mit Leichtigkeit ihre Renten, Aktien und Fonds verwalten"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:6
 msgid "Keep your small business' accounting up to date"
-msgstr "Behalten Sie Ihre Buchhaltung aktuell"
+msgstr "Ihre kleine Geschäftsbuchhaltung auf dem Laufenden halten"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:7
 msgid "Create accurate reports and graphs from your financial data"
-msgstr ""
+msgstr "Präzise Berichte ind Grafiken ihrer Finanzdaten erzeugen"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:8
 msgid "Set up scheduled transactions to avoid repeated data entry"
 msgstr ""
 "Terminierte Buchungen einrichten, um wiederholte Dateneingabe zu vermeiden"
 
+# Fixme: expand Source
 #: ../src/gnome/gnucash.appdata.xml.in.h:9
 msgid "QIF/OFX/HBCI Import, Transaction Matching"
-msgstr ""
+msgstr "Datenaustausch via FinTS(HBCI)/SWIFT-MT9xx/QIF/OFX und Abgleich"
 
 #: ../src/gnome/gnucash.appdata.xml.in.h:10
 msgid "Perform financial calculations, such as a loan repayment"
-msgstr ""
+msgstr "Finanzkalkulationen ausführen wie Kredit-Rückzahlung"
 
 #: ../src/gnome/gnucash.desktop.in.in.h:1
 msgid "GnuCash"
@@ -25906,6 +26013,7 @@ msgstr "Finanzmanagement"
 msgid "Manage your finances, accounts, and investments"
 msgstr "Verwaltung der Finanzen von Privatanwendern und Kleinbetrieben."
 
+# Fixme: Source qofbookslots: All accelerators missing
 #: ../src/libqof/qof/qofbookslots.h:66
 msgid "Use Trading Accounts"
 msgstr "Devisenhandel-Konten benutzen"
@@ -26263,9 +26371,8 @@ msgstr ""
 #~ msgid "(USD)"
 #~ msgstr "(USD)"
 
-#, fuzzy
 #~ msgid "Retrieve the current online quote"
-#~ msgstr "Aktuellen Buchungsteil löschen"
+#~ msgstr "Aktuellen Kurs online abrufen"
 
 #~ msgid "Auto pay on post_ing"
 #~ msgstr "Automatisch durchbuchen"

commit 64cfab0508bd804b195032b4fa98ecbf48c8a92f
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 20 11:33:54 2017 +0200

    Fix wiki link

diff --git a/src/engine/ScrubBusiness.c b/src/engine/ScrubBusiness.c
index aa48ea3..2a1be67 100644
--- a/src/engine/ScrubBusiness.c
+++ b/src/engine/ScrubBusiness.c
@@ -519,7 +519,7 @@ gncScrubBusinessLot (GNCLot *lot)
 gboolean
 gncScrubBusinessSplit (Split *split)
 {
-    const gchar *memo = _("Please delete this transaction. Explanation at http://wiki.gnucash.org/wiki/Business_Features_Issues#Double_Posting");
+    const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
     Transaction *txn;
     gboolean deleted_split = FALSE;
 

commit e26c55e6cb1b7c26c7cea2ef57a2d99fdbc2b105
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Fri Oct 13 10:35:09 2017 +0200

    update de.po to commit f283437

diff --git a/po/de.po b/po/de.po
index a5d6b6f..a1c0f5f 100644
--- a/po/de.po
+++ b/po/de.po
@@ -15,7 +15,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: GnuCash 2.6.15\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2017-09-11 02:57+0200\n"
+"POT-Creation-Date: 2017-10-13 10:24+0200\n"
 "PO-Revision-Date: 2017-09-11 04:33+0200\n"
 "Last-Translator: Mechtilde <ooo at mechtilde.de>\n"
 "Language-Team: GnuCash-de <gnucash-de at gnucash.org>\n"
@@ -27,12 +27,12 @@ msgstr ""
 "X-Generator: Lokalize 1.5\n"
 
 #. Business options
-#: ../src/app-utils/app-utils.scm:304
+#: ../src/app-utils/app-utils.scm:305
 #: ../src/business/business-gnome/gncmod-business-gnome.c:117
 msgid "Business"
 msgstr "Geschäft"
 
-#: ../src/app-utils/app-utils.scm:305
+#: ../src/app-utils/app-utils.scm:306
 #: ../src/business/business-gnome/dialog-customer.c:923
 #: ../src/business/business-gnome/dialog-vendor.c:726
 #: ../src/gnome-utils/gnc-tree-view-owner.c:380
@@ -41,31 +41,31 @@ msgstr "Geschäft"
 msgid "Company Name"
 msgstr "Firmenname"
 
-#: ../src/app-utils/app-utils.scm:306
+#: ../src/app-utils/app-utils.scm:307
 msgid "Company Address"
 msgstr "Firmenadresse"
 
-#: ../src/app-utils/app-utils.scm:307
+#: ../src/app-utils/app-utils.scm:308
 msgid "Company ID"
 msgstr "Firmennummer"
 
-#: ../src/app-utils/app-utils.scm:308
+#: ../src/app-utils/app-utils.scm:309
 msgid "Company Phone Number"
 msgstr "Firmentelefonnummer"
 
-#: ../src/app-utils/app-utils.scm:309
+#: ../src/app-utils/app-utils.scm:310
 msgid "Company Fax Number"
 msgstr "Firmenfaxnummer"
 
-#: ../src/app-utils/app-utils.scm:310
+#: ../src/app-utils/app-utils.scm:311
 msgid "Company Website URL"
 msgstr "Firmenwebseite URL"
 
-#: ../src/app-utils/app-utils.scm:311
+#: ../src/app-utils/app-utils.scm:312
 msgid "Company Email Address"
 msgstr "Firmen-E-Mail-Adresse"
 
-#: ../src/app-utils/app-utils.scm:312
+#: ../src/app-utils/app-utils.scm:313
 msgid "Company Contact Person"
 msgstr "Firmen Ansprechpartner"
 
@@ -842,7 +842,7 @@ msgstr "Soll"
 msgid "Credit"
 msgstr "Haben"
 
-#: ../src/app-utils/option-util.c:1685
+#: ../src/app-utils/option-util.c:1656
 #, c-format
 msgid ""
 "There is a problem with option %s:%s.\n"
@@ -2015,7 +2015,7 @@ msgstr "Gutschrift?"
 #: ../src/gnome/dialog-lot-viewer.c:931 ../src/gnome/reconcile-view.c:373
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:2992
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3004
-#: ../src/import-export/aqb/dialog-ab.glade.h:35
+#: ../src/import-export/aqb/dialog-ab.glade.h:39
 #: ../src/import-export/import-main-matcher.c:467
 #: ../src/import-export/import-match-picker.c:394
 #: ../src/import-export/import-match-picker.c:434
@@ -11059,31 +11059,31 @@ msgid "Select the default selection."
 msgstr "Die voreingestellte Auswahl auswählen."
 
 #. The reset button on each option page
-#: ../src/gnome-utils/dialog-options.c:1131
+#: ../src/gnome-utils/dialog-options.c:1136
 msgid "Reset defaults"
 msgstr "Voreinstellungen"
 
-#: ../src/gnome-utils/dialog-options.c:1133
+#: ../src/gnome-utils/dialog-options.c:1138
 msgid "Reset all values to their defaults."
 msgstr "Alle Werte auf ihre Voreinstellung zurücksetzen."
 
-#: ../src/gnome-utils/dialog-options.c:1459
+#: ../src/gnome-utils/dialog-options.c:1464
 msgid "Page"
 msgstr "Seite"
 
-#: ../src/gnome-utils/dialog-options.c:2139
+#: ../src/gnome-utils/dialog-options.c:2144
 msgid "Clear"
 msgstr "Zurücksetzen"
 
-#: ../src/gnome-utils/dialog-options.c:2140
+#: ../src/gnome-utils/dialog-options.c:2145
 msgid "Clear any selected image file."
 msgstr "Auswahl der Bilddatei wieder löschen."
 
-#: ../src/gnome-utils/dialog-options.c:2142
+#: ../src/gnome-utils/dialog-options.c:2147
 msgid "Select image"
 msgstr "Bild auswählen"
 
-#: ../src/gnome-utils/dialog-options.c:2144
+#: ../src/gnome-utils/dialog-options.c:2149
 msgid "Select an image file."
 msgstr "Bilddatei auswählen."
 
@@ -15762,127 +15762,163 @@ msgid "Confirm Password:"
 msgstr "Passwort bestätigen:"
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:21
-msgid "Remember _PIN"
-msgstr "_PIN merken"
+#, fuzzy
+msgid "Remember the _PIN in memory"
+msgstr "HBCI PIN im Speicher merken"
 
 #: ../src/import-export/aqb/dialog-ab.glade.h:22
+#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:6
+msgid ""
+"If active, the PIN for HBCI/AqBanking actions will be remembered in memory "
+"during a session. Otherwise it will have to be entered again each time "
+"during a session when it is needed."
+msgstr ""
+"Wenn aktiviert, wird die PIN (Persönliche Identifikationsnummer) für HBCI/"
+"AqBanking während einer Programmbenutzung im Speicher zwischengespeichert. "
+"Wenn nicht aktiviert, muss die PIN bei jeder einzelnen Aktion von HBCI/"
+"AqBanking eingegeben werden und wird nicht im Speicher gehalten."
+
+#: ../src/import-export/aqb/dialog-ab.glade.h:23
 msgid "<b>Online Banking</b>"
 msgstr "<b>Onlinebanking</b>"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:23
+#: ../src/import-export/aqb/dialog-ab.glade.h:24
 msgid "_Close log window when finished"
 msgstr "Fenster nach Verbindungsende _schließen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:24
+#: ../src/import-export/aqb/dialog-ab.glade.h:25
+#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:4
+msgid ""
+"If active, the window will be closed automatically when you finish the HBCI/"
+"AqBanking import process. Otherwise it will stay open."
+msgstr ""
+"Wenn aktiviert, wird das Fenster automatisch geschlossen, wenn der HBCI/"
+"AqBanking-Import beendet ist. Andernfalls bleibt das Fenster geöffnet."
+
+#: ../src/import-export/aqb/dialog-ab.glade.h:26
 #, fuzzy
 msgid "Use Non-SWIFT _transaction text"
 msgstr "Verwende das dem Buchungsdatum nächste Datum."
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:25
+#: ../src/import-export/aqb/dialog-ab.glade.h:27
+#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:8
+msgid ""
+"Some banks place part of transaction description as \"transaction text\" in "
+"the MT940 file. Normally GNUcash ignores this text. However by activating "
+"this option, the transaction text is used for the transaction description "
+"too."
+msgstr ""
+
+#: ../src/import-export/aqb/dialog-ab.glade.h:28
 msgid "_Verbose debug messages"
 msgstr "Ausführliche _Fehlermeldungen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:26
+#: ../src/import-export/aqb/dialog-ab.glade.h:29
+#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:10
+msgid "Enables verbose debug messages for HBCI/AqBanking Online Banking."
+msgstr "Ausführliche Fehlermeldungen für HBCI Online Banking aktivieren."
+
+#: ../src/import-export/aqb/dialog-ab.glade.h:30
 msgid "Name for new template"
 msgstr "Namen für neue Überweisungsvorlage"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:27
+#: ../src/import-export/aqb/dialog-ab.glade.h:31
 msgid "Enter name for new template:"
 msgstr "Bitte geben Sie einen Namen für die neue Überweisungsvorlage ein:"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:28
+#: ../src/import-export/aqb/dialog-ab.glade.h:32
 msgid "Online Transaction"
 msgstr "Online-Auftrag Einzelüberweisung"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:29
+#: ../src/import-export/aqb/dialog-ab.glade.h:33
 msgid "Enter an Online Transaction"
 msgstr "Online-Ãœberweisung eingeben"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:30
+#: ../src/import-export/aqb/dialog-ab.glade.h:34
 msgid "Recipient Account Number"
 msgstr "Konto-Nr. des Empfängers"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:31
+#: ../src/import-export/aqb/dialog-ab.glade.h:35
 msgid "Recipient Bank Code"
 msgstr "Bankleitzahl"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:32
+#: ../src/import-export/aqb/dialog-ab.glade.h:36
 msgid "Recipient Name"
 msgstr "Empfänger: Name, Vorname / Firma"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:33
+#: ../src/import-export/aqb/dialog-ab.glade.h:37
 msgid "at Bank"
 msgstr "der Bank"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:34
+#: ../src/import-export/aqb/dialog-ab.glade.h:38
 msgid "(filled in automatically)"
 msgstr "(wird automatisch ausgefüllt)"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:36
+#: ../src/import-export/aqb/dialog-ab.glade.h:40
 msgid "Payment Purpose (only for recipient)"
 msgstr "Verwendungszweck - z.B. Kunden-Referenznummer - (nur für Empfänger)"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:37
+#: ../src/import-export/aqb/dialog-ab.glade.h:41
 msgid "Payment Purpose continued"
 msgstr "noch Verwendungszweck (ggf. noch Anschrift des Auftraggebers)"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:38
+#: ../src/import-export/aqb/dialog-ab.glade.h:42
 msgid "Originator Name"
 msgstr "Auftraggeber: Name, Vorname"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:39
+#: ../src/import-export/aqb/dialog-ab.glade.h:43
 msgid "something"
 msgstr "irgendwas"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:40
+#: ../src/import-export/aqb/dialog-ab.glade.h:44
 msgid "Originator Account Number"
 msgstr "Konto-Nr. des Auftraggebers"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:41
+#: ../src/import-export/aqb/dialog-ab.glade.h:45
 msgid "Bank Code"
 msgstr "Bankleitzahl"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:42
+#: ../src/import-export/aqb/dialog-ab.glade.h:46
 msgid "Add the current online transaction as a new transaction template"
 msgstr "Aktuelle Online-Buchung als neue Überweisungsvorlage hinzufügen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:43
+#: ../src/import-export/aqb/dialog-ab.glade.h:47
 msgid "Add current"
 msgstr "Aktuelle hinzufügen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:44
+#: ../src/import-export/aqb/dialog-ab.glade.h:48
 msgid "Move the selected transaction template one row up"
 msgstr "Gewählte Überweisungsvorlage eine Zeile nach oben umsortieren"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:45
+#: ../src/import-export/aqb/dialog-ab.glade.h:49
 msgid "Move the selected transaction template one row down"
 msgstr "Gewählte Überweisungsvorlage eine Zeile nach unten umsortieren"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:46
+#: ../src/import-export/aqb/dialog-ab.glade.h:50
 msgid "Sort the list of transaction templates alphabetically"
 msgstr "Die Liste der Ãœberweisungsvorlagen alphabetisch sortieren"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:47
+#: ../src/import-export/aqb/dialog-ab.glade.h:51
 msgid "Sort"
 msgstr "Sortieren"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:48
+#: ../src/import-export/aqb/dialog-ab.glade.h:52
 msgid "Delete the currently selected transaction template"
 msgstr "Ausgewählte Überweisungsvorlage löschen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:49
+#: ../src/import-export/aqb/dialog-ab.glade.h:53
 msgid "Templates"
 msgstr "Vorlagen"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:50
+#: ../src/import-export/aqb/dialog-ab.glade.h:54
 msgid "Execute later (unimpl.)"
 msgstr "Später ausführen (unfertig)"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:51
+#: ../src/import-export/aqb/dialog-ab.glade.h:55
 msgid "Execute this online transaction now"
 msgstr "Diesen Auftrag jetzt online abschicken"
 
-#: ../src/import-export/aqb/dialog-ab.glade.h:52
+#: ../src/import-export/aqb/dialog-ab.glade.h:56
 msgid "Execute Now"
 msgstr "Jetzt ausführen"
 
@@ -16480,29 +16516,10 @@ msgstr "Online-Banking Verlaufsfenster anzeigen"
 msgid "Close window when finished"
 msgstr "Fenster nach Verbindungsende schließen"
 
-#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:4
-msgid ""
-"If active, the window will be closed automatically when you finish the HBCI/"
-"AqBanking import process. Otherwise it will stay open."
-msgstr ""
-"Wenn aktiviert, wird das Fenster automatisch geschlossen, wenn der HBCI/"
-"AqBanking-Import beendet ist. Andernfalls bleibt das Fenster geöffnet."
-
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:5
 msgid "Remember the PIN in memory"
 msgstr "HBCI PIN im Speicher merken"
 
-#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:6
-msgid ""
-"If active, the PIN for HBCI/AqBanking actions will be remembered in memory "
-"during a session. Otherwise it will have to be entered again each time "
-"during a session when it is needed."
-msgstr ""
-"Wenn aktiviert, wird die PIN (Persönliche Identifikationsnummer) für HBCI/"
-"AqBanking während einer Programmbenutzung im Speicher zwischengespeichert. "
-"Wenn nicht aktiviert, muss die PIN bei jeder einzelnen Aktion von HBCI/"
-"AqBanking eingegeben werden und wird nicht im Speicher gehalten."
-
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:7
 #, fuzzy
 msgid "Put the transaction text in front of the purpose of a transaction."
@@ -16510,22 +16527,10 @@ msgstr ""
 "Alle Buchungssätze außer dem aktuellen einzeilig anzeigen. Den aktuellen "
 "Buchungssatz vollständig anzeigen."
 
-#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:8
-msgid ""
-"Some banks place part of transaction description as \"transaction text\" in "
-"the MT940 file. Normally GNUcash ignores this text. However by activating "
-"this option, the transaction text is used for the transaction description "
-"too."
-msgstr ""
-
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:9
 msgid "Verbose HBCI debug messages"
 msgstr "Ausführliche HBCI-Fehlermeldungen"
 
-#: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:10
-msgid "Enables verbose debug messages for HBCI/AqBanking Online Banking."
-msgstr "Ausführliche Fehlermeldungen für HBCI Online Banking aktivieren."
-
 #: ../src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in.h:11
 msgid "DTAUS import data format"
 msgstr "DTAUS-Import Dateiformat"
@@ -26202,6 +26207,9 @@ msgstr ""
 "wählen Sie im Menü 'Fenster -> Neues Fenster mit Seite', um diesen Reiter in "
 "einem neuen Fenster anzuzeigen "
 
+#~ msgid "Remember _PIN"
+#~ msgstr "_PIN merken"
+
 #~ msgid "CURRENCY"
 #~ msgstr "WÄHRUNG"
 

commit f2834377bc32a60f7de377900ad586f505da26a4
Merge: 3cdac65 0b3da70
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Wed Oct 11 23:07:55 2017 +0200

    Merge branch 'maint' of https://github.com/DiMan/Gnucash into maint


commit 0b3da701238dab938ec70de6f830672807d13d03
Author: Di Mang <dimang.freenet at gmail.com>
Date:   Sat Oct 7 02:28:44 2017 +0200

    Adjustment of some Russian translations

diff --git a/po/ru.po b/po/ru.po
index 4a6dbbc..8451a09 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -9,14 +9,15 @@
 # Sergey Belyashov <Sergey.Belyashov at gmail.com>, 2009, 2011.
 # Dmitry Pavlov  <zeldigas at gmail.com>, 2014.
 # ashed <craysy at gmail.com>, 2017
+# Dmitriy Mangul <dimang.freetime at gmail.com>, 2017
 msgid ""
 msgstr ""
 "Project-Id-Version: GnuCash 2.6.18\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-10-02 06:36+0200\n"
 "PO-Revision-Date: 2017-10-01 04:09+0500\n"
-"Last-Translator: ashed <craysy at gmail.com>\n"
-"Language-Team: russian <ru at li.org>\n"
+"Last-Translator: Dmitriy Mangul <dimang.freetime at gmail.com>\n"
+"Language-Team: russian <gnucash-ru at googlegroups.com>\n"
 "Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -47,7 +48,7 @@ msgstr "Адрес фирмы"
 
 #: ../src/app-utils/app-utils.scm:308
 msgid "Company ID"
-msgstr "ID фирмы"
+msgstr "Идентификатор фирмы"
 
 #: ../src/app-utils/app-utils.scm:309
 msgid "Company Phone Number"
@@ -71,7 +72,7 @@ msgstr "Контактное лицо фирмы"
 
 #: ../src/app-utils/business-prefs.scm:24
 msgid "Counters"
-msgstr "Счётчики"
+msgstr "Номера"
 
 #: ../src/app-utils/business-prefs.scm:31
 msgid "Customer number format"
@@ -296,7 +297,7 @@ msgstr "URL адрес вашего сайта."
 
 #: ../src/app-utils/business-prefs.scm:107
 msgid "The ID for your company (eg 'Tax-ID: 00-000000)."
-msgstr "ID вашей фирмы (например 'Tax-ID:00-000000)."
+msgstr "Идентификатор вашей фирмы (например 'Tax-ID:00-000000)."
 
 #: ../src/app-utils/business-prefs.scm:112
 msgid "Default Customer TaxTable"
@@ -316,11 +317,11 @@ msgstr "Таблица налогов применяемая по умолчан
 
 #: ../src/app-utils/business-prefs.scm:124
 msgid "Fancy Date Format"
-msgstr "Современный формат даты"
+msgstr "Расширенный формат даты"
 
 #: ../src/app-utils/business-prefs.scm:125
 msgid "The default date format used for fancy printed dates."
-msgstr "Формат даты используемый для печати современных дат"
+msgstr "Настройки для печати даты в расширенном формате."
 
 #: ../src/app-utils/business-prefs.scm:133
 msgid ""
@@ -339,9 +340,10 @@ msgid ""
 msgstr ""
 "Укажите число дней после истечения которых проводки будут доступны только "
 "для просмотра и не смогут быть отредактированы. Эта граница помечена красной "
-"линией в окне журнала проводок. Если значение установлено в 0, все "
-"транзакции можно изменять."
+"линией в окне журнала проводок. Если установлено значение 0, то можно изменять "
+"все транзакции."
 
+# TODO: check translation
 # "Отметьте для размещения поля с типом проводки,  для ввода номеров проводок. "
 # "Номер проводки отображаемый как \"№\" на второй строке реестра"
 #: ../src/app-utils/business-prefs.scm:150
@@ -358,7 +360,7 @@ msgstr ""
 
 #: ../src/app-utils/business-prefs.scm:158
 msgid "Budget to be used when none has been otherwise specified."
-msgstr "Используемый бюджет, если явно не указано."
+msgstr "Бюджет, который будет использоваться по умолчанию, если не указано что-то другое."
 
 #: ../src/app-utils/date-utilities.scm:122
 #: ../src/report/standard-reports/account-piecharts.scm:470
@@ -841,7 +843,6 @@ msgstr ""
 #: ../src/app-utils/prefs.scm:63
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3184
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3191
-#, fuzzy
 msgid "Funds In"
 msgstr "Средства в"
 
@@ -990,7 +991,6 @@ msgstr "Счёт-фактура"
 #: ../src/app-utils/prefs.scm:80
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3103
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3110
-#, fuzzy
 msgid "Funds Out"
 msgstr "Средства из"
 
@@ -1199,7 +1199,7 @@ msgid ""
 "This copy was built from %s rev %s on %s."
 msgstr ""
 "%s\n"
-"Эта копия собрана из %s, ревизия %s. Дата сборки %s."
+"Эта копия собрана из %s, ревизия %s. \nДата сборки %s."
 
 #: ../src/bin/gnucash-bin.c:458
 #, c-format
@@ -1334,7 +1334,7 @@ msgstr "Нет такого счета: %s"
 
 #: ../src/business/business-gnome/dialog-billterms.c:265
 msgid "Discount days cannot be more than due days."
-msgstr "Дни скидок не могут быть больше, чем в выходные дни."
+msgstr "Дисконтных дней не может быть больше, чем дней для оплаты."
 
 #: ../src/business/business-gnome/dialog-billterms.c:324
 msgid "You must provide a name for this Billing Term."
@@ -1397,7 +1397,7 @@ msgid ""
 "below."
 msgstr ""
 "Эта проводка должна быть назначена поставщику. Пожалуйста, выберите "
-"поставщика ниже."
+"Поставщика ниже."
 
 #: ../src/business/business-gnome/dialog-customer.c:329
 msgid ""
@@ -2307,7 +2307,7 @@ msgstr "Открыть диалог создания новых операций
 #: ../src/business/business-gnome/gnc-plugin-business.c:185
 #: ../src/business/business-gnome/gnc-plugin-business.c:228
 msgid "Find Jo_b..."
-msgstr "Найти _задачу..."
+msgstr "Найти о_перацию..."
 
 #: ../src/business/business-gnome/gnc-plugin-business.c:186
 #: ../src/business/business-gnome/gnc-plugin-business.c:229
@@ -2979,7 +2979,7 @@ msgid ""
 "well. Otherwise they are not shown."
 msgstr ""
 "При включении, отображаются дополнительные кнопки для стандартных бизнес "
-"операций. В противном случае они не показываются"
+"операций. В противном случае они не показываются."
 
 #: ../src/business/business-gnome/gschemas/org.gnucash.dialogs.business.gschema.xml.in.in.h:11
 #: ../src/business/business-gnome/gtkbuilder/business-prefs.glade.h:23
@@ -3203,7 +3203,7 @@ msgstr "Подтвердить этот срок оплаты"
 
 #: ../src/business/business-gnome/gtkbuilder/dialog-billterms.glade.h:3
 msgid "<b>Term Definition</b>"
-msgstr "<b>Определение срока</b>"
+msgstr "<b>Параметры срока</b>"
 
 #: ../src/business/business-gnome/gtkbuilder/dialog-billterms.glade.h:4
 msgid "De_scription:"
@@ -9172,7 +9172,7 @@ msgstr "Конец"
 # Частичное гашение долга
 #: ../src/gnome/gtkbuilder/dialog-fincalc.glade.h:21
 msgid "<b>Compounding:</b>"
-msgstr "<b>Компаундинг:</b>"
+msgstr "<b>Начисление процентов:</b>"
 
 #: ../src/gnome/gtkbuilder/dialog-fincalc.glade.h:22
 msgid "<b>Period:</b>"
@@ -12026,7 +12026,7 @@ msgstr "Настройки книги"
 #: ../src/gnome-utils/gnc-main-window.c:4370
 msgid "The GnuCash personal finance manager. The GNU way to manage your money!"
 msgstr ""
-"Персональный финансовый менеджер GnuCash. GNU-способ распоряжения вашими "
+"Персональный финансовый менеджер GnuCash. \nGNU-способ распоряжения вашими "
 "деньгами!"
 
 #: ../src/gnome-utils/gnc-main-window.c:4372
@@ -12046,7 +12046,8 @@ msgstr ""
 "Владимир Турбаевский\n"
 "Сергей Беляшов\n"
 "Дмитрий Павлов <zeldigas at gmail.com>\n"
-"ashed <craysy at gmail.com>"
+"ashed <craysy at gmail.com>\n"
+"Дмитрий Мангул <dimang.freetime at gmail.com>"
 
 #: ../src/gnome-utils/gnc-period-select.c:73
 msgid "Start of this quarter"
@@ -12509,7 +12510,7 @@ msgstr "_Пересчитать"
 #: ../src/report/standard-reports/transaction.scm:954
 #: ../src/report/standard-reports/trial-balance.scm:664
 msgid "Account Name"
-msgstr "Название счета"
+msgstr "Название счёта"
 
 #: ../src/gnome-utils/gnc-tree-view-account.c:730
 #: ../src/gnome-utils/gnc-tree-view-split-reg.c:3016
@@ -12527,7 +12528,7 @@ msgstr "Товар"
 #: ../src/report/standard-reports/transaction.scm:790
 #: ../src/report/standard-reports/transaction.scm:956
 msgid "Account Code"
-msgstr "Код счета"
+msgstr "Код счёта"
 
 #: ../src/gnome-utils/gnc-tree-view-account.c:748
 msgid "Last Num"
@@ -13979,7 +13980,7 @@ msgstr "<b>Дополнение даты</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:60
 msgid "When a date is entered without year, it should be taken:"
-msgstr "Если дата введена без года, то она должна быть взята:"
+msgstr "Если дата введена без года, то она должна быть дополнена:"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:62
 msgid ""
@@ -14285,7 +14286,7 @@ msgstr "<b>Стиль по умолчанию</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:146
 msgid "<b>Other Defaults</b>"
-msgstr "<b>Другие Умолчания</b>"
+msgstr "<b>Другие Настройки</b>"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:147
 msgid "_Basic ledger"
@@ -14361,7 +14362,7 @@ msgstr "Отображать даты создания и согласовани
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:171
 msgid "Register Defaults"
-msgstr "Умолчания журнала"
+msgstr "Настройки журнала"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:174
 msgid "<b>Default Report Currency</b>"
@@ -14523,7 +14524,7 @@ msgstr "_Название: "
 
 #: ../src/gnome-utils/gtkbuilder/dialog-tax-table.glade.h:7
 msgid "Tax Tables"
-msgstr "<b>Таблицы налогов</b>"
+msgstr "Таблицы налогов"
 
 #: ../src/gnome-utils/gtkbuilder/dialog-tax-table.glade.h:8
 msgid "<b>Tax Tables</b>"
@@ -14638,19 +14639,19 @@ msgstr "%Y-%m-%d"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:5
 msgid "Include Century"
-msgstr "Включить век"
+msgstr "Указывать век"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:7
 msgid "Abbreviation"
-msgstr "Аббревиатура"
+msgstr "Сокращение"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:9
 msgid "Months:"
-msgstr "Месяцы:"
+msgstr "Месяца:"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:10
 msgid "Years:"
-msgstr "Годы:"
+msgstr "Года:"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:11
 #: ../src/import-export/dialog-import.glade.h:5
@@ -14683,7 +14684,7 @@ msgstr "UTC - Скоординированное универсальное вр
 
 #: ../src/gnome-utils/gtkbuilder/gnc-date-format.glade.h:21
 msgid "No Fancy Date Format"
-msgstr "Нет Современного формата даты"
+msgstr "Нет расширенного формата даты"
 
 #: ../src/gnome-utils/gtkbuilder/gnc-frequency.glade.h:3
 msgid "Not scheduled"
@@ -25691,7 +25692,7 @@ msgstr "Использовать торговые счета"
 
 #: ../src/libqof/qof/qofbookslots.h:67
 msgid "Day Threshold for Read-Only Transactions (red line)"
-msgstr "Граница начала неизм-х проводок в днях (красн. линия)"
+msgstr "Дневной лимит для неизменяемых проводок (красная линия)"
 
 #: ../src/libqof/qof/qofbookslots.h:68
 msgid "Use Split Action Field for Number"
@@ -25720,7 +25721,7 @@ msgid ""
 "The GnuCash online manual has lots of helpful information. You can access "
 "the manual under the Help menu."
 msgstr ""
-"Онлайновое руководство по GnuCash содержит много полезной информации. "
+"Практическое руководство по GnuCash содержит много полезной информации. "
 "Получить доступ к руководству можно через меню \"Справка\"."
 
 #: ../doc/tip_of_the_day.list.in:4
@@ -25731,7 +25732,7 @@ msgid ""
 "follow the instructions provided."
 msgstr ""
 "Вы можете очень просто импортировать имеющиеся у вас финансовые данные из "
-"таких программ, как Qucken, MS Money и других, позволяющих экспортировать в "
+"таких программ, как Quicken, MS Money и других, позволяющих экспортировать данные в "
 "формат файлов QIF или OFX. В меню \"Файл\" выберите подменю \"Импорт\" и "
 "выберите нужный файл QIF или OFX. Далее следуйте предложенным инструкциям."
 
@@ -25745,7 +25746,7 @@ msgstr ""
 "Если вы уже работали с другими финансовыми программами, такими как Quicken, "
 "заметьте, что GnuCash использует счета вместо категорий для отслеживания "
 "приходов и расходов. За дополнительной информацией о счетах Приход и Расход, "
-"пожалуйста, обращайтесь к онлайновому руководству GnuCash."
+"пожалуйста, обращайтесь к практическому руководству GnuCash."
 
 #: ../doc/tip_of_the_day.list.in:14
 msgid ""
@@ -25757,7 +25758,7 @@ msgstr ""
 "Создавайте новые счета нажатием кнопки \"Новый\" на панели инструментов "
 "главного окна. Это вызовет появление диалога, где вы сможете указать "
 "различные параметры счёта. За дополнительной информацией по выбору типа "
-"счёта или настройке плана счетов, обращайтесь к онлайновому руководству "
+"счёта или настройке плана счетов, обращайтесь к практическому руководству "
 "GnuCash."
 
 #: ../doc/tip_of_the_day.list.in:20
@@ -25778,9 +25779,9 @@ msgid ""
 "View menu, you can choose the register style Auto-Split Ledger or "
 "Transaction Journal."
 msgstr ""
-"Чтобы ввести проводку, состоящую из нескольких частей, такую как Платёж по "
+"Чтобы ввести проводку, состоящую из нескольких частей, такую как платёж по "
 "чеку с различными удержаниями, нажмите кнопку \"Части\" на панели "
-"инструментов. Также вы можете выбрать стиль журнала в меню \"Вид\",например "
+"инструментов. Также вы можете выбрать стиль журнала в меню \"Вид\", например "
 "\"Авторазворачиваемый\" или \"Журнал проводок\"."
 
 #: ../doc/tip_of_the_day.list.in:30
@@ -25803,8 +25804,8 @@ msgid ""
 "was last entered."
 msgstr ""
 "Быстрое заполнение упрощает ввод повторяющихся проводок. Когда вы набираете "
-"первые буквы описания какой-либо частой проводки, GnuCash будет "
-"автоматически дополнять оставшуюся часть описания так, как она была введена "
+"первые буквы описания какой-либо частой проводки, GnuCash "
+"автоматически дополняет оставшуюся часть описания так, как она была введена "
 "до этого."
 
 #: ../doc/tip_of_the_day.list.in:40
@@ -25817,8 +25818,8 @@ msgid ""
 msgstr ""
 "Наберите первые несколько букв существующего имени счёта в колонке \"Передать"
 "\" журнала проводок, и GnuCash завершит название из вашего списка счетов. "
-"Для подсчетов, наберите первые буквы родительского счёта, затем символ "
-"двоеточия и первые буквы субсчетов (например, А:Н для получения Активы:"
+"Для субсчетов, наберите первые буквы родительского счёта, затем символ "
+"двоеточия и первые буквы субсчёта (например, А:Н для получения Активы:"
 "Наличные)."
 
 #: ../doc/tip_of_the_day.list.in:46
@@ -25828,8 +25829,8 @@ msgid ""
 "Edit -> Open Subaccounts from the menu."
 msgstr ""
 "Желаете увидеть все проводки субсчетов в одном журнале? Во вкладке Счета "
-"главного окна выделите родительский счёт и выберите из меню Правка -> "
-"Открыть субсчета."
+"главного окна выделите родительский счёт и выберите из меню \"Правка\" -> "
+"\"Открыть субсчета\"."
 
 #: ../doc/tip_of_the_day.list.in:50
 msgid ""
@@ -25886,7 +25887,7 @@ msgid ""
 "report as a report option, and use the Edit -> Style Sheets menu to "
 "customize style sheets."
 msgstr ""
-"Стили оформления действуют на то, как будут показываться отчеты. Выберите "
+"Стили оформления влияют на то, как будут показываться отчеты. Выберите "
 "стиль оформления для вашего отчета и используйте меню \"Правка\" - \"Стили "
 "оформления\" для его настройки."
 
@@ -25964,7 +25965,7 @@ msgid ""
 "from the main accounts hierarchy page. To limit your search to a single "
 "account, start the search from that account's register."
 msgstr ""
-"Для поиска по всем транзакциям, откройте диалог поиска (Правка -> Найти...) "
+"Для поиска по всем транзакциям, откройте диалог поиска (\"Правка\" -> \"Найти...\") "
 "со страницы иерархии счетов. Чтобы искать в пределах одного счета, откройте "
 "диалог поиска со страницы журнала этого счета."
 
@@ -25974,8 +25975,8 @@ msgid ""
 "select Window -> New Window with Page from the menu to duplicate that tab in "
 "a new window."
 msgstr ""
-"Чтобы визуально сравнить на экране содержимое двух вкладок в одной из "
-"вкладок, выберите Окно -> Новое окно со страницей из меню, чтобы дублировать "
+"Чтобы визуально сравнить на экране содержимое двух вкладок, выберите в одной из "
+"вкладок \"Окно\" -> \"Новое окно со страницей\" из меню, чтобы продублировать "
 "эту вкладку в новом окне."
 
 #~ msgid "Dummy message"



Summary of changes:
 data/accounts/de_DE/acctchrt_skr03.gnucash-xea     |   4 +-
 gnucash/gnome-search/dialog-search.c               |   1 +
 gnucash/gnome-utils/gnc-tree-control-split-reg.c   |   1 +
 .../gtkbuilder/dialog-preferences.glade            |  26 +-
 gnucash/gnome/gnc-plugin-page-register.c           |   4 +-
 gnucash/gnome/gnc-split-reg.c                      |   4 +-
 .../gtkbuilder/gnc-plugin-page-register.glade      |  22 +-
 .../csv-exp/csv-transactions-export.c              |   9 +-
 gnucash/import-export/dialog-import.glade          |  24 +-
 .../register/ledger-core/split-register-layout.c   |  21 +-
 libgnucash/backend/dbi/gnc-backend-dbi.cpp         |  29 +-
 libgnucash/backend/dbi/gnc-dbisqlresult.cpp        |  17 +-
 libgnucash/engine/ScrubBusiness.c                  |   2 +-
 po/de.po                                           | 775 ++++++++++++---------
 po/glossary/ar.po                                  |  24 +-
 po/glossary/bg.po                                  |  31 +-
 po/glossary/ca.po                                  |  33 +-
 po/glossary/da.po                                  |  31 +-
 po/glossary/de.po                                  |  33 +-
 po/glossary/de_CH.po                               |  31 +-
 po/glossary/el.po                                  |  31 +-
 po/glossary/es.po                                  |  31 +-
 po/glossary/fr.po                                  |  29 +-
 po/glossary/gnc-glossary.txt                       |   6 +-
 po/glossary/he.po                                  |  31 +-
 po/glossary/hu.po                                  |  31 +-
 po/glossary/it.po                                  |  31 +-
 po/glossary/lt.po                                  |  29 +-
 po/glossary/nb.po                                  |  31 +-
 po/glossary/nl.po                                  |  31 +-
 po/glossary/pl.po                                  |  31 +-
 po/glossary/pt.po                                  |  31 +-
 po/glossary/pt_BR.po                               |  31 +-
 po/glossary/ru.po                                  |  31 +-
 po/glossary/rw.po                                  |  26 +-
 po/glossary/sk.po                                  |  31 +-
 po/glossary/sv.po                                  |  31 +-
 po/glossary/vi.po                                  |  31 +-
 po/glossary/zh_CN.po                               |  41 +-
 po/glossary/zh_TW.po                               |  31 +-
 po/ru.po                                           |  99 +--
 41 files changed, 1153 insertions(+), 664 deletions(-)



More information about the gnucash-changes mailing list