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
|
@ -1,3 +1,10 @@
|
|||
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);
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
||||
|
||||
#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 ();
|
||||
|
|
|
@ -15,9 +15,10 @@
|
|||
#include "capplet-widget.h"
|
||||
#include "gnome.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 */
|
||||
|
||||
/* prototypes */
|
||||
static void restart (gboolean force);
|
||||
|
@ -127,6 +128,7 @@ gboolean restart_pending = FALSE;
|
|||
*/
|
||||
gboolean in_fill = FALSE;
|
||||
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
|
||||
static void
|
||||
store_archive_data (void)
|
||||
|
@ -144,6 +146,7 @@ store_archive_data (void)
|
|||
archive_close (archive);
|
||||
}
|
||||
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
|
||||
static GtkWidget *
|
||||
left_aligned_button (gchar *label)
|
||||
|
@ -698,7 +701,9 @@ ok_callback (void)
|
|||
}
|
||||
|
||||
wm_list_save ();
|
||||
#ifdef HAVE_XIMIAN_ARCHIVER
|
||||
store_archive_data ();
|
||||
#endif /* HAVE_XIMIAN_ARCHIVER */
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
30
configure.in
30
configure.in
|
@ -93,14 +93,32 @@ case "x$vers" in
|
|||
;;
|
||||
esac
|
||||
|
||||
CAPPLET_CFLAGS=`gnome-config --cflags libglade capplet gdk_pixbuf ximian_archiver`
|
||||
CAPPLET_LIBS=`gnome-config --libs libglade capplet gdk_pixbuf ximian_archiver`
|
||||
dnl
|
||||
dnl Check for libximian_archiver and set the flag
|
||||
dnl HAVE_LIBXIMIAN_ARCHIVER iff it is prsent
|
||||
dnl
|
||||
AC_MSG_CHECKING(for Ximian archiver library)
|
||||
vers=`$GNOME_CONFIG --modversion ximian_archiver 2>/dev/null`
|
||||
case "x$vers" in
|
||||
xximian-archiver-*)
|
||||
AC_DEFINE(HAVE_XIMIAN_ARCHIVER)
|
||||
ARCHIVER_CFLAGS=`gnome-config --cflags ximian_archiver`
|
||||
ARCHIVER_LIBS=`gnome-config --libs ximian_archiver`
|
||||
AC_MSG_RESULT(found)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(not found)
|
||||
;;
|
||||
esac
|
||||
|
||||
BG_CAPPLET_CFLAGS=`gnome-config --cflags libglade capplet gdk_pixbuf gdk_pixbuf_xlib ximian_archiver`
|
||||
BG_CAPPLET_LIBS=`gnome-config --libs libglade capplet gdk_pixbuf gdk_pixbuf_xlib ximian_archiver`
|
||||
CAPPLET_CFLAGS="`gnome-config --cflags libglade capplet gdk_pixbuf` $ARCHIVER_CFLAGS"
|
||||
CAPPLET_LIBS="`gnome-config --libs libglade capplet gdk_pixbuf` $ARCHIVER_LIBS"
|
||||
|
||||
ROLLBACK_CAPPLET_CFLAGS=`gnome-config --cflags libglade capplet gdk_pixbuf ximian_archiver`
|
||||
ROLLBACK_CAPPLET_LIBS=`gnome-config --libs libglade capplet gdk_pixbuf ximian_archiver`
|
||||
BG_CAPPLET_CFLAGS="`gnome-config --cflags libglade capplet gdk_pixbuf gdk_pixbuf_xlib` $ARCHIVER_CFLAGS"
|
||||
BG_CAPPLET_LIBS="`gnome-config --libs libglade capplet gdk_pixbuf gdk_pixbuf_xlib` $ARCHIVER_LIBS"
|
||||
|
||||
ROLLBACK_CAPPLET_CFLAGS="`gnome-config --cflags libglade capplet gdk_pixbuf` $ARCHIVER_CFLAGS"
|
||||
ROLLBACK_CAPPLET_LIBS="`gnome-config --libs libglade capplet gdk_pixbuf` $ARCHIVER_LIBS"
|
||||
|
||||
GNOMECC_CFLAGS=`gnome-config --cflags gnomeui libglade xml gdk_pixbuf capplet gnomecanvaspixbuf gtkhtml`
|
||||
GNOMECC_LIBS=`gnome-config --libs gnomeui libglade xml gdk_pixbuf capplet gnomecanvaspixbuf gtkhtml`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue