gnucash maint: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Thu Nov 15 15:32:21 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/eecc0137 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3cc05792 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/10377c51 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/916e7efd (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a9e0f4a7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d458e13a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/dfdafc71 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/539a27b5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/06b2e6bb (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8c03b999 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d327ff08 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/cf587c12 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/60f184be (commit)
	from  https://github.com/Gnucash/gnucash/commit/284d6c14 (commit)



commit eecc013724075656cc9bfcb7bca8cbb7511f777d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Nov 7 09:14:43 2018 +0000

    Allow the text options widget to use all remaining space
    
    The text option widget used for report options has only about 3 lines
    visible currently and will not use any available space in the dialogue.
    
    Change the packing for this widget to expand and fill the remaining
    dialogue space. If there are more than one text option widget on a page
    then the available space will be shared equally.

diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 915bd6c..66c0a1e 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -1759,7 +1759,12 @@ gnc_option_set_ui_widget(GNCOption *option,
         GtkWidget *eventbox = gtk_event_box_new();
 
         gtk_container_add (GTK_CONTAINER (eventbox), enclosing);
-        gtk_box_pack_start (page_box, eventbox, FALSE, FALSE, 0);
+
+        /* Allow the text widget to expand and fill remaining space */
+        if (g_strcmp0 (type, "text") == 0)
+            gtk_box_pack_start (page_box, eventbox, TRUE, TRUE, 0);
+        else
+            gtk_box_pack_start (page_box, eventbox, FALSE, FALSE, 0);
 
         gtk_widget_set_tooltip_text (eventbox, documentation);
     }

commit 3cc05792ca7acf67943cb2b53619b5f920b448a4
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Nov 3 10:51:12 2018 +0000

    Bug 796806 - Crash after OFX import if line item dragged
    
    Prevent the import rows being dragged to a different order.

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 63d9e4a..214ce8b 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -476,6 +476,9 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
     gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
     g_object_unref(store);
 
+    /* prevent the rows being dragged to a different order */
+    gtk_tree_view_set_reorderable (view, FALSE);
+
     /* Add the columns *
      * (keep the line break below to avoid a translator comment) */
     add_text_column(view,

commit 10377c51e256ac874ee056d984b9430fb17e3dbd
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Oct 31 10:30:40 2018 +0000

    Remove some white space/tabs from gnc_tree_view_account.c

diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index ea50fd2..0d0d64b 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -60,7 +60,8 @@ static QofLogModule log_module = GNC_MOD_GUI;
 static void gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass);
 static void gnc_tree_view_account_init (GncTreeViewAccount *view);
 static void gnc_tree_view_account_finalize (GObject *object);
-static gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data);
+static gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column,
+        const gchar *key, GtkTreeIter *iter, gpointer search_data);
 
 static void gtva_update_column_names (GncTreeView *view);
 static void gtva_currency_changed_cb (void);
@@ -86,7 +87,8 @@ static void acc_color_data_func (GtkTreeViewColumn *col,
                                  GtkTreeIter       *iter,
                                  gpointer           view);
 
-static void gnc_tree_view_account_color_update (gpointer gsettings, gchar *key, gpointer user_data);
+static void gnc_tree_view_account_color_update (gpointer gsettings,
+         gchar *key, gpointer user_data);
 
 
 typedef struct GncTreeViewAccountPrivate
@@ -930,7 +932,7 @@ gnc_tree_view_account_new_with_root (Account *root, gboolean show_root)
 
     gnc_tree_view_add_toggle_column(view, _("Placeholder"),
                                     /* Translators: This string has a context prefix; the translation
-                                    	must only contain the part after the | character. */
+                                        must only contain the part after the | character. */
                                     Q_("Column letter for 'Placeholder'|P"),
                                     "placeholder",
                                     GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
@@ -993,10 +995,10 @@ gnc_tree_view_account_new (gboolean show_root)
 /*                   Auxiliary Functions                    */
 /************************************************************/
 
-#define debug_path(fn, path) {				\
+#define debug_path(fn, path) {              \
     gchar *path_string = gtk_tree_path_to_string(path); \
-    fn("tree path %s", path_string);			\
-    g_free(path_string);				\
+    fn("tree path %s", path_string);            \
+    g_free(path_string);                \
   }
 
 static GtkTreePath *
