diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index 6ff9e8b988..96d596dd1d 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -47,6 +47,7 @@ #include "gnc-budget-view.h" #include "gnc-budget.h" +#include "gnc-features.h" #include "dialog-options.h" #include "dialog-utils.h" @@ -367,6 +368,7 @@ gbv_create_widget (GncBudgetView *budget_view) GtkTreeViewColumn *totals_title_col; GtkTreeIter iter; GtkWidget *h_separator; + GKeyFile *state_file = gnc_state_get_current (); gchar *state_section; gchar guidstr[GUID_ENCODING_LENGTH+1]; @@ -388,6 +390,17 @@ gbv_create_widget (GncBudgetView *budget_view) guid_to_string_buff (&priv->key, guidstr); state_section = g_strjoin (" ", STATE_SECTION_PREFIX, guidstr, NULL); g_object_set (G_OBJECT(tree_view), "state-section", state_section, NULL); + + // make sure any extra account columns are hidden, there will be an option to + // show code and description in 4.0 which will disrupt the display of the table + if (gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS)) + { + if (g_key_file_has_group (state_file, state_section)) + { + g_key_file_set_boolean (state_file, state_section, "account-code_visible", FALSE); + g_key_file_set_boolean (state_file, state_section, "description_visible", FALSE); + } + } g_free (state_section); gnc_tree_view_configure_columns (GNC_TREE_VIEW(tree_view)); diff --git a/libgnucash/engine/gnc-features.c b/libgnucash/engine/gnc-features.c index 98e8d50b22..163bd36f50 100644 --- a/libgnucash/engine/gnc-features.c +++ b/libgnucash/engine/gnc-features.c @@ -50,6 +50,7 @@ static gncFeature known_features[] = { GNC_FEATURE_SQLITE3_ISO_DATES, "Use ISO formatted date-time strings in SQLite3 databases (requires at least GnuCash 2.6.20)"}, { GNC_FEATURE_REG_SORT_FILTER, "Store the register sort and filter settings in .gcm metadata file (requires at least GnuCash 3.3)"}, { GNC_FEATURE_BUDGET_UNREVERSED, "Store budget amounts unreversed (i.e. natural) signs (requires at least Gnucash 3.8)"}, + { GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS, "Show extra account columns in the Budget View (requires at least Gnucash 3.8)"}, { NULL }, }; diff --git a/libgnucash/engine/gnc-features.h b/libgnucash/engine/gnc-features.h index bb2efe10bc..0ceeee3eb3 100644 --- a/libgnucash/engine/gnc-features.h +++ b/libgnucash/engine/gnc-features.h @@ -54,6 +54,7 @@ extern "C" { #define GNC_FEATURE_SQLITE3_ISO_DATES "ISO-8601 formatted date strings in SQLite3 databases." #define GNC_FEATURE_REG_SORT_FILTER "Register sort and filter settings stored in .gcm file" #define GNC_FEATURE_BUDGET_UNREVERSED "Use natural signs in budget amounts" +#define GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS "Show extra account columns in the Budget View" /** @} */