From f0626e5ec9959fb23047783c9cdafa51fc4858fa Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 4 May 2013 07:49:09 +0000 Subject: [PATCH] Register rewrite Update, change the default for the new register and rename old one. This update changes the default for double click on the accounts page to open with the new register layout. Also the menu options have been renamed / re-arranged to reflect this. Have also done the same on the general ledger options. Author: Robert Fewell git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22945 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/gnc-plugin-page-account-tree.c | 42 ++++++------------- src/gnome/gnc-plugin-register.c | 4 +- src/gnome/gnc-plugin-register2.c | 12 +----- .../ui/gnc-plugin-page-account-tree2-ui.xml | 8 ++-- 4 files changed, 20 insertions(+), 46 deletions(-) diff --git a/src/gnome/gnc-plugin-page-account-tree.c b/src/gnome/gnc-plugin-page-account-tree.c index ae5701d9c3..f66fed0db5 100644 --- a/src/gnome/gnc-plugin-page-account-tree.c +++ b/src/gnome/gnc-plugin-page-account-tree.c @@ -80,9 +80,6 @@ static QofLogModule log_module = GNC_MOD_GUI; #define DELETE_DIALOG_SA_TRANS_MAS "sa_trans_mas" #define DELETE_DIALOG_OK_BUTTON "deletebutton" -/* This define will enable the New Register menu option, comment out to hide it */ -#define REG2ENABLE "yes" - enum { ACCOUNT_SELECTED, @@ -174,25 +171,23 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] = G_CALLBACK (gnc_plugin_page_account_tree_cmd_file_new_hierarchy) }, { - "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL, + "FileOpenAccount2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL, N_("Open the selected account"), - G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account) + G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_account) }, -#ifdef REG2ENABLE { - "FileOpenAccount2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open New Register2 _Account"), NULL, - N_("Open the New Register2 selected account"), - G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_account) + "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Old Style Register Account"), NULL, + N_("Open the old style register selected account"), + G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account) }, { - "FileOpenSubaccounts2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open New Register2 _SubAccount"), NULL, - N_("Open the New Register2 selected subaccounts"), + "FileOpenSubaccounts2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open _SubAccounts"), NULL, + N_("Open the selected account and all its subaccounts"), G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_subaccounts) }, -#endif { - "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Subaccounts"), NULL, - N_("Open the selected account and all its subaccounts"), + "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open Old St_yle Subaccounts"), NULL, + N_("Open the old style register selected account and all its subaccounts"), G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts) }, @@ -282,9 +277,7 @@ static const gchar *actions_requiring_account_rw[] = static const gchar *actions_requiring_account_always[] = { "FileOpenAccountAction", -#ifdef REG2ENABLE "FileOpenAccount2Action", -#endif "FileOpenSubaccountsAction", "ActionsLotsAction", NULL @@ -311,11 +304,9 @@ static const gchar* readonly_inactive_actions[] = /** Short labels for use on the toolbar buttons. */ static action_toolbar_labels toolbar_labels[] = { - { "FileOpenAccountAction", N_("Open") }, -#ifdef REG2ENABLE + { "FileOpenAccountAction", N_("Open") }, { "FileOpenAccount2Action", N_("Open2") }, -#endif - { "EditEditAccountAction", N_("Edit") }, + { "EditEditAccountAction", N_("Edit") }, { "FileNewAccountAction", N_("New") }, { "EditDeleteAccountAction", N_("Delete") }, { NULL, NULL }, @@ -409,11 +400,7 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page) g_object_set(G_OBJECT(plugin_page), "page-name", _("Accounts"), "page-uri", "default:", -#ifdef REG2ENABLE "ui-description", "gnc-plugin-page-account-tree2-ui.xml", -#else - "ui-description", "gnc-plugin-page-account-tree-ui.xml", -#endif NULL); g_signal_connect (G_OBJECT (plugin_page), "selected", G_CALLBACK (gnc_plugin_page_account_tree_selected), plugin_page); @@ -804,8 +791,6 @@ gppat_open_account_common (GncPluginPageAccountTree *page, gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page); } - -#ifdef REG2ENABLE /*################## Added for Reg2 #################*/ /* New Register Common */ static void @@ -824,7 +809,6 @@ gppat_open2_account_common (GncPluginPageAccountTree *page, gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page); } /*################## Added for Reg2 #################*/ -#endif static void gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview, @@ -854,7 +838,7 @@ gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview, { /* It's an account without any children, so open its register */ Account *account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path); - gppat_open_account_common (page, account, FALSE); + gppat_open2_account_common (page, account, FALSE); } } } @@ -945,7 +929,6 @@ gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action, } -#ifdef REG2ENABLE /*################## Added for Reg2 #################*/ /* Register Firing - Single Account to start with */ static void @@ -970,7 +953,6 @@ gnc_plugin_page_account_tree_cmd_open2_subaccounts (GtkAction *action, gppat_open2_account_common (page, account, TRUE); } /*################## Added for Reg2 #################*/ -#endif static void diff --git a/src/gnome/gnc-plugin-register.c b/src/gnome/gnc-plugin-register.c index ec72f7903f..f2f45d0159 100644 --- a/src/gnome/gnc-plugin-register.c +++ b/src/gnome/gnc-plugin-register.c @@ -47,8 +47,8 @@ static void gnc_plugin_register_cmd_general_ledger (GtkAction *action, GncMainWi static GtkActionEntry gnc_plugin_actions [] = { { - "ToolsGeneralLedgerAction", NULL, N_("_General Ledger"), NULL, - N_("Open a general ledger window"), + "ToolsGeneralLedgerAction", NULL, N_("Old St_yle General Ledger"), NULL, + N_("Open an old style general ledger window"), G_CALLBACK (gnc_plugin_register_cmd_general_ledger) }, }; diff --git a/src/gnome/gnc-plugin-register2.c b/src/gnome/gnc-plugin-register2.c index d6ae6b905b..aaa5399e3c 100644 --- a/src/gnome/gnc-plugin-register2.c +++ b/src/gnome/gnc-plugin-register2.c @@ -32,10 +32,6 @@ #include "gnc-plugin-register2.h" #include "gnc-plugin-page-register2.h" -/* This define will enable the New Register menu option, comment out to hide it */ -#define REG2ENABLE "yes" - - static void gnc_plugin_register2_class_init (GncPluginRegister2Class *klass); static void gnc_plugin_register2_init (GncPluginRegister2 *plugin); static void gnc_plugin_register2_finalize (GObject *object); @@ -49,13 +45,11 @@ static void gnc_plugin_register2_cmd_general_ledger (GtkAction *action, GncMainW static GtkActionEntry gnc_plugin_actions [] = { -#ifdef REG2ENABLE { - "ToolsGeneralLedger2Action", NULL, N_("_General Ledger2"), NULL, - N_("Open a general ledger2 window"), + "ToolsGeneralLedger2Action", NULL, N_("_General Ledger"), NULL, + N_("Open a general ledger window"), G_CALLBACK (gnc_plugin_register2_cmd_general_ledger) }, -#endif }; static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions); @@ -159,13 +153,11 @@ gnc_plugin_register2_class_init (GncPluginRegister2Class *klass) /* plugin info */ plugin_class->plugin_name = GNC_PLUGIN_REGISTER2_NAME; -#ifdef REG2ENABLE /* widget addition/removal */ plugin_class->actions_name = PLUGIN_ACTIONS_NAME; plugin_class->actions = gnc_plugin_actions; plugin_class->n_actions = gnc_plugin_n_actions; plugin_class->ui_filename = PLUGIN_UI_FILENAME; -#endif plugin_class->gconf_section = GCONF_REGISTER2_SECTION; plugin_class->gconf_notifications = gnc_plugin_register2_gconf_changed; diff --git a/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml b/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml index 9aa79e4e76..3330f46112 100644 --- a/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml +++ b/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml @@ -6,10 +6,10 @@ - - + + @@ -35,10 +35,10 @@ - - + +