gnucash maint: [gnc-plugin-page-sx-list] don't disable Edit/Delete at startup

Christopher Lam clam at code.gnucash.org
Sun Oct 23 04:24:02 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/b778152e (commit)
	from  https://github.com/Gnucash/gnucash/commit/704946d5 (commit)



commit b778152eba92460cf0edeb33b1b92a4733d89bb2
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Oct 23 16:13:01 2022 +0800

    [gnc-plugin-page-sx-list] don't disable Edit/Delete at startup
    
    At startup, if there are SX in the editor, the previous block disables
    Edit & Delete actions, yet in the next block, the call to
    gtk_tree_selection_select_path will select a SX which cannot be edited
    nor deleted unless the user selects it again.
    
    This commit skips disabling Edit & Delete actions, and calls
    gppsl_selection_changed_cb which enables Edit & Delete sensitivity if
    there is a SX selected.

diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index 4ea5d6e45..18ddbb45d 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -469,14 +469,6 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
         priv->instances = GNC_SX_INSTANCE_MODEL(gnc_sx_get_instances (&end, TRUE));
     }
 
-    {
-        GtkAction *edit_action, *delete_action;
-        edit_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), "SxListEditAction");
-        delete_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page), "SxListDeleteAction");
-        gtk_action_set_sensitive (edit_action, FALSE);
-        gtk_action_set_sensitive (delete_action, FALSE);
-    }
-
     {
         GtkTreeSelection *selection;
         GtkTreePath *path = gtk_tree_path_new_first ();
@@ -497,6 +489,8 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
         g_signal_connect (G_OBJECT(priv->tree_view), "row-activated", (GCallback)gppsl_row_activated_cb, (gpointer)page);
         g_signal_connect (G_OBJECT(gtk_tree_view_get_model (GTK_TREE_VIEW(priv->tree_view))),
                           "model-populated", (GCallback)gppsl_model_populated_cb, (gpointer)page);
+
+        gppsl_selection_changed_cb (selection, page);
     }
 
     /* Add vbox and label */



Summary of changes:
 gnucash/gnome/gnc-plugin-page-sx-list.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list