gnucash stable: Multiple changes pushed
Robert Fewell
bobit at code.gnucash.org
Mon Nov 20 05:01:29 EST 2023
Updated via https://github.com/Gnucash/gnucash/commit/46e47d44 (commit)
via https://github.com/Gnucash/gnucash/commit/63150987 (commit)
via https://github.com/Gnucash/gnucash/commit/ceb21790 (commit)
from https://github.com/Gnucash/gnucash/commit/af48ab7c (commit)
commit 46e47d44a020ebaeff37b27c2eba539ca4b4acc6
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 15 10:58:56 2023 +0000
Rename the scheduled edit/new/delete menus
There is a conflict when updating the tooltip menu entries for the
scheduled transaction 'edit' menu. To find the appropriate menu entry,
the list of menu entries is searched by name and this entry conflicts
with the main 'edit' menu which has no tooltip and so the scheduled
'edit' menu entry does not get the correct tooltip.
To fix this just change the entries to 'Edit Schedule'/'New Schedule'
and 'Delete Schedule', this also changes them to the same format as the
account menu options.
diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index 7c44263b6d..573f2deb56 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -390,19 +390,19 @@ treeview_popup (GtkTreeView *treeview, GdkEvent *event, GncPluginPageSxList *pag
menu = gtk_menu_new();
- menuitem = gtk_menu_item_new_with_mnemonic (_("_New"));
+ menuitem = gtk_menu_item_new_with_mnemonic (_("_New Schedule"));
full_action_name = g_strconcat (group_name, ".SxListNewAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
- menuitem = gtk_menu_item_new_with_mnemonic (_("_Edit"));
+ menuitem = gtk_menu_item_new_with_mnemonic (_("_Edit Schedule"));
full_action_name = g_strconcat (group_name, ".SxListEditAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
- menuitem = gtk_menu_item_new_with_mnemonic (_("_Delete"));
+ menuitem = gtk_menu_item_new_with_mnemonic (_("_Delete Schedule"));
full_action_name = g_strconcat (group_name, ".SxListDeleteAction", NULL);
gtk_actionable_set_action_name (GTK_ACTIONABLE(menuitem), full_action_name);
g_free (full_action_name);
diff --git a/gnucash/ui/gnc-plugin-page-sx-list.ui b/gnucash/ui/gnc-plugin-page-sx-list.ui
index d281ef458a..3ddab428b5 100644
--- a/gnucash/ui/gnc-plugin-page-sx-list.ui
+++ b/gnucash/ui/gnc-plugin-page-sx-list.ui
@@ -44,19 +44,19 @@
<menu id="SchedulePlaceholder0">
<item>
- <attribute name="label" translatable="yes">_New</attribute>
+ <attribute name="label" translatable="yes">_New Schedule</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListNewAction</attribute>
<attribute name="tooltip" translatable="yes">Create a new scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">_Edit</attribute>
+ <attribute name="label" translatable="yes">_Edit Schedule</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListEditAction</attribute>
<attribute name="tooltip" translatable="yes">Edit the selected scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">_Delete</attribute>
+ <attribute name="label" translatable="yes">_Delete Schedule</attribute>
<attribute name="action">GncPluginPageSxListActions.SxListDeleteAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the selected scheduled transaction</attribute>
<attribute name="temp" translatable="no">yes</attribute>
commit 6315098723ee15de993cb6a50a52fc87ffc575ae
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Oct 15 12:57:19 2023 +0100
Make it clearer for which SX's will be deleted
Add the SX names that will be deleted below the confirmation dialogue
question.
diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index 8ffcc93a28..7c44263b6d 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -848,6 +848,15 @@ _destroy_sx(gpointer data, gpointer user_data)
}
+static void
+_destroy_sx_names (gpointer data, gpointer user_data)
+{
+ SchedXaction *sx = (SchedXaction*)data;
+ GList **to_delete_names = (GList**)user_data;
+ *to_delete_names = g_list_append (*to_delete_names, xaccSchedXactionGetName (sx));
+}
+
+
static void
gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple,
GVariant *parameter,
@@ -855,14 +864,14 @@ gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple,
{
GncPluginPageSxList *plugin_page = user_data;
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(plugin_page);
- GtkTreeSelection *selection;
- GList *selected_paths, *to_delete = NULL;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (priv->tree_view);
+ GList *selected_paths, *to_delete = NULL, *to_delete_names = NULL;
GtkTreeModel *model;
GtkWindow *window;
gchar *message = NULL;
gint length;
+ gchar *text_list_of_scheduled_transaction_names = NULL;
- selection = gtk_tree_view_get_selection (priv->tree_view);
selected_paths = gtk_tree_selection_get_selected_rows (selection, &model);
if (!gnc_list_length_cmp (selected_paths, 0))
{
@@ -874,14 +883,23 @@ gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple,
(GncGMapFunc)_argument_reorder_fn,
priv->tree_view);
+ g_list_foreach (to_delete, (GFunc)_destroy_sx_names, &to_delete_names);
+
window = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
length = g_list_length (to_delete);
- /* Translators: This is a ngettext(3) message, %d is the number of scheduled transactions deleted */
- message = g_strdup_printf (ngettext ("Do you really want to delete this scheduled transaction?",
- "Do you really want to delete %d scheduled transactions?",
- length), length);
+ text_list_of_scheduled_transaction_names = gnc_g_list_stringjoin (to_delete_names, "\n");
+
+ /* Translators: This is a ngettext(3) message, question followed by list of scheduled transactions to be deleted */
+ message = g_strdup_printf ("%s\n\n%s",
+ ngettext ("Do you really want to delete this scheduled transaction?",
+ "Do you really want to delete these scheduled transactions?",
+ length),
+ text_list_of_scheduled_transaction_names);
+
+ g_free (text_list_of_scheduled_transaction_names);
+ g_list_free (to_delete_names);
if (gnc_verify_dialog (window, FALSE, "%s", message))
{
commit ceb21790b488a40f0ef6188348a205e8d09f3c57
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Oct 15 12:50:34 2023 +0100
Bug 799090 - Right Clicking scheduled transaction
If you have a highlighted SX and you right click on another SX the new,
edit, delete popup uses the highlighted SX not the one you clicked on.
This is misleading because the box appears at the right clicked
location, and it looks like that is the SX it will affect.
To fix this, check to see if SX right clicked on is selected, if not
unselect all SX's and select the one clicked on before popup.
diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index 61b32be911..8ffcc93a28 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -425,6 +425,20 @@ treeview_button_press (GtkTreeView *treeview, GdkEvent *event,
GdkEventButton *event_button = (GdkEventButton*)event;
if (event_button->button == GDK_BUTTON_SECONDARY)
{
+ GtkTreePath *path = NULL;
+ if (gtk_tree_view_get_path_at_pos (priv->tree_view, event_button->x, event_button->y,
+ &path, NULL, NULL, NULL))
+ {
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (priv->tree_view);
+
+ if (!gtk_tree_selection_path_is_selected (selection, path))
+ {
+ gtk_tree_selection_unselect_all (selection);
+ gtk_tree_selection_select_path (selection, path);
+ }
+ }
+ gtk_tree_path_free (path);
+
treeview_popup (tree_view, event, page);
return TRUE;
}
Summary of changes:
gnucash/gnome/gnc-plugin-page-sx-list.c | 52 ++++++++++++++++++++++++++-------
gnucash/ui/gnc-plugin-page-sx-list.ui | 6 ++--
2 files changed, 45 insertions(+), 13 deletions(-)
More information about the gnucash-changes
mailing list