r23262 - gnucash/trunk/src - Remove state saving/restoring code from new and old register code
Geert Janssens
gjanssens at code.gnucash.org
Mon Oct 7 10:28:02 EDT 2013
Author: gjanssens
Date: 2013-10-07 10:28:01 -0400 (Mon, 07 Oct 2013)
New Revision: 23262
Trac: http://svn.gnucash.org/trac/changeset/23262
Modified:
gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
gnucash/trunk/src/gnome/Makefile.am
gnucash/trunk/src/gnome/gnc-split-reg.c
gnucash/trunk/src/gnome/gnc-split-reg2.c
gnucash/trunk/src/register/register-core/table-allgui.h
gnucash/trunk/src/register/register-gnome/Makefile.am
gnucash/trunk/src/register/register-gnome/table-gnome.c
Log:
Remove state saving/restoring code from new and old register code
This is similar to what the previous commit did for GncTreeView
and means column widths, column's visibility and register sort order
are currently no longer saved or restored for any register.
This is done because the state code relies heavily on gconf
and unfortunately can't be mapped to gsettings in its present
form. State save/restore will be added again later, once
the gconf conversion is complete.
Modified: gnucash/trunk/src/gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/Makefile.am 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/gnome/Makefile.am 2013-10-07 14:28:01 UTC (rev 23262)
@@ -19,7 +19,6 @@
${LIBXML2_LIBS} \
${GUILE_LIBS} \
${GTK_LIBS} \
- ${GCONF_LIBS} \
${GLIB_LIBS} \
${QOF_LIBS}
@@ -144,7 +143,6 @@
${LIBXML2_CFLAGS} \
${GUILE_INCS} \
${GTK_CFLAGS} \
- ${GCONF_CFLAGS} \
$(GLIB_CFLAGS) \
${GTK_MAC_CFLAGS}
Modified: gnucash/trunk/src/gnome/gnc-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg.c 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/gnome/gnc-split-reg.c 2013-10-07 14:28:01 UTC (rev 23262)
@@ -686,13 +686,13 @@
{
GNCSplitReg *gsr = gnc_ledger_display_get_user_data( ledger );
- gchar *prefs_key;
+ gchar *state_key;
const GncGUID * guid;
Account * account;
account = gnc_ledger_display_leader(ledger);
guid = xaccAccountGetGUID(account);
- prefs_key = (gchar*)guid_to_string (guid);
+ state_key = (gchar*)guid_to_string (guid);
if (gsr)
@@ -702,7 +702,7 @@
reg = gnc_ledger_display_get_split_register (ledger);
if (reg && reg->table)
- gnc_table_save_state (reg->table, prefs_key);
+ gnc_table_save_state (reg->table, state_key);
/*
* Don't destroy the window here any more. The register no longer
Modified: gnucash/trunk/src/gnome/gnc-split-reg2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg2.c 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/gnome/gnc-split-reg2.c 2013-10-07 14:28:01 UTC (rev 23262)
@@ -37,7 +37,6 @@
#include "gnc-ledger-display2.h"
#include "gnc-euro.h"
-#include "gnc-gconf-utils.h"
#include "gnome-utils/gnc-warnings.h"
#include "dialog-utils.h"
@@ -291,11 +290,11 @@
gnc_ledger_display2_set_split_view_register (gsr->ledger, view);
- /* Restore the sort depth from gconf */
- view->sort_depth = gnc_gconf_get_int (state_key, "sort_depth", NULL);
+ /* Restore the sort depth from saved state */
+ /* Restore the sort order from saved state */
+ // FIXME currently not implemented
- /* Restore the sort order from gconf */
- sort_string = gnc_gconf_get_string (state_key, "sort_order", NULL);
+ sort_string = NULL;
if (g_strcmp0 ("descending", sort_string) == 0)
view->sort_direction = -1;
else
@@ -820,10 +819,9 @@
model->sort_direction = 1;
}
- /* Save the sort depth to gconf */
+ /* Save the sort depth state */
state_section = gnc_tree_view_get_state_section (GNC_TREE_VIEW (view));
- gnc_gconf_set_int (state_section, "sort_depth", view->sort_depth, NULL);
- gnc_gconf_set_int (state_section, "sort_col", view->sort_col, NULL);
+ // FIXME currently not implemented
LEAVE("v_sort_col %d, v_sort_direction is %d v_sort_depth is %d", view->sort_col, view->sort_direction, view->sort_depth);
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c 2013-10-07 14:28:01 UTC (rev 23262)
@@ -33,7 +33,6 @@
#include "gnc-tree-model-split-reg.h"
#include "gnc-component-manager.h"
#include "gnc-commodity.h"
-#include "gnc-gconf-utils.h"
#include "gnc-prefs.h"
#include "gnc-engine.h"
#include "gnc-event.h"
@@ -1020,22 +1019,25 @@
state_key = g_strconcat (STATE_SECTION_PREFIX, (gchar*)guid_to_string (guid), NULL);
- /* Restore the sort column from gconf */
- col = gnc_gconf_get_int (state_key, "sort_col", NULL);
+ /* Restore the sort column from saved state */
+ // FIXME currently not implemented
+ col = 0;
if (col == 0)
model->sort_col = 1;
else
model->sort_col = col;
- /* Restore the sort depth from gconf */
- depth = gnc_gconf_get_int (state_key, "sort_depth", NULL);
+ /* Restore the sort depth from saved state */
+ // FIXME currently not implemented
+ depth = 0;
if (depth == 0)
model->sort_depth = 1;
else
model->sort_depth = depth;
- /* Restore the sort order from gconf */
- sort_string = gnc_gconf_get_string (state_key, "sort_order", NULL);
+ /* Restore the sort order from saved state */
+ // FIXME currently not implemented
+ sort_string = NULL;
if (g_strcmp0 ("descending", sort_string) == 0)
model->sort_direction = -1;
else
Modified: gnucash/trunk/src/register/register-core/table-allgui.h
===================================================================
--- gnucash/trunk/src/register/register-core/table-allgui.h 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/register/register-core/table-allgui.h 2013-10-07 14:28:01 UTC (rev 23262)
@@ -166,7 +166,7 @@
TableControl *control);
void gnc_virtual_location_init (VirtualLocation *vloc);
-void gnc_table_save_state (Table *table, gchar *gconf_key);
+void gnc_table_save_state (Table *table, gchar *state_key);
void gnc_table_destroy (Table *table);
@@ -303,7 +303,7 @@
/** UI-specific functions *******************************/
/* Initialize the GUI from a table */
-void gnc_table_init_gui (GtkWidget *widget, gchar * gconf_key);
+void gnc_table_init_gui (GtkWidget *widget, gchar * state_key);
void gnc_table_realize_gui (Table *table);
Modified: gnucash/trunk/src/register/register-gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/register/register-gnome/Makefile.am 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/register/register-gnome/Makefile.am 2013-10-07 14:28:01 UTC (rev 23262)
@@ -13,7 +13,6 @@
${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
${top_builddir}/src/libqof/qof/libgnc-qof.la \
${GLIB_LIBS} \
- ${GCONF_LIBS} \
${GNOMECANVAS_LIBS}
libgncmod_register_gnome_la_SOURCES = \
@@ -63,7 +62,6 @@
-I${top_srcdir}/src/register/register-core \
-I${top_srcdir}/src/libqof/qof \
${GLIB_CFLAGS} \
- ${GCONF_CFLAGS} \
${GTK_XIM_FLAGS} \
${GNOMECANVAS_CFLAGS}
Modified: gnucash/trunk/src/register/register-gnome/table-gnome.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/table-gnome.c 2013-10-07 14:27:50 UTC (rev 23261)
+++ gnucash/trunk/src/register/register-gnome/table-gnome.c 2013-10-07 14:28:01 UTC (rev 23262)
@@ -48,13 +48,11 @@
#include "gnucash-style.h"
#include "table-allgui.h"
#include "table-gnome.h"
-#include "gnc-gconf-utils.h"
#include "gnc-prefs.h"
#include "gnc-engine.h"
#include "gnc-ledger-display.h"
-#define GCONF_SECTION "window/pages/register"
/** Static Globals *****************************************************/
@@ -66,24 +64,20 @@
/** Implementation *****************************************************/
void
-gnc_table_save_state (Table *table, gchar * gconf_key)
+gnc_table_save_state (Table *table, gchar * state_key)
{
GnucashSheet *sheet;
GNCHeaderWidths widths;
GList *node;
gchar *key;
- gchar * gconf_section = NULL;
- if(gconf_key != NULL)gconf_section = g_strjoin(NULL,GCONF_SECTION, "/", gconf_key,NULL);
- PINFO("gconf_key=%s",gconf_key );
-
if (!table)
return;
if (table->ui_data == NULL)
return;
- if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
+ if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
return;
sheet = GNUCASH_SHEET (table->ui_data);
@@ -107,7 +101,7 @@
/* Remember whether the column is visible */
key = g_strdup_printf("%s_width", cell->cell_name);
- gnc_gconf_set_int( gconf_section, key, width, NULL);
+ // FIXME the actual state saving is currently not implemented
g_free(key);
}
@@ -158,7 +152,7 @@
to pass NULL as second parameter. */
void
-gnc_table_init_gui (GtkWidget *widget, gchar * gconf_key)
+gnc_table_init_gui (GtkWidget *widget, gchar * state_key)
{
GNCHeaderWidths widths;
GnucashSheet *sheet;
@@ -169,13 +163,10 @@
guint value;
// Stuff for per-register settings load.
- gchar * gconf_section = NULL;
- 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));
- PINFO("gconf_key=%s",gconf_key);
+ PINFO("state_key=%s",state_key);
ENTER("widget=%p, data=%p", widget, "");
@@ -206,7 +197,8 @@
/* Remember whether the column is visible */
key = g_strdup_printf("%s_width", cell->cell_name);
- value = gnc_gconf_get_int(gconf_section, key, NULL);
+ // FIXME the actual state loading is currently not implemented
+ value = 0;
if (value != 0)
gnc_header_widths_set_width (widths, cell->cell_name, value);
g_free(key);
More information about the gnucash-changes
mailing list