gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Tue Jul 30 05:27:47 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/76ba1331 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d4dd2891 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/aca8a734 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/69f76c63 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b56203e0 (commit)
	from  https://github.com/Gnucash/gnucash/commit/aadb3d14 (commit)



commit 76ba133174bc1b638ae0a186a248733e03ae1aaf
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jul 18 15:43:38 2019 +0100

    Account Picker dialogue warning message placement
    
    Currently this message is below the dialogue buttons so move the
    message to above them.

diff --git a/gnucash/gtkbuilder/dialog-import.glade b/gnucash/gtkbuilder/dialog-import.glade
index d1cd6396b..74e040d92 100644
--- a/gnucash/gtkbuilder/dialog-import.glade
+++ b/gnucash/gtkbuilder/dialog-import.glade
@@ -79,7 +79,7 @@
             <property name="expand">False</property>
             <property name="fill">False</property>
             <property name="pack_type">end</property>
-            <property name="position">0</property>
+            <property name="position">4</property>
           </packing>
         </child>
         <child>
@@ -108,6 +108,20 @@
             <property name="position">1</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkScrolledWindow" id="account_tree_sw">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkBox" id="placeholder_warning_hbox">
             <property name="can_focus">False</property>
@@ -143,22 +157,7 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkScrolledWindow" id="account_tree_sw">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">4</property>
+            <property name="position">3</property>
           </packing>
         </child>
       </object>
@@ -1283,9 +1282,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <placeholder/>
-        </child>
       </object>
     </child>
     <action-widgets>

commit d4dd289113452e2aceedbbecc3ef8ad837ce3859
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jul 18 15:42:27 2019 +0100

    Error when cancelling the create a new account in register
    
    When you are asked whether you want to create a new account on the
    register, possibly due to a typo and you answer no, the same dialogue
    will appear another three times before resetting the account cell to
    the original value.
    
    These changes eliminate that by returning you back to the cell with the
    invalid entry so that you can amend / cancel or use the dialogue again
    to create a new account based on an amended entry.

diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index 628da74d5..5291e41bb 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -2268,7 +2268,7 @@ gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev, gboolean refresh
         gnc_ledger_display_refresh( gsr->ledger );
 }
 
-static void
+static gboolean
 gnc_split_reg_record (GNCSplitReg *gsr)
 {
     SplitRegister *reg;
@@ -2282,7 +2282,7 @@ gnc_split_reg_record (GNCSplitReg *gsr)
     if (!gnc_split_register_save (reg, TRUE))
     {
         LEAVE("no save");
-        return;
+        return FALSE;
     }
 
     gsr_emit_include_date_signal( gsr, xaccTransGetDate(trans) );
@@ -2291,6 +2291,7 @@ gnc_split_reg_record (GNCSplitReg *gsr)
      * since gui_refresh events should handle this. */
     /* gnc_split_register_redraw (reg); */
     LEAVE(" ");
+    return TRUE;
 }
 
 static gboolean
@@ -2354,7 +2355,14 @@ gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction )
     }
 
     /* First record the transaction. This will perform a refresh. */
-    gnc_split_reg_record( gsr );
+    if (!gnc_split_reg_record (gsr))
+    {
+        /* make sure the sheet has the focus if the record is FALSE
+         * which results in no cursor movement. */
+        gnc_split_reg_focus_on_sheet (gsr);
+        LEAVE(" ");
+        return;
+    }
 
     if (!goto_blank && next_transaction)
         gnc_split_register_expand_current_trans (sr, FALSE);
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 9fc109927..a73ac9382 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1735,8 +1735,12 @@ gnc_split_register_save (SplitRegister *reg, gboolean do_commit)
           blank_split, blank_trans, pending_trans, trans);
 
     /* Act on any changes to the current cell before the save. */
