|
|
|
|
@ -53,6 +53,8 @@
|
|
|
|
|
#include "gnc-gconf-utils.h"
|
|
|
|
|
#include "gnc-engine.h"
|
|
|
|
|
|
|
|
|
|
#include "gnc-ledger-display.h"
|
|
|
|
|
|
|
|
|
|
#define GCONF_SECTION "window/pages/register"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -65,13 +67,17 @@ static QofLogModule log_module = GNC_MOD_REGISTER;
|
|
|
|
|
/** Implementation *****************************************************/
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gnc_table_save_state (Table *table)
|
|
|
|
|
gnc_table_save_state (Table *table, gchar * gconf_key)
|
|
|
|
|
{
|
|
|
|
|
GnucashSheet *sheet;
|
|
|
|
|
GNCHeaderWidths widths;
|
|
|
|
|
GList *node;
|
|
|
|
|
gchar *key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gchar * gconf_section;
|
|
|
|
|
if(gconf_key != NULL)gconf_section = g_strjoin(NULL,GCONF_SECTION, "/", gconf_key,NULL);
|
|
|
|
|
PINFO("gconf_key=%s",gconf_key );
|
|
|
|
|
|
|
|
|
|
if (!table)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
@ -102,7 +108,7 @@ gnc_table_save_state (Table *table)
|
|
|
|
|
|
|
|
|
|
/* Remember whether the column is visible */
|
|
|
|
|
key = g_strdup_printf("%s_width", cell->cell_name);
|
|
|
|
|
gnc_gconf_set_int(GCONF_SECTION, key, width, NULL);
|
|
|
|
|
gnc_gconf_set_int( gconf_section, key, width, NULL);
|
|
|
|
|
g_free(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -147,8 +153,13 @@ table_destroy_cb (Table *table)
|
|
|
|
|
/* Um, this function checks that data is not null but never uses it.
|
|
|
|
|
Weird. Also, since this function only works with a GnucashRegister
|
|
|
|
|
widget, maybe some of it should be moved to gnucash-sheet.c. */
|
|
|
|
|
/* Adding to previous note: Since data doesn't appear do anything and to
|
|
|
|
|
align the function with save_state() I've removed the check for
|
|
|
|
|
NULL and changed two calls in dialog_order.c and dialog_invoice.c
|
|
|
|
|
to pass NULL as second parameter. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gnc_table_init_gui (GtkWidget *widget, void *data)
|
|
|
|
|
gnc_table_init_gui (GtkWidget *widget, gchar * gconf_key)
|
|
|
|
|
{
|
|
|
|
|
GNCHeaderWidths widths;
|
|
|
|
|
GnucashSheet *sheet;
|
|
|
|
|
@ -157,12 +168,18 @@ gnc_table_init_gui (GtkWidget *widget, void *data)
|
|
|
|
|
GList *node;
|
|
|
|
|
gchar *key;
|
|
|
|
|
guint value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Stuff for per-register settings load.
|
|
|
|
|
gchar * gconf_section;
|
|
|
|
|
if(gconf_key != NULL) gconf_section =g_strjoin(NULL,GCONF_SECTION, "/", gconf_key,NULL);
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
|
g_return_if_fail (GNUCASH_IS_REGISTER (widget));
|
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
|
|
|
|
ENTER("widget=%p, data=%p", widget, data);
|
|
|
|
|
|
|
|
|
|
PINFO("gconf_key=%s",gconf_key);
|
|
|
|
|
|
|
|
|
|
ENTER("widget=%p, data=%p", widget, "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
greg = GNUCASH_REGISTER (widget);
|
|
|
|
|
sheet = GNUCASH_SHEET (greg->sheet);
|
|
|
|
|
@ -190,7 +207,7 @@ gnc_table_init_gui (GtkWidget *widget, void *data)
|
|
|
|
|
|
|
|
|
|
/* Remember whether the column is visible */
|
|
|
|
|
key = g_strdup_printf("%s_width", cell->cell_name);
|
|
|
|
|
value = gnc_gconf_get_int(GCONF_SECTION, key, NULL);
|
|
|
|
|
value = gnc_gconf_get_int(gconf_section, key, NULL);
|
|
|
|
|
if (value != 0)
|
|
|
|
|
gnc_header_widths_set_width (widths, cell->cell_name, value);
|
|
|
|
|
g_free(key);
|
|
|
|
|
|