gnucash maint: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Fri Apr 27 06:00:27 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/d0fca779 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/196e7ea3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2eb0324b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9ce01be3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/dacaa939 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4e2697b0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6a37d7f5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9e784b03 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0eabe766 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ce839588 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d69cdaeb (commit)



commit d0fca7794e58063138ad201e73a6254184b56e2e
Merge: d69cdae 196e7ea
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Apr 27 11:33:57 2018 +0200

    Merge branch 'fixes3' of https://github.com/Bob-IT/gnucash into maint


commit 196e7ea3afa505d8d2748e617fa555d9b9c7dd44
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Apr 25 14:41:12 2018 +0100

    Clean up gnc-budget-view.c of tabs and white space

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 3d57cd2..e25b38e 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -3,7 +3,8 @@
  * @addtogroup budget Budgets
  * @{
  * @file gnc-budget-view.c
- * @brief File to define budget views for gnucash (the actual display of the budget, along with some calculations and event handlers).
+ * @brief File to define budget views for gnucash (the actual display 
+          of the budget, along with some calculations and event handlers).
  * @author Phil Longstaff Copyright (C) 2013 phil.longstaff at yahoo.ca
  *
  * This program is free software; you can redistribute it and/or    *
@@ -70,7 +71,7 @@
 #include "gnc-tree-model-account-types.h"
 
 
-/* This static indicates the debugging module that this .o belongs to.  */
+/* This static indicates the debugging module that this .o belongs to. */
 static QofLogModule log_module = GNC_MOD_BUDGET;
 
 #define PLUGIN_PAGE_BUDGET_CM_CLASS "budget-view"
@@ -97,7 +98,9 @@ enum
 };
 /**< \brief ENUM for different budget totals types.
 
-This enum is used to specify the specific type of account that the selected account belongs to. This is important to ensure that the sum of the different types of accounts can be calculated.
+This enum is used to specify the specific type of account that the
+ selected account belongs to. This is important to ensure that the sum 
+ of the different types of accounts can be calculated.
 */
 
 
@@ -131,7 +134,8 @@ static gnc_numeric gbv_get_accumulated_budget_amount(GncBudget* budget,
 
 /** \brief the private budget view structure
 
-    This structure defines the different elements required for a budget view - the actual display of how a budget looks when you open it.
+    This structure defines the different elements required for a budget view - 
+    the actual display of how a budget looks when you open it.
         @param tree_view Pointer to the widget to display the detailed budget.
         @param totals_tree_view Pointer to the widget to display the totals tree at the bottom of the budget screen.
         @param the main scrolled window horizonatl adjustment
@@ -227,7 +231,7 @@ gnc_budget_view_init(GncBudgetView *budget_view)
     /* Keep track of the root and top level asset, liability, income and expense accounts */
     root = gnc_book_get_root_account(gnc_get_current_book());
     num_top_accounts = gnc_account_n_children(root);
-    
+
     priv->rootAcct = root;
 
     for (i = 0; i < num_top_accounts; ++i)
@@ -272,7 +276,8 @@ gnc_budget_view_finalize(GObject *object)
 
 /** \brief returns the current selection in the gnc budget view.
 
-    Returns the current selection in the gnc budget view by using the macro GNC_BUDGET_VIEW_GET_PRIVATE.
+    Returns the current selection in the gnc budget view by using the 
+    macro GNC_BUDGET_VIEW_GET_PRIVATE.
 */
 GtkTreeSelection*
 gnc_budget_view_get_selection(GncBudgetView* view)
@@ -300,9 +305,9 @@ GtkWidget*
 gnc_budget_view_get_account_tree_view (GncBudgetView* view)
 {
     GncBudgetViewPrivate *priv;
-    
+
     g_return_val_if_fail(GNC_IS_BUDGET_VIEW(view), NULL);
-        
+
     priv =  GNC_BUDGET_VIEW_GET_PRIVATE(view);
     return GTK_WIDGET(priv->fd->tree_view);
 }
@@ -795,19 +800,16 @@ gbv_get_accumulated_budget_amount(GncBudget* budget, Account* account, guint per
     info.total = gnc_numeric_zero();
     info.budget = budget;
     info.period_num = period_num;
-    
 
-    
     if (!gnc_budget_is_account_period_value_set(budget, account, period_num))
     {
-    	gnc_account_foreach_child(account, budget_accum_helper, &info);
+        gnc_account_foreach_child(account, budget_accum_helper, &info);
     }
     else
     {
-    	info.total = gnc_budget_get_account_period_value(budget, account, period_num);
+        info.total = gnc_budget_get_account_period_value(budget, account, period_num);
     }
-    	return info.total;
-    
+    return info.total;
 }
 
 /** \brief Calculates and displays budget amount for a period in a defined account.
@@ -871,7 +873,8 @@ budget_col_source(Account *account, GtkTreeViewColumn *col,
     return g_strdup(amtbuff);
 }
 
-/** \brief Function to find the total for an account for display in the totals column to the right.
+/** \brief Function to find the total for an account for display in the
+ totals column to the right.
 */
 static gnc_numeric
 bgv_get_total_for_account(Account* account, GncBudget* budget)
@@ -901,7 +904,6 @@ bgv_get_total_for_account(Account* account, GncBudget* budget)
             }
         }
     }
-
     return total;
 }
 
@@ -922,9 +924,12 @@ budget_total_col_source(Account *account, GtkTreeViewColumn *col,
     return g_strdup(amtbuff);
 }
 
-/** \brief Function to perform actions if an account has been edited (e.g. when removing or adding data values).
+/** \brief Function to perform actions if an account has been edited
+     (e.g. when removing or adding data values).
 
-Primarily this function is here to check to see if a cell has been updated to be zero so that the values in the children of that account can then be tallied for the value.
+ Primarily this function is here to check to see if a cell has been
+ updated to be zero so that the values in the children of that account
+ can then be tallied for the value.
 */
 static void
 budget_col_edited(Account *account, GtkTreeViewColumn *col,
@@ -950,12 +955,17 @@ budget_col_edited(Account *account, GtkTreeViewColumn *col,
                                             numeric);
 }
 