@@ -1778,10 +1780,10 @@ gtva_currency_changed_cb (void)
  */
 static void
 account_cell_property_data_func (GtkTreeViewColumn *tree_column,
-				 GtkCellRenderer *cell,
-				 GtkTreeModel *s_model,
-				 GtkTreeIter *s_iter,
-				 gpointer key)
+                 GtkCellRenderer *cell,
+                 GtkTreeModel *s_model,
+                 GtkTreeIter *s_iter,
+                 gpointer key)
 {
     GncTreeViewAccount *view;
     Account *account;
@@ -1789,11 +1791,9 @@ account_cell_property_data_func (GtkTreeViewColumn *tree_column,
 
     g_return_if_fail (GTK_IS_TREE_MODEL_SORT (s_model));
     account = gnc_tree_view_account_get_account_from_iter(s_model, s_iter);
-    qof_instance_get (QOF_INSTANCE (account),
-		      key, &string,
-		      NULL);
+    qof_instance_get (QOF_INSTANCE (account), key, &string, NULL);
     if (string == NULL)
-	string = "";
+        string = "";
 
     g_object_set (G_OBJECT (cell), "text", string, "xalign", 0.0, NULL);
 
@@ -2270,15 +2270,12 @@ account_filter_dialog_create(AccountFilterDialog *fd, GncPluginPage *page)
     g_signal_connect(renderer, "toggled",
                      G_CALLBACK(gppat_filter_visible_toggled_cb), fd);
 
-    gtk_tree_view_insert_column_with_data_func
-    (view,
-     -1, NULL, renderer,
-     gppat_filter_visible_set_func, fd, NULL);
+    gtk_tree_view_insert_column_with_data_func (view, -1, NULL, renderer,
+                     gppat_filter_visible_set_func, fd, NULL);
 
-    gtk_tree_view_insert_column_with_attributes
-    (view,
-     -1, _("Account Types"), gtk_cell_renderer_text_new(),
-     "text", GNC_TREE_MODEL_ACCOUNT_TYPES_COL_NAME, NULL);
+    gtk_tree_view_insert_column_with_attributes (view,
+            -1, _("Account Types"), gtk_cell_renderer_text_new(),
+            "text", GNC_TREE_MODEL_ACCOUNT_TYPES_COL_NAME, NULL);
 
     /* Wire up the rest of the callbacks */
     gtk_builder_connect_signals(builder, fd);
@@ -2643,7 +2640,9 @@ gnc_tree_view_account_set_notes_edited(GncTreeViewAccount *view,
     gtva_set_column_editor(view, priv->notes_column, edited_cb);
 }
 
-static gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data)
+static
+gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column,
+        const gchar *key, GtkTreeIter *iter, gpointer search_data)
 {
     gchar *normalized_key;
     gchar *case_normalized_key = NULL;
@@ -2703,11 +2702,13 @@ static gboolean gnc_tree_view_search_compare (GtkTreeModel *model, gint column,
 void gnc_tree_view_account_set_editing_started_cb(GncTreeViewAccount *view,
     GFunc editing_started_cb, gpointer editing_cb_data)
 {
-    gnc_tree_view_set_editing_started_cb (GNC_TREE_VIEW(view), editing_started_cb, editing_cb_data);
+    gnc_tree_view_set_editing_started_cb (GNC_TREE_VIEW(view),
+            editing_started_cb, editing_cb_data);
 }
 
 void gnc_tree_view_account_set_editing_finished_cb(GncTreeViewAccount *view,
     GFunc editing_finished_cb, gpointer editing_cb_data)
 {
-    gnc_tree_view_set_editing_finished_cb (GNC_TREE_VIEW(view), editing_finished_cb, editing_cb_data);
+    gnc_tree_view_set_editing_finished_cb (GNC_TREE_VIEW(view),
+            editing_finished_cb, editing_cb_data);
 }

commit 916e7efd5594ab76cab2b2eef32245f320aa43b7
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Oct 31 10:27:01 2018 +0000

    Bug 788332 - Last Reconcile Date column sorts by day of month not date
    
    The Reconcile date column was being sorted by string instead of date
    value. Added a sort function for ReconciledLastDate and use that for
    the tree view column.

diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index f5e5676..ea50fd2 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -299,6 +299,31 @@ sort_cb_setup (GtkTreeModel *f_model,
 }
 
 static gint
+sort_by_last_reconcile_date (GtkTreeModel *f_model,
+                             GtkTreeIter *f_iter1,
+                             GtkTreeIter *f_iter2,
+                             gpointer user_data)
+{
+    const Account *account1, *account2;
+    time64 account1_date, account2_date;
+
+    sort_cb_setup (f_model, f_iter1, f_iter2, &account1, &account2);
+
+    if (!xaccAccountGetReconcileLastDate (account1, &account1_date))
+        account1_date = 0;
+
+    if (!xaccAccountGetReconcileLastDate (account2, &account2_date))
+        account2_date = 0;
+
+    if (account1_date < account2_date)
+        return -1;
+    else if (account1_date > account2_date)
+        return 1;
+    else
+        return xaccAccountOrder (account1, account2);
+}
+
+static gint
 sort_by_string (GtkTreeModel *f_model,
                 GtkTreeIter *f_iter1,
                 GtkTreeIter *f_iter2,
@@ -834,7 +859,7 @@ gnc_tree_view_account_new_with_root (Account *root, gboolean show_root)
                                   "Last Reconcile Date",
                                   GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_DATE,
                                   GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
-                                  sort_by_string);
+                                  sort_by_last_reconcile_date);
 
     gnc_tree_view_add_numeric_column(view, _("Future Minimum"), "future_min",
                                      SAMPLE_ACCOUNT_VALUE,

commit a9e0f4a7218ebe2c8604c1e484fd5e68f2572518
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Oct 31 10:21:18 2018 +0000

    Bug 793156 - Incorrect date sort order in Generic import matcher window
    
    The date column was being sorted by string as opposed to date value.
    Added an INT64 value to the model store to hold the time64 value and
    use that for sorting the tree view date column.

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 00fe751..63d9e4a 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -68,7 +68,8 @@ struct _main_matcher_info
 
 enum downloaded_cols
 {
-    DOWNLOADED_COL_DATE = 0,
+    DOWNLOADED_COL_DATE_TXT = 0,
+    DOWNLOADED_COL_DATE_INT64,
     DOWNLOADED_COL_ACCOUNT,
     DOWNLOADED_COL_AMOUNT,
     DOWNLOADED_COL_DESCRIPTION,
@@ -418,7 +419,13 @@ add_text_column(GtkTreeView *view, const gchar *title, int col_num)
               "text", col_num,
               "background", DOWNLOADED_COL_COLOR,
               NULL);
-    gtk_tree_view_column_set_sort_column_id(column, col_num);
+
+    // If date column, use the time64 value for the sorting.
+    if (col_num == DOWNLOADED_COL_DATE_TXT)
+        gtk_tree_view_column_set_sort_column_id(column, DOWNLOADED_COL_DATE_INT64);
+    else
+        gtk_tree_view_column_set_sort_column_id(column, col_num);
+
     g_object_set(G_OBJECT(column),
                  "reorderable", TRUE,
                  "resizable", TRUE,
@@ -461,8 +468,8 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
     GtkTreeSelection *selection;
 
     view = info->view;
-    store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
-                               G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+    store = gtk_list_store_new(NUM_DOWNLOADED_COLS, G_TYPE_STRING,
+                               G_TYPE_INT64, G_TYPE_STRING, G_TYPE_STRING,
                                G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN,
                                G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING,
                                GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING);
@@ -472,7 +479,7 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
     /* Add the columns *
      * (keep the line break below to avoid a translator comment) */
     add_text_column(view,
-                    _("Date"), DOWNLOADED_COL_DATE);
+                    _("Date"), DOWNLOADED_COL_DATE_TXT);
     column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT);
     gtk_tree_view_column_set_visible(column, show_account);
     add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT);
@@ -702,6 +709,7 @@ refresh_model_row (GNCImportMainMatcher *gui,
     gchar *int_required_class, *int_prob_required_class, *int_not_required_class;
     gchar *class_extension = NULL;
     Split *split;
+    time64 date;
     g_assert (gui);
     g_assert (model);
     g_assert (info);
@@ -724,8 +732,10 @@ refresh_model_row (GNCImportMainMatcher *gui,
     gtk_list_store_set(store, iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
 
     /*Date*/
-    text = qof_print_date ( xaccTransGetDate( gnc_import_TransInfo_get_trans(info) ) );
-    gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE, text, -1);
+    date = xaccTransGetDate (gnc_import_TransInfo_get_trans(info));
+    text = qof_print_date (date);
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE_TXT, text, -1);
+    gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE_INT64, date, -1);
     g_free(text);
 
     /*Amount*/

commit d458e13a7f41a4f0e00d46d26bac363995a1df08
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Nov 15 14:01:27 2018 +0000

    Remove KVP for assoc_uri when passed an empty string
    
    Change xaccTransSetAssociation so if an empty string is passed the KVP
    entry is removed instead of leaving an empty stub.

diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 22d96db..f9edab7 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -2137,12 +2137,17 @@ xaccTransSetDescription (Transaction *trans, const char *desc)
 void
 xaccTransSetAssociation (Transaction *trans, const char *assoc)
 {
-    GValue v = G_VALUE_INIT;
     if (!trans || !assoc) return;
-    g_value_init (&v, G_TYPE_STRING);
-    g_value_set_string (&v, assoc);
     xaccTransBeginEdit(trans);
-    qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, assoc_uri_str);
+    if (g_strcmp0 (assoc, "") == 0)
+        qof_instance_set_kvp (QOF_INSTANCE (trans), NULL, 1, assoc_uri_str);
+    else
+    {
+        GValue v = G_VALUE_INIT;
+        g_value_init (&v, G_TYPE_STRING);
+        g_value_set_string (&v, assoc);
+        qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, assoc_uri_str);
+    }
     qof_instance_set_dirty(QOF_INSTANCE(trans));
     xaccTransCommitEdit(trans);
 }

