From 299c4ed6f4d6e4bc16cf02881168d32cd786a809 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Mon, 9 Jul 2001 16:46:31 +0000 Subject: [PATCH] Try to load the defaults file if no rollback data can be found 2001-07-09 Bradford Hovinen * bonobo-config-archiver.c (bonobo_config_archiver_new): Try to load the defaults file if no rollback data can be found * capplets/sound/Makefile.am (defaults_DATA): Add sound-properties.xml (EXTRA_DIST): Add defaults_DATA * control-center/Makefile.am (INCLUDES): Update directory locations --- archiver/ChangeLog | 5 +++++ archiver/Makefile.am | 3 ++- archiver/bonobo-config-archiver.c | 14 ++++++++++++-- capplets/sound/ChangeLog | 3 +++ capplets/sound/Makefile.am | 10 +++++++--- capplets/sound/sound-properties.xml | 7 +++++++ control-center/ChangeLog | 2 ++ control-center/Makefile.am | 18 +++++++++--------- 8 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 capplets/sound/sound-properties.xml diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 27bb7a1ed..415eadb1f 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,8 @@ +2001-07-09 Bradford Hovinen + + * bonobo-config-archiver.c (bonobo_config_archiver_new): Try to + load the defaults file if no rollback data can be found + 2001-07-05 Bradford Hovinen * bonobo-config-archiver.[ch]: Use bonobo-conf rather than diff --git a/archiver/Makefile.am b/archiver/Makefile.am index 15df2660a..cebd7d868 100644 --- a/archiver/Makefile.am +++ b/archiver/Makefile.am @@ -13,9 +13,10 @@ INCLUDES = \ -DVERSION=\""$(VERSION)"\" \ -DG_LOG_DOMAIN=\"libconfig-archiver\" \ -DCONFIGDIR=\""/etc"\" \ - -DLOCATION_DIR=\""$(datadir)/control-center-data/archiver"\" \ + -DLOCATION_DIR=\""$(datadir)/control-center/archiver"\" \ -DGLADE_DIR=\""$(INTERFACES_DIR)"\" \ -DXST_BACKEND_LOCATION=\""$(datadir)/ximian-setup-tools/scripts"\" \ + -DDEFAULTS_DIR=\""$(datadir)/control-center/defaults"\" \ @ARCHIVER_CFLAGS@ \ @MONIKER_CFLAGS@ diff --git a/archiver/bonobo-config-archiver.c b/archiver/bonobo-config-archiver.c index f925a1e84..9be974fab 100644 --- a/archiver/bonobo-config-archiver.c +++ b/archiver/bonobo-config-archiver.c @@ -656,8 +656,18 @@ bonobo_config_archiver_new (const char *backend_id, const char *location_id) archiver_db->doc = location_load_rollback_data (archiver_db->location, NULL, 0, archiver_db->backend_id, TRUE); - if (archiver_db->doc == NULL) - archiver_db->doc = xmlNewDoc ("1.0"); + if (archiver_db->doc == NULL) { + gchar *filename; + + filename = g_strconcat (DEFAULTS_DIR, "/", archiver_db->backend_id, ".xml", NULL); + archiver_db->doc = xmlParseFile (filename); + g_free (filename); + + if (archiver_db->doc == NULL) { + gtk_object_destroy (GTK_OBJECT (archiver_db)); + return CORBA_OBJECT_NIL; + } + } if (archiver_db->doc->root == NULL) archiver_db->doc->root = diff --git a/capplets/sound/ChangeLog b/capplets/sound/ChangeLog index 871fd523f..7b8017a1d 100644 --- a/capplets/sound/ChangeLog +++ b/capplets/sound/ChangeLog @@ -1,5 +1,8 @@ 2001-07-09 Bradford Hovinen + * Makefile.am (defaults_DATA): Add sound-properties.xml + (EXTRA_DIST): Add defaults_DATA + * sound-properties-capplet.c (close_cb): Don't destroy the widget -- it's already destroyed diff --git a/capplets/sound/Makefile.am b/capplets/sound/Makefile.am index 914533e7d..d29f153c6 100644 --- a/capplets/sound/Makefile.am +++ b/capplets/sound/Makefile.am @@ -1,4 +1,4 @@ -Applicationsdir = $(datadir)/control-center/Desktop +Applicationsdir = $(datadir)/control-center/capplets/Desktop Applications_DATA = \ sound-properties.desktop @@ -6,10 +6,14 @@ pApplicationsdir = $(datadir)/gnome/apps/Settings/Desktop pApplications_DATA = \ sound-properties.desktop -Gladedir = $(datadir)/control-center-data +Gladedir = $(datadir)/control-center/interfaces Glade_DATA = \ sound-properties.glade +defaultsdir= $(datadir)/control-center/defaults +defaults_DATA = \ + sound-properties.xml + oafdir = $(datadir)/oaf oaf_DATA = \ Bonobo_Control_Capplet_sound_properties.oaf @@ -17,7 +21,7 @@ oaf_DATA = \ glade_msgs = \ sound-properties.glade.h -EXTRA_DIST = ChangeLog $(Applications_DATA) $(Glade_DATA) $(glade_msgs) $(oaf_DATA) +EXTRA_DIST = ChangeLog $(Applications_DATA) $(Glade_DATA) $(glade_msgs) $(oaf_DATA) $(defaults_DATA) INCLUDES = \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ diff --git a/capplets/sound/sound-properties.xml b/capplets/sound/sound-properties.xml new file mode 100644 index 000000000..d14e23383 --- /dev/null +++ b/capplets/sound/sound-properties.xml @@ -0,0 +1,7 @@ + + +
+ + +
+
diff --git a/control-center/ChangeLog b/control-center/ChangeLog index 2fe853b0f..4eee0c005 100644 --- a/control-center/ChangeLog +++ b/control-center/ChangeLog @@ -1,5 +1,7 @@ 2001-07-09 Bradford Hovinen + * Makefile.am (INCLUDES): Update directory locations + * capplet-dir.c (capplet_control_launch): Terminate the list of properties to set diff --git a/control-center/Makefile.am b/control-center/Makefile.am index 378ec1be8..893a15e59 100644 --- a/control-center/Makefile.am +++ b/control-center/Makefile.am @@ -23,15 +23,15 @@ glade_DATA = \ icon-view.xpm \ tree-view.xpm -INCLUDES = \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -DGLADEDIR=\""$(datadir)/control-center-data"\" \ - -I$(top_srcdir)/intl -I$(top_builddir)/intl \ - -DVERSION=\""$(VERSION)"\" \ - -DSETTINGS_DIR=\""$(datadir)/control-center"\" \ - -DPIXMAPS_DIR=\""$(appicondir)"\" \ - -DART_DIR=\""$(splashdir)"\" \ - -DGNOME_SBINDIR=\""$(sbindir)"\" \ +INCLUDES = \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -DGLADEDIR=\""$(datadir)/control-center/interfaces"\" \ + -I$(top_srcdir)/intl -I$(top_builddir)/intl \ + -DVERSION=\""$(VERSION)"\" \ + -DSETTINGS_DIR=\""$(datadir)/control-center/capplets"\" \ + -DPIXMAPS_DIR=\""$(appicondir)"\" \ + -DART_DIR=\""$(splashdir)"\" \ + -DGNOME_SBINDIR=\""$(sbindir)"\" \ @GNOMECC_CFLAGS@ bin_PROGRAMS = gnomecc