diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt index 7ceb5c93cf..31846fc79f 100644 --- a/gnucash/gnome-utils/CMakeLists.txt +++ b/gnucash/gnome-utils/CMakeLists.txt @@ -53,6 +53,7 @@ set (gnome_utils_SOURCES gnc-cell-renderer-text-flag.c gnc-combott.c gnc-commodity-edit.c + gnc-component-manager.c gnc-currency-edit.c gnc-date-delta.c gnc-date-edit.c @@ -141,6 +142,7 @@ set (gnome_utils_HEADERS gnc-cell-renderer-text-flag.h gnc-combott.h gnc-commodity-edit.h + gnc-component-manager.h gnc-currency-edit.h gnc-date-delta.h gnc-date-edit.h diff --git a/libgnucash/app-utils/gnc-component-manager.c b/gnucash/gnome-utils/gnc-component-manager.c similarity index 100% rename from libgnucash/app-utils/gnc-component-manager.c rename to gnucash/gnome-utils/gnc-component-manager.c diff --git a/libgnucash/app-utils/gnc-component-manager.h b/gnucash/gnome-utils/gnc-component-manager.h similarity index 100% rename from libgnucash/app-utils/gnc-component-manager.h rename to gnucash/gnome-utils/gnc-component-manager.h diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index 935c4dd7df..479685e709 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -48,9 +48,11 @@ #include "dialog-reset-warnings.h" #include "dialog-transfer.h" #include "dialog-utils.h" +#include "engine-helpers.h" #include "file-utils.h" #include "gnc-component-manager.h" #include "gnc-engine.h" +#include "gnc-features.h" #include "gnc-file.h" #include "gnc-filepath-utils.h" #include "gnc-gkeyfile-utils.h" @@ -4111,6 +4113,44 @@ gnc_book_options_dialog_close_cb(GNCOptionWin * optionwin, gnc_option_db_destroy(options); } +/** Calls gnc_book_option_num_field_source_change to initiate registered + * callbacks when num_field_source book option changes so that + * registers/reports can update themselves; sets feature flag */ +void +gnc_book_option_num_field_source_change_cb (gboolean num_action) +{ + gnc_suspend_gui_refresh (); + if (num_action) + { + /* Set a feature flag in the book for use of the split action field as number. + * This will prevent older GnuCash versions that don't support this feature + * from opening this file. */ + gnc_features_set_used (gnc_get_current_book(), + GNC_FEATURE_NUM_FIELD_SOURCE); + } + gnc_book_option_num_field_source_change (num_action); + gnc_resume_gui_refresh (); +} + +/** Calls gnc_book_option_book_currency_selected to initiate registered + * callbacks when currency accounting book option changes to book-currency so + * that registers/reports can update themselves; sets feature flag */ +void +gnc_book_option_book_currency_selected_cb (gboolean use_book_currency) +{ + gnc_suspend_gui_refresh (); + if (use_book_currency) + { + /* Set a feature flag in the book for use of book currency. This will + * prevent older GnuCash versions that don't support this feature from + * opening this file. */ + gnc_features_set_used (gnc_get_current_book(), + GNC_FEATURE_BOOK_CURRENCY); + } + gnc_book_option_book_currency_selected (use_book_currency); + gnc_resume_gui_refresh (); +} + static gboolean show_handler (const char *class_name, gint component_id, gpointer user_data, gpointer iter_data) diff --git a/gnucash/gnome-utils/gncmod-gnome-utils.c b/gnucash/gnome-utils/gncmod-gnome-utils.c index a063b0dc03..0d901bd85d 100644 --- a/gnucash/gnome-utils/gncmod-gnome-utils.c +++ b/gnucash/gnome-utils/gncmod-gnome-utils.c @@ -33,6 +33,7 @@ #include "gnc-module.h" #include "gnc-module-api.h" +#include "gnc-component-manager.h" #include "dialog-options.h" #include "qof.h" #include "gnc-gui-query.h" @@ -85,6 +86,7 @@ libgncmod_gnome_utils_gnc_module_init(int refcount) /* Initialize the options-ui database */ if (refcount == 0) { + gnc_component_manager_init (); gnc_options_ui_initialize (); } @@ -94,5 +96,8 @@ libgncmod_gnome_utils_gnc_module_init(int refcount) int libgncmod_gnome_utils_gnc_module_end(int refcount) { + if (refcount == 0) + gnc_component_manager_shutdown (); + return TRUE; } diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt index 7f1cc09ad1..438b6e92ac 100644 --- a/libgnucash/app-utils/CMakeLists.txt +++ b/libgnucash/app-utils/CMakeLists.txt @@ -18,7 +18,6 @@ set (app_utils_HEADERS gnc-account-merge.h gnc-accounting-period.h gnc-addr-quickfill.h - gnc-component-manager.h gnc-entry-quickfill.h gnc-euro.h gnc-exp-parser.h @@ -56,7 +55,6 @@ set (app_utils_SOURCES gnc-account-merge.c gnc-accounting-period.c gnc-addr-quickfill.c - gnc-component-manager.c gnc-entry-quickfill.c gnc-euro.c gnc-exp-parser.c diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i index 9b24346c08..392c964e1a 100644 --- a/libgnucash/app-utils/app-utils.i +++ b/libgnucash/app-utils/app-utils.i @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "gnc-engine-guile.h" diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c index 30531cb362..924119bf8d 100644 --- a/libgnucash/app-utils/gnc-ui-util.c +++ b/libgnucash/app-utils/gnc-ui-util.c @@ -56,8 +56,6 @@ #include "gnc-session.h" #include "engine-helpers.h" #include "gnc-locale-utils.h" -#include "gnc-component-manager.h" -#include "gnc-features.h" #include "gnc-guile-utils.h" #define GNC_PREF_CURRENCY_CHOICE_LOCALE "currency-choice-locale" @@ -414,44 +412,6 @@ gnc_get_current_book_tax_type (void) } } -/** Calls gnc_book_option_num_field_source_change to initiate registered - * callbacks when num_field_source book option changes so that - * registers/reports can update themselves; sets feature flag */ -void -gnc_book_option_num_field_source_change_cb (gboolean num_action) -{ - gnc_suspend_gui_refresh (); - if (num_action) - { - /* Set a feature flag in the book for use of the split action field as number. - * This will prevent older GnuCash versions that don't support this feature - * from opening this file. */ - gnc_features_set_used (gnc_get_current_book(), - GNC_FEATURE_NUM_FIELD_SOURCE); - } - gnc_book_option_num_field_source_change (num_action); - gnc_resume_gui_refresh (); -} - -/** Calls gnc_book_option_book_currency_selected to initiate registered - * callbacks when currency accounting book option changes to book-currency so - * that registers/reports can update themselves; sets feature flag */ -void -gnc_book_option_book_currency_selected_cb (gboolean use_book_currency) -{ - gnc_suspend_gui_refresh (); - if (use_book_currency) - { - /* Set a feature flag in the book for use of book currency. This will - * prevent older GnuCash versions that don't support this feature from - * opening this file. */ - gnc_features_set_used (gnc_get_current_book(), - GNC_FEATURE_BOOK_CURRENCY); - } - gnc_book_option_book_currency_selected (use_book_currency); - gnc_resume_gui_refresh (); -} - /** Returns TRUE if both book-currency and default gain/loss policy KVPs exist * and are valid and trading accounts are not used. */ gboolean diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c index 012516f391..3f242d243f 100644 --- a/libgnucash/app-utils/gncmod-app-utils.c +++ b/libgnucash/app-utils/gncmod-app-utils.c @@ -32,7 +32,6 @@ #include "gnc-module.h" #include "gnc-module-api.h" -#include "gnc-component-manager.h" #include "gnc-hooks.h" #include "gnc-exp-parser.h" @@ -88,7 +87,6 @@ libgncmod_app_utils_gnc_module_init(int refcount) if (refcount == 0) { - gnc_component_manager_init (); gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL, NULL); gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL, NULL); } @@ -99,8 +97,5 @@ libgncmod_app_utils_gnc_module_init(int refcount) int libgncmod_app_utils_gnc_module_end(int refcount) { - if (refcount == 0) - gnc_component_manager_shutdown (); - return TRUE; } diff --git a/po/POTFILES.in b/po/POTFILES.in index cf4dae0177..1c3e7c43a2 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -157,6 +157,7 @@ gnucash/gnome-utils/gnc-cell-renderer-popup-entry.c gnucash/gnome-utils/gnc-cell-renderer-text-flag.c gnucash/gnome-utils/gnc-combott.c gnucash/gnome-utils/gnc-commodity-edit.c +gnucash/gnome-utils/gnc-component-manager.c gnucash/gnome-utils/gnc-currency-edit.c gnucash/gnome-utils/gnc-date-delta.c gnucash/gnome-utils/gnc-date-edit.c @@ -528,7 +529,6 @@ libgnucash/app-utils/gfec.c libgnucash/app-utils/gnc-accounting-period.c libgnucash/app-utils/gnc-account-merge.c libgnucash/app-utils/gnc-addr-quickfill.c -libgnucash/app-utils/gnc-component-manager.c libgnucash/app-utils/gnc-entry-quickfill.c libgnucash/app-utils/gnc-euro.c libgnucash/app-utils/gnc-exp-parser.c