commit dfdafc71851fd4f1763ff4b49931e1de9109d12d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Oct 30 11:20:45 2018 +0000

    Bug 796915 - Update Account colour background
    
    The account tree view background colour does not update straight away
    with the preference option so add gnc_tree_view_account_refilter to the
    colour change call back to force a refresh.

diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index c1cac82..f5e5676 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -657,6 +657,9 @@ gnc_tree_view_account_color_update (gpointer gsettings, gchar *key, gpointer use
     priv = GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(view);
     if (g_strcmp0 (key, GNC_PREF_ACCOUNT_COLOR) == 0)
         priv->show_account_color = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, key);
+
+    // do a refilter so the tree view background color gets updated
+    gnc_tree_view_account_refilter (view);
 }
 
 /** Add the account color background data function to the GncTreeViewAccount column to

commit 539a27b5ff177a2e8f7d8f46e9fffaf6633e5a60
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Oct 18 12:58:30 2018 +0100

    Bug 796849 - Load another QIF file causes "that file already loaded" dialog
    
    Clear the gtk entry for the filename in the
    qif_import_load_another_file_cb function.

diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index a8bc00e..4d117a0 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -2180,6 +2180,8 @@ gnc_ui_qif_import_load_another_cb(GtkButton * button,
     QIFImportWindow * wind = user_data;
     GtkAssistant *assistant = GTK_ASSISTANT(wind->window);
 
+    gtk_entry_set_text (GTK_ENTRY(wind->filename_entry), "");
+
     gtk_assistant_set_current_page (assistant, 1);
 }
 

commit 06b2e6bb2f0aa7f99b2da49fecfe2931db4f7408
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Oct 18 12:24:39 2018 +0100

    Remove white space/tabs from search-owner.c/h
    
    Remove the white space and tabs from search-owner.c/h and adjust format
    to be the same as the other similar search source files.

diff --git a/gnucash/gnome/search-owner.c b/gnucash/gnome/search-owner.c
index a479f2d..d33f693 100644
--- a/gnucash/gnome/search-owner.c
+++ b/gnucash/gnome/search-owner.c
@@ -45,21 +45,21 @@ static gboolean gncs_validate (GNCSearchCoreType *fe);
 static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
 static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);
 
-static void gnc_search_owner_class_init	(GNCSearchOwnerClass *klass);
-static void gnc_search_owner_init	(GNCSearchOwner *gspaper);
-static void gnc_search_owner_finalize	(GObject *obj);
+static void gnc_search_owner_class_init (GNCSearchOwnerClass *klass);
+static void gnc_search_owner_init   (GNCSearchOwner *gspaper);
+static void gnc_search_owner_finalize   (GObject *obj);
 
-#define _PRIVATE(x) (((GNCSearchOwner *)(x))->priv)
+typedef struct _GNCSearchOwnerPrivate GNCSearchOwnerPrivate;
 
 typedef struct _GNCSearchOwnerPrivate
 {
-    GncOwner	owner;
+    GncOwner    owner;
     GtkWindow * parent;
-    GtkWidget *	owner_box;
-    GtkWidget *	owner_choice;
+    GtkWidget * owner_box;
+    GtkWidget * owner_choice;
 } GNCSearchOwnerPrivate;
 
-#define GNC_SEARCH_OWNER_GET_PRIVATE(o)  \
+#define _PRIVATE(o)  \
    (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_OWNER, GNCSearchOwnerPrivate))
 
 static GNCSearchCoreTypeClass *parent_class;
@@ -83,13 +83,13 @@ gnc_search_owner_get_type (void)
         GTypeInfo type_info =
         {
             sizeof(GNCSearchOwnerClass),    /* class_size */