-/** \brief Function to find the total in a column of budget provided and display the info in the totals tree widget.
-
-This function is called on each row within the totals tree (i.e. assets, expenses, transfers, and totals) in order to 
-update the total values in the totals tree (grand totals at the bottom of the budget page). It looks at which type of account is currently being examined, and then calls the function
-\ref gbv_get_accumulated_budget_amount on all of the relevant children accounts of the root. It then sets the value and color of the cell based on this information in the totals tree widget.
-
+/** \brief Function to find the total in a column of budget provided and
+ display the info in the totals tree widget.
+
+This function is called on each row within the totals tree
+ (i.e. assets, expenses, transfers, and totals) in order to
+ update the total values in the totals tree (grand totals at the bottom
+ of the budget page). It looks at which type of account is currently being
+ examined, and then calls the function
+\ref gbv_get_accumulated_budget_amount on all of the relevant children
+ accounts of the root. It then sets the value and color of the cell based
+ on this information in the totals tree widget.
 */
 static void
 totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
@@ -986,74 +996,68 @@ totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
     period_num = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(col),
                                  "period_num"));
 
-
     num_top_accounts = gnc_account_n_children(priv->rootAcct);
-    
+
     // step through each child account of the root, find the total income, expenses, liabilities, and assets.
-    
+
     for (i = 0; i < num_top_accounts; ++i)
-  	{
-    	account = gnc_account_nth_child(priv->rootAcct, i);
-    	
-    	// find the total for this account
-    	
-    	if (period_num < 0)
-    	{
-    		value = bgv_get_total_for_account(account, budget);
-    	}
-    	else
-    	{
-    		value = gbv_get_accumulated_budget_amount(budget, account, period_num);
-    	}
-
-		// test for what account type, and add 'value' to the appopriate total
-    	
-    	if (xaccAccountGetType(account) == ACCT_TYPE_INCOME)
-    	{
-    		totalincome = gnc_numeric_add(totalincome, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
-    	}
-    	else if (xaccAccountGetType(account) == ACCT_TYPE_EXPENSE)
-    	{
-    		totalexpenses = gnc_numeric_add(totalexpenses, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
-    	}
-    	else if (xaccAccountGetType(account) == ACCT_TYPE_ASSET)
-    	{
-    		totalassets = gnc_numeric_add(totalassets, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
-    	}
-    	else if (xaccAccountGetType(account) == ACCT_TYPE_LIABILITY)
-    	{
-    		totalliabilities = gnc_numeric_add(totalliabilities, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
-    	}
-    	else
-    	{
-    		// Do nothing because this account is not of interest
-    	}
-    	
-   	}
-
-   
-    
+    {
+        account = gnc_account_nth_child(priv->rootAcct, i);
+
+        // find the total for this account
+
+        if (period_num < 0)
+        {
+            value = bgv_get_total_for_account(account, budget);
+        }
+        else
+        {
+            value = gbv_get_accumulated_budget_amount(budget, account, period_num);
+        }
+
+        // test for what account type, and add 'value' to the appopriate total
+
+        if (xaccAccountGetType(account) == ACCT_TYPE_INCOME)
+        {
+            totalincome = gnc_numeric_add(totalincome, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
+        }
+        else if (xaccAccountGetType(account) == ACCT_TYPE_EXPENSE)
+        {
+            totalexpenses = gnc_numeric_add(totalexpenses, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
+        }
+        else if (xaccAccountGetType(account) == ACCT_TYPE_ASSET)
+        {
+            totalassets = gnc_numeric_add(totalassets, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
+        }
+        else if (xaccAccountGetType(account) == ACCT_TYPE_LIABILITY)
+        {
+            totalliabilities = gnc_numeric_add(totalliabilities, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
+        }
+        else
+        {
+            // Do nothing because this account is not of interest
+        }
+    }
+
     // at this point we should have variables holding the values for assets, liabilities, expenses and incomes.
-    
-    // Set the text to display, depending on which of the totals rows we are currently looking at	
-    	
+
+    // Set the text to display, depending on which of the totals rows we are currently looking at
+
     if (row_type == TOTALS_TYPE_INCOME)
     {
-    	// FIXME: There must be a better way to get the GncAccountPrintInfo object than this. Would prefer to depreciate the tracking of top level accounts.
+        // FIXME: There must be a better way to get the GncAccountPrintInfo object than this. Would prefer to depreciate the tracking of top level accounts.
         xaccSPrintAmount(amtbuff, totalincome,
                          gnc_account_print_info(priv->income, FALSE));
         g_object_set(cell, "foreground", NULL, NULL);
     }
     else if (row_type == TOTALS_TYPE_EXPENSES)
     {
-       
         xaccSPrintAmount(amtbuff, totalexpenses,
                          gnc_account_print_info(priv->expenses, FALSE));
         g_object_set(cell, "foreground", NULL, NULL);
     }
     else if (row_type == TOTALS_TYPE_TRANSFERS)
     {
-    	
         xaccSPrintAmount(amtbuff, gnc_numeric_sub(totalassets, totalliabilities, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
                          gnc_account_print_info(priv->assets, FALSE));
         g_object_set(cell, "foreground", NULL, NULL);
@@ -1076,14 +1080,12 @@ totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
     }
     else
     {
-    	// if it reaches here then the row type was not set correctly
+        // if it reaches here then the row type was not set correctly
         g_strlcpy(amtbuff, "error", sizeof(amtbuff));
     }
-
     g_object_set(G_OBJECT(cell), "text", amtbuff, "xalign", 1.0, NULL);
 }
 
-
 /**
  \brief Function to refresh the titles of each column.
 
@@ -1163,10 +1165,10 @@ gbv_col_edited_cb(GtkCellRendererText* cell, gchar* path_string, gchar* new_text
     gtk_widget_queue_draw(GTK_WIDGET(priv->totals_tree_view));
 }
 
-
 /** \brief refreshes the current budget view
 
-The function will step through to only display the columns that are set as visible, and will add any needed columns (e.g. the totals column).
+The function will step through to only display the columns that are set
+ as visible, and will add any needed columns (e.g. the totals column).
 */
 void
 gnc_budget_view_refresh(GncBudgetView *view)
@@ -1263,7 +1265,6 @@ gnc_budget_view_refresh(GncBudgetView *view)
             gtk_tree_view_append_column(priv->totals_tree_view, col);
         }
     }
-
     gbv_refresh_col_titles(view);
     LEAVE(" ");
 }

commit 2eb0324b799dea1033d03274beddd5d46738020d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Apr 25 14:19:01 2018 +0100

    Bug 795389 - Hard to see figures in the budget window
    
    The budget view had hard coded black for normal values and dark grey for
    other values. Changed this so normal values are reset to default color
    and adjusted the grey based on default color for theme.

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index e47a418..3d57cd2 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -51,6 +51,7 @@
 #include "dialog-utils.h"
 #include "gnc-gnome-utils.h"
 #include "gnc-gobject-utils.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-icons.h"
 
 #include "gnc-session.h"
@@ -811,21 +812,23 @@ gbv_get_accumulated_budget_amount(GncBudget* budget, Account* account, guint per
 
 /** \brief Calculates and displays budget amount for a period in a defined account.
 
-Displays budget amount for a period for an account.  If a budget
-   amount is set, it is displayed in black.  If no budget amount is
-   set and the account has children, the total of the children's
+   Displays budget amount for a period for an account.  If a budget
+   amount is set, it is displayed in the default color.  If no budget
+   amount is set and the account has children, the total of the children's
    budget amounts (if any) is displayed in dark grey.
 */
 static gchar *
 budget_col_source(Account *account, GtkTreeViewColumn *col,
                   GtkCellRenderer *cell)
 {
+    GtkTreeView *bview;
     GncBudget *budget;
     guint period_num;
     gnc_numeric numeric;
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
 
     budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col), "budget"));
+    bview = GTK_TREE_VIEW(g_object_get_data(G_OBJECT(col), "budget_view"));
     period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
                                   "period_num"));
 
@@ -837,10 +840,17 @@ budget_col_source(Account *account, GtkTreeViewColumn *col,
         }
         else
         {
+            GdkRGBA color;
+            GtkStyleContext *stylectxt = gtk_widget_get_style_context (GTK_WIDGET(bview));
+            gtk_style_context_get_color (stylectxt, GTK_STATE_FLAG_NORMAL, &color);
+
             numeric = gbv_get_accumulated_budget_amount(budget, account, period_num);
             xaccSPrintAmount(amtbuff, numeric,
                              gnc_account_print_info(account, FALSE));
-            g_object_set(cell, "foreground", "dark gray", NULL);
+            if (gnc_is_dark_theme (&color))
+                g_object_set(cell, "foreground", "darkgray", NULL);
+            else
+                g_object_set(cell, "foreground", "dimgray", NULL);
         }
     }
     else
@@ -855,7 +865,7 @@ budget_col_source(Account *account, GtkTreeViewColumn *col,
         {
             xaccSPrintAmount(amtbuff, numeric,
                              gnc_account_print_info(account, FALSE));
-            g_object_set(cell, "foreground", "black", NULL);
+            g_object_set(cell, "foreground", NULL, NULL);
         }
     }
     return g_strdup(amtbuff);
@@ -1032,21 +1042,21 @@ totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
     	// FIXME: There must be a better way to get the GncAccountPrintInfo object than this. Would prefer to depreciate the tracking of top level accounts.
         xaccSPrintAmount(amtbuff, totalincome,
                          gnc_account_print_info(priv->income, FALSE));
-        g_object_set(cell, "foreground", "black", NULL);
+        g_object_set(cell, "foreground", NULL, NULL);
     }
     else if (row_type == TOTALS_TYPE_EXPENSES)
     {
        
         xaccSPrintAmount(amtbuff, totalexpenses,
                          gnc_account_print_info(priv->expenses, FALSE));
-        g_object_set(cell, "foreground", "black", NULL);
+        g_object_set(cell, "foreground", NULL, NULL);
     }
     else if (row_type == TOTALS_TYPE_TRANSFERS)
     {
     	
         xaccSPrintAmount(amtbuff, gnc_numeric_sub(totalassets, totalliabilities, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD),
                          gnc_account_print_info(priv->assets, FALSE));
-        g_object_set(cell, "foreground", "black", NULL);
+        g_object_set(cell, "foreground", NULL, NULL);
     }
     else if (row_type == TOTALS_TYPE_TOTAL)
     {
@@ -1061,7 +1071,7 @@ totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
         }
         else
         {
-            g_object_set(cell, "foreground", "black", NULL);
+            g_object_set(cell, "foreground", NULL, NULL);
         }
     }
     else
@@ -1215,6 +1225,7 @@ gnc_budget_view_refresh(GncBudgetView *view)
                   GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
                   budget_col_source, budget_col_edited);
         g_object_set_data(G_OBJECT(col), "budget", priv->budget);
+        g_object_set_data(G_OBJECT(col), "budget_view", priv->tree_view);
         g_object_set_data(G_OBJECT(col), "period_num",
                           GUINT_TO_POINTER(num_periods_visible));
         col_list = g_list_append(col_list, col);

commit 9ce01be36aba542da4ed06f698428bbadc112c1a
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Apr 25 14:13:36 2018 +0100

    Bug 795471 - Budget window scrolls edited cell out of site
    
    When editing cells that have been revealed on the right by scrolling the
    window snaps back to the left hiding the cell being edited. This may be
    due to an underlying gtk issue but these changes fix the issue visually.

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 00be309..e47a418 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -133,6 +133,8 @@ static gnc_numeric gbv_get_accumulated_budget_amount(GncBudget* budget,
     This structure defines the different elements required for a budget view - the actual display of how a budget looks when you open it.
         @param tree_view Pointer to the widget to display the detailed budget.
         @param totals_tree_view Pointer to the widget to display the totals tree at the bottom of the budget screen.
+        @param the main scrolled window horizonatl adjustment
+        @param saved value for the horizontal adjustment
         @param budget Contains much of the data required to implement a budget.
         @param key Each budget struct has its own GUID.
         @param period_col_list List of columns in the tree_view widget (this list varies depending on the number of periods)
@@ -145,6 +147,9 @@ struct GncBudgetViewPrivate
     GtkTreeView *tree_view;
     GtkTreeView *totals_tree_view;
 
+    GtkAdjustment *hadj;
+    gfloat hadj_value;
+
     GncBudget* budget;
     GncGUID key;
 
@@ -312,6 +317,32 @@ gnc_budget_view_get_selected_accounts(GncBudgetView* view)
     return gnc_tree_view_account_get_selected_accounts(GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
 }
 
+static void
+gbv_container_set_focus_child_cb(GtkContainer *container, GtkWidget *widget,
+                               GncBudgetView* view)
+{
+    GncBudgetViewPrivate *priv;
+    g_return_if_fail(GNC_IS_BUDGET_VIEW(view));
+
+    priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
+
+    PINFO("set-focus-child container is %p, widget is %p", container, widget);
+
+    /* There seems to be an underlying gtk issue in this configuration when
+     * the main scroll window is scrolled to reveal the cells on the right
+     * and once selected/focused the window snapps back to the left so
+     * you can no longer see the cell. By saving the horizontal adjustment
+     * value from when this callback is called for inner_scrolled_window
+     * and using it when the main scrolled windows calls this call back
+     * visualy stops the error.
+     */
+
+    if (widget == GTK_WIDGET(priv->tree_view)) // we are looking at the inner scrolled window
+        priv->hadj_value = gtk_adjustment_get_value(priv->hadj);
+    else // we are looking at the scrolled window
+        gtk_adjustment_set_value(priv->hadj, priv->hadj_value);
+}
+
 /****************************
  * GncPluginPage Functions  *
  ***************************/
@@ -350,6 +381,9 @@ gbv_create_widget(GncBudgetView *view)
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
                                    GTK_POLICY_AUTOMATIC,
                                    GTK_POLICY_NEVER);
+    // save the main scrolled window horizontal adjustment
+    priv->hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(scrolled_window));
+
     gtk_widget_show(scrolled_window);
     gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, /*expand*/TRUE, /*fill*/TRUE, 0);
 
@@ -358,6 +392,10 @@ gbv_create_widget(GncBudgetView *view)
     gtk_container_add (GTK_CONTAINER(scrolled_window), GTK_WIDGET(inner_vbox));
     gtk_widget_show(GTK_WIDGET(inner_vbox));
 
+    // This is used to keep the selected cell in view
+    g_signal_connect(G_OBJECT(scrolled_window), "set-focus-child",
+                     G_CALLBACK(gbv_container_set_focus_child_cb), view);
+
     inner_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(inner_scrolled_window),
                                    GTK_POLICY_NEVER,
@@ -366,6 +404,10 @@ gbv_create_widget(GncBudgetView *view)
     tree_view = gnc_tree_view_account_new(FALSE);
     gtk_container_add(GTK_CONTAINER(inner_scrolled_window), GTK_WIDGET(tree_view));
 
+    // This is used to keep the selected cell in view
+    g_signal_connect(G_OBJECT(inner_scrolled_window), "set-focus-child",
+                     G_CALLBACK(gbv_container_set_focus_child_cb), view);
+
     guid_to_string_buff(&priv->key, guidstr);
     state_section = g_strjoin(" ", STATE_SECTION_PREFIX, guidstr, NULL);
     g_object_set(G_OBJECT(tree_view), "state-section", state_section, NULL);

commit dacaa93951f02d04d8d698f4cb01e60ec0082c85
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Apr 24 15:52:52 2018 +0100

    Bug 795446 - On Windows there is a blank tip of the day
    
    When the tip_of_the_day.list is created a new line is appended to the
    list file and on Windows this causes a blank tip so remove the adding
    of the extra line.

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index a369e57..5108379 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -44,8 +44,6 @@ FOREACH(line ${TIP_OF_THE_DAY_LINES})
   LIST(APPEND TOTD_OUTPUT "${line3}\n")
 ENDFOREACH()
 
-LIST(APPEND TOTD_OUTPUT "\n")
-
 STRING(CONCAT FINAL_TOTD ${TOTD_OUTPUT})
 
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tip_of_the_day.list "${FINAL_TOTD}")

commit 4e2697b02fe6b079dd7cf1eda8205f88d78d13ec
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Apr 21 15:13:03 2018 +0100

    Bug 794976 - Wrong context menu on register sheet
    
    Block the entry one and signal for the gnucash one to show.

diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index c50a413..028eb37 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -172,7 +172,6 @@ static void gnc_main_window_cmd_help_contents (GtkAction *action, GncMainWindow
 static void gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window);
 
 static void do_popup_menu(GncPluginPage *page, GdkEventButton *event);
-static gboolean gnc_main_window_popup_menu_cb (GtkWidget *widget, GncPluginPage *page);
 static GtkWidget *gnc_main_window_get_statusbar (GncWindow *window_in);
 static void statusbar_notification_lastmodified(void);
 
@@ -4797,7 +4796,7 @@ do_popup_menu(GncPluginPage *page, GdkEventButton *event)
  *  @return Always returns TRUE to indicate that the menu request was
  *  handled.
  */
