diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c index d934cb31ac..3650bcb2ba 100644 --- a/gnucash/gnome/gnc-split-reg.c +++ b/gnucash/gnome/gnc-split-reg.c @@ -586,11 +586,16 @@ gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger ) const GncGUID * guid = xaccAccountGetGUID(account); gchar guidstr[GUID_ENCODING_LENGTH+1]; gchar *state_section; - + gchar *acct_fullname; guid_to_string_buff(guid, guidstr); state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", guidstr, NULL); + if (g_strcmp0(guidstr, "00000000000000000000000000000000") == 0) + acct_fullname = g_strdup(_("General Journal")); + else + acct_fullname = gnc_account_get_full_name(account); + if (gsr) { SplitRegister *reg; @@ -598,7 +603,7 @@ gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger ) reg = gnc_ledger_display_get_split_register (ledger); if (reg && reg->table) - gnc_table_save_state (reg->table, state_section); + gnc_table_save_state (reg->table, state_section, acct_fullname); /* * Don't destroy the window here any more. The register no longer @@ -606,6 +611,7 @@ gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger ) */ } g_free (state_section); + g_free (acct_fullname); gnc_ledger_display_set_user_data (ledger, NULL); } diff --git a/gnucash/register/register-core/table-allgui.h b/gnucash/register/register-core/table-allgui.h index 3b4fa26d11..1487058270 100644 --- a/gnucash/register/register-core/table-allgui.h +++ b/gnucash/register/register-core/table-allgui.h @@ -201,7 +201,7 @@ Table * gnc_table_new (TableLayout *layout, TableControl *control); void gnc_virtual_location_init (VirtualLocation *vloc); -void gnc_table_save_state (Table *table, gchar *state_section); +void gnc_table_save_state (Table *table, gchar *state_section, gchar *account_fullname); void gnc_table_destroy (Table *table); diff --git a/gnucash/register/register-gnome/table-gnome.c b/gnucash/register/register-gnome/table-gnome.c index c292385f03..365072121c 100644 --- a/gnucash/register/register-gnome/table-gnome.c +++ b/gnucash/register/register-gnome/table-gnome.c @@ -61,6 +61,8 @@ #define UNUSED_VAR __attribute__ ((unused)) +#define KEY_ACCOUNT_NAME "account_name" + /* This static indicates the debugging module that this .o belongs to. */ static QofLogModule UNUSED_VAR log_module = GNC_MOD_REGISTER; @@ -68,14 +70,14 @@ static QofLogModule UNUSED_VAR log_module = GNC_MOD_REGISTER; /** Implementation *****************************************************/ void -gnc_table_save_state (Table *table, gchar * state_section) +gnc_table_save_state (Table *table, gchar * state_section, gchar * account_fullname) { GnucashSheet *sheet; GNCHeaderWidths widths; GList *node; gchar *key; GKeyFile *state_file = gnc_state_get_current(); - + if (!table) return; @@ -109,7 +111,7 @@ gnc_table_save_state (Table *table, gchar * state_section) g_key_file_remove_key (state_file, state_section, key, NULL); g_free (key); } - + g_key_file_set_string (state_file, state_section, KEY_ACCOUNT_NAME, account_fullname); gnc_header_widths_destroy (widths); }