Commit eba544a0 authored by Bradford Hovinen's avatar Bradford Hovinen Committed by Bradford Hovinen (Gdict maintainer)
Browse files

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
parent 27692b9c
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
2001-05-03 Bradford Hovinen <hovinen@ximian.com>
* capplets/*/main.c (main): Handle --get-defaults
......
......@@ -7,6 +7,7 @@
#undef HAVE_LIBSM
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_XIMIAN_ARCHIVER
#undef PACKAGE
#undef VERSION
......
......@@ -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 PrefsWidget *prefs_widget;
static guint ok_handler_id;
static guint cancel_handler_id;
#ifdef HAVE_XIMIAN_ARCHIVER
static Archive *archive;
static gboolean outside_location;
......@@ -70,27 +74,41 @@ 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 (prefs);
preferences_apply_now (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
gtk_signal_disconnect (GTK_OBJECT (prefs_widget), ok_handler_id);
gtk_signal_disconnect (GTK_OBJECT (prefs_widget), cancel_handler_id);
gtk_object_destroy (GTK_OBJECT (prefs_widget));
#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 (prefs);
preferences_apply_now (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
gtk_signal_disconnect (GTK_OBJECT (prefs_widget), ok_handler_id);
gtk_signal_disconnect (GTK_OBJECT (prefs_widget), cancel_handler_id);
......@@ -116,6 +134,8 @@ setup_capplet_widget (void)
preferences_thaw (prefs);
}
#ifdef HAVE_XIMIAN_ARCHIVER
static void
do_get_xml (void)
{
......@@ -162,6 +182,8 @@ do_set_xml (gboolean apply_settings)
return;
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
do_restore_from_defaults (void)
{
......@@ -190,11 +212,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) {
......@@ -230,6 +256,7 @@ main (int argc, char **argv)
gnome_window_icon_set_default_from_file
(GNOME_ICONDIR"/gnome-ccbackground.png");
#ifdef HAVE_XIMIAN_ARCHIVER
archive = ARCHIVE (archive_load (FALSE));
if (capplet_get_location () != NULL &&
......@@ -249,6 +276,16 @@ main (int argc, char **argv)
preferences_apply_now (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
prefs = PREFERENCES (preferences_new ());
preferences_load (prefs);
if (token || res == 1)
preferences_apply_now (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
if (!res) {
old_prefs = PREFERENCES (preferences_clone (prefs));
setup_capplet_widget ();
......
......@@ -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 ();
......
......@@ -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,6 +71,8 @@ store_archive_data (void)
archive_close (archive);
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
ok_cb (GtkWidget *widget)
{
......@@ -75,7 +81,9 @@ ok_cb (GtkWidget *widget)
preferences_apply_now (prefs);
}
#ifdef HAVE_XIMIAN_ARCHIVER
store_archive_data ();
#endif /* HAVE_XIMIAN_ARCHIVER */
}
static void
......@@ -104,6 +112,8 @@ setup_capplet_widget (void)
preferences_thaw (prefs);
}
#ifdef HAVE_XIMIAN_ARCHIVER
static void
do_get_xml (void)
{
......@@ -152,6 +162,8 @@ do_set_xml (gboolean apply_settings)
return;
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
do_restore_from_defaults (void)
{
......@@ -180,11 +192,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) {
......@@ -220,6 +236,7 @@ main (int argc, char **argv)
gnome_window_icon_set_default_from_file
(GNOME_ICONDIR"/gnome-mouse.png");
#ifdef HAVE_XIMIAN_ARCHIVER
archive = ARCHIVE (archive_load (FALSE));
if (capplet_get_location () != NULL &&
......@@ -239,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 ();
......
......@@ -37,8 +37,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"
......@@ -52,6 +54,8 @@ static PrefsWidget *prefs_widget;
static CappletWidget *capplet;
#ifdef HAVE_XIMIAN_ARCHIVER
static Archive *archive;
static gboolean outside_location;
......@@ -74,6 +78,8 @@ store_archive_data (void)
archive_close (archive);
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
state_changed_cb (GtkWidget *widget)
{
......@@ -88,11 +94,17 @@ try_cb (GtkWidget *widget)
old_sm = prefs->selection_mode;
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
prefs_widget_store_prefs (prefs_widget, prefs);
preferences_save (prefs);
setup_dpms (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
prefs_widget_store_prefs (prefs_widget, prefs);
preferences_save (prefs);
setup_dpms (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
if (old_sm == SM_DISABLE_SCREENSAVER &&
prefs->selection_mode != SM_DISABLE_SCREENSAVER)
......@@ -109,10 +121,15 @@ revert_cb (GtkWidget *widget)
old_sm = old_prefs->selection_mode;
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
preferences_save (old_prefs);
preferences_destroy (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
preferences_save (old_prefs);
preferences_destroy (prefs);
#endif /* HAVE_XIMIAN_ARCHIVER */
prefs = preferences_new ();
preferences_load (prefs);
......@@ -140,7 +157,9 @@ ok_cb (GtkWidget *widget)
close_preview ();
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
#endif /* HAVE_XIMIAN_ARCHIVER */
prefs_widget_store_prefs (prefs_widget, prefs);
preferences_save (prefs);
setup_dpms (prefs);
......@@ -150,9 +169,11 @@ ok_cb (GtkWidget *widget)
else if (old_sm != SM_DISABLE_SCREENSAVER &&
prefs->selection_mode == SM_DISABLE_SCREENSAVER)
stop_xscreensaver ();
#ifdef HAVE_XIMIAN_ARCHIVER
}
store_archive_data ();
#endif /* HAVE_XIMIAN_ARCHIVER */
}
static void
......@@ -164,7 +185,9 @@ cancel_cb (GtkWidget *widget)
close_preview ();
#ifdef HAVE_XIMIAN_ARCHIVER
if (!outside_location) {
#endif /* HAVE_XIMIAN_ARCHIVER */
preferences_save (old_prefs);
setup_dpms (old_prefs);
......@@ -174,7 +197,9 @@ cancel_cb (GtkWidget *widget)
else if (old_sm != SM_DISABLE_SCREENSAVER &&
prefs->selection_mode == SM_DISABLE_SCREENSAVER)
stop_xscreensaver ();
#ifdef HAVE_XIMIAN_ARCHIVER
}
#endif /* HAVE_XIMIAN_ARCHIVER */
}
static void
......@@ -218,6 +243,8 @@ setup_capplet_widget (void)
prefs->frozen--;
}
#ifdef HAVE_XIMIAN_ARCHIVER
static void
do_get_xml (void)
{
......@@ -264,6 +291,8 @@ do_set_xml (gboolean apply_settings)
return;
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
do_restore_from_defaults (void)
{
......@@ -290,11 +319,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) {
......@@ -331,6 +364,7 @@ main (int argc, char **argv)
(GNOME_ICONDIR"/gnome-ccscreensaver.png");
init_resource_database (argc, argv);
#ifdef HAVE_XIMIAN_ARCHIVER
archive = ARCHIVE (archive_load (FALSE));
if (capplet_get_location () != NULL &&
......@@ -352,6 +386,19 @@ main (int argc, char **argv)
setup_dpms (prefs);
}
#else /* !HAVE_XIMIAN_ARCHIVER */
prefs = preferences_new ();
preferences_load (prefs);
if (token) {
if (prefs->selection_mode != SM_DISABLE_SCREENSAVER)
start_xscreensaver ();
setup_dpms (prefs);
}
#endif /* HAVE_XIMIAN_ARCHIVER */
if (!res) {
old_prefs = preferences_new ();
preferences_load (old_prefs);
......
/*
* Translatable strings file generated by extract-labels
* Add this file to your project's POTFILES.in.
* DO NOT compile it as part of your application.
*/
......@@ -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 (prefs);
preferences_apply_now (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)
{
......@@ -150,6 +170,8 @@ do_set_xml (gboolean apply_settings)
return;
}
#endif /* HAVE_XIMIAN_ARCHIVER */
static void
do_restore_from_defaults (void)
{
......@@ -181,11 +203,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) {
......@@ -221,6 +247,7 @@ main (int argc, char **argv)
gnome_window_icon_set_default_from_file
(GNOME_ICONDIR"/~icon~");
#ifdef HAVE_XIMIAN_ARCHIVER
archive = ARCHIVE (archive_load (FALSE));
if (capplet_get_location () != NULL &&
......@@ -240,6 +267,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 ();
......
......@@ -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 */