-static gboolean
+gboolean
 gnc_main_window_popup_menu_cb (GtkWidget *widget,
                                GncPluginPage *page)
 {
diff --git a/gnucash/gnome-utils/gnc-main-window.h b/gnucash/gnome-utils/gnc-main-window.h
index 46f01bf..351a487 100644
--- a/gnucash/gnome-utils/gnc-main-window.h
+++ b/gnucash/gnome-utils/gnc-main-window.h
@@ -322,6 +322,24 @@ gboolean gnc_main_window_button_press_cb (GtkWidget *whatever,
         GdkEventButton *event,
         GncPluginPage *page);
 
+
+/** Callback function invoked when the user requests that Gnucash
+ *  popup the contextual menu via the keyboard context-menu request
+ *  key combination (Shift-F10 by default).
+ *
+ *  @param page This is the GncPluginPage corresponding to the visible
+ *  page.
+ *
+ *  @param widget Whatever widget had focus when the user issued the
+ *  keyboard context-menu request.
+ *
+ *  @return Always returns TRUE to indicate that the menu request was
+ *  handled.
+ */
+gboolean gnc_main_window_popup_menu_cb (GtkWidget *widget,
+        GncPluginPage *page);
+
+
 /** Restore the persistent state of all windows.
  *
  *  @param keyfile The GKeyFile containing persistent window state.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 9377f12..e97406b 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -180,6 +180,7 @@ static void gnc_plugin_page_register_cmd_associate_location_transaction (GtkActi
 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_popup_menu_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);
 
@@ -1129,6 +1130,10 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
                       G_CALLBACK ( gnc_plugin_page_help_changed_cb ),
                       page );
 
+    g_signal_connect (G_OBJECT (gsr), "show-popup-menu",
+                      G_CALLBACK ( gnc_plugin_page_popup_menu_cb ),
+                      page );
+
     reg = gnc_ledger_display_get_split_register(priv->ledger);
     gnc_split_register_config(reg, reg->type, reg->style,
                               reg->use_double_line);
@@ -4055,6 +4060,23 @@ gnc_plugin_page_help_changed_cb (GNCSplitReg *gsr, GncPluginPageRegister *regist
 }
 
 static void
+gnc_plugin_page_popup_menu_cb (GNCSplitReg *gsr, GncPluginPageRegister *register_page)
+{
+    GncWindow *window;
+
+    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;
+    }
+    gnc_main_window_popup_menu_cb (GTK_WIDGET(window), GNC_PLUGIN_PAGE(register_page));
+}
+
+static void
 gnc_plugin_page_register_refresh_cb (GHashTable *changes, gpointer user_data)
 {
     GncPluginPageRegister *page = user_data;
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index ac90943..d934cb3 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -113,9 +113,10 @@ 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 );
+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_show_popup_menu     ( 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);
@@ -221,6 +222,7 @@ enum gnc_split_reg_signal_enum
     UNVOID_TXN_SIGNAL,
     REVERSE_TXN_SIGNAL,
     HELP_CHANGED_SIGNAL,
+    SHOW_POPUP_MENU_SIGNAL,
     INCLUDE_DATE_SIGNAL,
     LAST_SIGNAL
 };
@@ -239,26 +241,27 @@ gnc_split_reg_class_init( GNCSplitRegClass *klass )
         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 ) },
+        { 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 ) },
+        { SHOW_POPUP_MENU_SIGNAL, "show-popup-menu", G_STRUCT_OFFSET( GNCSplitRegClass, show_popup_menu_cb ) },
+        { INCLUDE_DATE_SIGNAL,    "include-date",    G_STRUCT_OFFSET( GNCSplitRegClass, include_date_cb ) },
         { LAST_SIGNAL, NULL, 0 }
     };
 
@@ -309,6 +312,7 @@ gnc_split_reg_class_init( GNCSplitRegClass *klass )
     klass->reverse_txn_cb  = gsr_default_reverse_txn_handler;
 
     klass->help_changed_cb = NULL;
+    klass->show_popup_menu_cb = NULL;
     klass->include_date_cb = NULL;
 }
 
@@ -416,6 +420,8 @@ gsr_create_table( GNCSplitReg *gsr )
                       G_CALLBACK(gsr_redraw_all_cb), gsr);
     g_signal_connect (gsr->reg, "redraw_help",
                       G_CALLBACK(gsr_emit_help_changed), gsr);
+    g_signal_connect (gsr->reg, "show_popup_menu",
+                      G_CALLBACK(gsr_emit_show_popup_menu), gsr);
 
     LEAVE(" ");
 }
@@ -2207,6 +2213,13 @@ gsr_emit_help_changed( GnucashRegister *reg, gpointer user_data )
 
 static
 void
+gsr_emit_show_popup_menu( GnucashRegister *reg, gpointer user_data )
+{
+    gsr_emit_simple_signal( (GNCSplitReg*)user_data, "show-popup-menu" );
+}
+
+static
+void
 gsr_emit_include_date_signal( GNCSplitReg *gsr, time64 date )
 {
     g_signal_emit_by_name( gsr, "include-date", date, NULL );
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index 02bd07c..37bea97 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -92,26 +92,27 @@ struct _GNCSplitRegClass
     GtkBoxClass parent_class;
 
     /* Signal defaults */
-    void (*enter_ent_cb)    ( GNCSplitReg *w, gpointer user_data );
-    void (*cancel_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-    void (*delete_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-    void (*reinit_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-    void (*dup_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
-    void (*schedule_ent_cb) ( GNCSplitReg *w, gpointer user_data );
-    void (*expand_ent_cb)   ( GNCSplitReg *w, gpointer user_data );
-    void (*blank_cb)        ( GNCSplitReg *w, gpointer user_data );
-    void (*jump_cb)         ( GNCSplitReg *w, gpointer user_data );
-    void (*cut_cb)          ( GNCSplitReg *w, gpointer user_data );
-    void (*cut_txn_cb)      ( GNCSplitReg *w, gpointer user_data );
-    void (*copy_cb)         ( GNCSplitReg *w, gpointer user_data );
-    void (*copy_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
-    void (*paste_cb)        ( GNCSplitReg *w, gpointer user_data );
-    void (*paste_txn_cb)    ( GNCSplitReg *w, gpointer user_data );
-    void (*void_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
-    void (*unvoid_txn_cb)   ( GNCSplitReg *w, gpointer user_data );
-    void (*reverse_txn_cb)  ( GNCSplitReg *w, gpointer user_data );
-    void (*help_changed_cb) ( GNCSplitReg *w, gpointer user_data );
-    void (*include_date_cb) ( GNCSplitReg *w, time64 date, gpointer user_data );
+    void (*enter_ent_cb)       ( GNCSplitReg *w, gpointer user_data );
+    void (*cancel_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*delete_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*reinit_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*dup_ent_cb)         ( GNCSplitReg *w, gpointer user_data );
+    void (*schedule_ent_cb)    ( GNCSplitReg *w, gpointer user_data );
+    void (*expand_ent_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*blank_cb)           ( GNCSplitReg *w, gpointer user_data );
+    void (*jump_cb)            ( GNCSplitReg *w, gpointer user_data );
+    void (*cut_cb)             ( GNCSplitReg *w, gpointer user_data );
+    void (*cut_txn_cb)         ( GNCSplitReg *w, gpointer user_data );
+    void (*copy_cb)            ( GNCSplitReg *w, gpointer user_data );
+    void (*copy_txn_cb)        ( GNCSplitReg *w, gpointer user_data );
+    void (*paste_cb)           ( GNCSplitReg *w, gpointer user_data );
+    void (*paste_txn_cb)       ( GNCSplitReg *w, gpointer user_data );
+    void (*void_txn_cb)        ( GNCSplitReg *w, gpointer user_data );
+    void (*unvoid_txn_cb)      ( GNCSplitReg *w, gpointer user_data );
+    void (*reverse_txn_cb)     ( GNCSplitReg *w, gpointer user_data );
+    void (*help_changed_cb)    ( GNCSplitReg *w, gpointer user_data );
+    void (*show_popup_menu_cb) ( GNCSplitReg *w, gpointer user_data );
+    void (*include_date_cb)    ( GNCSplitReg *w, time64 date, gpointer user_data );
 };
 /* Something somewhere sets these to silly values and causes problems */
 #undef DELETE
diff --git a/gnucash/register/register-gnome/gnucash-item-edit.c b/gnucash/register/register-gnome/gnucash-item-edit.c
index 7a2a3b4..d62e4f2 100644
--- a/gnucash/register/register-gnome/gnucash-item-edit.c
+++ b/gnucash/register/register-gnome/gnucash-item-edit.c
@@ -801,6 +801,22 @@ gnc_item_edit_get_padding_border (GncItemEdit *item_edit, Sides side)
     }
 }
 
+static gboolean
+button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer *pointer)
+{
+    GnucashSheet *sheet = GNUCASH_SHEET(pointer);
+
+    /* Ignore double-clicks and triple-clicks */
+    if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+    {
+        // This is a right click event so over ride entry menu and
+        // display main register popup menu.
+        g_signal_emit_by_name (sheet->reg, "show_popup_menu");
+        return TRUE;
+    }
+    return FALSE;
+}
+
 GtkWidget *
 gnc_item_edit_new (GnucashSheet *sheet)
 {
@@ -867,6 +883,11 @@ gnc_item_edit_new (GnucashSheet *sheet)
     g_signal_connect (item_edit, "draw",
                             G_CALLBACK (draw_background_cb), item_edit);
 
+    // This call back intercepts the mouse button event so the main
+    // register popup menu can be displayed instead of the entry one.
+    g_signal_connect (item_edit->editor, "button-press-event",
+                            G_CALLBACK (button_press_cb), sheet);
+
     /* Create the popup button
        It will only be displayed when the cell being edited provides
        a popup item (like a calendar or account list) */
diff --git a/gnucash/register/register-gnome/gnucash-register.c b/gnucash/register/register-gnome/gnucash-register.c
index 2987093..5581508 100644
--- a/gnucash/register/register-gnome/gnucash-register.c
+++ b/gnucash/register/register-gnome/gnucash-register.c
@@ -53,6 +53,7 @@ enum
     ACTIVATE_CURSOR,
     REDRAW_ALL,
     REDRAW_HELP,
+    SHOW_POPUP_MENU,
     LAST_SIGNAL
 };
 
@@ -82,6 +83,7 @@ struct _GnucashRegisterClass
     void (*activate_cursor) (GnucashRegister *reg);
     void (*redraw_all)      (GnucashRegister *reg);
     void (*redraw_help)     (GnucashRegister *reg);
+    void (*show_popup_menu) (GnucashRegister *reg);
 };
 
 /** Implementation *****************************************************/
@@ -351,9 +353,20 @@ gnucash_register_class_init (GnucashRegisterClass *klass)
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE, 0);
 
+    register_signals[SHOW_POPUP_MENU] =
+        g_signal_new("show_popup_menu",
+                     G_TYPE_FROM_CLASS(gobject_class),
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET(GnucashRegisterClass,
+                                     show_popup_menu),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE, 0);
+
     klass->activate_cursor = NULL;
     klass->redraw_all = NULL;
     klass->redraw_help = NULL;
+    klass->show_popup_menu = NULL;
 }
 
 

commit 6a37d7f5dd270ae69d8eb743dad44680536abd86
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Apr 21 12:57:07 2018 +0100

    Bug 795132 - Tabs not workings on register sheet with caps-lock
    
    And the keyboard event state with the default mod mask to eliminate the
    effect of the caps-lock value.

diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 980c0ea..2fd6398 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -1689,6 +1689,7 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
     VirtualLocation new_virt_loc;
     gncTableTraversalDir direction = 0;
     int distance;
+    GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
 
     g_return_val_if_fail(widget != NULL, TRUE);
     g_return_val_if_fail(GNUCASH_IS_SHEET(widget), TRUE);
@@ -1706,7 +1707,7 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
     /* Don't process any keystrokes where a modifier key (Alt,
      * Meta, etc.) is being held down.  This should't include
          * MOD2, aka NUM LOCK. */
-    if (event->state & (GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK))
+    if (event->state & modifiers & (GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK))
         pass_on = TRUE;
 
     /* Calculate tentative physical values */

commit 9e784b03e14023232dec7ec8558c77a73b1736c4
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Apr 21 12:56:12 2018 +0100

    Remove white space and tabs from dialog-custom-report.c

diff --git a/gnucash/report/report-gnome/dialog-custom-report.c b/gnucash/report/report-gnome/dialog-custom-report.c
index 14c1370..d201982 100644
--- a/gnucash/report/report-gnome/dialog-custom-report.c
+++ b/gnucash/report/report-gnome/dialog-custom-report.c
@@ -116,7 +116,6 @@ close_custom_report_clicked_cb(GtkWidget* widget, gpointer data)
     custom_report_dialog_close_cb(NULL, crd);
 }
 
-
 /********************************************************************
  * update_report_list
  *
@@ -156,7 +155,7 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
     if (scm_is_list(rpt_guids))
     {
         /* for all the report guids in the list, store them, with a reference,
-        	 in the gtkliststore */
+             in the gtkliststore */
         for (i = 0; !scm_is_null(rpt_guids); i++)
         {
             GncGUID *guid = guid_malloc ();
@@ -179,7 +178,6 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
     }
 }
 