-    (void) gnc_split_register_check_cell (reg,
-                                          gnc_table_get_current_cell_name (reg->table));
+    if (!gnc_split_register_check_cell (reg,
+            gnc_table_get_current_cell_name (reg->table)))
+    {
+        LEAVE("need another go at changing cell");
+        return FALSE;
+    }
 
     if (!gnc_split_register_auto_calc (reg, split))
     {
@@ -1945,6 +1949,10 @@ gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
     if (!account)
         account = gnc_account_lookup_by_code(gnc_get_current_root_account(), name);
 
+    /* if gnc_ui_new_accounts_from_name_window is used, there is a call to
+     * refresh which subsequently calls this function again, thats the
+     * reason for static creating_account. */
+
     if (!account && !creating_account)
     {
         /* Ask if they want to create a new one. */
@@ -1958,21 +1966,27 @@ gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
             return NULL;
     }
 
-    /* Now have the account. */
-    account_name = gnc_get_account_name_for_split_register (account, reg->show_leaf_accounts);
-    if (g_strcmp0(account_name, gnc_basic_cell_get_value(bcell)))
+    if (!creating_account)
     {
-        /* The name has changed. Update the cell. */
-        gnc_combo_cell_set_value (cell, account_name);
-        gnc_basic_cell_set_changed (&cell->cell, TRUE);
-    }
-    g_free (account_name);
+        /* Now have the account. */
+        account_name = gnc_get_account_name_for_split_register (account, reg->show_leaf_accounts);
+        if (g_strcmp0(account_name, gnc_basic_cell_get_value(bcell)))
+        {
+            /* The name has changed. Update the cell. */
+            gnc_combo_cell_set_value (cell, account_name);
+            gnc_basic_cell_set_changed (&cell->cell, TRUE);
+        }
+        g_free (account_name);
 
-    /* See if the account (either old or new) is a placeholder. */
-    if (account && xaccAccountGetPlaceholder (account))
-    {
-        gnc_error_dialog (GTK_WINDOW (gnc_split_register_get_parent (reg)),
-                          placeholder, name);
+        /* See if the account (either old or new) is a placeholder. */
+        if (account && xaccAccountGetPlaceholder (account))
+        {
+            gchar *fullname = gnc_account_get_full_name (account);
+            gnc_error_dialog (GTK_WINDOW (gnc_split_register_get_parent (reg)),
+                              placeholder, fullname);
+            g_free (fullname);
+            return NULL;
+        }
     }
 
     /* Be seeing you. */
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index abfaf6039..683455b6c 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -1855,7 +1855,12 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
 
     /* If that would leave the register, abort */
     if (abort_move)
+    {
+        // Make sure the sheet is the focus
+        if (!gtk_widget_has_focus(GTK_WIDGET (sheet)))
+            gtk_widget_grab_focus (GTK_WIDGET (sheet));
         return TRUE;
+    }
 
     /* Clear the saved selection for the new cell. */
     sheet->end_sel = sheet->start_sel;

commit aca8a734b0ae0f058dadb1ef3f18e81f987a5eb6
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jul 16 13:34:13 2019 +0100

    Error when creating a new account on expanded transaction
    
    With the register in journal mode and you edit the account field so the
    'Account x does not exist, do you want to create it' dialogue is shown
    you get the following error...
    
    gboolean boolean_from_key(const Account*, const std::vector<std::
    __cxx11::basic_string<char> >&): assertion 'GNC_IS_ACCOUNT(acc)' failed
    
    This was tracked down to a refresh being triggered with the account
    dialogue so add a check for a valid account as part of the placeholder
    test.

diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 852c85cb7..9fc109927 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1969,7 +1969,7 @@ gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
     g_free (account_name);
 
     /* See if the account (either old or new) is a placeholder. */
-    if (xaccAccountGetPlaceholder (account))
+    if (account && xaccAccountGetPlaceholder (account))
     {
         gnc_error_dialog (GTK_WINDOW (gnc_split_register_get_parent (reg)),
                           placeholder, name);

commit 69f76c63787d991605b8890a867674f54ec489a5
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jul 16 13:30:01 2019 +0100

    Bug 797301/2 - Sub-account register not seeing changes to sub accounts.
    
    If you have a sub account register open and you create another account
    that is a descendant of the top account the transaction will not be
    seen as the query used for the sub account register does not include
    the new account. Add a check to 'refresh_handler' to check for the same
    number of sub accounts, if different recreate query.

diff --git a/gnucash/register/ledger-core/gnc-ledger-display.c b/gnucash/register/ledger-core/gnc-ledger-display.c
index c84c1f7cd..456048f1b 100644
--- a/gnucash/register/ledger-core/gnc-ledger-display.c
+++ b/gnucash/register/ledger-core/gnc-ledger-display.c
@@ -70,6 +70,8 @@ struct gnc_ledger_display
     GNCLedgerDisplayGetParent get_parent;
 
     gpointer user_data;
+    
+    gint number_of_subaccounts;
 
     gint component_id;
 };
@@ -87,9 +89,13 @@ gnc_ledger_display_internal (Account *lead_account, Query *q,
                              SplitRegisterStyle style,
                              gboolean use_double_line,
                              gboolean is_template);
+
 static void gnc_ledger_display_refresh_internal (GNCLedgerDisplay *ld,
-        GList *splits);
+                             GList *splits);
 
