diff options
Diffstat (limited to 'archiver')
-rw-r--r-- | archiver/ChangeLog | 13 | ||||
-rw-r--r-- | archiver/Makefile.am | 62 | ||||
-rw-r--r-- | archiver/config-manager-dialog.c | 625 | ||||
-rw-r--r-- | archiver/config-manager-dialog.h | 63 | ||||
-rw-r--r-- | archiver/create-location-dialog.c | 291 | ||||
-rw-r--r-- | archiver/create-location-dialog.h | 62 | ||||
-rw-r--r-- | archiver/location-list.c | 364 | ||||
-rw-r--r-- | archiver/location-list.h | 68 | ||||
-rw-r--r-- | archiver/rollback-widget.c | 163 | ||||
-rw-r--r-- | archiver/rollback-widget.h | 57 |
10 files changed, 53 insertions, 1715 deletions
diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 6d6155afb..1887565c8 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,16 @@ +2001-07-05 Bradford Hovinen <hovinen@ximian.com> + + * bonobo-moniker-archiver.c (archiver_resolve): Update call to + Bonobo_ConfigDatabase_addDatabase + + * bonobo-config-archiver.h: Fix include directories + + * Makefile.am (INCLUDES): Update to use pkg-config standards; add + BONOBO_CFLAGS + Include configuration moniker-related material + (SUBDIRS): Remove + (bin_PROGRAMS): Added ximian-archiver + 2001-07-02 Tambet Ingo <tambet@ximian.com> * default-global.xml: Added display-conf backend. diff --git a/archiver/Makefile.am b/archiver/Makefile.am index 432dbdd06..859abe1c9 100644 --- a/archiver/Makefile.am +++ b/archiver/Makefile.am @@ -1,5 +1,3 @@ -SUBDIRS = . location-manager-capplet - confexecdir = $(libdir) confexec_DATA = ximian_archiverConf.sh @@ -9,33 +7,32 @@ Locationmeta_DATA = default-user.xml default-global.xml includedir = $(prefix)/include/ximian-archiver INCLUDES = \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -I$(includedir) $(GNOME_INCLUDEDIR) \ - -DVERSION=\""$(VERSION)"\" \ - -DG_LOG_DOMAIN=\"libximian-archiver\" \ - -DCONFIGDIR=\""/etc"\" \ - -DLOCATION_DIR=\""$(datadir)/ximian-setup-tools/archiver"\" \ - -DGLADE_DIR=\""$(INTERFACES_DIR)"\" \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -I$(includedir) \ + $(GNOME_INCLUDEDIR) \ + -DVERSION=\""$(VERSION)"\" \ + -DG_LOG_DOMAIN=\"libximian-archiver\" \ + -DCONFIGDIR=\""/etc"\" \ + -DLOCATION_DIR=\""$(datadir)/ximian-setup-tools/archiver"\" \ + -DGLADE_DIR=\""$(INTERFACES_DIR)"\" \ -DXST_BACKEND_LOCATION=\""$(datadir)/ximian-setup-tools/scripts"\" \ - $(GNOME_XML_CFLAGS) \ - $(LIBGLADE_CFLAGS) + @ARCHIVER_CFLAGS@ \ + @MONIKER_CFLAGS@ -bin_PROGRAMS = ximian-archiver +bin_PROGRAMS = bonobo-moniker-archiver ximian-archiver lib_LTLIBRARIES = libximian_archiver.la libximian_archiver_la_SOURCES = \ archive.c archive.h \ location.c location.h \ config-log.c config-log.h \ - create-location-dialog.c create-location-dialog.h \ - location-list.c location-list.h \ backend-list.c backend-list.h \ cluster.c cluster.h \ cluster-location.c cluster-location.h \ - config-manager-dialog.c config-manager-dialog.h \ util.c util.h -libximian_archiver_la_LIBADD = $(XIMIAN_ARCHIVER_LIBS) +libximian_archiver_la_LIBADD = \ + @GNOME_XML_LIBS@ include_HEADERS = \ archive.h \ @@ -52,14 +49,10 @@ ximian_archiver_SOURCES = \ ximian_archiver_LDADD = \ $(GNOME_LIBDIR) \ $(GNOMEUI_LIBS) \ - $(INTLLIBS) \ - $(GNOME_XML_LIB) \ + $(INTLLIBS) \ + @ARCHIVER_LIBS@ \ libximian_archiver.la -EXTRA_DIST = \ - $(Locationmeta_DATA) \ - ximian_archiverConf.sh.in - # # Create the ximian_archiverConf.sh file from the sh.in file # @@ -71,4 +64,29 @@ ximian_archiverConf.sh: ximian_archiverConf.sh.in Makefile < $(srcdir)/ximian_archiverConf.sh.in > ximian_archiverConf.tmp \ && mv ximian_archiverConf.tmp ximian_archiverConf.sh +OAF_FILES = \ + Bonobo_Moniker_archiver.oaf + +oafdir = $(datadir)/oaf +oaf_DATA = $(OAF_FILES) + +monikerdir = $(libdir)/bonobo/monikers +Bonobo_Moniker_archiver.oaf : $(srcdir)/Bonobo_Moniker_archiver.oaf.in $(top_builddir)/config.status + sed -e "s|\@MONIKER_LIBDIR\@|$(monikerdir)|" \ + $(srcdir)/Bonobo_Moniker_archiver.oaf.in > Bonobo_Moniker_archiver.oaf + +clean-local: + -rm -f $(OAF_FILES) + +bonobo_moniker_archiver_SOURCES = \ + bonobo-config-archiver.c \ + bonobo-config-archiver.h \ + bonobo-moniker-archiver.c + +bonobo_moniker_archiver_LDADD = @MONIKER_LIBS@ libximian_archiver.la + +EXTRA_DIST = \ + $(Locationmeta_DATA) \ + ximian_archiverConf.sh.in \ + Bonobo_Moniker_archiver.oaf.in diff --git a/archiver/config-manager-dialog.c b/archiver/config-manager-dialog.c deleted file mode 100644 index 475904242..000000000 --- a/archiver/config-manager-dialog.c +++ /dev/null @@ -1,625 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* config-manager-dialog.c - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <time.h> - -#include <glade/glade.h> - -#include "config-manager-dialog.h" -#include "create-location-dialog.h" -#include "archive.h" -#include "location.h" -#include "backend-list.h" -#include "location-list.h" - -#define WID(str) (glade_xml_get_widget (dialog->p->config_dialog_data, str)) - -enum { - ARG_0, - ARG_TYPE -}; - -struct _ConfigManagerDialogPrivate -{ - GladeXML *config_dialog_data; - - CMDialogType type; - - struct tm *date; - gboolean rollback_all; - gchar *backend_id; - gchar *selected_location_id; - - Archive *global_archive; - Archive *user_archive; - - BackendList *global_list; - BackendList *user_list; - - Location *current_global; - Location *current_user; - - LocationList *location_list; -}; - -static GnomeDialogClass *parent_class; - -static void config_manager_dialog_init (ConfigManagerDialog *dialog); -static void config_manager_dialog_class_init (ConfigManagerDialogClass *class); - -static void config_manager_dialog_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void config_manager_dialog_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - -static void config_manager_dialog_finalize (GtkObject *object); - -static void ok_cb (GtkWidget *widget, - ConfigManagerDialog *dialog); -static void apply_cb (GtkWidget *widget, - ConfigManagerDialog *dialog); -static void cancel_cb (GtkWidget *widget, - ConfigManagerDialog *dialog); -static void time_count_changed_cb (GtkSpinButton *button, - ConfigManagerDialog *dialog); -static void rollback_all_toggled_cb (GtkToggleButton *button, - ConfigManagerDialog *dialog); -static void rollback_one_toggled_cb (GtkToggleButton *button, - ConfigManagerDialog *dialog); -static void backend_select_cb (GtkMenuItem *menu_item, - ConfigManagerDialog *dialog); - -static void create_cb (GtkWidget *button, - ConfigManagerDialog *dialog); -static void rename_cb (GtkWidget *button, - ConfigManagerDialog *dialog); -static void destroy_cb (GtkWidget *button, - ConfigManagerDialog *dialog); -static void change_location_cb (GtkWidget *button, - ConfigManagerDialog *dialog); -static void edit_location_cb (GtkWidget *button, - ConfigManagerDialog *dialog); -static void real_create_cb (CreateLocationDialog - *create_dialog, - gchar *name, - Location *parent, - ConfigManagerDialog *dialog); - -static void do_rollback (ConfigManagerDialog *dialog); -static void reset_time (ConfigManagerDialog *dialog, - guint sub_days); -static gint populate_backends_cb (BackendList *list, - gchar *backend_id, - ConfigManagerDialog *dialog); -static void populate_backends_list (ConfigManagerDialog *dialog, - BackendList *list); - -static void set_backend_controls_sensitive (ConfigManagerDialog *dialog, - gboolean s); - -guint -config_manager_dialog_get_type (void) -{ - static guint config_manager_dialog_type = 0; - - if (!config_manager_dialog_type) { - GtkTypeInfo config_manager_dialog_info = { - "ConfigManagerDialog", - sizeof (ConfigManagerDialog), - sizeof (ConfigManagerDialogClass), - (GtkClassInitFunc) config_manager_dialog_class_init, - (GtkObjectInitFunc) config_manager_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL - }; - - config_manager_dialog_type = - gtk_type_unique (gnome_dialog_get_type (), - &config_manager_dialog_info); - } - - return config_manager_dialog_type; -} - -static void -config_manager_dialog_init (ConfigManagerDialog *dialog) -{ - static char *buttons[] = { - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_APPLY, - GNOME_STOCK_BUTTON_CANCEL, - NULL - }; - - gnome_dialog_constructv (GNOME_DIALOG (dialog), - _("Rollback and Location Management"), - buttons); - - dialog->p = g_new0 (ConfigManagerDialogPrivate, 1); - dialog->p->config_dialog_data = - glade_xml_new (GLADE_DIR "/rollback-location-management.glade", - "config_dialog_data"); - - gtk_box_pack_start (GTK_BOX - (GNOME_DIALOG (dialog)->vbox), - WID ("config_dialog_data"), 0, TRUE, TRUE); - - gtk_window_set_policy (GTK_WINDOW (dialog), - TRUE, FALSE, TRUE); - - gnome_dialog_button_connect (GNOME_DIALOG (dialog), - 0, GTK_SIGNAL_FUNC (ok_cb), - dialog); - gnome_dialog_button_connect (GNOME_DIALOG (dialog), - 1, GTK_SIGNAL_FUNC (apply_cb), - dialog); - gnome_dialog_button_connect (GNOME_DIALOG (dialog), - 2, GTK_SIGNAL_FUNC (cancel_cb), - dialog); - - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "time_count_changed_cb", - time_count_changed_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "rollback_all_toggled_cb", - rollback_all_toggled_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "rollback_one_toggled_cb", - rollback_one_toggled_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "create_cb", - create_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "rename_cb", - rename_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "destroy_cb", - destroy_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "change_location_cb", - change_location_cb, - dialog); - glade_xml_signal_connect_data (dialog->p->config_dialog_data, - "edit_location_cb", - edit_location_cb, - dialog); - - dialog->p->rollback_all = TRUE; - dialog->p->date = g_new (struct tm, 1); - dialog->p->location_list = - LOCATION_LIST (location_list_new (FALSE, NULL, NULL)); - - gtk_widget_show (GTK_WIDGET (dialog->p->location_list)); - gtk_container_add (GTK_CONTAINER (WID ("location_tree_location")), - GTK_WIDGET (dialog->p->location_list)); - - set_backend_controls_sensitive (dialog, FALSE); - reset_time (dialog, 0); -} - -static void -config_manager_dialog_class_init (ConfigManagerDialogClass *class) -{ - GtkObjectClass *object_class; - - gtk_object_add_arg_type ("ConfigManagerDialog::type", - GTK_TYPE_INT, - GTK_ARG_CONSTRUCT_ONLY | GTK_ARG_READWRITE, - ARG_TYPE); - - object_class = GTK_OBJECT_CLASS (class); - object_class->finalize = config_manager_dialog_finalize; - object_class->set_arg = config_manager_dialog_set_arg; - object_class->get_arg = config_manager_dialog_get_arg; - - parent_class = GNOME_DIALOG_CLASS - (gtk_type_class (gnome_dialog_get_type ())); -} - -static void -config_manager_dialog_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - ConfigManagerDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (object)); - - dialog = CONFIG_MANAGER_DIALOG (object); - - switch (arg_id) { - case ARG_TYPE: - dialog->p->type = GTK_VALUE_INT (*arg); - - switch (dialog->p->type) { - case CM_DIALOG_USER_ONLY: - dialog->p->user_archive = - ARCHIVE (archive_load (FALSE)); - dialog->p->global_archive = NULL; - break; - - case CM_DIALOG_GLOBAL_ONLY: - dialog->p->global_archive = - ARCHIVE (archive_load (TRUE)); - dialog->p->user_archive = NULL; - break; - - case CM_DIALOG_BOTH: - dialog->p->user_archive = - ARCHIVE (archive_load (FALSE)); - dialog->p->global_archive = - ARCHIVE (archive_load (TRUE)); - break; - } - - if (dialog->p->user_archive != NULL) { - dialog->p->user_list = - archive_get_backend_list - (dialog->p->user_archive); - dialog->p->current_user = - archive_get_current_location - (dialog->p->user_archive); - populate_backends_list - (dialog, dialog->p->user_list); - } - - if (dialog->p->global_archive != NULL) { - dialog->p->global_list = - archive_get_backend_list - (dialog->p->global_archive); - dialog->p->current_global = - archive_get_current_location - (dialog->p->global_archive); - populate_backends_list - (dialog, dialog->p->global_list); - } - - gtk_object_set (GTK_OBJECT (dialog->p->location_list), - "user-archive", dialog->p->user_archive, - "global-archive", dialog->p->global_archive, - NULL); - - break; - - default: - g_warning ("Bad argument set"); - break; - } -} - -static void -config_manager_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - ConfigManagerDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (object)); - - dialog = CONFIG_MANAGER_DIALOG (object); - - switch (arg_id) { - case ARG_TYPE: - GTK_VALUE_INT (*arg) = dialog->p->type; - break; - - default: - g_warning ("Bad argument get"); - break; - } -} - -static void -config_manager_dialog_finalize (GtkObject *object) -{ - ConfigManagerDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (object)); - - dialog = CONFIG_MANAGER_DIALOG (object); - - if (dialog->p->date != NULL) - g_free (dialog->p->date); - - if (dialog->p->type == CM_DIALOG_USER_ONLY || - dialog->p->type == CM_DIALOG_BOTH) - { - gtk_object_unref (GTK_OBJECT (dialog->p->current_user)); - gtk_object_unref (GTK_OBJECT (dialog->p->user_list)); - gtk_object_unref (GTK_OBJECT (dialog->p->user_archive)); - } - - if (dialog->p->type == CM_DIALOG_GLOBAL_ONLY || - dialog->p->type == CM_DIALOG_BOTH) - { - gtk_object_unref (GTK_OBJECT (dialog->p->current_global)); - gtk_object_unref (GTK_OBJECT (dialog->p->global_list)); - gtk_object_unref (GTK_OBJECT (dialog->p->global_archive)); - } - - g_free (dialog->p); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); -} - -GtkWidget * -config_manager_dialog_new (CMDialogType type) -{ - return gtk_widget_new (config_manager_dialog_get_type (), - "type", type, - NULL); -} - -static void -ok_cb (GtkWidget *widget, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - do_rollback (dialog); - - gnome_dialog_close (GNOME_DIALOG (dialog)); -} - -static void -apply_cb (GtkWidget *widget, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - do_rollback (dialog); -} - -static void -cancel_cb (GtkWidget *widget, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - /* This little hack will trick the location manager into rolling back - * to the last known configuration - */ - g_free (dialog->p->date); - dialog->p->date = NULL; - do_rollback (dialog); - - gnome_dialog_close (GNOME_DIALOG (dialog)); -} - -static void -time_count_changed_cb (GtkSpinButton *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - reset_time (dialog, gtk_spin_button_get_value_as_int (button)); -} - -static void -rollback_all_toggled_cb (GtkToggleButton *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - if (gtk_toggle_button_get_active (button)) { - dialog->p->rollback_all = TRUE; - set_backend_controls_sensitive (dialog, FALSE); - } -} - -static void -rollback_one_toggled_cb (GtkToggleButton *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - if (gtk_toggle_button_get_active (button)) { - dialog->p->rollback_all = FALSE; - set_backend_controls_sensitive (dialog, TRUE); - } -} - -static void -backend_select_cb (GtkMenuItem *menu_item, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - dialog->p->backend_id = gtk_object_get_data (GTK_OBJECT (menu_item), - "backend-id"); -} - -static void -create_cb (GtkWidget *button, ConfigManagerDialog *dialog) -{ - CreateLocationDialog *create_dialog; - - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - create_dialog = CREATE_LOCATION_DIALOG - (create_location_dialog_new (dialog->p->type)); - - gtk_signal_connect (GTK_OBJECT (create_dialog), - "create-location", - GTK_SIGNAL_FUNC (real_create_cb), - dialog); - - gtk_widget_show (GTK_WIDGET (create_dialog)); -} - -static void -rename_cb (GtkWidget *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); -} - -static void -destroy_cb (GtkWidget *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); -} - -static void -change_location_cb (GtkWidget *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - /* FIXME */ - archive_set_current_location (dialog->p->user_archive, - location_list_get_selected_location - (dialog->p->location_list)); -} - -static void -edit_location_cb (GtkWidget *button, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); -} - -static void -real_create_cb (CreateLocationDialog *create_dialog, gchar *name, - Location *parent, ConfigManagerDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); - - /* FIXME */ - location_new (dialog->p->user_archive, name, parent); - location_list_reread (dialog->p->location_list); -} - -static void -do_rollback (ConfigManagerDialog *dialog) -{ - switch (dialog->p->type) { - case CM_DIALOG_USER_ONLY: - if (dialog->p->rollback_all) - location_rollback_all_to - (dialog->p->current_user, - dialog->p->date, TRUE); - else - location_rollback_backend_to - (dialog->p->current_user, - dialog->p->date, - dialog->p->backend_id, TRUE); - break; - - case CM_DIALOG_GLOBAL_ONLY: - if (dialog->p->rollback_all) - location_rollback_all_to - (dialog->p->current_global, - dialog->p->date, TRUE); - else - location_rollback_backend_to - (dialog->p->current_global, - dialog->p->date, - dialog->p->backend_id, TRUE); - break; - - case CM_DIALOG_BOTH: - if (dialog->p->rollback_all) { - location_rollback_all_to - (dialog->p->current_global, - dialog->p->date, TRUE); - location_rollback_all_to - (dialog->p->current_user, - dialog->p->date, TRUE); - } - else if (backend_list_contains - (dialog->p->global_list, dialog->p->backend_id)) - { - location_rollback_backend_to - (dialog->p->current_global, - dialog->p->date, - dialog->p->backend_id, TRUE); - } else { - location_rollback_backend_to - (dialog->p->current_user, - dialog->p->date, - dialog->p->backend_id, TRUE); - } - - break; - } -} - -static void -reset_time (ConfigManagerDialog *dialog, guint sub_days) -{ - time_t current_time; - - time (¤t_time); - current_time -= sub_days * 24 * 60 * 60; - localtime_r (¤t_time, dialog->p->date); -} - -static gint -populate_backends_cb (BackendList *list, gchar *backend_id, - ConfigManagerDialog *dialog) -{ - GtkWidget *menu_item; - GtkWidget *menu; - - menu_item = gtk_menu_item_new_with_label (backend_id); - gtk_widget_show (menu_item); - gtk_object_set_data (GTK_OBJECT (menu_item), - "backend-id", backend_id); - gtk_signal_connect (GTK_OBJECT (menu_item), "activate", - GTK_SIGNAL_FUNC (backend_select_cb), dialog); - - menu = gtk_option_menu_get_menu - (GTK_OPTION_MENU (WID ("backend_select"))); - gtk_menu_append (GTK_MENU (menu), menu_item); - return 0; -} - -static void -populate_backends_list (ConfigManagerDialog *dialog, BackendList *list) -{ - backend_list_foreach (list, (BackendCB) populate_backends_cb, dialog); - - gtk_option_menu_set_history - (GTK_OPTION_MENU (WID ("backend_select")), 0); -} - -static void -set_backend_controls_sensitive (ConfigManagerDialog *dialog, gboolean s) -{ - gtk_widget_set_sensitive (WID ("backend_select"), s); -} diff --git a/archiver/config-manager-dialog.h b/archiver/config-manager-dialog.h deleted file mode 100644 index 792941cc4..000000000 --- a/archiver/config-manager-dialog.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* config-manager-dialog.h - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __CONFIG_MANAGER_DIALOG_H -#define __CONFIG_MANAGER_DIALOG_H - -#include <gnome.h> - -BEGIN_GNOME_DECLS - -#define CONFIG_MANAGER_DIALOG(obj) GTK_CHECK_CAST (obj, config_manager_dialog_get_type (), ConfigManagerDialog) -#define CONFIG_MANAGER_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, config_manager_dialog_get_type (), ConfigManagerDialogClass) -#define IS_CONFIG_MANAGER_DIALOG(obj) GTK_CHECK_TYPE (obj, config_manager_dialog_get_type ()) - -typedef struct _ConfigManagerDialog ConfigManagerDialog; -typedef struct _ConfigManagerDialogClass ConfigManagerDialogClass; -typedef struct _ConfigManagerDialogPrivate ConfigManagerDialogPrivate; - -typedef enum _CMDialogType CMDialogType; - -struct _ConfigManagerDialog -{ - GnomeDialog parent; - - ConfigManagerDialogPrivate *p; -}; - -struct _ConfigManagerDialogClass -{ - GnomeDialogClass gnome_dialog_class; -}; - -enum _CMDialogType { - CM_DIALOG_USER_ONLY, CM_DIALOG_GLOBAL_ONLY, CM_DIALOG_BOTH -}; - -guint config_manager_dialog_get_type (void); - -GtkWidget *config_manager_dialog_new (CMDialogType type); - -END_GNOME_DECLS - -#endif /* __CONFIG_MANAGER_DIALOG_H */ diff --git a/archiver/create-location-dialog.c b/archiver/create-location-dialog.c deleted file mode 100644 index e08757f23..000000000 --- a/archiver/create-location-dialog.c +++ /dev/null @@ -1,291 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* create-location-dialog.c - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <glade/glade.h> - -#include "create-location-dialog.h" -#include "location-list.h" - -#define WID(str) (glade_xml_get_widget (dialog->p->create_dialog_data, str)) - -enum { - ARG_0, - ARG_TYPE -}; - -enum { - CREATE_LOCATION_SIGNAL, - LAST_SIGNAL -}; - -struct _CreateLocationDialogPrivate -{ - GladeXML *create_dialog_data; - - CMDialogType type; - - gchar *selected_location_id; - - Archive *global_archive; - Archive *user_archive; - - LocationList *location_list; -}; - -static GnomeDialogClass *parent_class; - -static guint create_location_dialog_signals[LAST_SIGNAL] = { 0 }; - -static void create_location_dialog_init (CreateLocationDialog *dialog); -static void create_location_dialog_class_init (CreateLocationDialogClass *class); - -static void create_location_dialog_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void create_location_dialog_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - -static void ok_cb (GtkWidget *widget, - CreateLocationDialog *dialog); -static void cancel_cb (GtkWidget *widget, - CreateLocationDialog *dialog); - -static void create_location_dialog_finalize (GtkObject *object); - -guint -create_location_dialog_get_type (void) -{ - static guint create_location_dialog_type = 0; - - if (!create_location_dialog_type) { - GtkTypeInfo create_location_dialog_info = { - "CreateLocationDialog", - sizeof (CreateLocationDialog), - sizeof (CreateLocationDialogClass), - (GtkClassInitFunc) create_location_dialog_class_init, - (GtkObjectInitFunc) create_location_dialog_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL - }; - - create_location_dialog_type = - gtk_type_unique (gnome_dialog_get_type (), - &create_location_dialog_info); - } - - return create_location_dialog_type; -} - -static void -create_location_dialog_init (CreateLocationDialog *dialog) -{ - static char *buttons[] = { - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_CANCEL, - NULL - }; - - gnome_dialog_constructv (GNOME_DIALOG (dialog), - _("Rollback and Location Management"), - buttons); - - dialog->p = g_new0 (CreateLocationDialogPrivate, 1); - dialog->p->create_dialog_data = - glade_xml_new (GLADE_DIR "/rollback-location-management.glade", - "create_dialog_data"); - - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), - WID ("create_dialog_data"), 0, TRUE, TRUE); - - gtk_window_set_policy (GTK_WINDOW (dialog), TRUE, FALSE, TRUE); - - gnome_dialog_button_connect (GNOME_DIALOG (dialog), - 0, GTK_SIGNAL_FUNC (ok_cb), - dialog); - gnome_dialog_button_connect (GNOME_DIALOG (dialog), - 1, GTK_SIGNAL_FUNC (cancel_cb), - dialog); - - dialog->p->location_list = - LOCATION_LIST (location_list_new (FALSE, NULL, NULL)); - - gtk_widget_show (GTK_WIDGET (dialog->p->location_list)); - gtk_container_add (GTK_CONTAINER (WID ("location_list_location")), - GTK_WIDGET (dialog->p->location_list)); -} - -static void -create_location_dialog_class_init (CreateLocationDialogClass *class) -{ - GtkObjectClass *object_class; - - gtk_object_add_arg_type ("CreateLocationDialog::type", - GTK_TYPE_INT, - GTK_ARG_CONSTRUCT_ONLY | GTK_ARG_READWRITE, - ARG_TYPE); - - object_class = GTK_OBJECT_CLASS (class); - object_class->finalize = create_location_dialog_finalize; - object_class->set_arg = create_location_dialog_set_arg; - object_class->get_arg = create_location_dialog_get_arg; - - create_location_dialog_signals[CREATE_LOCATION_SIGNAL] = - gtk_signal_new ("create-location", GTK_RUN_FIRST, - object_class->type, - GTK_SIGNAL_OFFSET (CreateLocationDialogClass, - create_location), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, - GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, - create_location_dialog_signals, - LAST_SIGNAL); - - parent_class = GNOME_DIALOG_CLASS - (gtk_type_class (gnome_dialog_get_type ())); -} - -static void -create_location_dialog_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - CreateLocationDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CREATE_LOCATION_DIALOG (object)); - - dialog = CREATE_LOCATION_DIALOG (object); - - switch (arg_id) { - case ARG_TYPE: - dialog->p->type = GTK_VALUE_INT (*arg); - - switch (dialog->p->type) { - case CM_DIALOG_USER_ONLY: - dialog->p->user_archive = - ARCHIVE (archive_load (FALSE)); - dialog->p->global_archive = NULL; - break; - - case CM_DIALOG_GLOBAL_ONLY: - dialog->p->global_archive = - ARCHIVE (archive_load (TRUE)); - dialog->p->user_archive = NULL; - break; - - case CM_DIALOG_BOTH: - dialog->p->user_archive = - ARCHIVE (archive_load (FALSE)); - dialog->p->global_archive = - ARCHIVE (archive_load (TRUE)); - break; - } - - gtk_object_set (GTK_OBJECT (dialog->p->location_list), - "user-archive", dialog->p->user_archive, - "global-archive", dialog->p->global_archive, - NULL); - - break; - - default: - g_warning ("Bad argument set"); - break; - } -} - -static void -create_location_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - CreateLocationDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CREATE_LOCATION_DIALOG (object)); - - dialog = CREATE_LOCATION_DIALOG (object); - - switch (arg_id) { - case ARG_TYPE: - GTK_VALUE_INT (*arg) = dialog->p->type; - break; - - default: - g_warning ("Bad argument get"); - break; - } -} - -static void -create_location_dialog_finalize (GtkObject *object) -{ - CreateLocationDialog *dialog; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_CREATE_LOCATION_DIALOG (object)); - - dialog = CREATE_LOCATION_DIALOG (object); - - g_free (dialog->p); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); -} - -GtkObject * -create_location_dialog_new (CMDialogType type) -{ - return gtk_object_new (create_location_dialog_get_type (), - "type", type, - NULL); -} - -static void -ok_cb (GtkWidget *widget, CreateLocationDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CREATE_LOCATION_DIALOG (dialog)); - - gtk_signal_emit (GTK_OBJECT (dialog), - create_location_dialog_signals - [CREATE_LOCATION_SIGNAL], - gtk_entry_get_text - (GTK_ENTRY (WID ("location_name_entry"))), - location_list_get_selected_location - (dialog->p->location_list)); - - gnome_dialog_close (GNOME_DIALOG (dialog)); -} - -static void -cancel_cb (GtkWidget *widget, CreateLocationDialog *dialog) -{ - g_return_if_fail (dialog != NULL); - g_return_if_fail (IS_CREATE_LOCATION_DIALOG (dialog)); - - gnome_dialog_close (GNOME_DIALOG (dialog)); -} - diff --git a/archiver/create-location-dialog.h b/archiver/create-location-dialog.h deleted file mode 100644 index c01fd43c4..000000000 --- a/archiver/create-location-dialog.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* create-location-dialog.h - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __CREATE_LOCATION_DIALOG_H -#define __CREATE_LOCATION_DIALOG_H - -#include <gnome.h> - -#include "config-manager-dialog.h" -#include "location.h" - -BEGIN_GNOME_DECLS - -#define CREATE_LOCATION_DIALOG(obj) GTK_CHECK_CAST (obj, create_location_dialog_get_type (), CreateLocationDialog) -#define CREATE_LOCATION_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, create_location_dialog_get_type (), CreateLocationDialogClass) -#define IS_CREATE_LOCATION_DIALOG(obj) GTK_CHECK_TYPE (obj, create_location_dialog_get_type ()) - -typedef struct _CreateLocationDialog CreateLocationDialog; -typedef struct _CreateLocationDialogClass CreateLocationDialogClass; -typedef struct _CreateLocationDialogPrivate CreateLocationDialogPrivate; - -struct _CreateLocationDialog -{ - GnomeDialog parent; - - CreateLocationDialogPrivate *p; -}; - -struct _CreateLocationDialogClass -{ - GnomeDialogClass gnome_dialog_class; - - void (*create_location) (CreateLocationDialog *, gchar *, Location *); -}; - -guint create_location_dialog_get_type (void); - -GtkObject *create_location_dialog_new (CMDialogType type); - -END_GNOME_DECLS - -#endif /* __CREATE_LOCATION_DIALOG_H */ diff --git a/archiver/location-list.c b/archiver/location-list.c deleted file mode 100644 index ccfeaa788..000000000 --- a/archiver/location-list.c +++ /dev/null @@ -1,364 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* location-list.c - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "location-list.h" - -typedef struct _pair_t pair_t; - -struct _pair_t -{ - gpointer a, b; -}; - -enum { - ARG_0, - ARG_USER_ARCHIVE, - ARG_GLOBAL_ARCHIVE, - ARG_SEPARATE_LOCATIONS -}; - -struct _LocationListPrivate -{ - gchar *selected_location_id; - Location *selected_location; - - gboolean separate_locations; - Archive *user_archive; - Archive *global_archive; -}; - -static GtkCTreeClass *parent_class; - -static void location_list_init (LocationList *location_list); -static void location_list_class_init (LocationListClass *class); - -static void location_list_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void location_list_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - -static void select_row_cb (LocationList *list, - GList *node, gint column); - -static void location_list_finalize (GtkObject *object); - -static gint populate_locations_cb (Archive *archive, - Location *location, - pair_t *data); -static void populate_locations_list (LocationList *list, - gboolean do_global); - -guint -location_list_get_type (void) -{ - static guint location_list_type = 0; - - if (!location_list_type) { - GtkTypeInfo location_list_info = { - "LocationList", - sizeof (LocationList), - sizeof (LocationListClass), - (GtkClassInitFunc) location_list_class_init, - (GtkObjectInitFunc) location_list_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL - }; - - location_list_type = - gtk_type_unique (gtk_ctree_get_type (), - &location_list_info); - } - - return location_list_type; -} - -static void -location_list_init (LocationList *location_list) -{ - static char *titles = { "Location" }; - - gtk_ctree_construct (GTK_CTREE (location_list), - 1, 0, &titles); - - gtk_clist_column_titles_hide (GTK_CLIST (location_list)); - - location_list->p = g_new0 (LocationListPrivate, 1); - - gtk_signal_connect (GTK_OBJECT (location_list), - "tree-select-row", GTK_SIGNAL_FUNC (select_row_cb), - NULL); -} - -static void -location_list_class_init (LocationListClass *class) -{ - GtkObjectClass *object_class; - - gtk_object_add_arg_type ("LocationList::user-archive", - GTK_TYPE_POINTER, - GTK_ARG_READWRITE, - ARG_USER_ARCHIVE); - - gtk_object_add_arg_type ("LocationList::global-archive", - GTK_TYPE_POINTER, - GTK_ARG_READWRITE, - ARG_GLOBAL_ARCHIVE); - - gtk_object_add_arg_type ("LocationList::separate-locations", - GTK_TYPE_POINTER, - GTK_ARG_READWRITE, - ARG_SEPARATE_LOCATIONS); - - object_class = GTK_OBJECT_CLASS (class); - object_class->finalize = location_list_finalize; - object_class->set_arg = location_list_set_arg; - object_class->get_arg = location_list_get_arg; - - parent_class = GTK_CTREE_CLASS - (gtk_type_class (gtk_ctree_get_type ())); -} - -static void -location_list_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - LocationList *location_list; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_LOCATION_LIST (object)); - - location_list = LOCATION_LIST (object); - - switch (arg_id) { - case ARG_USER_ARCHIVE: - g_return_if_fail (GTK_VALUE_POINTER (*arg) == NULL || - IS_ARCHIVE (GTK_VALUE_POINTER (*arg))); - - if (GTK_VALUE_POINTER (*arg) == NULL) return; - - location_list->p->user_archive = - ARCHIVE (GTK_VALUE_POINTER (*arg)); - - gtk_object_ref (GTK_OBJECT (location_list->p->user_archive)); - populate_locations_list (location_list, FALSE); - - break; - - case ARG_GLOBAL_ARCHIVE: - g_return_if_fail (GTK_VALUE_POINTER (*arg) == NULL || - IS_ARCHIVE (GTK_VALUE_POINTER (*arg))); - - if (GTK_VALUE_POINTER (*arg) == NULL) return; - - location_list->p->global_archive = - ARCHIVE (GTK_VALUE_POINTER (*arg)); - - gtk_object_ref (GTK_OBJECT (location_list->p->global_archive)); - populate_locations_list (location_list, TRUE); - - break; - - case ARG_SEPARATE_LOCATIONS: - location_list->p->separate_locations = - GTK_VALUE_INT (*arg); - break; - - default: - g_warning ("Bad argument set"); - break; - } -} - -static void -location_list_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - LocationList *location_list; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_LOCATION_LIST (object)); - - location_list = LOCATION_LIST (object); - - switch (arg_id) { - case ARG_USER_ARCHIVE: - GTK_VALUE_POINTER (*arg) = location_list->p->user_archive; - break; - - case ARG_GLOBAL_ARCHIVE: - GTK_VALUE_POINTER (*arg) = location_list->p->global_archive; - break; - - case ARG_SEPARATE_LOCATIONS: - GTK_VALUE_INT (*arg) = location_list->p->separate_locations; - break; - - default: - g_warning ("Bad argument get"); - break; - } -} - -static void -location_list_finalize (GtkObject *object) -{ - LocationList *location_list; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_LOCATION_LIST (object)); - - location_list = LOCATION_LIST (object); - - if (location_list->p->user_archive != NULL) - gtk_object_unref - (GTK_OBJECT (location_list->p->user_archive)); - - if (location_list->p->global_archive != NULL) - gtk_object_unref - (GTK_OBJECT (location_list->p->global_archive)); - - g_free (location_list->p); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); -} - -GtkWidget * -location_list_new (gboolean sep_locations, Archive *user_archive, - Archive *global_archive) -{ - return gtk_widget_new (location_list_get_type (), - "separate-locations", sep_locations, - "user-archive", user_archive, - "global-archive", global_archive, - NULL); -} - -gchar * -location_list_get_selected_location_id (LocationList *list) -{ - g_return_val_if_fail (list != NULL, NULL); - g_return_val_if_fail (IS_LOCATION_LIST (list), NULL); - - return list->p->selected_location_id; -} - -Location * -location_list_get_selected_location (LocationList *list) -{ - g_return_val_if_fail (list != NULL, NULL); - g_return_val_if_fail (IS_LOCATION_LIST (list), NULL); - - return list->p->selected_location; -} - -void -location_list_reread (LocationList *list) -{ - g_return_if_fail (list != NULL); - g_return_if_fail (IS_LOCATION_LIST (list)); - - gtk_clist_freeze (GTK_CLIST (list)); - gtk_clist_clear (GTK_CLIST (list)); - - if (list->p->global_archive) - populate_locations_list (list, TRUE); - - if (list->p->user_archive) - populate_locations_list (list, FALSE); - - gtk_clist_thaw (GTK_CLIST (list)); -} - -static void -select_row_cb (LocationList *list, GList *node, gint column) -{ - GtkCTreeRow *row; - - g_return_if_fail (list != NULL); - g_return_if_fail (IS_LOCATION_LIST (list)); - - row = GTK_CTREE_ROW (node); - list->p->selected_location = row->row.data; - list->p->selected_location_id = - GTK_CELL_PIXTEXT (row->row.cell[0])->text; -} - -static gint -populate_locations_cb (Archive *archive, Location *location, pair_t *data) -{ - pair_t new_pair; - char *label; - - label = g_strdup (location_get_label (location)); - - new_pair.b = gtk_ctree_insert_node (GTK_CTREE (data->a), - (GtkCTreeNode *) data->b, NULL, - &label, GNOME_PAD_SMALL, NULL, - NULL, NULL, NULL, FALSE, TRUE); - gtk_ctree_node_set_row_data (GTK_CTREE (data->a), - (GtkCTreeNode *) new_pair.b, - location); - - new_pair.a = data->a; - - archive_foreach_child_location (archive, - (LocationCB) populate_locations_cb, - location, &new_pair); - - return 0; -} - -static void -populate_locations_list (LocationList *list, gboolean do_global) -{ - pair_t pair; - Archive *archive; - char *label; - - if (do_global) { - archive = list->p->global_archive; - label = _("Global locations"); - } else { - archive = list->p->user_archive; - label = _("User locations"); - } - - pair.a = list; - - if (list->p->separate_locations) - pair.b = gtk_ctree_insert_node (GTK_CTREE (list), - NULL, NULL, &label, - GNOME_PAD_SMALL, NULL, - NULL, NULL, NULL, FALSE, - TRUE); - else - pair.b = NULL; - - archive_foreach_child_location (archive, - (LocationCB) populate_locations_cb, - NULL, &pair); -} diff --git a/archiver/location-list.h b/archiver/location-list.h deleted file mode 100644 index 328ede417..000000000 --- a/archiver/location-list.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* location-list.h - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __LOCATION_LIST_H -#define __LOCATION_LIST_H - -#include <gnome.h> - -#include "archive.h" -#include "location.h" -#include "config-manager-dialog.h" - -BEGIN_GNOME_DECLS - -#define LOCATION_LIST(obj) GTK_CHECK_CAST (obj, location_list_get_type (), LocationList) -#define LOCATION_LIST_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, location_list_get_type (), LocationListClass) -#define IS_LOCATION_LIST(obj) GTK_CHECK_TYPE (obj, location_list_get_type ()) - -typedef struct _LocationList LocationList; -typedef struct _LocationListClass LocationListClass; -typedef struct _LocationListPrivate LocationListPrivate; - -struct _LocationList -{ - GtkCTree parent; - - LocationListPrivate *p; -}; - -struct _LocationListClass -{ - GtkCTreeClass gtk_ctree_class; -}; - -guint location_list_get_type (void); - -GtkWidget *location_list_new (gboolean sep_locations, - Archive *user_archive, - Archive *global_archive); - -gchar *location_list_get_selected_location_id (LocationList *list); -Location *location_list_get_selected_location (LocationList *list); - -void location_list_reread (LocationList *list); - -END_GNOME_DECLS - -#endif /* __LOCATION_LIST_H */ diff --git a/archiver/rollback-widget.c b/archiver/rollback-widget.c deleted file mode 100644 index c823068c5..000000000 --- a/archiver/rollback-widget.c +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* rollback-widget.c - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "rollback-widget.h" - -enum { - ARG_0, - ARG_SAMPLE -}; - -struct _RollbackWidgetPrivate -{ - /* Private data members */ -}; - -static GtkWidgetClass *parent_class; - -static void rollback_widget_init (RollbackWidget *rollback_widget); -static void rollback_widget_class_init (RollbackWidgetClass *class); - -static void rollback_widget_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void rollback_widget_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - -static void rollback_widget_finalize (GtkObject *object); - -guint -rollback_widget_get_type (void) -{ - static guint rollback_widget_type = 0; - - if (!rollback_widget_type) { - GtkTypeInfo rollback_widget_info = { - "RollbackWidget", - sizeof (RollbackWidget), - sizeof (RollbackWidgetClass), - (GtkClassInitFunc) rollback_widget_class_init, - (GtkObjectInitFunc) rollback_widget_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL - }; - - rollback_widget_type = - gtk_type_unique (gtk_widget_get_type (), - &rollback_widget_info); - } - - return rollback_widget_type; -} - -static void -rollback_widget_init (RollbackWidget *rollback_widget) -{ - rollback_widget->p = g_new0 (RollbackWidgetPrivate, 1); -} - -static void -rollback_widget_class_init (RollbackWidgetClass *class) -{ - GtkObjectClass *object_class; - - gtk_object_add_arg_type ("RollbackWidget::sample", - GTK_TYPE_POINTER, - GTK_ARG_READWRITE, - ARG_SAMPLE); - - object_class = GTK_OBJECT_CLASS (class); - object_class->finalize = rollback_widget_finalize; - object_class->set_arg = rollback_widget_set_arg; - object_class->get_arg = rollback_widget_get_arg; - - parent_class = GTK_WIDGET_CLASS - (gtk_type_class (gtk_widget_get_type ())); -} - -static void -rollback_widget_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - RollbackWidget *rollback_widget; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_ROLLBACK_WIDGET (object)); - - rollback_widget = ROLLBACK_WIDGET (object); - - switch (arg_id) { - case ARG_SAMPLE: - break; - - default: - g_warning ("Bad argument set"); - break; - } -} - -static void -rollback_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - RollbackWidget *rollback_widget; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_ROLLBACK_WIDGET (object)); - - rollback_widget = ROLLBACK_WIDGET (object); - - switch (arg_id) { - case ARG_SAMPLE: - break; - - default: - g_warning ("Bad argument get"); - break; - } -} - -static void -rollback_widget_finalize (GtkObject *object) -{ - RollbackWidget *rollback_widget; - - g_return_if_fail (object != NULL); - g_return_if_fail (IS_ROLLBACK_WIDGET (object)); - - rollback_widget = ROLLBACK_WIDGET (object); - - g_free (rollback_widget->p); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); -} - -GtkObject * -rollback_widget_new (void) -{ - return gtk_object_new (rollback_widget_get_type (), - NULL); -} diff --git a/archiver/rollback-widget.h b/archiver/rollback-widget.h deleted file mode 100644 index fcb0b79d1..000000000 --- a/archiver/rollback-widget.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* rollback-widget.h - * Copyright (C) 2000-2001 Ximian, Inc. - * - * Written by Bradford Hovinen <hovinen@ximian.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __ROLLBACK_WIDGET_H -#define __ROLLBACK_WIDGET_H - -#include <gnome.h> - -BEGIN_GNOME_DECLS - -#define ROLLBACK_WIDGET(obj) GTK_CHECK_CAST (obj, rollback_widget_get_type (), RollbackWidget) -#define ROLLBACK_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, rollback_widget_get_type (), RollbackWidgetClass) -#define IS_ROLLBACK_WIDGET(obj) GTK_CHECK_TYPE (obj, rollback_widget_get_type ()) - -typedef struct _RollbackWidget RollbackWidget; -typedef struct _RollbackWidgetClass RollbackWidgetClass; -typedef struct _RollbackWidgetPrivate RollbackWidgetPrivate; - -struct _RollbackWidget -{ - GtkWidget parent; - - RollbackWidgetPrivate *p; -}; - -struct _RollbackWidgetClass -{ - GtkWidgetClass gtk_widget_class; -}; - -guint rollback_widget_get_type (void); - -GtkObject *rollback_widget_new (void); - -END_GNOME_DECLS - -#endif /* __ROLLBACK_WIDGET_H */ |