gnucash master: Multiple changes pushed

Mike Alexander mta at code.gnucash.org
Sun Aug 31 19:03:41 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/18666f1e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/483302ab (commit)
	 via  https://github.com/Gnucash/gnucash/commit/67f84774 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a028ae0f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/95816477 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c9af8269 (commit)
	from  https://github.com/Gnucash/gnucash/commit/85c74fbe (commit)



commit 18666f1ed2fa9fda605b1840d03bbc8489328196
Merge: 85c74fb 483302a
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 18:49:35 2014 -0400

    Merge branch 'maint'


commit 483302aba0d73526c43a518ab0b152722a3da9e6
Author: Mike Alexander <mta at umich.edu>
Date:   Tue Jul 1 22:40:45 2014 -0400

    Use guint64 instead of uint64_t with G_GUINT64_FORMAT to avoid warnings.

diff --git a/src/libqof/qof/guid.c b/src/libqof/qof/guid.c
index 6ffed52..22a5cf5 100644
--- a/src/libqof/qof/guid.c
+++ b/src/libqof/qof/guid.c
@@ -249,7 +249,7 @@ init_from_file(const char *filename, size_t max_size)
 
 #ifdef HAVE_SCANF_LLD
     PINFO ("guid_init got %" G_GUINT64_FORMAT " bytes from %s",
-	   (uint64_t) file_bytes,
+	   (guint64) file_bytes,
            filename);
 #else
     PINFO ("guid_init got %lu bytes from %s", (unsigned long int) file_bytes,
@@ -515,12 +515,12 @@ guid_init(void)
     /* time in secs and clock ticks */
     bytes += init_from_time();
 
-    PINFO ("got %" G_GUINT64_FORMAT " bytes", (uint64_t) bytes);
+    PINFO ("got %" G_GUINT64_FORMAT " bytes", (guint64) bytes);
 
     if (bytes < THRESHOLD)
         PWARN("only got %" G_GUINT64_FORMAT " bytes.\n"
               "The identifiers might not be very random.\n",
-              (uint64_t)bytes);
+              (guint64)bytes);
 
     guid_initialized = TRUE;
     LEAVE();

commit 67f84774e975db6dd187a065329bf40b392bd8a1
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 02:36:59 2014 -0400

    Change gncOwnerGetBalanceInCurrency to only cosider lots that contain an invoice.
    This function is currently only used in the owner tree code and this change
    will cause payments not properly linked to invoices to be ignored when computing
    owner balances.

diff --git a/src/engine/gncOwner.c b/src/engine/gncOwner.c
index 8a1d0bf..6301fba 100644
--- a/src/engine/gncOwner.c
+++ b/src/engine/gncOwner.c
@@ -1133,8 +1133,10 @@ gncOwnerGetBalanceInCurrency (const GncOwner *owner,
         {
             GNCLot *lot = lot_node->data;
             gnc_numeric lot_balance = gnc_lot_get_balance (lot);
-            balance = gnc_numeric_add (balance, lot_balance,
-                                       gnc_commodity_get_fraction (owner_currency), GNC_HOW_RND_ROUND_HALF_UP);
+            GncInvoice *invoice = gncInvoiceGetInvoiceFromLot(lot);
+            if (invoice)
+               balance = gnc_numeric_add (balance, lot_balance,
+                                          gnc_commodity_get_fraction (owner_currency), GNC_HOW_RND_ROUND_HALF_UP);
         }
     }
 

commit a028ae0f985f37399e86bdd40e9a6cdfd6fb15bb
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 01:56:49 2014 -0400

    Finish implementing the "Show zero balance owners" filter option.
    It always showed nothing before.

