Add check for libximian_archiver; try include cflags and libs only if the

2001-05-05  Bradford Hovinen  <hovinen@ximian.com>

	* configure.in: Add check for libximian_archiver; try include
	cflags and libs only if the archiver is present *
	capplets/*/main.c: Add #ifdef's around anything that uses the
	Ximian archiver so that the capplets can compile without it
This commit is contained in:
Bradford Hovinen 2001-05-05 14:19:03 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 27692b9c5c
commit eba544a091
11 changed files with 260 additions and 27 deletions

View file

@ -35,8 +35,10 @@
#include <capplet-widget.h>
#include <ximian-archiver/archive.h>
#include <ximian-archiver/location.h>
#ifdef HAVE_XIMIAN_ARCHIVER
# include <ximian-archiver/archive.h>
# include <ximian-archiver/location.h>
#endif /* HAVE_XIMIAN_ARCHIVER */
#include "preferences.h"
#include "prefs-widget.h"
@ -45,6 +47,8 @@ static Preferences *prefs;
static Preferences *old_prefs;
static PrefsWidget *prefs_widget;
#ifdef HAVE_XIMIAN_ARCHIVER
static Archive *archive;
static gboolean outside_location;
@ -67,24 +71,38 @@ store_archive_data (void)
archive_close (archive);
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
ok_cb (GtkWidget *widget)
{
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
preferences_save (prefs);
preferences_apply_now (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
preferences_save (old_prefs);
preferences_apply_now (old_prefs);
#endif /* !HAVE_XIMIAN_ARCHIVER */
#ifdef HAVE_XIMIAN_ARCHIVER
store_archive_data ();
#endif /* HAVE_XIMIAN_ARCHIVER */
}
static void
cancel_cb (GtkWidget *widget)
{
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
preferences_save (old_prefs);
preferences_apply_now (old_prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
preferences_save (old_prefs);
preferences_apply_now (old_prefs);
#endif /* !HAVE_XIMIAN_ARCHIVER */
}
static void
@ -104,6 +122,8 @@ setup_capplet_widget (void)
preferences_thaw (prefs);
}
#ifdef HAVE_XIMIAN_ARCHIVER
static void
do_get_xml (void)
{
@ -151,6 +171,8 @@ do_set_xml (gboolean apply_settings)
return;
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
do_restore_from_defaults (void)
{
@ -179,11 +201,15 @@ main (int argc, char **argv)
g_error ("Could not initialize the capplet.");
}
else if (res == 3) {
#ifdef HAVE_XIMIAN_ARCHIVER
do_get_xml ();
#endif /* HAVE_XIMIAN_ARCHIVER */
return 0;
}
else if (res == 4) {
#ifdef HAVE_XIMIAN_ARCHIVER
do_set_xml (TRUE);
#endif /* HAVE_XIMIAN_ARCHIVER */
return 0;
}
else if (res == 5) {
@ -219,6 +245,7 @@ main (int argc, char **argv)
gnome_window_icon_set_default_from_file
(GNOME_ICONDIR"/gnome-cckeyboard.png");
#ifdef HAVE_XIMIAN_ARCHIVER
archive = ARCHIVE (archive_load (FALSE));
if (capplet_get_location () != NULL &&
@ -238,6 +265,14 @@ main (int argc, char **argv)
preferences_apply_now (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
prefs = PREFERENCES (preferences_new ());
preferences_load (prefs);
if (token) preferences_apply_now (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
if (!res) {
old_prefs = PREFERENCES (preferences_clone (prefs));
setup_capplet_widget ();