From 35dc2d9c09b50e9bcd01ad9106d18c6bf97697c0 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Thu, 25 Jan 2001 15:26:03 +0000 Subject: Update unrefs (config_manager_dialog_init): GLADE_DIR -> GLADE_DATADIR 2001-01-24 Bradford Hovinen * config-manager-dialog.c (config_manager_dialog_finalize): Update unrefs (config_manager_dialog_init): GLADE_DIR -> GLADE_DATADIR (config_manager_dialog_init): Remove outdated signal connections (config_manager_dialog_init): Remove code to create location list Inherit from CappletWidget rather than GnomeDialog (config_manager_dialog_init): Remove gtk_window_set_policy call (ok_cb): (cancel_cb): Remove gnome_dialog_close call (config_manager_dialog_init): Set state to "changed" so that the Ok button is active (populate_backends_cb): Set backend_id in dialog if not already set --- capplets/rollback/ChangeLog | 7 +++++ capplets/rollback/TODO | 24 +++++++++++++++ capplets/rollback/config-manager-dialog.c | 51 +++++++++++-------------------- 3 files changed, 48 insertions(+), 34 deletions(-) create mode 100644 capplets/rollback/TODO (limited to 'capplets') diff --git a/capplets/rollback/ChangeLog b/capplets/rollback/ChangeLog index 25bef16b9..121392761 100644 --- a/capplets/rollback/ChangeLog +++ b/capplets/rollback/ChangeLog @@ -5,6 +5,13 @@ (config_manager_dialog_init): GLADE_DIR -> GLADE_DATADIR (config_manager_dialog_init): Remove outdated signal connections (config_manager_dialog_init): Remove code to create location list + Inherit from CappletWidget rather than GnomeDialog + (config_manager_dialog_init): Remove gtk_window_set_policy call + (ok_cb): + (cancel_cb): Remove gnome_dialog_close call + (config_manager_dialog_init): Set state to "changed" so that the + Ok button is active + (populate_backends_cb): Set backend_id in dialog if not already set * Makefile.am (INCLUDES): Changed CAPPLET_CFLAGS to ROLLBACK_CAPPLET_CFLAGS diff --git a/capplets/rollback/TODO b/capplets/rollback/TODO new file mode 100644 index 000000000..5f5137657 --- /dev/null +++ b/capplets/rollback/TODO @@ -0,0 +1,24 @@ +Short-term + * Get this thing to actually work + * Accept command line argument to tell whether it's going to be user + or global + * Accept command line argument to allow rollback of a specific backend + * Remove backends list and rely on the above command line argument + * Add logic in the control center to activate this capplet with the + appropriate command line argument from menu items or a control + connected with each capplet + * Something that tells the user when he tries to go back so far in + time that there is no configuration available from that date + +Long(er)-term + * Somehow fix this so that the user sees the old configurations as he + selects a time. The selection should be a slider that the user slides + back and forth to roll forwards and backwards, and the user should see + the configuration settings as reflected in the position of the slider. + - This could just be put into libcapplet, so that the user + sees this slider at all times. That could be a bit much for a lot of + users, though. + - This could be a bonobo component, acting as a container for + capplets (which are then bonobo controls). + - This could be a feature of libcapplet enabled by a command + line switch diff --git a/capplets/rollback/config-manager-dialog.c b/capplets/rollback/config-manager-dialog.c index e6c74b304..005f4c4a7 100644 --- a/capplets/rollback/config-manager-dialog.c +++ b/capplets/rollback/config-manager-dialog.c @@ -57,7 +57,7 @@ struct _ConfigManagerDialogPrivate Location *current_location; }; -static GnomeDialogClass *parent_class; +static CappletWidgetClass *parent_class; static void config_manager_dialog_init (ConfigManagerDialog *dialog); static void config_manager_dialog_class_init (ConfigManagerDialogClass *class); @@ -116,7 +116,7 @@ config_manager_dialog_get_type (void) }; config_manager_dialog_type = - gtk_type_unique (gnome_dialog_get_type (), + gtk_type_unique (capplet_widget_get_type (), &config_manager_dialog_info); } @@ -126,38 +126,20 @@ config_manager_dialog_get_type (void) 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_DATADIR "/rollback.glade", "config_dialog_data"); - gtk_box_pack_start (GTK_BOX - (GNOME_DIALOG (dialog)->vbox), - WID ("config_dialog_data"), 0, TRUE, TRUE); + gtk_container_add (GTK_CONTAINER (dialog), + WID ("config_dialog_data")); - 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); + gtk_signal_connect (GTK_OBJECT (dialog), "ok", + GTK_SIGNAL_FUNC (ok_cb), dialog); + gtk_signal_connect (GTK_OBJECT (dialog), "try", + GTK_SIGNAL_FUNC (apply_cb), dialog); + gtk_signal_connect (GTK_OBJECT (dialog), "cancel", + GTK_SIGNAL_FUNC (cancel_cb), dialog); glade_xml_signal_connect_data (dialog->p->config_dialog_data, "time_count_changed_cb", @@ -177,6 +159,8 @@ config_manager_dialog_init (ConfigManagerDialog *dialog) set_backend_controls_sensitive (dialog, FALSE); reset_time (dialog, 0); + + capplet_widget_state_changed (CAPPLET_WIDGET (dialog), FALSE); } static void @@ -194,8 +178,8 @@ config_manager_dialog_class_init (ConfigManagerDialogClass *class) 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 ())); + parent_class = CAPPLET_WIDGET_CLASS + (gtk_type_class (capplet_widget_get_type ())); } static void @@ -294,8 +278,6 @@ ok_cb (GtkWidget *widget, ConfigManagerDialog *dialog) g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); do_rollback (dialog, FALSE); - - gnome_dialog_close (GNOME_DIALOG (dialog)); } static void @@ -314,8 +296,6 @@ cancel_cb (GtkWidget *widget, ConfigManagerDialog *dialog) g_return_if_fail (IS_CONFIG_MANAGER_DIALOG (dialog)); do_rollback (dialog, TRUE); - - gnome_dialog_close (GNOME_DIALOG (dialog)); } static void @@ -402,6 +382,9 @@ populate_backends_cb (BackendList *list, gchar *backend_id, GtkWidget *menu_item; GtkWidget *menu; + if (dialog->p->backend_id == NULL) + dialog->p->backend_id = backend_id; + menu_item = gtk_menu_item_new_with_label (backend_id); gtk_widget_show (menu_item); gtk_object_set_data (GTK_OBJECT (menu_item), -- cgit v1.2.1