diff --git a/src/gnome-utils/gnc-tree-view-owner.c b/src/gnome-utils/gnc-tree-view-owner.c
index 7f93770..51d3cac 100644
--- a/src/gnome-utils/gnc-tree-view-owner.c
+++ b/src/gnome-utils/gnc-tree-view-owner.c
@@ -1069,13 +1069,7 @@ gnc_plugin_page_owner_tree_filter_owners (GncOwner *owner,
 
     if (!fd->show_zero_total)
     {
-        /* FIXME I'm not aware of any functions to get an owner's "balance" yet.
-         *       This should be implemented before this function does anything useful.
-         *       The code below is copied from the tree-view-account source to serve
-         *       as an example.
-        total = gncOwnerGetBalanceInCurrency (owner, NULL, TRUE);
-        */
-        total = gnc_numeric_zero();
+        total = gncOwnerGetBalanceInCurrency (owner, NULL);
         if (gnc_numeric_zero_p(total))
         {
             LEAVE(" hide: zero balance");

commit 95816477e4b3f6062ed7bd3d2595e7876433f1f9
Author: Mike Alexander <mta at umich.edu>
Date:   Sun Aug 31 01:24:01 2014 -0400

    The sense of the "Only show active customers" checkbox was inverted.

diff --git a/src/gnome-utils/gnc-tree-view-owner.c b/src/gnome-utils/gnc-tree-view-owner.c
index 091f42a..7f93770 100644
--- a/src/gnome-utils/gnc-tree-view-owner.c
+++ b/src/gnome-utils/gnc-tree-view-owner.c
@@ -1099,7 +1099,7 @@ gppot_filter_show_inactive_toggled_cb (GtkToggleButton *button,
     g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
 
     ENTER("button %p", button);
-    fd->show_inactive = gtk_toggle_button_get_active(button);
+    fd->show_inactive = !gtk_toggle_button_get_active(button);
     gnc_tree_view_owner_refilter(fd->tree_view);
     LEAVE("show_inactive %d", fd->show_inactive);
 }
@@ -1194,7 +1194,7 @@ owner_filter_dialog_create(OwnerFilterDialog *fd, GncPluginPage *page)
     /* Update the dialog widgets for the current state */
     button = GTK_WIDGET(gtk_builder_get_object (builder, "show_inactive"));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button),
-                                  fd->show_inactive);
+                                  !fd->show_inactive);
     button = GTK_WIDGET(gtk_builder_get_object (builder, "show_zero"));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button),
                                   fd->show_zero_total);

commit c9af8269fac031b1e90f144daad3d7ef9ac30f15
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Fri Aug 29 22:48:16 2014 +0200

    Bug 707243 - Hard-coded font colors in account tree?

diff --git a/src/gnome-utils/gnc-tree-model-account.c b/src/gnome-utils/gnc-tree-model-account.c
index c3627ab..b37bd56 100644
--- a/src/gnome-utils/gnc-tree-model-account.c
+++ b/src/gnome-utils/gnc-tree-model-account.c
@@ -124,7 +124,7 @@ gnc_tree_model_account_update_color (gpointer gsettings, gchar *key, gpointer us
     model = user_data;
     priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
     use_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
-    priv->negative_color = use_red ? "red" : "black";
+    priv->negative_color = use_red ? "red" : NULL;
 }
 /************************************************************/
 /*               g_object required functions                */
@@ -205,7 +205,7 @@ gnc_tree_model_account_init (GncTreeModelAccount *model)
     priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
     priv->book = NULL;
     priv->root = NULL;
-    priv->negative_color = red ? "red" : "black";
+    priv->negative_color = red ? "red" : NULL;
 
     gnc_prefs_register_cb(GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED,
                           gnc_tree_model_account_update_color,
@@ -562,7 +562,7 @@ gnc_tree_model_account_set_color(GncTreeModelAccount *model,
     if (negative)
         g_value_set_static_string (value, priv->negative_color);
     else
-        g_value_set_static_string (value, "black");
+        g_value_set_static_string (value, NULL);
 }
 
 static gchar *
diff --git a/src/gnome-utils/gnc-tree-model-owner.c b/src/gnome-utils/gnc-tree-model-owner.c
index e88003f..e37df19 100644
--- a/src/gnome-utils/gnc-tree-model-owner.c
+++ b/src/gnome-utils/gnc-tree-model-owner.c
@@ -123,7 +123,7 @@ gnc_tree_model_owner_update_color (gpointer gsettings, gchar *key, gpointer user
     model = user_data;
     priv = GNC_TREE_MODEL_OWNER_GET_PRIVATE(model);
     use_red = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
-    priv->negative_color = use_red ? "red" : "black";
+    priv->negative_color = use_red ? "red" : NULL;
 }
 /************************************************************/
 /*               g_object required functions                */
@@ -205,7 +205,7 @@ gnc_tree_model_owner_init (GncTreeModelOwner *model)
     priv->book       = NULL;
     priv->owner_list = NULL;
     priv->owner_type = GNC_OWNER_NONE;
-    priv->negative_color = red ? "red" : "black";
+    priv->negative_color = red ? "red" : NULL;
 
     gnc_prefs_register_cb(GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED,
                           gnc_tree_model_owner_update_color,
@@ -528,7 +528,7 @@ gnc_tree_model_owner_set_color(GncTreeModelOwner *model,
     if (negative)
         g_value_set_static_string (value, priv->negative_color);
     else
-        g_value_set_static_string (value, "black");
+        g_value_set_static_string (value, NULL);
 }
 
 static void



Summary of changes:
 src/engine/gncOwner.c                    |  6 ++++--
 src/gnome-utils/gnc-tree-model-account.c |  6 +++---
 src/gnome-utils/gnc-tree-model-owner.c   |  6 +++---
 src/gnome-utils/gnc-tree-view-owner.c    | 12 +++---------
 4 files changed, 13 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list