Skip to content

Commit

Permalink
[assistant-stock-transaction] add to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Sep 19, 2022
1 parent cfd37c9 commit 84f4f3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnucash/gnome/gnc-plugin-page-register.c
Expand Up @@ -487,8 +487,8 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
G_CALLBACK (gnc_plugin_page_register_cmd_autoclear)
},
{
"ActionsStockAssistantAction", NULL, N_ ("Stock Ass_istant"), NULL,
N_ ("Stock Assistant"),
"ActionsStockAssistantAction", "applications-utilities",
N_ ("Stock Ass_istant"), NULL, N_ ("Stock Assistant"),
G_CALLBACK (gnc_plugin_page_register_cmd_stock_assistant)
},
{
Expand Down
1 change: 1 addition & 0 deletions gnucash/ui/gnc-plugin-page-register-ui.xml
Expand Up @@ -86,6 +86,7 @@
<separator name="ToolbarSep68"/>
<toolitem name="ToolbarTransfer" action="ActionsTransferAction"/>
<toolitem name="ActionsReconcile" action="ActionsReconcileAction"/>
<toolitem name="ActionsAssistant" action="ActionsStockAssistantAction"/>
</placeholder>
</toolbar>

Expand Down

4 comments on commit 84f4f3b

@Bob-IT
Copy link
Contributor

@Bob-IT Bob-IT commented on 84f4f3b Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherlam I am just wondering if this should be on the tool bar if on most registers it will appear as disabled and just wondering on what sort of frequency it is likely to be used. I would of thought that adding it to the action menu and right click menu popup when on the accounts page would be a good idea.

@christopherlam
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking as well we should hide when using a non-stock register; when this assistant is ready to be unveiled without --extra then it'll be a simple removal of gnc_prefs_is_extra_enabled () &&.

modified   gnucash/gnome/gnc-plugin-page-register.c
@@ -624,12 +624,6 @@ static const gchar* view_style_actions[] =
     NULL
 };
 
-static const gchar* actions_requiring_extra[] =
-{
-    "ActionsStockAssistantAction",
-    NULL
-};
-
 static const gchar* actions_requiring_priced_account[] =
 {
     "ActionsStockAssistantAction",
@@ -1289,11 +1283,10 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
     gnc_plugin_update_actions (action_group, actions_requiring_account,
                                "sensitive", is_readwrite && account != NULL);
 
-    gnc_plugin_update_actions (action_group, actions_requiring_extra,
-                               "visible", gnc_prefs_is_extra_enabled ());
-
     gnc_plugin_update_actions (action_group, actions_requiring_priced_account,
-                               "sensitive", account && xaccAccountIsPriced (account));
+                               "visible", account &&
+                               gnc_prefs_is_extra_enabled () &&
+                               xaccAccountIsPriced (account));
 
     /* Set "style" radio button */
     ledger_type = gnc_ledger_display_type (priv->ledger);

@christopherlam
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as the frequency of use of the Stock Assistant, I'd think it would probably be best to encourage any new stock transactions to be added with it, and may be positioned next to the "New Invoice" button in the toolbar. It could also be added to the R-click action menu.

@fellen
Copy link
Member

@fellen fellen commented on 84f4f3b Sep 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as the frequency of use of the Stock Assistant, I'd think it would probably be best to encourage any new stock transactions to be added with it, and may be positioned next to the "New Invoice" button in the toolbar. It could also be added to the R-click action menu.

That would require at least a section in https://github.com/Gnucash/gnucash-docs/blob/master/manual/C/ch_Tools_Assistants.xml and perhaps a few links from other chapters. Perhaps you can write it together with @CDB-Man ?

Please sign in to comment.