-
 static GtkTreeModel *
 create_and_fill_report_list(CustomReportDialog *crd)
 {
@@ -192,7 +190,6 @@ create_and_fill_report_list(CustomReportDialog *crd)
     return GTK_TREE_MODEL (store);
 }
 
-
 static void
 set_reports_view_and_model(CustomReportDialog *crd)
 {
@@ -237,7 +234,6 @@ set_reports_view_and_model(CustomReportDialog *crd)
     g_object_unref(model);
 }
 
-
 /**************************************************************
  * custom_report_run_report
  *
@@ -319,8 +315,6 @@ custom_report_delete (SCM guid, CustomReportDialog *crd)
     g_free (report_name);
 }
 
-
-
 /********************************************************************
  * get_custom_report_selection
  *
@@ -359,7 +353,6 @@ get_custom_report_selection(CustomReportDialog *crd,
     return scm_from_utf8_string (guid_str);
 }
 
-
 /**************************************************************
  * custom_report_list_view_row_activated_cb
  *
@@ -393,7 +386,6 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
     }
 }
 
-
 /**************************************************************
  * custom_report_list_view_clicked_cb
  *
@@ -439,7 +431,8 @@ custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpo
     return FALSE;
 }
 
-void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data)
+void
+custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data)
 {
     CustomReportDialog *crd = data;
     SCM guid = get_custom_report_selection(crd, _("Unable to change report configuration name."));
@@ -455,16 +448,15 @@ void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gc
     else
         gnc_error_dialog (GTK_WINDOW (crd->dialog), "%s",
                           _("A saved report configuration with this name already exists, please choose another name.") );
-
-
 }
 
-gboolean custom_report_query_tooltip_cb (GtkTreeView  *view,
-                                     gint        x,
-                                     gint        y,
-                                     gboolean    keyboard_mode,
-                                     GtkTooltip *tooltip,
-                                     gpointer    data)
+gboolean
+custom_report_query_tooltip_cb (GtkTreeView  *view,
+                                gint        x,
+                                gint        y,
+                                gboolean    keyboard_mode,
+                                GtkTooltip *tooltip,
+                                gpointer    data)
 {
     CustomReportDialog *crd = data;
     GtkTreePath *path = NULL;
@@ -495,9 +487,9 @@ gboolean custom_report_query_tooltip_cb (GtkTreeView  *view,
 }
 
 /* Internal function that builds the dialog */
-static CustomReportDialog *gnc_ui_custom_report_internal(GncMainWindow * window)
+static CustomReportDialog *
+gnc_ui_custom_report_internal(GncMainWindow * window)
 {
-
     GtkBuilder *builder;
     CustomReportDialog *crd;
     GtkTreeIter iter;
@@ -532,40 +524,40 @@ static CustomReportDialog *gnc_ui_custom_report_internal(GncMainWindow * window)
     model = gtk_tree_view_get_model (GTK_TREE_VIEW (crd->reportview));
     if (gtk_tree_model_get_iter_first (model, &iter))
     {
-		/* saved reports available
-		   -> hide the "no reports available" notification */
-		gtk_widget_hide(no_report_notification);
-	}
-	else
-	{
-		/* hide the scrolled window of the report list */
-		gtk_widget_hide(crd->reportview);
-	}
+        /* saved reports available
+           -> hide the "no reports available" notification */
+        gtk_widget_hide(no_report_notification);
+    }
+    else
+    {
+        /* hide the scrolled window of the report list */
+        gtk_widget_hide(crd->reportview);
+    }
 
     g_object_unref(G_OBJECT(builder));
 
     return crd;
 }
 
-
 /***********************************************************
  * gnc_ui_custom_report
  *
  * this is the primary driver for the custom report dialog.
  ***********************************************************/
-void gnc_ui_custom_report(GncMainWindow * window)
+void
+gnc_ui_custom_report(GncMainWindow * window)
 {
     gnc_ui_custom_report_internal (window);
 }
 
-
 /***********************************************************
  * gnc_ui_custom_report_edit_name
  *
  * open the custom report dialog and highlight the given
  * report's name for editing.
  ***********************************************************/
-void gnc_ui_custom_report_edit_name (GncMainWindow * window, SCM scm_guid)
+void
+gnc_ui_custom_report_edit_name (GncMainWindow * window, SCM scm_guid)
 {
     SCM is_custom_report;
     CustomReportDialog *crd = gnc_ui_custom_report_internal (window);

commit 0eabe766eb65ef35740f6987649175d4e2ea7aea
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Apr 21 12:33:22 2018 +0100

    On Windows the tooltip for saved reports was incorrect
    
    When the mouse was placed over a saved report description on Windows an
    empty tooltip was displayed. Setup the query tooltip callback so it does
     not display a tooltip for description column.

diff --git a/gnucash/report/report-gnome/dialog-custom-report.c b/gnucash/report/report-gnome/dialog-custom-report.c
index 0f06613..14c1370 100644
--- a/gnucash/report/report-gnome/dialog-custom-report.c
+++ b/gnucash/report/report-gnome/dialog-custom-report.c
@@ -86,12 +86,12 @@ void custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *pa
         GtkTreeViewColumn *column, gpointer data);
 gboolean custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpointer data);
 void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data);
-void custom_report_query_tooltip_cb (GtkTreeView  *view,
-                                     gint        x,
-                                     gint        y,
-                                     gboolean    keyboard_mode,
-                                     GtkTooltip *tooltip,
-                                     gpointer    data);
+gboolean custom_report_query_tooltip_cb (GtkTreeView  *view,
+                                         gint        x,
+                                         gint        y,
+                                         gboolean    keyboard_mode,
+                                         GtkTooltip *tooltip,
+                                         gpointer    data);
 
 void
 custom_report_dialog_close_cb(GtkWidget* widget, gpointer data)
@@ -458,7 +458,8 @@ void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gc
 
 
 }