-            NULL,   				/* base_init */
-            NULL,				/* base_finalize */
+            NULL,                           /* base_init */
+            NULL,                           /* base_finalize */
             (GClassInitFunc)gnc_search_owner_class_init,
-            NULL,				/* class_finalize */
-            NULL,				/* class_data */
-            sizeof(GNCSearchOwner),		/* */
-            0,				/* n_preallocs */
+            NULL,                           /* class_finalize */
+            NULL,                           /* class_data */
+            sizeof(GNCSearchOwner),         /* */
+            0,                              /* n_preallocs */
             (GInstanceInitFunc)gnc_search_owner_init,
         };
 
@@ -159,7 +159,7 @@ gncs_validate (GNCSearchCoreType *fe)
     g_return_val_if_fail (fi, FALSE);
     g_return_val_if_fail (IS_GNCSEARCH_OWNER (fi), FALSE);
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv = _PRIVATE(fi);
     if (priv->owner.owner.undefined == NULL)
     {
         valid = FALSE;
@@ -177,7 +177,7 @@ owner_changed_cb (GtkWidget *widget, gpointer data)
     GNCSearchOwner *fe = data;
     GNCSearchOwnerPrivate *priv;
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fe);
+    priv = _PRIVATE(fe);
     gnc_owner_get_owner (priv->owner_choice, &(priv->owner));
     return FALSE;
 }
@@ -188,7 +188,7 @@ set_owner_widget (GNCSearchOwner *fe)
     GNCSearchOwnerPrivate *priv;
 
     /* Remove the old choice widget */
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fe);
+    priv = _PRIVATE(fe);
     if (priv->owner_choice)
         gtk_container_remove (GTK_CONTAINER (priv->owner_box), priv->owner_choice);
 
@@ -215,7 +215,7 @@ type_combo_changed (GtkWidget *widget, GNCSearchOwner *fe)
     type = gnc_combo_box_search_get_active(GTK_COMBO_BOX(widget));
 
     /* If the type changed or if we don't have a type create the owner_choice */
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fe);
+    priv = _PRIVATE(fe);
     if (type != gncOwnerGetType (&(priv->owner)))
     {
         priv->owner.type = type;
@@ -234,7 +234,7 @@ make_type_menu (GNCSearchCoreType *fe)
     GtkComboBox *combo;
     GncOwnerType type;
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv = _PRIVATE(fi);
     type = gncOwnerGetType (&(priv->owner));
 
     combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
@@ -275,7 +275,7 @@ pass_parent (GNCSearchCoreType *fe, gpointer parent)
     g_return_if_fail (fi);
     g_return_if_fail (IS_GNCSEARCH_OWNER (fi));
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv = _PRIVATE(fi);
     priv->parent = GTK_WINDOW(parent);
 }
 
@@ -289,7 +289,7 @@ gncs_get_widget (GNCSearchCoreType *fe)
     g_return_val_if_fail (fi, NULL);
     g_return_val_if_fail (IS_GNCSEARCH_OWNER (fi), NULL);
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv = _PRIVATE(fi);
     box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
     gtk_box_set_homogeneous (GTK_BOX (box), FALSE);
 
@@ -325,7 +325,7 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe)
     g_return_val_if_fail (fi, NULL);
     g_return_val_if_fail (IS_GNCSEARCH_OWNER (fi), NULL);
 
-    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv = _PRIVATE(fi);
     guid = gncOwnerGetGUID (&(priv->owner));
     l = g_list_prepend (l, (gpointer)guid);
 
@@ -342,8 +342,8 @@ static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
 
     se = gnc_search_owner_new ();
     se->how = fse->how;
-    se_priv = GNC_SEARCH_OWNER_GET_PRIVATE(se);
-    fse_priv = GNC_SEARCH_OWNER_GET_PRIVATE(fse);
+    se_priv = _PRIVATE(se);
+    fse_priv = _PRIVATE(fse);
     gncOwnerCopy (&(fse_priv->owner), &(se_priv->owner));
 
     return (GNCSearchCoreType *)se;
diff --git a/gnucash/gnome/search-owner.h b/gnucash/gnome/search-owner.h
index c2e398f..2b573c3 100644
--- a/gnucash/gnome/search-owner.h
+++ b/gnucash/gnome/search-owner.h
@@ -26,18 +26,18 @@
 #include "qof.h"
 
 #define GNC_TYPE_SEARCH_OWNER             (gnc_search_owner_get_type ())
-#define GNCSEARCH_OWNER(obj)	          G_TYPE_CHECK_INSTANCE_CAST(obj, gnc_search_owner_get_type (), GNCSearchOwner)
-#define GNCSEARCH_OWNER_CLASS(klass)	  G_TYPE_CHECK_CLASS_CAST(klass, gnc_search_owner_get_type (), GNCSearchOwnerClass)
+#define GNCSEARCH_OWNER(obj)              G_TYPE_CHECK_INSTANCE_CAST(obj, gnc_search_owner_get_type (), GNCSearchOwner)
+#define GNCSEARCH_OWNER_CLASS(klass)      G_TYPE_CHECK_CLASS_CAST(klass, gnc_search_owner_get_type (), GNCSearchOwnerClass)
 #define IS_GNCSEARCH_OWNER(obj)           G_TYPE_CHECK_INSTANCE_TYPE(obj, gnc_search_owner_get_type ())
 
-typedef struct _GNCSearchOwner	GNCSearchOwner;
-typedef struct _GNCSearchOwnerClass	GNCSearchOwnerClass;
+typedef struct _GNCSearchOwner  GNCSearchOwner;
+typedef struct _GNCSearchOwnerClass GNCSearchOwnerClass;
 
 struct _GNCSearchOwner
 {
     GNCSearchCoreType parent;
 
-    QofGuidMatch	how;
+    QofGuidMatch    how;
 };
 
 struct _GNCSearchOwnerClass
@@ -49,8 +49,8 @@ struct _GNCSearchOwnerClass
     /* signals */
 };
 
-GType		gnc_search_owner_get_type	(void);
-GNCSearchOwner	*gnc_search_owner_new	(void);
+GType       gnc_search_owner_get_type   (void);
+GNCSearchOwner  *gnc_search_owner_new   (void);
 
 /* methods */
 

commit 8c03b999ed97e47583a4da0d475239207909224a
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Oct 15 12:37:17 2018 +0100

    Bug 796903 - Crash when searching invoice by Invoice Owner
    
    This was caused by a missing override function pass_parent used to pass
    the parent GtkWindow for the error dialogues.

