diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/dialogs/recur-comp.c | 94 | ||||
-rw-r--r-- | calendar/gui/dialogs/recur-comp.h | 32 |
2 files changed, 126 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c new file mode 100644 index 0000000000..560ff28529 --- /dev/null +++ b/calendar/gui/dialogs/recur-comp.c @@ -0,0 +1,94 @@ +/* Evolution calendar - Delete calendar component dialog + * + * Copyright (C) 2001 Ximian, Inc. + * + * Author: Federico Mena-Quintero <federico@ximian.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * 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 <glib.h> +#include <gtk/gtk.h> +#include <libgnome/gnome-i18n.h> +#include <libgnomeui/gnome-uidefs.h> +#include <gal/widgets/e-unicode.h> +#include "recur-comp.h" + + + +gboolean +recur_component_dialog (CalComponent *comp, + CalObjModType *mod, + GtkWindow *parent) +{ + char *str; + GtkWidget *dialog, *rb1, *rb2, *rb3, *hbox; + CalComponentVType vtype; + gboolean ret; + + g_return_val_if_fail (IS_CAL_COMPONENT (comp), CALOBJ_MOD_THIS); + + vtype = cal_component_get_vtype (comp); + + switch (vtype) { + case CAL_COMPONENT_EVENT: + str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?")); + break; + + case CAL_COMPONENT_TODO: + str = g_strdup_printf (_("You are modifying a recurring task, what would you like to modify?")); + break; + + case CAL_COMPONENT_JOURNAL: + str = g_strdup_printf (_("You are modifying a recurring journal, what would you like to modify?")); + break; + + default: + g_message ("recur_component_dialog(): Cannot handle object of type %d", vtype); + return CALOBJ_MOD_THIS; + } + + + dialog = gtk_message_dialog_new(parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str); + g_free (str); + + hbox = gtk_hbox_new (FALSE, 2); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); + rb1 = gtk_radio_button_new_with_label (NULL, _("This Instance Only")); + gtk_container_add (GTK_CONTAINER (hbox), rb1); + + rb2 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb1), _("This and Future Instances")); + gtk_container_add (GTK_CONTAINER (hbox), rb2); + rb3 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb1), _("All Instances")); + gtk_container_add (GTK_CONTAINER (hbox), rb3); + + gtk_widget_show_all (hbox); + + ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb1))) + *mod = CALOBJ_MOD_THIS; + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb2))) + *mod = CALOBJ_MOD_THISANDFUTURE; + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb3))) + *mod = CALOBJ_MOD_ALL; + + gtk_widget_destroy (dialog); + + return ret; +} diff --git a/calendar/gui/dialogs/recur-comp.h b/calendar/gui/dialogs/recur-comp.h new file mode 100644 index 0000000000..942bb592c8 --- /dev/null +++ b/calendar/gui/dialogs/recur-comp.h @@ -0,0 +1,32 @@ +/* Evolution calendar - Recur calendar component dialog + * + * Copyright (C) 2001 Ximian, Inc. + * + * Author: Federico Mena-Quintero <federico@ximian.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * 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 RECUR_COMP_H +#define RECUR_COMP_H + +#include <gtk/gtkwidget.h> +#include <cal-util/cal-component.h> +#include <cal-util/cal-util.h> + +gboolean recur_component_dialog (CalComponent *comp, + CalObjModType *mod, + GtkWindow *parent); + +#endif |