aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-06-08 23:41:12 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-06-08 23:41:12 +0800
commit5a150fae3cc3aa122db2d4ee5f040604e09ed8c6 (patch)
treeb647d44f4d69e384125d7612277c50318cebee42 /calendar/gui/dialogs
parentbf7287dedcb5a5dc17d45339fdea81e3acec648a (diff)
downloadgsoc2013-evolution-5a150fae3cc3aa122db2d4ee5f040604e09ed8c6.tar.gz
gsoc2013-evolution-5a150fae3cc3aa122db2d4ee5f040604e09ed8c6.tar.zst
gsoc2013-evolution-5a150fae3cc3aa122db2d4ee5f040604e09ed8c6.zip
Disable the meeting editor if the user is not an organizer wherever
necessary svn path=/trunk/; revision=29474
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/event-editor.c17
-rw-r--r--calendar/gui/dialogs/event-page.c39
-rw-r--r--calendar/gui/dialogs/meeting-page.c8
-rw-r--r--calendar/gui/dialogs/recurrence-page.c24
4 files changed, 54 insertions, 34 deletions
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 223d4c4866..72b4d8246b 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -215,11 +215,16 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
priv = ee->priv;
priv->updating = TRUE;
-
- if (COMP_EDITOR_CLASS (event_editor_parent_class)->edit_comp)
- COMP_EDITOR_CLASS (event_editor_parent_class)->edit_comp (editor, comp);
+
client = comp_editor_get_e_cal (COMP_EDITOR (editor));
+ if (priv->is_meeting && itip_organizer_is_user (comp, client)) {
+ COMP_EDITOR_PAGE (priv->event_page)->flags |= COMP_EDITOR_PAGE_USER_ORG;
+ COMP_EDITOR_PAGE (priv->recur_page)->flags |= COMP_EDITOR_PAGE_USER_ORG;
+ }
+
+ if (COMP_EDITOR_CLASS (event_editor_parent_class)->edit_comp)
+ COMP_EDITOR_CLASS (event_editor_parent_class)->edit_comp (editor, comp);
/* Get meeting related stuff */
e_cal_component_get_organizer (comp, &organizer);
@@ -294,6 +299,9 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
e_cal_component_free_attendee_list (attendees);
comp_editor_set_needs_send (COMP_EDITOR (ee), priv->meeting_shown && itip_organizer_is_user (comp, client));
+ if (e_cal_component_has_organizer (comp) && (COMP_EDITOR_PAGE (priv->event_page)->flags &
+ COMP_EDITOR_PAGE_MEETING))
+ comp_editor_sensitize_attachment_bar (editor, itip_organizer_is_user (comp, client));
priv->updating = FALSE;
}
@@ -420,7 +428,8 @@ show_meeting (EventEditor *ee)
}
if (comp_editor_get_flags (COMP_EDITOR (ee)) & COMP_EDITOR_DELEGATE)
comp_editor_show_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->meet_page));
-
+ if (comp_editor_get_existing_org (COMP_EDITOR (ee)) && !comp_editor_get_user_org (COMP_EDITOR (ee)))
+ comp_editor_remove_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->sched_page));
}
void
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index ae466e6d2f..3671e7267e 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -603,10 +603,12 @@ is_custom_alarm_store (EAlarmList *alarm_list_store, char *old_summary, CalUnit
static void
sensitize_widgets (EventPage *epage)
{
- gboolean read_only, custom, alarm;
+ gboolean read_only, custom, alarm, sens = TRUE;
EventPagePrivate *priv;
priv = epage->priv;
+ if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_MEETING)
+ sens = COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_USER_ORG;
if (!e_cal_is_read_only (COMP_EDITOR_PAGE (epage)->client, &read_only, NULL))
read_only = TRUE;
@@ -614,28 +616,28 @@ sensitize_widgets (EventPage *epage)
custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL);
alarm = e_dialog_toggle_get (priv->alarm);
- gtk_widget_set_sensitive (priv->summary_label, !read_only);
- gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only);
- gtk_widget_set_sensitive (priv->location_label, !read_only);
- gtk_entry_set_editable (GTK_ENTRY (priv->location), !read_only);
- gtk_widget_set_sensitive (priv->start_time, !read_only);
- gtk_widget_set_sensitive (priv->start_timezone, !read_only);
- gtk_widget_set_sensitive (priv->end_time, !read_only);
- gtk_widget_set_sensitive (priv->end_timezone, !read_only);
- gtk_widget_set_sensitive (priv->all_day_event, !read_only);
- gtk_widget_set_sensitive (priv->description, !read_only);
- gtk_widget_set_sensitive (priv->classification, !read_only);
- gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only);
- gtk_widget_set_sensitive (priv->alarm, !read_only);
+ gtk_widget_set_sensitive (priv->summary_label, !read_only && sens);
+ gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only && sens);
+ gtk_widget_set_sensitive (priv->location_label, !read_only && sens);
+ gtk_entry_set_editable (GTK_ENTRY (priv->location), !read_only && sens);
+ gtk_widget_set_sensitive (priv->start_time, !read_only && sens);
+ gtk_widget_set_sensitive (priv->start_timezone, !read_only && sens);
+ gtk_widget_set_sensitive (priv->end_time, !read_only && sens);
+ gtk_widget_set_sensitive (priv->end_timezone, !read_only && sens);
+ gtk_widget_set_sensitive (priv->all_day_event, !read_only && sens);
+ gtk_widget_set_sensitive (priv->description, !read_only && sens);
+ gtk_widget_set_sensitive (priv->classification, !read_only && sens);
+ gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only && sens);
+ gtk_widget_set_sensitive (priv->alarm, !read_only && sens);
gtk_widget_set_sensitive (priv->alarm_time, !read_only && !custom && alarm);
gtk_widget_set_sensitive (priv->alarm_custom, alarm);
if (custom)
gtk_widget_show (priv->alarm_warning);
else
gtk_widget_hide (priv->alarm_warning);
- gtk_widget_set_sensitive (priv->categories_btn, !read_only);
- gtk_widget_set_sensitive (priv->sendoptions_button, !read_only);
- gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only);
+ gtk_widget_set_sensitive (priv->categories_btn, !read_only && sens);
+ gtk_widget_set_sensitive (priv->sendoptions_button, !read_only && sens);
+ gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only && sens);
}
void
@@ -687,6 +689,9 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
epage = EVENT_PAGE (page);
priv = epage->priv;
+ if (!e_cal_component_has_organizer (comp))
+ page->flags |= COMP_EDITOR_PAGE_USER_ORG;
+
/* Don't send off changes during this time */
priv->updating = TRUE;
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index ee51c4e4ad..7290110a8d 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -337,10 +337,10 @@ sensitize_widgets (MeetingPage *mpage)
g_error_free (error);
}
gtk_widget_set_sensitive (priv->organizer, !read_only);
- gtk_widget_set_sensitive (priv->existing_organizer_btn, !read_only);
- gtk_widget_set_sensitive (priv->add, !read_only && (priv->user_org || delegate));
- gtk_widget_set_sensitive (priv->remove, !read_only && (priv->user_org|| delegate));
- gtk_widget_set_sensitive (priv->invite, !read_only && (priv->user_org || delegate));
+ gtk_widget_set_sensitive (priv->existing_organizer_btn, (!read_only && priv->user_org));
+ gtk_widget_set_sensitive (priv->add, (!read_only && priv->user_org) || delegate);
+ gtk_widget_set_sensitive (priv->remove, (!read_only && priv->user_org) || delegate);
+ gtk_widget_set_sensitive (priv->invite, (!read_only && priv->user_org) || delegate);
gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only);
}
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 8f528d230d..325b30fe2c 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -470,10 +470,11 @@ static void
sensitize_recur_widgets (RecurrencePage *rpage)
{
RecurrencePagePrivate *priv;
- gboolean recurs;
+ gboolean recurs, sens = TRUE;
GtkWidget *label;
priv = rpage->priv;
+ sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
recurs = e_dialog_toggle_get (priv->recurs);
@@ -481,7 +482,7 @@ sensitize_recur_widgets (RecurrencePage *rpage)
if (e_cal_component_is_instance (priv->comp))
gtk_widget_set_sensitive (priv->preview_calendar, FALSE);
else
- gtk_widget_set_sensitive (priv->preview_calendar, TRUE);
+ gtk_widget_set_sensitive (priv->preview_calendar, TRUE && sens);
if (GTK_BIN (priv->custom_warning_bin)->child)
gtk_widget_destroy (GTK_BIN (priv->custom_warning_bin)->child);
@@ -497,7 +498,7 @@ sensitize_recur_widgets (RecurrencePage *rpage)
label);
gtk_widget_show_all (priv->custom_warning_bin);
} else if (recurs) {
- gtk_widget_set_sensitive (priv->params, TRUE);
+ gtk_widget_set_sensitive (priv->params, sens);
gtk_widget_show (priv->params);
gtk_widget_hide (priv->custom_warning_bin);
} else {
@@ -510,14 +511,16 @@ sensitize_recur_widgets (RecurrencePage *rpage)
static void
sensitize_buttons (RecurrencePage *rpage)
{
- gboolean read_only;
+ gboolean read_only, sens = TRUE;
gint selected_rows;
RecurrencePagePrivate *priv;
icalcomponent *icalcomp;
const char *uid;
priv = rpage->priv;
-
+ if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING)
+ sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
+
selected_rows = gtk_tree_selection_count_selected_rows (
gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)));
@@ -551,10 +554,10 @@ sensitize_buttons (RecurrencePage *rpage)
else
gtk_widget_set_sensitive (priv->params, FALSE);
- gtk_widget_set_sensitive (priv->recurs, !read_only);
- gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp));
- gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0);
- gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0);
+ gtk_widget_set_sensitive (priv->recurs, !read_only && sens);
+ gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp) && sens);
+ gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0 && sens);
+ gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0 && sens);
}
#if 0
@@ -1520,6 +1523,9 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
priv->comp = e_cal_component_clone (comp);
+ if (!e_cal_component_has_organizer (comp))
+ page->flags |= COMP_EDITOR_PAGE_USER_ORG;
+
/* Don't send off changes during this time */
priv->updating = TRUE;