Make sure register column sizes are saved.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3342 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-12-22 08:42:48 +00:00
parent f429055b01
commit a9a8dfa0b4
3 changed files with 31 additions and 15 deletions

View File

@ -1135,7 +1135,7 @@ gnc_register_create_menu_bar(RegWindow *regData, GtkWidget *statusbar)
{
GNOMEUIINFO_RADIOLIST(style_list),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_TOGGLEITEM(N_("Double Line"),
GNOMEUIINFO_TOGGLEITEM(N_("_Double Line"),
N_("Show two lines of information for each "
"transaction"),
gnc_register_double_line_cb, NULL),
@ -2031,6 +2031,8 @@ regDestroy (xaccLedgerDisplay *ledger)
if (regData)
{
gnc_reg_save_size (regData);
if (ledger->reg && ledger->reg->table)
gnc_table_save_state (ledger->reg->table);
gtk_widget_destroy (regData->window);
}

View File

@ -258,6 +258,7 @@ Table * gnc_table_new (TableGetEntryHandler entry_handler,
VirtCellDataDeallocator deallocator,
VirtCellDataCopy copy);
void gnc_table_save_state (Table *table);
void gnc_table_destroy (Table *table);
/* These functions check the bounds of virtal locations in the table

View File

@ -1,5 +1,5 @@
/********************************************************************\
* table-gnome.c -- implemntation of table object in GNOME *
* table-gnome.c -- implementation of table object in GNOME *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -36,31 +36,30 @@
* Copyright (c) 2000 Dave Peticolas <dave@krondo.com>
*/
#include "config.h"
#include <gnome.h>
#include <guile/gh.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gnome.h>
#include <guile/gh.h>
#include "global-options.h"
#include "table-allgui.h"
#include "splitreg.h"
#include "gnucash-sheet.h"
#include "gnucash-style.h"
#include "splitreg.h"
#include "table-allgui.h"
static void
table_destroy_cb(Table *table)
void
gnc_table_save_state (Table *table)
{
int header_widths[CELL_TYPE_COUNT];
GnucashSheet *sheet;
int header_widths[CELL_TYPE_COUNT];
SCM alist;
int i;
if (table == NULL)
if (!table)
return;
if (table->ui_data == NULL)
@ -93,6 +92,20 @@ table_destroy_cb(Table *table)
if (!gh_null_p (alist))
gnc_set_option ("__gui", "reg_column_widths", alist);
}
static void
table_destroy_cb(Table *table)
{
GnucashSheet *sheet;
if (table == NULL)
return;
if (table->ui_data == NULL)
return;
sheet = GNUCASH_SHEET (table->ui_data);
gtk_widget_unref (GTK_WIDGET(sheet));