diff --git a/gnucash/gnome/search-owner.c b/gnucash/gnome/search-owner.c
index 1d63761..a479f2d 100644
--- a/gnucash/gnome/search-owner.c
+++ b/gnucash/gnome/search-owner.c
@@ -40,6 +40,7 @@
 #define d(x)
 
 static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
 static gboolean gncs_validate (GNCSearchCoreType *fe);
 static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
 static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);
@@ -53,6 +54,7 @@ static void gnc_search_owner_finalize	(GObject *obj);
 typedef struct _GNCSearchOwnerPrivate
 {
     GncOwner	owner;
+    GtkWindow * parent;
     GtkWidget *	owner_box;
     GtkWidget *	owner_choice;
 } GNCSearchOwnerPrivate;
@@ -112,6 +114,7 @@ gnc_search_owner_class_init (GNCSearchOwnerClass *klass)
 
     /* override methods */
     gnc_search_core_type->validate = gncs_validate;
+    gnc_search_core_type->pass_parent = pass_parent;
     gnc_search_core_type->get_widget = gncs_get_widget;
     gnc_search_core_type->get_predicate = gncs_get_predicate;
     gnc_search_core_type->clone = gncs_clone;
@@ -160,7 +163,7 @@ gncs_validate (GNCSearchCoreType *fe)
     if (priv->owner.owner.undefined == NULL)
     {
         valid = FALSE;
-        gnc_error_dialog (NULL, "%s", _("You have not selected an owner"));
+        gnc_error_dialog (GTK_WINDOW(priv->parent), "%s", _("You have not selected an owner"));
     }
 
     /* XXX */
