mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Don't compile Register2 code if it is not being used.
The Registger and Register2 code were entangled in such a way that changing the Register headers made the Register2 code not compile. Fixing this was difficult and would undubtedly make the Register2 code even worse than it is already. Most of it has been ifdeffed out. Some of the conflicts have been fixed but many are left.
This commit is contained in:
parent
56cc021d33
commit
3f5b4228b9
@ -26,6 +26,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <stdlib.h>
|
||||
@ -2183,3 +2185,4 @@ gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans,
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h>
|
||||
@ -3295,3 +3297,5 @@ gnc_tree_model_split_reg_get_parent (GncTreeModelSplitReg *model)
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <stdlib.h>
|
||||
@ -1348,3 +1350,5 @@ gnc_tree_util_get_rate_for (GncTreeViewSplitReg *view, Transaction *trans, Split
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <stdlib.h>
|
||||
@ -6338,3 +6340,4 @@ gboolean gnc_tree_view_split_reg_call_uiupdate_cb(GncTreeViewSplitReg *view)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <stdio.h>
|
||||
@ -239,3 +241,5 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
|
||||
|
||||
return ftd->sw;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <locale.h>
|
||||
@ -55,7 +57,7 @@
|
||||
#include "gnc-frequency.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-hooks.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-ledger-display2.h"
|
||||
#include "gnc-plugin-page.h"
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
#include "gnc-prefs.h"
|
||||
@ -1781,3 +1783,5 @@ gnc_ui_sx_initialize2 (void) //FIXME need to remove the 2 when live
|
||||
"create_days_adj,remind_days_adj,sx_prefs",
|
||||
_("Scheduled Transactions"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -48,10 +48,12 @@
|
||||
#include "qof.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
#include "gnc-ledger-display2.h"
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
#include "gnc-main-window.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-gui-query.h"
|
||||
|
@ -44,7 +44,9 @@
|
||||
#include "dialog-file-access.h"
|
||||
#include "dialog-fincalc.h"
|
||||
#include "dialog-find-transactions.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
#include "dialog-find-transactions2.h"
|
||||
#endif
|
||||
#include "dialog-imap-editor.h"
|
||||
#include "dialog-sx-since-last-run.h"
|
||||
#include "dialog-totd.h"
|
||||
|
@ -38,7 +38,9 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include "gnc-plugin-page-account-tree.h"
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
#endif
|
||||
|
||||
#include "Scrub.h"
|
||||
#include "Scrub3.h"
|
||||
@ -173,9 +175,11 @@ static void gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPl
|
||||
static void gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page);
|
||||
static void gnc_plugin_page_account_tree_cmd_cascade_account_properties (GtkAction *action, GncPluginPageAccountTree *page);
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/* Command callback for new Register Test */
|
||||
static void gnc_plugin_page_account_tree_cmd_open2_account (GtkAction *action, GncPluginPageAccountTree *page);
|
||||
static void gnc_plugin_page_account_tree_cmd_open2_subaccounts (GtkAction *action, GncPluginPageAccountTree *page);
|
||||
#endif
|
||||
/* Account Deletion Actions. */
|
||||
static int confirm_delete_account (GtkAction *action,
|
||||
GncPluginPageAccountTree *page, Account* ta,
|
||||
@ -341,6 +345,7 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
|
||||
},
|
||||
/* Extensions Menu */
|
||||
{ "Register2TestAction", NULL, N_("_Register2"), NULL, NULL, NULL },
|
||||
#ifdef REGISTER2_ENABLED
|
||||
{
|
||||
"Register2TestAccountAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Account"), NULL,
|
||||
N_("Open the selected account"),
|
||||
@ -351,6 +356,7 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
|
||||
N_("Open the selected account and all its subaccounts"),
|
||||
G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_subaccounts)
|
||||
},
|
||||
#endif
|
||||
};
|
||||
/** The number of actions provided by this plugin. */
|
||||
static guint gnc_plugin_page_account_tree_n_actions = G_N_ELEMENTS (gnc_plugin_page_account_tree_actions);
|
||||
@ -1053,6 +1059,7 @@ gppat_open_account_common (GncPluginPageAccountTree *page,
|
||||
gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
|
||||
}
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
/* New Register Common */
|
||||
static void
|
||||
@ -1071,6 +1078,7 @@ 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,
|
||||
@ -1205,6 +1213,7 @@ gnc_plugin_page_account_tree_cmd_open_subaccounts (GtkAction *action,
|
||||
}
|
||||
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
/* Register Firing - Single Account to start with */
|
||||
static void
|
||||
@ -1229,6 +1238,7 @@ gnc_plugin_page_account_tree_cmd_open2_subaccounts (GtkAction *action,
|
||||
gppat_open2_account_common (page, account, TRUE);
|
||||
}
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
|
||||
static void
|
||||
gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page)
|
||||
|
@ -42,9 +42,11 @@
|
||||
#include "guile-mappings.h"
|
||||
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
#include "gnc-plugin-register.h"
|
||||
#include "gnc-plugin-menu-additions.h"
|
||||
#include "gnc-plugin-page-report.h"
|
||||
@ -802,14 +804,17 @@ gnc_plugin_page_register_new (Account* account, gboolean subaccounts)
|
||||
gnc_commodity* com0;
|
||||
gnc_commodity* com1;
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
const GList* item;
|
||||
GncPluginPageRegister2* new_register_page;
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
|
||||
ENTER ("account=%p, subaccounts=%s", account,
|
||||
subaccounts ? "TRUE" : "FALSE");
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
// We test for the new register being open here, ie matching account guids
|
||||
item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER2_NAME);
|
||||
@ -830,6 +835,7 @@ gnc_plugin_page_register_new (Account* account, gboolean subaccounts)
|
||||
}
|
||||
}
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
com0 = gnc_account_get_currency_or_parent (account);
|
||||
com1 = gnc_account_foreach_descendant_until (account,
|
||||
gnc_plug_page_register_check_commodity, com0);
|
||||
|
@ -35,6 +35,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <libguile.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
@ -1676,12 +1678,12 @@ gnc_plugin_page_register2_get_tab_name (GncPluginPage *plugin_page)
|
||||
case LD2_GL:
|
||||
switch (model->type)
|
||||
{
|
||||
case GENERAL_JOURNAL:
|
||||
case INCOME_LEDGER:
|
||||
case GENERAL_JOURNAL2:
|
||||
case INCOME_LEDGER2:
|
||||
return g_strdup(_("General Journal"));
|
||||
case PORTFOLIO_LEDGER:
|
||||
case PORTFOLIO_LEDGER2:
|
||||
return g_strdup(_("Portfolio"));
|
||||
case SEARCH_LEDGER:
|
||||
case SEARCH_LEDGER2:
|
||||
return g_strdup(_("Search Results"));
|
||||
default:
|
||||
break;
|
||||
@ -2410,20 +2412,20 @@ gnc_reg_get_name (GNCLedgerDisplay2 *ledger, gboolean for_window) // this works
|
||||
|
||||
switch (model->type)
|
||||
{
|
||||
case GENERAL_JOURNAL:
|
||||
case INCOME_LEDGER:
|
||||
case GENERAL_JOURNAL2:
|
||||
case INCOME_LEDGER2:
|
||||
if (for_window)
|
||||
reg_name = _("General Journal");
|
||||
else
|
||||
reg_name = _("General Journal Report");
|
||||
break;
|
||||
case PORTFOLIO_LEDGER:
|
||||
case PORTFOLIO_LEDGER2:
|
||||
if (for_window)
|
||||
reg_name = _("Portfolio");
|
||||
else
|
||||
reg_name = _("Portfolio Report");
|
||||
break;
|
||||
case SEARCH_LEDGER:
|
||||
case SEARCH_LEDGER2:
|
||||
if (for_window)
|
||||
reg_name = _("Search Results");
|
||||
else
|
||||
@ -4108,6 +4110,7 @@ gnc_plugin_page_register2_event_handler (QofInstance *entity,
|
||||
LEAVE(" ");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
|
@ -52,9 +52,11 @@
|
||||
#include "Split.h"
|
||||
#include "Transaction.h"
|
||||
#include "dialog-sx-editor.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
#include "dialog-sx-editor2.h"
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-component-manager.h"
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h>
|
||||
@ -231,3 +233,5 @@ gnc_plugin_register2_cmd_general_ledger (GtkAction *action,
|
||||
page = gnc_plugin_page_register2_new_gl ();
|
||||
gnc_main_window_open_page (data->window, page);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
@ -1138,3 +1140,5 @@ gnc_split_reg2_set_moved_cb (GNCSplitReg2 *gsr, GFunc cb, gpointer cb_data ) //t
|
||||
{
|
||||
gnc_tree_view_split_reg_set_uiupdate_cb (gnc_ledger_display2_get_split_view_register (gsr->ledger), cb, cb_data);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,7 +31,6 @@
|
||||
#define GNC_SPLIT_REG2_H
|
||||
|
||||
#include "gnc-ledger-display2.h"
|
||||
#include "gnc-split-reg.h"
|
||||
#include "gnc-tree-view-split-reg.h"
|
||||
/** @ingroup Register
|
||||
* @addtogroup Register2
|
||||
@ -84,8 +83,29 @@ struct _GNCSplitReg2Class
|
||||
void (*help_changed) (GNCSplitReg2 *w, gpointer user_data);
|
||||
};
|
||||
|
||||
/*FIXME Note sure about this == Coming from original gnc-split-reg.h */
|
||||
typedef GNC_SPLIT_REG_ITEM GNC_SPLIT_REG2_ITEM;
|
||||
/* Something somewhere sets these to silly values and causes problems */
|
||||
#undef DELETE
|
||||
#undef DUPLICATE
|
||||
typedef enum
|
||||
{
|
||||
ENTER,
|
||||
CANCEL,
|
||||
DELETE,
|
||||
REINIT,
|
||||
DUPLICATE,
|
||||
SCHEDULE,
|
||||
SPLIT,
|
||||
BLANK,
|
||||
JUMP,
|
||||
CUT,
|
||||
CUT_TXN,
|
||||
COPY,
|
||||
COPY_TXN,
|
||||
PASTE,
|
||||
PASTE_TXN,
|
||||
SORT_ORDER_SUBMENU,
|
||||
STYLE_SUBMENU,
|
||||
} GNC_SPLIT_REG2_ITEM;
|
||||
|
||||
/**
|
||||
* GTK-related; gets an identifier for the class of GNCSplitRegs.
|
||||
|
@ -56,11 +56,15 @@
|
||||
#include "gnc-plugin-basic-commands.h" /* FIXME Remove this line*/
|
||||
#include "gnc-plugin-file-history.h" /* FIXME Remove this line*/
|
||||
#include "gnc-plugin-register.h" /* FIXME Remove this line*/
|
||||
#ifdef REGISTER2_ENABLED
|
||||
#include "gnc-plugin-register2.h" /* FIXME Remove this line*/
|
||||
#endif
|
||||
#include "gnc-plugin-budget.h"
|
||||
#include "gnc-plugin-business.h"
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
#endif
|
||||
#include "gnc-plugin-manager.h" /* FIXME Remove this line*/
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-gnome-utils.h"
|
||||
@ -434,8 +438,10 @@ gnc_main_gui_init (void)
|
||||
gnc_plugin_manager_get (), gnc_plugin_menu_additions_new ());
|
||||
gnc_plugin_manager_add_plugin (
|
||||
gnc_plugin_manager_get (), gnc_plugin_register_new ());
|
||||
#ifdef REGISTER2_ENABLED
|
||||
gnc_plugin_manager_add_plugin (
|
||||
gnc_plugin_manager_get (), gnc_plugin_register2_new ());
|
||||
#endif
|
||||
gnc_plugin_manager_add_plugin (
|
||||
gnc_plugin_manager_get (), gnc_plugin_business_new ());
|
||||
/* I'm not sure why the FIXME note says to remove this. Maybe
|
||||
|
@ -30,6 +30,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#ifdef __G_IR_SCANNER__
|
||||
@ -2215,3 +2217,5 @@ static GtkActionEntry recnWindow2_actions [] =
|
||||
|
||||
/** The number of actions provided by the main window. */
|
||||
static guint recnWindow2_n_actions = G_N_ELEMENTS (recnWindow2_actions);
|
||||
|
||||
#endif
|
||||
|
@ -46,7 +46,9 @@
|
||||
#include "gnc-plugin-manager.h"
|
||||
#include "gnc-plugin-page-account-tree.h"
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
#endif
|
||||
#include "gnc-main-window.h"
|
||||
#include "gnc-prefs.h"
|
||||
#include "gnc-ui-util.h" // for gnc_get_current_book
|
||||
@ -463,12 +465,14 @@ main_window_to_account(GncMainWindow *window)
|
||||
account = gnc_plugin_page_register_get_account(
|
||||
GNC_PLUGIN_PAGE_REGISTER(page));
|
||||
}
|
||||
#ifdef REGISTER2_ENABLED
|
||||
else if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER2_NAME) == 0)
|
||||
{
|
||||
DEBUG("register2 page");
|
||||
account = gnc_plugin_page_register2_get_account(
|
||||
GNC_PLUGIN_PAGE_REGISTER2(page));
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
|
||||
{
|
||||
DEBUG("account tree page");
|
||||
|
@ -31,9 +31,11 @@
|
||||
#include "assistant-csv-export.h"
|
||||
|
||||
#include "gnc-plugin-page-register.h"
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
#include "gnc-plugin-page-register2.h"
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
#include "Query.h"
|
||||
|
||||
static void gnc_plugin_csv_export_class_init (GncPluginCsvExportClass *klass);
|
||||
@ -157,6 +159,7 @@ gnc_plugin_csv_export_register_cmd (GtkAction *action,
|
||||
gnc_file_csv_export_register (XML_EXPORT_REGISTER, query, acc);
|
||||
}
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
/*################## Added for Reg2 #################*/
|
||||
if (GNC_IS_PLUGIN_PAGE_REGISTER2(page))
|
||||
{
|
||||
@ -165,6 +168,7 @@ gnc_plugin_csv_export_register_cmd (GtkAction *action,
|
||||
gnc_file_csv_export_register (XML_EXPORT_REGISTER, query, acc);
|
||||
}
|
||||
/*################## Added for Reg2 #################*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef REGISTER2_ENABLED
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "Account.h"
|
||||
@ -1045,3 +1047,5 @@ gnc_ledger_display2_close (GNCLedgerDisplay2 *ld)
|
||||
|
||||
gnc_close_gui_component (ld->component_id);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include "Account.h"
|
||||
#include "Query.h"
|
||||
|
||||
#include "split-register.h"
|
||||
|
||||
#include "SchedXaction.h"
|
||||
#include "Transaction.h"
|
||||
#include "gnc-tree-model-split-reg.h"
|
||||
|
Loading…
Reference in New Issue
Block a user