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:
parent
27692b9c5c
commit
eba544a091
11 changed files with 260 additions and 27 deletions
|
@ -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"
|
||||
|
@ -48,6 +50,8 @@ static Preferences *prefs;
|
|||
static Preferences *old_prefs;
|
||||
static PrefsWidget *prefs_widget;
|
||||
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
|
||||
static Archive *archive;
|
||||
static gboolean outside_location;
|
||||
|
||||
|
@ -70,19 +74,27 @@ store_archive_data (void)
|
|||
archive_close (archive);
|
||||
}
|
||||
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
|
||||
static void
|
||||
ok_cb (GtkWidget *widget)
|
||||
{
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
if (!outside_location)
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
preferences_save (prefs);
|
||||
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
store_archive_data ();
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
}
|
||||
|
||||
static void
|
||||
cancel_cb (GtkWidget *widget)
|
||||
{
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
if (!outside_location)
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
preferences_save (old_prefs);
|
||||
}
|
||||
|
||||
|
@ -103,6 +115,8 @@ setup_capplet_widget (void)
|
|||
preferences_thaw (prefs);
|
||||
}
|
||||
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
|
||||
static void
|
||||
do_get_xml (void)
|
||||
{
|
||||
|
@ -149,6 +163,8 @@ do_set_xml (gboolean apply_settings)
|
|||
return;
|
||||
}
|
||||
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
|
||||
static void
|
||||
do_restore_from_defaults (void)
|
||||
{
|
||||
|
@ -177,11 +193,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) {
|
||||
|
@ -216,6 +236,7 @@ main (int argc, char **argv)
|
|||
|
||||
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-applications.png");
|
||||
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
archive = ARCHIVE (archive_load (FALSE));
|
||||
|
||||
if (capplet_get_location () != NULL &&
|
||||
|
@ -235,6 +256,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 ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue