Skip to content

Commit

Permalink
[gnc-plugin-page-sx-list] don't disable Edit/Delete at startup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christopherlam committed Oct 23, 2022
1 parent 704946d commit b778152
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gnucash/gnome/gnc-plugin-page-sx-list.c
Expand Up @@ -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 ();
Expand All @@ -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 */
Expand Down

0 comments on commit b778152

Please sign in to comment.