+static void gnc_ledger_display_make_query (GNCLedgerDisplay *ld,
+                             gint limit,
+                             SplitRegisterType type);
 
 /** Implementations *************************************************/
 
@@ -572,6 +578,21 @@ refresh_handler (GHashTable *changes, gpointer user_data)
         }
     }
 
+    /* if subaccount ledger, check to see if still the same number
+     *  of subaccounts, if not recreate the query. */
+    if (ld->ld_type == LD_SUBACCOUNT)
+    {
+        Account *leader = gnc_ledger_display_leader (ld);
+        GList *accounts = gnc_account_get_descendants (leader);
+
+        if (g_list_length (accounts) != ld->number_of_subaccounts)
+            gnc_ledger_display_make_query (ld,
+                               gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_MAX_TRANS),
+                               gnc_get_reg_type (leader, ld->ld_type));
+
+        g_list_free (accounts);
+    }
+
     /* Its not clear if we should re-run the query, or if we should
      * just use qof_query_last_run().  Its possible that the dates
      * changed, requiring a full new query.  Similar considerations
@@ -647,8 +668,14 @@ gnc_ledger_display_make_query (GNCLedgerDisplay *ld,
 
     leader = gnc_ledger_display_leader (ld);
 
+    /* if this is a subaccount ledger, record the number of 
+     * subaccounts so we can determine if the query needs 
+     * recreating on a refresh. */
     if (ld->ld_type == LD_SUBACCOUNT)
+    {
         accounts = gnc_account_get_descendants (leader);
+        ld->number_of_subaccounts = g_list_length (accounts);
+    }
     else
         accounts = NULL;
 

commit b56203e06f6a87f17b362dd5a7ed1e1112fe3116
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jul 16 13:29:18 2019 +0100

    Bug 797301/1 - Menu View->Refresh not refreshing register
    
    The Menu 'View->Refresh' only worked for the report page which reloaded
    the report so added functions for other pages as follows. The Register
    and Budget pages are reloaded with the remaining pages being redrawn
    with a call to gtk_widget_queue_draw.

diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 5f4ac0a83..36c7c81d7 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -146,6 +146,7 @@ static void gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action,
 static void gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageAccountTree *plugin_page);
 static void gnc_plugin_page_account_tree_cmd_reconcile (GtkAction *action, GncPluginPageAccountTree *page);
+static void gnc_plugin_page_account_tree_cmd_refresh (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_autoclear (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_transfer (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_stock_split (GtkAction *action, GncPluginPageAccountTree *page);
@@ -253,6 +254,11 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
         "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
         G_CALLBACK (gnc_plugin_page_account_tree_cmd_view_filter_by)
     },
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_refresh)
+    },
 
     /* Actions menu */
     {
@@ -1656,6 +1662,18 @@ gnc_plugin_page_account_tree_cmd_renumber_accounts (GtkAction *action,
     gnc_account_renumber_create_dialog(window, account);
 }
 
+static void
+gnc_plugin_page_account_tree_cmd_refresh (GtkAction *action,
+        GncPluginPageAccountTree *page)
+{
+    GncPluginPageAccountTreePrivate *priv;
+
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE(page));
+
+    priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(page);
+    gtk_widget_queue_draw (priv->widget);
+}
+
 /*********************/
 
 static void
diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c
index d47ae121c..5d785682e 100644
--- a/gnucash/gnome/gnc-plugin-page-budget.c
+++ b/gnucash/gnome/gnc-plugin-page-budget.c
@@ -117,6 +117,8 @@ static void gnc_plugin_page_budget_cmd_estimate_budget(
     GtkAction *action, GncPluginPageBudget *page);
 static void gnc_plugin_page_budget_cmd_allperiods_budget(
     GtkAction *action, GncPluginPageBudget *page);
+static void gnc_plugin_page_budget_cmd_refresh (
+    GtkAction *action, GncPluginPageBudget *page);
 
 static GtkActionEntry gnc_plugin_page_budget_actions [] =
 {
@@ -165,6 +167,11 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] =
         "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
         G_CALLBACK (gnc_plugin_page_budget_cmd_view_filter_by)
     },
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_budget_cmd_refresh)
+    },
 
 };
 
@@ -1145,3 +1152,18 @@ gnc_plugin_page_budget_cmd_view_filter_by (GtkAction *action,
 
     LEAVE(" ");
 }
+
+static void
+gnc_plugin_page_budget_cmd_refresh (GtkAction *action,
+        GncPluginPageBudget *page)
+{
+    GncPluginPageBudgetPrivate *priv;
+
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET(page));
+    ENTER("(action %p, page %p)", action, page);
+
+    priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
+
+    gnc_budget_view_refresh (priv->budget_view);
+    LEAVE(" ");
+}
diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c
index cbd4b8497..ba7bafb4c 100644
--- a/gnucash/gnome/gnc-plugin-page-invoice.c
+++ b/gnucash/gnome/gnc-plugin-page-invoice.c
@@ -69,6 +69,7 @@ static void gnc_plugin_page_invoice_cmd_edit (GtkAction *action, GncPluginPageIn
 static void gnc_plugin_page_invoice_cmd_duplicateInvoice (GtkAction *action, GncPluginPageInvoice *plugin_page);
 static void gnc_plugin_page_invoice_cmd_post (GtkAction *action, GncPluginPageInvoice *plugin_page);
 static void gnc_plugin_page_invoice_cmd_unpost (GtkAction *action, GncPluginPageInvoice *plugin_page);
+static void gnc_plugin_page_invoice_cmd_refresh (GtkAction *action, GncPluginPageInvoice *plugin_page);
 
 static void gnc_plugin_page_invoice_cmd_sort_changed (GtkAction *action,
         GtkRadioAction *current,
@@ -147,6 +148,13 @@ static GtkActionEntry gnc_plugin_page_invoice_actions [] =
         G_CALLBACK (gnc_plugin_page_invoice_cmd_unpost)
     },
 
+    /* View menu */
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_invoice_cmd_refresh)
+    },
+
     /* Actions menu */
     {
         "RecordEntryAction", "list-add", N_("_Enter"), NULL,
@@ -853,6 +861,20 @@ gnc_plugin_page_invoice_cmd_sort_changed (GtkAction *action,
     LEAVE(" ");
 }
 
+static void
+gnc_plugin_page_invoice_cmd_refresh (GtkAction *action,
+                                     GncPluginPageInvoice *plugin_page)
+{
+    GncPluginPageInvoicePrivate *priv;
+
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
+
+    ENTER("(action %p, plugin_page %p)", action, plugin_page);
+    priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
+
+    gtk_widget_queue_draw (priv->widget);
+    LEAVE(" ");
+}
 
 static void
 gnc_plugin_page_invoice_cmd_enter (GtkAction *action,
diff --git a/gnucash/gnome/gnc-plugin-page-owner-tree.c b/gnucash/gnome/gnc-plugin-page-owner-tree.c
index b58e94039..d4d2cbd57 100644
--- a/gnucash/gnome/gnc-plugin-page-owner-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-owner-tree.c
@@ -123,6 +123,7 @@ static void gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPlu
 static void gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwnerTree *page);
 #endif
 static void gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageOwnerTree *page);
+static void gnc_plugin_page_owner_tree_cmd_refresh (GtkAction *action, GncPluginPageOwnerTree *page);
 static void gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action, GncPluginPageOwnerTree *page);
 static void gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
 static void gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
@@ -181,6 +182,11 @@ static GtkActionEntry gnc_plugin_page_owner_tree_actions [] =
         "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
         G_CALLBACK (gnc_plugin_page_owner_tree_cmd_view_filter_by)
     },
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_owner_tree_cmd_refresh)
+    },
 
     /* Business menu */
     {
@@ -1150,6 +1156,17 @@ gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action,
     LEAVE(" ");
 }
 
+static void
+gnc_plugin_page_owner_tree_cmd_refresh (GtkAction *action,
+        GncPluginPageOwnerTree *page)
+{
+    GncPluginPageOwnerTreePrivate *priv;
+
+    g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
+
+    priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
+    gtk_widget_queue_draw (priv->widget);
+}
 
 static void
 gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action,
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index f199a7dab..452fb1226 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -175,6 +175,7 @@ static void gnc_plugin_page_register_cmd_reinitialize_transaction (GtkAction *ac
 static void gnc_plugin_page_register_cmd_expand_transaction (GtkToggleAction *action, GncPluginPageRegister *plugin_page);
 static void gnc_plugin_page_register_cmd_exchange_rate (GtkAction *action, GncPluginPageRegister *plugin_page);
 static void gnc_plugin_page_register_cmd_jump (GtkAction *action, GncPluginPageRegister *plugin_page);
+static void gnc_plugin_page_register_cmd_reload (GtkAction *action, GncPluginPageRegister *plugin_page);
 static void gnc_plugin_page_register_cmd_schedule (GtkAction *action, GncPluginPageRegister *plugin_page);
 static void gnc_plugin_page_register_cmd_scrub_all (GtkAction *action, GncPluginPageRegister *plugin_page);
 static void gnc_plugin_page_register_cmd_scrub_current (GtkAction *action, GncPluginPageRegister *plugin_page);
@@ -349,6 +350,11 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
         "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
         G_CALLBACK (gnc_plugin_page_register_cmd_view_filter_by)
     },
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"),
+        G_CALLBACK (gnc_plugin_page_register_cmd_reload)
+    },
 
     /* Actions menu */
 
@@ -4043,6 +4049,29 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
     LEAVE(" ");
 }
 
+static void
+gnc_plugin_page_register_cmd_reload (GtkAction *action, GncPluginPageRegister *plugin_page)
+{
+    GncPluginPageRegisterPrivate *priv;
+    SplitRegister *reg;
+
+    ENTER("(action %p, page %p)", action, plugin_page);
+
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
+
+    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
+    reg = gnc_ledger_display_get_split_register (priv->ledger);
+
+    /* Check for trans being edited */
+    if (gnc_split_register_changed (reg))
+    {
+        LEAVE("register has pending edits");
+        return;
+    }
+    gnc_ledger_display_refresh (priv->ledger);
+    LEAVE(" ");
+}
+
 static void
 gnc_plugin_page_register_cmd_style_changed (GtkAction *action,
         GtkRadioAction *current,
diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index ec4851dd2..10f1b9a27 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -127,6 +127,7 @@ static void gnc_plugin_page_sx_list_cmd_edit2(GtkAction *action, GncPluginPageSx
 /*################## Added for Reg2 #################*/
 #endif
 static void gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page);
+static void gnc_plugin_page_sx_list_cmd_refresh (GtkAction *action, GncPluginPageSxList *page);
 
 /* Command callbacks */
 static GtkActionEntry gnc_plugin_page_sx_list_actions [] =
@@ -160,6 +161,13 @@ static GtkActionEntry gnc_plugin_page_sx_list_actions [] =
         "SxListDeleteAction", GNC_ICON_DELETE_ACCOUNT, N_("_Delete"), NULL,
         N_("Delete the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_delete)
     },
+
+    /* View menu */
+
+    {
+        "ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
+        N_("Refresh this window"), G_CALLBACK (gnc_plugin_page_sx_list_cmd_refresh)
+    },
 };
 /** The number of actions provided by this plugin. */
 static guint gnc_plugin_page_sx_list_n_actions = G_N_ELEMENTS (gnc_plugin_page_sx_list_actions);
@@ -659,6 +667,17 @@ gnc_plugin_page_sx_list_cmd_new2 (GtkAction *action, GncPluginPageSxList *page)
 /*################## Added for Reg2 #################*/
 #endif
 
+static void
+gnc_plugin_page_sx_list_cmd_refresh (GtkAction *action, GncPluginPageSxList *page)
+{
+    GncPluginPageSxListPrivate *priv;
+
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_SX_LIST(page));
+
+    priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(page);
+    gtk_widget_queue_draw (priv->widget);
+}
+
 static void
 _edit_sx(gpointer data, gpointer user_data)
 {



Summary of changes:
 gnucash/gnome/gnc-plugin-page-account-tree.c      | 18 ++++++++++
 gnucash/gnome/gnc-plugin-page-budget.c            | 22 ++++++++++++
 gnucash/gnome/gnc-plugin-page-invoice.c           | 22 ++++++++++++
 gnucash/gnome/gnc-plugin-page-owner-tree.c        | 17 +++++++++
 gnucash/gnome/gnc-plugin-page-register.c          | 29 +++++++++++++++
 gnucash/gnome/gnc-plugin-page-sx-list.c           | 19 ++++++++++
 gnucash/gnome/gnc-split-reg.c                     | 14 ++++++--
 gnucash/gtkbuilder/dialog-import.glade            | 36 +++++++++----------
 gnucash/register/ledger-core/gnc-ledger-display.c | 29 ++++++++++++++-
 gnucash/register/ledger-core/split-register.c     | 44 +++++++++++++++--------
 gnucash/register/register-gnome/gnucash-sheet.c   |  5 +++
 11 files changed, 216 insertions(+), 39 deletions(-)



More information about the gnucash-changes mailing list