mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add hook to stock transaction GtkAssistant
This commit is contained in:
parent
2f9963b708
commit
9e44ef5c02
@ -59,6 +59,7 @@
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "assistant-stock-split.h"
|
||||
#include "assistant-stock-transaction.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-date.h"
|
||||
#include "gnc-date-edit.h"
|
||||
@ -218,6 +219,9 @@ static void gnc_plugin_page_register_cmd_style_double_line (
|
||||
|
||||
static void gnc_plugin_page_register_cmd_reconcile (GtkAction* action,
|
||||
GncPluginPageRegister* plugin_page);
|
||||
static void gnc_plugin_page_register_cmd_stock_assistant (GtkAction* action,
|
||||
GncPluginPageRegister* page);
|
||||
|
||||
static void gnc_plugin_page_register_cmd_autoclear (GtkAction* action,
|
||||
GncPluginPageRegister* plugin_page);
|
||||
static void gnc_plugin_page_register_cmd_transfer (GtkAction* action,
|
||||
@ -481,6 +485,11 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
|
||||
N_ ("Automatically clear individual transactions, so as to reach a certain cleared amount"),
|
||||
G_CALLBACK (gnc_plugin_page_register_cmd_autoclear)
|
||||
},
|
||||
{
|
||||
"ActionsStockAssistantAction", NULL, N_ ("Stock Ass_istant"), NULL,
|
||||
N_ ("Stock Assistant"),
|
||||
G_CALLBACK (gnc_plugin_page_register_cmd_stock_assistant)
|
||||
},
|
||||
{
|
||||
"ActionsStockSplitAction", NULL, N_ ("Stoc_k Split..."), NULL,
|
||||
N_ ("Record a stock split or a stock merger"),
|
||||
@ -614,6 +623,18 @@ static const gchar* view_style_actions[] =
|
||||
NULL
|
||||
};
|
||||
|
||||
static const gchar* actions_requiring_extra[] =
|
||||
{
|
||||
"ActionsStockAssistantAction",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const gchar* actions_requiring_priced_account[] =
|
||||
{
|
||||
"ActionsStockAssistantAction",
|
||||
NULL
|
||||
};
|
||||
|
||||
/** Short labels for use on the toolbar buttons. */
|
||||
static action_toolbar_labels toolbar_labels[] =
|
||||
{
|
||||
@ -1267,6 +1288,12 @@ 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", xaccAccountIsPriced (account));
|
||||
|
||||
/* Set "style" radio button */
|
||||
ledger_type = gnc_ledger_display_type (priv->ledger);
|
||||
gnc_plugin_update_actions (action_group, view_style_actions,
|
||||
@ -4539,6 +4566,23 @@ gnc_plugin_page_register_cmd_reconcile (GtkAction* action,
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_register_cmd_stock_assistant (GtkAction* action,
|
||||
GncPluginPageRegister* page)
|
||||
{
|
||||
Account *account;
|
||||
GtkWindow *window;
|
||||
|
||||
ENTER ("(action %p, plugin_page %p)", action, page);
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
|
||||
window = gnc_window_get_gtk_window (GNC_WINDOW (GNC_PLUGIN_PAGE (page)->window));
|
||||
account = gnc_plugin_page_register_get_account (page);
|
||||
gnc_stock_transaction_assistant (GTK_WIDGET (window), account);
|
||||
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_plugin_page_register_cmd_autoclear (GtkAction* action,
|
||||
GncPluginPageRegister* page)
|
||||
|
@ -46,6 +46,7 @@
|
||||
<menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
|
||||
<menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
|
||||
<menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
|
||||
<menuitem name="ActionsStockAssistant" action="ActionsStockAssistantAction"/>
|
||||
<menuitem name="ActionLots" action="ActionsLotsAction"/>
|
||||
<separator name="ActionsSep4"/>
|
||||
<menuitem name="BlankTransaction" action="BlankTransactionAction"/>
|
||||
|
Loading…
Reference in New Issue
Block a user