-void custom_report_query_tooltip_cb (GtkTreeView  *view,
+
+gboolean custom_report_query_tooltip_cb (GtkTreeView  *view,
                                      gint        x,
                                      gint        y,
                                      gboolean    keyboard_mode,
@@ -470,23 +471,27 @@ void custom_report_query_tooltip_cb (GtkTreeView  *view,
     GtkTreeViewColumn *column = NULL;
     gint cellx, celly;
 
-    g_return_if_fail ( view != NULL );
+    g_return_val_if_fail ( view != NULL, FALSE );
 
     if (gtk_tree_view_get_path_at_pos (view, x, y,
                                        &path, &column,
                                        &cellx, &celly))
     {
-        gtk_tree_view_set_tooltip_cell (view, tooltip, path, column, NULL);
-        if (column == crd->runcol)
-            gtk_tooltip_set_text (tooltip, _("Load report configuration"));
-        else if (column == crd->editcol)
-            gtk_tooltip_set_text (tooltip, _("Edit report configuration name"));
-        else if (column == crd->delcol)
-            gtk_tooltip_set_text (tooltip, _("Delete report configuration"));
+        if (column != crd->namecol)
+        {
+            gtk_tree_view_set_tooltip_cell (view, tooltip, path, column, NULL);
+            if (column == crd->runcol)
+                gtk_tooltip_set_text (tooltip, _("Load report configuration"));
+            else if (column == crd->editcol)
+                gtk_tooltip_set_text (tooltip, _("Edit report configuration name"));
+            else if (column == crd->delcol)
+                gtk_tooltip_set_text (tooltip, _("Delete report configuration"));
+            return TRUE;
+        }
         else
             gtk_tooltip_set_text (tooltip, NULL);
     }
-
+    return FALSE;
 }
 
 /* Internal function that builds the dialog */

commit ce839588dbbf9b29b2104614405c126c2e1b0f41
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Apr 21 12:28:49 2018 +0100

    Bug 794990 - Double click does not work on saved reports
    
    When you double click on the saved report description nothing happens.
    This was down to a conflict on a couple of call backs and one of them
    was incorrectly setup.

diff --git a/gnucash/report/report-gnome/dialog-custom-report.c b/gnucash/report/report-gnome/dialog-custom-report.c
index 980cf01..0f06613 100644
--- a/gnucash/report/report-gnome/dialog-custom-report.c
+++ b/gnucash/report/report-gnome/dialog-custom-report.c
@@ -84,7 +84,7 @@ void custom_report_help_cb(GtkWidget* widget, gpointer data);
 void close_custom_report_clicked_cb(GtkWidget* widget, gpointer data);
 void custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
         GtkTreeViewColumn *column, gpointer data);
-void custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpointer data);
+gboolean custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpointer data);
 void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data);
 void custom_report_query_tooltip_cb (GtkTreeView  *view,
                                      gint        x,
@@ -379,14 +379,17 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
 
     if (gtk_tree_model_get_iter(model, &iter, path))
     {
-        GncGUID *guid = guid_malloc ();
-        gchar *guid_str;
+        if (column == crd->namecol)
+        {
+            GncGUID *guid = guid_malloc ();
+            gchar *guid_str;
 
-        gtk_tree_model_get(model, &iter, COL_NUM, &guid, -1);
-        guid_str = g_new0 (gchar, GUID_ENCODING_LENGTH+1 );
-        guid_to_string_buff (guid, guid_str);
+            gtk_tree_model_get(model, &iter, COL_NUM, &guid, -1);
+            guid_str = g_new0 (gchar, GUID_ENCODING_LENGTH+1 );
+            guid_to_string_buff (guid, guid_str);
 
-        custom_report_run_report(scm_from_utf8_string (guid_str), crd);
+            custom_report_run_report(scm_from_utf8_string (guid_str), crd);
+        }
     }
 }
 
@@ -399,7 +402,7 @@ custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
  * pictogram, the corresponding action will be executed on the
  * selected row.
  **************************************************************/
-void
+gboolean
 custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpointer data)
 {
     CustomReportDialog *crd = data;
@@ -407,7 +410,7 @@ custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpo
     GtkTreeViewColumn *column = NULL;
     gint cellx, celly;
 
-    g_return_if_fail ( view != NULL );
+    g_return_val_if_fail ( view != NULL, FALSE );
 
     if (gtk_tree_view_get_path_at_pos (view, event->x, event->y,
                                        &path, &column,
@@ -417,19 +420,23 @@ custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpo
         {
             SCM guid = get_custom_report_selection(crd, _("You must select a report configuration to load."));
             custom_report_run_report (guid, crd);
+            return TRUE;
         }
         else if (column == crd->editcol)
         {
             g_object_set(G_OBJECT(crd->namerenderer), "editable", TRUE, NULL);
             gtk_tree_view_set_cursor_on_cell (view, path, crd->namecol,
                                               crd->namerenderer, TRUE);
+            return TRUE;
         }
         else if (column == crd->delcol)
         {
             SCM guid = get_custom_report_selection(crd, _("You must select a report configuration to delete."));
             custom_report_delete (guid, crd);
+            return TRUE;
         }
     }
+    return FALSE;
 }
 
 void custom_report_name_edited_cb(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data)



Summary of changes:
 doc/CMakeLists.txt                                 |   2 -
 gnucash/gnome-utils/gnc-main-window.c              |   3 +-
 gnucash/gnome-utils/gnc-main-window.h              |  18 ++
 gnucash/gnome/gnc-budget-view.c                    | 232 +++++++++++++--------
 gnucash/gnome/gnc-plugin-page-register.c           |  22 ++
 gnucash/gnome/gnc-split-reg.c                      |  59 ++++--
 gnucash/gnome/gnc-split-reg.h                      |  41 ++--
 .../register/register-gnome/gnucash-item-edit.c    |  21 ++
 gnucash/register/register-gnome/gnucash-register.c |  13 ++
 gnucash/register/register-gnome/gnucash-sheet.c    |   3 +-
 gnucash/report/report-gnome/dialog-custom-report.c | 118 ++++++-----
 11 files changed, 338 insertions(+), 194 deletions(-)



More information about the gnucash-changes mailing list