aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-11-01 00:49:30 +0800
committerDan Winship <danw@src.gnome.org>2003-11-01 00:49:30 +0800
commita7ac69cdc61b193cbc62fbe908652cebf1ee8f2d (patch)
tree306c89e4ab470ba39c961e449f28023d7c766075 /calendar/gui/dialogs
parentbdf19d320404cc3c0aa6900ea711279f80ceab6a (diff)
downloadgsoc2013-evolution-a7ac69cdc61b193cbc62fbe908652cebf1ee8f2d.tar.gz
gsoc2013-evolution-a7ac69cdc61b193cbc62fbe908652cebf1ee8f2d.tar.zst
gsoc2013-evolution-a7ac69cdc61b193cbc62fbe908652cebf1ee8f2d.zip
Add CAL_STATIC_CAPABILITY_NO_THISANDFUTURE and
* cal-util/cal-util.h: Add CAL_STATIC_CAPABILITY_NO_THISANDFUTURE and CAL_STATIC_CAPABILITY_NO_THISANDPRIOR * gui/dialogs/recur-comp.c (recur_component_dialog): Add a CalClient argument. Use cal_client_get_static_capability to decide whether or not to offer THISANDFUTURE and THISANDPRIOR options * gui/dialogs/comp-editor.c (prompt_to_save_changes, save_cmd, save_close_cmd): Pass a CalClient to recur_component_dialog. * gui/e-day-view.c (e_day_view_finish_long_event_resize, e_day_view_finish_resize, e_day_view_on_editing_stopped, e_day_view_on_top_canvas_drag_data_received, e_day_view_on_main_canvas_drag_data_received): Likewise * gui/e-week-view.c (e_week_view_on_editing_stopped): Likewise * gui/calendar-component.c (impl_createControls): set an exception if we fail, so evo won't crash. svn path=/trunk/; revision=23152
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/comp-editor.c6
-rw-r--r--calendar/gui/dialogs/recur-comp.c35
-rw-r--r--calendar/gui/dialogs/recur-comp.h4
3 files changed, 30 insertions, 15 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 2bbcf92df3..14dad44b2a 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -403,7 +403,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
switch (save_component_dialog (GTK_WINDOW (editor))) {
case GTK_RESPONSE_YES: /* Save */
if (cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
+ if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
return FALSE;
if (send && save_comp_with_send (editor))
@@ -1235,7 +1235,7 @@ save_cmd (GtkWidget *widget, gpointer data)
commit_all_fields (editor);
if (cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
+ if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
return;
save_comp_with_send (editor);
@@ -1252,7 +1252,7 @@ save_close_cmd (GtkWidget *widget, gpointer data)
commit_all_fields (editor);
if (cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
+ if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
return;
if (save_comp_with_send (editor))
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index caf3e59196..eafee32102 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -32,12 +32,13 @@
gboolean
-recur_component_dialog (CalComponent *comp,
+recur_component_dialog (CalClient *client,
+ CalComponent *comp,
CalObjModType *mod,
GtkWindow *parent)
{
char *str;
- GtkWidget *dialog, *rb1, *rb2, *rb3, *hbox;
+ GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox;
CalComponentVType vtype;
gboolean ret;
@@ -69,23 +70,35 @@ recur_component_dialog (CalComponent *comp,
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);
+ rb_this = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
+ gtk_container_add (GTK_CONTAINER (hbox), rb_this);
- 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);
+ if (!cal_client_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_THISANDPRIOR)) {
+ rb_prior = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This and Prior Instances"));
+ gtk_container_add (GTK_CONTAINER (hbox), rb_prior);
+ } else
+ rb_prior = NULL;
+
+ if (!cal_client_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_THISANDFUTURE)) {
+ rb_future = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This and Future Instances"));
+ gtk_container_add (GTK_CONTAINER (hbox), rb_future);
+ } else
+ rb_future = NULL;
+
+ rb_all = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("All Instances"));
+ gtk_container_add (GTK_CONTAINER (hbox), rb_all);
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)))
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_this)))
*mod = CALOBJ_MOD_THIS;
- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb2)))
+ else if (rb_prior && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_prior)))
+ *mod = CALOBJ_MOD_THISANDPRIOR;
+ else if (rb_future && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_future)))
*mod = CALOBJ_MOD_THISANDFUTURE;
- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb3)))
+ else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_all)))
*mod = CALOBJ_MOD_ALL;
gtk_widget_destroy (dialog);
diff --git a/calendar/gui/dialogs/recur-comp.h b/calendar/gui/dialogs/recur-comp.h
index 123e55e779..76b1a63bef 100644
--- a/calendar/gui/dialogs/recur-comp.h
+++ b/calendar/gui/dialogs/recur-comp.h
@@ -22,10 +22,12 @@
#define RECUR_COMP_H
#include <gtk/gtkwindow.h>
+#include <cal-client/cal-client.h>
#include <cal-util/cal-component.h>
#include <cal-util/cal-util.h>
-gboolean recur_component_dialog (CalComponent *comp,
+gboolean recur_component_dialog (CalClient *client,
+ CalComponent *comp,
CalObjModType *mod,
GtkWindow *parent);