@@ -263,6 +266,19 @@ make_how_menu (GNCSearchCoreType *fe)
     return GTK_WIDGET(combo);
 }
 
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+    GNCSearchOwner *fi = (GNCSearchOwner *)fe;
+    GNCSearchOwnerPrivate *priv;
+
+    g_return_if_fail (fi);
+    g_return_if_fail (IS_GNCSEARCH_OWNER (fi));
+
+    priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
+    priv->parent = GTK_WINDOW(parent);
+}
+
 static GtkWidget *
 gncs_get_widget (GNCSearchCoreType *fe)
 {

commit d327ff081974876c039da121e3fe8f31e3e4a2b2
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Oct 15 12:14:32 2018 +0100

    Bug 796842 - Add new employee window may not fit on screen
    
    Added notebook page for the Billing Information like other dialogues

diff --git a/gnucash/gtkbuilder/dialog-employee.glade b/gnucash/gtkbuilder/dialog-employee.glade
index 80647a4..6cd62bb 100644
--- a/gnucash/gtkbuilder/dialog-employee.glade
+++ b/gnucash/gtkbuilder/dialog-employee.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
   <object class="GtkDialog" id="employee_dialog">
@@ -591,6 +591,24 @@
                     <property name="position">2</property>
                   </packing>
                 </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label9">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Employee</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="vbox40">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <object class="GtkFrame" id="frame5">
                     <property name="visible">True</property>
@@ -794,19 +812,22 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">3</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label9">
+              <object class="GtkLabel" id="label40">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Employee</property>
-                <property name="justify">center</property>
+                <property name="label" translatable="yes">Billing Information</property>
               </object>
               <packing>
+                <property name="position">1</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -847,7 +868,7 @@
                 </child>
               </object>
               <packing>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child type="tab">
@@ -858,7 +879,7 @@
                 <property name="justify">center</property>
               </object>
               <packing>
-                <property name="position">1</property>
+                <property name="position">2</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -876,5 +897,8 @@
       <action-widget response="-6">cancelbutton</action-widget>
       <action-widget response="-5">okbutton</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>

commit cf587c12349dee27d1105628a35b70cf623a2401
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Oct 15 11:33:12 2018 +0100

    Do not destroy the 'blank split'
    
    With a register in journal mode and you use the
    'move to blank transaction' button which puts the cursor in the
    'blank split' and then immediately click on another transaction you
    loose the ability to add any more transactions using the blank
    transaction as there is no 'blank split'.
    Test for the old_split being the 'blank split' before destroying.

diff --git a/gnucash/register/ledger-core/split-register-control.c b/gnucash/register/ledger-core/split-register-control.c
index 0bb8ebe..129e051 100644
--- a/gnucash/register/ledger-core/split-register-control.c
+++ b/gnucash/register/ledger-core/split-register-control.c
@@ -453,18 +453,21 @@ gnc_split_register_move_cursor (VirtualLocation *p_new_virt_loc,
             (old_split != new_split) &&
             gnc_split_register_old_split_empty_p(reg, old_split))
     {
-        int current_row;
-
-        xaccSplitDestroy(old_split);
-        old_split = NULL;
-
-        /*
-         * If the user is moving down a row, we've just thrown off the
-         * numbers by deleting a split. Correct for that.
-         */
-        current_row = reg->table->current_cursor_loc.vcell_loc.virt_row;
-        if (new_virt_loc.vcell_loc.virt_row > current_row)
-            new_virt_loc.vcell_loc.virt_row--;
+        if (old_split != gnc_split_register_get_blank_split (reg))
+        {
+            int current_row;
+
+            xaccSplitDestroy(old_split);
+            old_split = NULL;
+
+            /*
+             * If the user is moving down a row, we've just thrown off the
+             * numbers by deleting a split. Correct for that.
+             */
+            current_row = reg->table->current_cursor_loc.vcell_loc.virt_row;
+            if (new_virt_loc.vcell_loc.virt_row > current_row)
+                new_virt_loc.vcell_loc.virt_row--;
+        }
     }
     else if ((pending_trans != NULL)      &&
              (pending_trans == old_trans) &&

commit 60f184be92038b07ab78a9cd776ea71468161e8c
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Oct 15 11:02:51 2018 +0100

    New hierarchy assistant error
    
    When using the new hierarchy assistant, when you cancel or finish an
    error is recorded in the trace file for invalid cast from GtkWindow to
    GtkDialog. The cause is when removing the added book options which are
    from a window and not a dialog so use 'gnc_options_dialog_destroy'
    instead. This also fixes when after saving the file and you go straight
    to File->Properties you get a blank book options dialogue.

diff --git a/gnucash/gnome/assistant-hierarchy.c b/gnucash/gnome/assistant-hierarchy.c
index a7f0d11..9f97334 100644
--- a/gnucash/gnome/assistant-hierarchy.c
+++ b/gnucash/gnome/assistant-hierarchy.c
@@ -1081,7 +1081,8 @@ on_cancel (GtkAssistant      *gtkassistant,
 {
     gnc_suspend_gui_refresh ();
     if (data->new_book)
-        gtk_dialog_response(GTK_DIALOG(gnc_options_dialog_widget (data->optionwin)), GTK_RESPONSE_CANCEL);
+        gnc_options_dialog_destroy (data->optionwin);
+
     delete_hierarchy_dialog (data);
     delete_our_account_tree (data);
     g_free(data);
@@ -1126,7 +1127,7 @@ on_finish (GtkAssistant  *gtkassistant,
 
     gnc_suspend_gui_refresh ();
     if (data->new_book)
-        gtk_dialog_response(GTK_DIALOG(gnc_options_dialog_widget (data->optionwin)), GTK_RESPONSE_CANCEL);
+        gnc_options_dialog_destroy (data->optionwin);
 
     account_trees_merge(gnc_get_current_root_account(), data->our_account_tree);
 



Summary of changes:
 gnucash/gnome-utils/dialog-options.c               |  7 +-
 gnucash/gnome-utils/gnc-tree-view-account.c        | 81 +++++++++++++++-------
 gnucash/gnome/assistant-hierarchy.c                |  5 +-
 gnucash/gnome/search-owner.c                       | 64 ++++++++++-------
 gnucash/gnome/search-owner.h                       | 14 ++--
 gnucash/gtkbuilder/dialog-employee.glade           | 38 ++++++++--
 gnucash/import-export/import-main-matcher.c        | 27 ++++++--
 .../import-export/qif-imp/assistant-qif-import.c   |  2 +
 .../register/ledger-core/split-register-control.c  | 27 ++++----
 libgnucash/engine/Transaction.c                    | 13 ++--
 10 files changed, 188 insertions(+), 90 deletions(-)



More information about the gnucash-changes mailing list