[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.
This commit is contained in:
Christopher Lam 2022-10-23 16:13:01 +08:00
parent 704946d517
commit b778152eba

View File

@ -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 */