gnucash master: Multiple changes pushed
Robert Fewell
bobit at code.gnucash.org
Wed Mar 22 10:12:50 EDT 2023
Updated via https://github.com/Gnucash/gnucash/commit/d529c427 (commit)
via https://github.com/Gnucash/gnucash/commit/7244808b (commit)
via https://github.com/Gnucash/gnucash/commit/5fc74256 (commit)
via https://github.com/Gnucash/gnucash/commit/37587253 (commit)
via https://github.com/Gnucash/gnucash/commit/b30fb2d3 (commit)
from https://github.com/Gnucash/gnucash/commit/0110442c (commit)
commit d529c4273029361062baf2339ba27191ee52d60f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Mar 22 12:45:22 2023 +0000
Bug 798793 - Cursor jumps to the end of the field.
When typing in to the description field, the cursor jumps to the end of
the field. This was due to an error in trying to restrict the field to
use type ahead only.
diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index 251f83695f..2dea9770cc 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -696,7 +696,7 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
/* If item_list is using temp then we're already partly matched by
* type-ahead and a quickfill_match won't work.
*/
- if (!gnc_item_list_using_temp (box->item_list) && !box->use_type_ahead_only)
+ if (!gnc_item_list_using_temp (box->item_list))
{
// If we were deleting or inserting in the middle, just accept.
if (change == NULL || *cursor_position < _cell->value_chars)
@@ -705,7 +705,9 @@ gnc_combo_cell_modify_verify (BasicCell* _cell,
*start_selection = *end_selection = *cursor_position;
return;
}
- match_str = quickfill_match (box->qf, newval);
+
+ if (!box->use_type_ahead_only) // Do we only want to use type-ahead
+ match_str = quickfill_match (box->qf, newval);
if (match_str != NULL) // Do we have a quickfill match
{
commit 7244808bf070874f70eefdaab6d01dc81ec4db49
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Mar 22 11:15:08 2023 +0000
Fix missing statusbar tooltips for popup menus
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index d0a905fbef..82e343364c 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -5503,11 +5503,17 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
GtkWidget *menu;
const gchar *menu_qualifier;
gchar *popup_menu_name;
+ GncWindow* gnc_window;
+ GtkWidget *statusbar;
g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
ENTER("page %p, event %p", page, event);
+ gnc_window = GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window);
+
+ statusbar = gnc_window_get_statusbar (gnc_window);
+
builder = gnc_plugin_page_get_builder (page);
menu_qualifier = gnc_plugin_page_get_menu_popup_qualifier (page);
@@ -5538,6 +5544,10 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
LEAVE("no menu");
return;
}
+
+ // add tooltip redirect call backs
+ gnc_plugin_add_menu_tooltip_callbacks (menu, menu_model, statusbar);
+
gtk_menu_attach_to_widget (GTK_MENU(menu), GTK_WIDGET(page->window), nullptr);
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
diff --git a/gnucash/gnome-utils/gnc-plugin.c b/gnucash/gnome-utils/gnc-plugin.c
index 0f8a742284..13e6610cee 100644
--- a/gnucash/gnome-utils/gnc-plugin.c
+++ b/gnucash/gnome-utils/gnc-plugin.c
@@ -267,7 +267,6 @@ gnc_plugin_add_menu_tooltip_callbacks (GtkWidget *menubar,
{
GList *menu_item_list;
- g_return_if_fail (GTK_IS_MENU_BAR(menubar));
g_return_if_fail (G_IS_MENU_MODEL(menubar_model));
g_return_if_fail (GTK_IS_STATUSBAR(statusbar));
commit 5fc74256af95d76ac0366e74c9734e5cd24b04f3
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Mar 22 10:38:39 2023 +0000
Popup menu missing from sx template transactions window
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index 87b1d953d1..f37ad1c3cf 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1359,6 +1359,8 @@ schedXact_editor_create_ledger (GncSxEditorDialog *sxed)
/* Now create the register plugin page. */
sxed->plugin_page = gnc_plugin_page_register_new_ledger (sxed->ledger);
+ gnc_plugin_page_merge_actions (sxed->plugin_page);
+
gtk_widget_insert_action_group (GTK_WIDGET(sxed->embed_window),
gnc_plugin_page_get_simple_action_group_name (sxed->plugin_page),
G_ACTION_GROUP(gnc_plugin_page_get_action_group (sxed->plugin_page)));
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 62fd703ff0..b4f35ff20f 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -928,9 +928,19 @@ gnc_plugin_page_register_ui_update (gpointer various,
trans = gnc_split_register_get_current_trans (reg);
if (cursor_class == CURSOR_CLASS_SPLIT)
- gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "split");
+ {
+ if (GNC_IS_MAIN_WINDOW(GNC_PLUGIN_PAGE(page)->window))
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "split");
+ else
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "split-sx");
+ }
else
- gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "trans");
+ {
+ if (GNC_IS_MAIN_WINDOW(GNC_PLUGIN_PAGE(page)->window))
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "trans");
+ else
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "trans-sx");
+ }
/* If the register is not read only, make any modifying action active
* to start with */
diff --git a/gnucash/ui/gnc-plugin-page-register.ui b/gnucash/ui/gnc-plugin-page-register.ui
index a04df4cd5b..d7ff0def88 100644
--- a/gnucash/ui/gnc-plugin-page-register.ui
+++ b/gnucash/ui/gnc-plugin-page-register.ui
@@ -568,6 +568,85 @@
</menu>
+ <menu id="mainwin-popup-trans-sx">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Dup_licate Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Delete Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
+ <attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Enter Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Blank Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
+ </item>
+ </section>
+ </menu>
+
+ <menu id="mainwin-popup-split-sx">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Dup_licate Split</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Make a copy of the current split</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Delete Split</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Delete the current split</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
+ <attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Enter Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Blank Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
+ </item>
+ </section>
+ </menu>
+
+
<object class="GtkToolbar" id="mainwin-toolbar">
<property name="visible">True</property>
<property name="can-focus">False</property>
commit 37587253c998fe9a26a5044743c469082633c4e1
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Mar 22 10:36:30 2023 +0000
Bug 798792 - "Delete Split" missing from context menu,take2
Another attempt to fix this, instead of trying to hide/reveal popup
menu items, just display a different popup menu based on 'cursor class'.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 13b2ff9951..62fd703ff0 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -312,9 +312,7 @@ static GActionEntry gnc_plugin_page_register_actions [] =
{ "CopyTransactionAction", gnc_plugin_page_register_cmd_copy_transaction, NULL, NULL, NULL },
{ "PasteTransactionAction", gnc_plugin_page_register_cmd_paste_transaction, NULL, NULL, NULL },
{ "DuplicateTransactionAction", gnc_plugin_page_register_cmd_duplicate_transaction, NULL, NULL, NULL },
- { "DuplicateSplitAction", gnc_plugin_page_register_cmd_duplicate_transaction, NULL, NULL, NULL },
{ "DeleteTransactionAction", gnc_plugin_page_register_cmd_delete_transaction, NULL, NULL, NULL },
- { "DeleteSplitAction", gnc_plugin_page_register_cmd_delete_transaction, NULL, NULL, NULL },
{ "RemoveTransactionSplitsAction", gnc_plugin_page_register_cmd_reinitialize_transaction, NULL, NULL, NULL },
{ "RecordTransactionAction", gnc_plugin_page_register_cmd_enter_transaction, NULL, NULL, NULL },
{ "CancelTransactionAction", gnc_plugin_page_register_cmd_cancel_transaction, NULL, NULL, NULL },
@@ -852,24 +850,6 @@ static const char* split_action_tips[] =
NULL
};
-static void
-update_context_menu (GncPluginPage *page, gboolean read_only, gboolean voided, gboolean enable_split)
-{
- GAction *action;
-
- action = gnc_plugin_page_get_action (page, "DuplicateTransactionAction");
- g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided & !enable_split);
-
- action = gnc_plugin_page_get_action (page, "DeleteTransactionAction");
- g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided & !enable_split);
-
- action = gnc_plugin_page_get_action (page, "DuplicateSplitAction");
- g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided & enable_split);
-
- action = gnc_plugin_page_get_action (page, "DeleteSplitAction");
- g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided & enable_split);
-}
-
static void
gnc_plugin_page_register_ui_update (gpointer various,
GncPluginPageRegister* page)
@@ -947,6 +927,11 @@ gnc_plugin_page_register_ui_update (gpointer various,
/* Set available actions based on read only */
trans = gnc_split_register_get_current_trans (reg);
+ if (cursor_class == CURSOR_CLASS_SPLIT)
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "split");
+ else
+ gnc_plugin_page_set_menu_popup_qualifier (GNC_PLUGIN_PAGE(page), "trans");
+
/* If the register is not read only, make any modifying action active
* to start with */
if (!read_only_reg)
@@ -973,10 +958,16 @@ gnc_plugin_page_register_ui_update (gpointer various,
"PasteTransactionAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
+ action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+ "DeleteTransactionAction");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
+
if (cursor_class == CURSOR_CLASS_SPLIT)
- update_context_menu (GNC_PLUGIN_PAGE(page), read_only, voided, TRUE);
- else
- update_context_menu (GNC_PLUGIN_PAGE(page), read_only, voided, FALSE);
+ {
+ action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+ "DuplicateTransactionAction");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION(action), !read_only & !voided);
+ }
action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
"RemoveTransactionSplitsAction");
diff --git a/gnucash/ui/gnc-plugin-page-register.ui b/gnucash/ui/gnc-plugin-page-register.ui
index 923b95de4e..a04df4cd5b 100644
--- a/gnucash/ui/gnc-plugin-page-register.ui
+++ b/gnucash/ui/gnc-plugin-page-register.ui
@@ -342,17 +342,16 @@
</item>
</menu>
- <menu id="mainwin-popup">
+
+ <menu id="mainwin-popup-trans">
<section>
<item>
<attribute name="label" translatable="yes">_Sort Byâ¦</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewSortByAction</attribute>
- <attribute name="tooltip" translatable="yes">Filter accounts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Filter Byâ¦</attribute>
<attribute name="action">GncPluginPageRegisterActions.ViewFilterByAction</attribute>
- <attribute name="tooltip" translatable="yes">Filter accounts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Re_name Page</attribute>
@@ -365,25 +364,123 @@
<attribute name="label" translatable="yes">Dup_licate Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current transaction</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Transaction</attribute>
<attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current transaction</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
</item>
+ <item>
+ <attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RemoveTransactionSplitsAction</attribute>
+ <attribute name="tooltip" translatable="yes">Remove all splits in the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Enter Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.RecordTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Record the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Ca_ncel Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.CancelTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Cancel the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Manage Document Linkâ¦</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.LinkTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Add, change, or unlink the document linked with the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Open Linked Document</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.LinkedTransactionOpenAction</attribute>
+ <attribute name="tooltip" translatable="yes">Open the linked document for the current transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Jump to Invoice</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.JumpLinkedInvoiceAction</attribute>
+ <attribute name="tooltip" translatable="yes">Jump to the linked bill, invoice, or voucher</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Blank Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.BlankTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Move to the blank transaction at the bottom of the register</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Go to Date</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.GotoDateAction</attribute>
+ <attribute name="tooltip" translatable="yes">Move to the split at the specified date</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">S_plit Transaction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.SplitTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Show all splits in the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Edit E_xchange Rate</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.EditExchangeRateAction</attribute>
+ <attribute name="tooltip" translatable="yes">Edit the exchange rate for the current transaction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Sche_duleâ¦</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.ScheduleTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Create a Scheduled Transaction with the current transaction as a template</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Jump to the other account</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.JumpTransactionAction</attribute>
+ <attribute name="tooltip" translatable="yes">Open a new register tab for the other account with focus on this transaction</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Assign as paymentâ¦</attribute>
+ <attribute name="action">gnc-plugin-business-actions.RegisterAssignPayment</attribute>
+ <attribute name="tooltip" translatable="yes">Assign the selected transaction as payment</attribute>
+ <attribute name="hidden-when">action-disabled</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Edit paymentâ¦</attribute>
+ <attribute name="action">gnc-plugin-business-actions.RegisterEditPayment</attribute>
+ <attribute name="tooltip" translatable="yes">Edit the payment this transaction is a part of</attribute>
+ <attribute name="hidden-when">action-disabled</attribute>
+ </item>
+ </section>
+ </menu>
+
+ <menu id="mainwin-popup-split">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Sort Byâ¦</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.ViewSortByAction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Filter Byâ¦</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.ViewFilterByAction</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Re_name Page</attribute>
+ <attribute name="action">mainwin.ActionsRenamePageAction</attribute>
+ <attribute name="tooltip" translatable="yes">Rename this page</attribute>
+ </item>
+ </section>
+ <section>
<item>
<attribute name="label" translatable="yes">Dup_licate Split</attribute>
- <attribute name="action">GncPluginPageRegisterActions.DuplicateSplitAction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DuplicateTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Make a copy of the current split</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Delete Split</attribute>
- <attribute name="action">GncPluginPageRegisterActions.DeleteSplitAction</attribute>
+ <attribute name="action">GncPluginPageRegisterActions.DeleteTransactionAction</attribute>
<attribute name="tooltip" translatable="yes">Delete the current split</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Remo_ve Other Splits</attribute>
commit b30fb2d34a84cc8a44a4d3ac4862b42fb378129f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Mar 22 10:35:11 2023 +0000
Add ability to main window to specify a popup window qualifier
This will allow different popup context window menus for a plugin page
to be popped when required.
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 18c18d9edf..d0a905fbef 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -5510,7 +5510,10 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
builder = gnc_plugin_page_get_builder (page);
- menu_qualifier = gnc_plugin_page_get_menu_qualifier (page);
+ menu_qualifier = gnc_plugin_page_get_menu_popup_qualifier (page);
+
+ if (!menu_qualifier)
+ menu_qualifier = gnc_plugin_page_get_menu_qualifier (page);
if (builder == nullptr)
{
@@ -5519,7 +5522,7 @@ do_popup_menu (GncPluginPage *page, GdkEventButton *event)
}
if (menu_qualifier)
- popup_menu_name = g_strconcat ("mainwin-popup-", menu_qualifier, NULL);
+ popup_menu_name = g_strconcat ("mainwin-popup-", menu_qualifier, nullptr);
else
popup_menu_name = g_strdup ("mainwin-popup");
diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c
index 54348e6c79..58074303ee 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.c
+++ b/gnucash/gnome-utils/gnc-plugin-page.c
@@ -94,6 +94,7 @@ typedef struct _GncPluginPagePrivate
GSimpleActionGroup *simple_action_group;
const gchar *simple_action_group_name;
const gchar *menu_qualifier;
+ const gchar *menu_popup_qualifier;
GList *books;
@@ -1024,7 +1025,6 @@ gnc_plugin_page_get_menu_qualifier (GncPluginPage *page)
return priv->menu_qualifier;
}
-
void
gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
const char *menu_qualifier)
@@ -1038,6 +1038,31 @@ gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
priv->menu_qualifier = menu_qualifier;
}
+const gchar *
+gnc_plugin_page_get_menu_popup_qualifier (GncPluginPage *page)
+{
+ GncPluginPagePrivate *priv;
+
+ g_return_val_if_fail (GNC_IS_PLUGIN_PAGE(page), NULL);
+
+ priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
+ return priv->menu_popup_qualifier;
+}
+
+void
+gnc_plugin_page_set_menu_popup_qualifier (GncPluginPage *page,
+ const char *menu_qualifier)
+{
+ GncPluginPagePrivate *priv;
+
+ g_return_if_fail (GNC_IS_PLUGIN_PAGE(page));
+
+ priv = GNC_PLUGIN_PAGE_GET_PRIVATE(page);
+
+ priv->menu_popup_qualifier = menu_qualifier;
+}
+
+
GSimpleActionGroup *
gnc_plugin_page_get_action_group (GncPluginPage *page)
{
diff --git a/gnucash/gnome-utils/gnc-plugin-page.h b/gnucash/gnome-utils/gnc-plugin-page.h
index 5ccec3b083..647706dc34 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.h
+++ b/gnucash/gnome-utils/gnc-plugin-page.h
@@ -516,6 +516,24 @@ const gchar * gnc_plugin_page_get_menu_qualifier (GncPluginPage *page);
void gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
const char *menu_qualifier);
+/** Retrieve the menu popup qualifier for this page.
+ *
+ * @param page The page whose quailifier string should be retrieved.
+ *
+ * @return A qualifier string for this page.
+ */
+const gchar * gnc_plugin_page_get_menu_popup_qualifier (GncPluginPage *page);
+
+/** Set a qualifier string for this page. This string is used when there
+ * is more than one popup menu associated with the page.
+ *
+ * @param page The page whose qualifier string should be updated.
+ *
+ * @param menu_qualifier A string to be used as for the qualifier.
+ */
+void gnc_plugin_page_set_menu_popup_qualifier (GncPluginPage *page,
+ const char *menu_qualifier);
+
/** Retrieve the GSimpleActionGroup object associated with this page.
*
* @param page The page whose menu/toolbar action group should be
Summary of changes:
gnucash/gnome-utils/gnc-main-window.cpp | 17 +-
gnucash/gnome-utils/gnc-plugin-page.c | 27 ++-
gnucash/gnome-utils/gnc-plugin-page.h | 18 ++
gnucash/gnome-utils/gnc-plugin.c | 1 -
gnucash/gnome/dialog-sx-editor.c | 2 +
gnucash/gnome/gnc-plugin-page-register.c | 47 +++---
gnucash/register/register-gnome/combocell-gnome.c | 6 +-
gnucash/ui/gnc-plugin-page-register.ui | 194 +++++++++++++++++++++-
8 files changed, 274 insertions(+), 38 deletions(-)
More information about the gnucash-changes
mailing list