diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-08-18 19:20:23 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-08-18 19:20:23 +0800 |
commit | 4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64 (patch) | |
tree | fca0bbade652c437cc8aedf4d3b12ad11ae457ec /calendar/gui/dialogs | |
parent | 38909705f4d3f23febcee4f16114f9dc07d38f06 (diff) | |
download | gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.gz gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.tar.zst gsoc2013-evolution-4f56bd0a43427ac45f7ca3ca20ca70a6e9696a64.zip |
Show the attachment bar menu items when needed.
svn path=/trunk/; revision=30157
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 21 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 34 | ||||
-rw-r--r-- | calendar/gui/dialogs/meeting-page.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 16 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 1 |
6 files changed, 38 insertions, 45 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index c7178f17fe..6e8f8ce6e8 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -1077,10 +1077,10 @@ cab_remove(EPopup *ep, EPopupItem *item, void *data) /* Popup menu handling. */ static EPopupItem cab_popups[] = { - { E_POPUP_ITEM, "10.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY }, + { E_POPUP_ITEM, "10.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY | E_CAL_POPUP_ATTACHMENTS_MODIFY }, { E_POPUP_ITEM, "20.attach", N_("_Properties"), cab_properties, NULL, GTK_STOCK_PROPERTIES, E_CAL_POPUP_ATTACHMENTS_ONE }, { E_POPUP_BAR, "30.attach.00", NULL, NULL, NULL, NULL, E_CAL_POPUP_ATTACHMENTS_MANY|E_CAL_POPUP_ATTACHMENTS_ONE }, - { E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, 0 }, + { E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, E_CAL_POPUP_ATTACHMENTS_MODIFY }, }; static void @@ -1121,6 +1121,7 @@ cab_popup(EAttachmentBar *bar, GdkEventButton *event, int id) ECalPopup *ecp; ECalPopupTargetAttachments *t; GtkMenu *menu; + CompEditor *editor = COMP_EDITOR (gtk_widget_get_toplevel (GTK_WIDGET (bar))); attachments = e_attachment_bar_get_attachment(bar, id); @@ -1136,7 +1137,7 @@ cab_popup(EAttachmentBar *bar, GdkEventButton *event, int id) */ ecp = e_cal_popup_new("org.gnome.evolution.calendar.attachmentbar.popup"); e_popup_add_items((EPopup *)ecp, menus, NULL, cab_popups_free, bar); - t = e_cal_popup_target_new_attachments(ecp, attachments); + t = e_cal_popup_target_new_attachments(ecp, editor, attachments); t->target.widget = (GtkWidget *)bar; menu = e_popup_create_menu_once((EPopup *)ecp, (EPopupTarget *)t, 0); @@ -1274,19 +1275,6 @@ setup_widgets (CompEditor *editor) } -void -comp_editor_sensitize_attachment_bar (CompEditor *editor, gboolean set) -{ - CompEditorPrivate *priv; - - g_return_if_fail (IS_COMP_EDITOR (editor)); - - priv = editor->priv; - - gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_bar), set); - gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_scrolled_window), set); -} - /* Object initialization function for the calendar component editor */ static void comp_editor_init (CompEditor *editor) @@ -2520,7 +2508,6 @@ comp_editor_notify_client_changed (CompEditor *editor, ECal *client) if (!e_cal_is_read_only (client, &read_only, NULL)) read_only = TRUE; - comp_editor_sensitize_attachment_bar (editor, !read_only); gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, !read_only); } diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 1c15bc1f53..37e6be7929 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -410,7 +410,9 @@ static void show_meeting (EventEditor *ee) { EventEditorPrivate *priv; - + CompEditor *editor = COMP_EDITOR (ee); + CompEditorFlags flags = comp_editor_get_flags (editor); + priv = ee->priv; event_page_set_meeting (priv->event_page, TRUE); @@ -428,6 +430,9 @@ 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 (!(flags & COMP_EDITOR_NEW_ITEM) && !(flags & COMP_EDITOR_USER_ORG)) + gtk_drag_dest_unset (GTK_WIDGET (editor)); } void diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 3d1ee328f2..414aa5ecca 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -603,7 +603,7 @@ is_custom_alarm_store (EAlarmList *alarm_list_store, char *old_summary, CalUnit static void sensitize_widgets (EventPage *epage) { - gboolean read_only, custom, alarm, sens = TRUE; + gboolean read_only, custom, alarm, sens = TRUE, sensitize; EventPagePrivate *priv; priv = epage->priv; @@ -612,22 +612,24 @@ sensitize_widgets (EventPage *epage) if (!e_cal_is_read_only (COMP_EDITOR_PAGE (epage)->client, &read_only, NULL)) read_only = TRUE; + + sensitize = !read_only && sens; 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 && 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->summary_label, sensitize); + gtk_entry_set_editable (GTK_ENTRY (priv->summary), sensitize); + gtk_widget_set_sensitive (priv->location_label, sensitize); + gtk_entry_set_editable (GTK_ENTRY (priv->location), sensitize); + gtk_widget_set_sensitive (priv->start_time, sensitize); + gtk_widget_set_sensitive (priv->start_timezone, sensitize); + gtk_widget_set_sensitive (priv->end_time, sensitize); + gtk_widget_set_sensitive (priv->end_timezone, sensitize); + gtk_widget_set_sensitive (priv->all_day_event, sensitize); + gtk_widget_set_sensitive (priv->description, sensitize); + gtk_widget_set_sensitive (priv->classification, sensitize); + gtk_widget_set_sensitive (priv->show_time_as_busy, sensitize); gtk_widget_set_sensitive (priv->alarm, !read_only); gtk_widget_set_sensitive (priv->alarm_time, !read_only && !custom && alarm); gtk_widget_set_sensitive (priv->alarm_custom, alarm); @@ -635,9 +637,9 @@ sensitize_widgets (EventPage *epage) gtk_widget_show (priv->alarm_warning); else gtk_widget_hide (priv->alarm_warning); - 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); + gtk_widget_set_sensitive (priv->categories_btn, sensitize); + gtk_widget_set_sensitive (priv->sendoptions_button, sensitize); + gtk_entry_set_editable (GTK_ENTRY (priv->categories), sensitize); if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) { gtk_widget_set_sensitive (priv->sendoptions_button, TRUE); diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 17072c6a2c..4ca971c3f3 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -384,9 +384,6 @@ meeting_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) gtk_widget_hide (priv->organizer_table); gtk_widget_show (priv->existing_organizer_table); if (itip_organizer_is_user (comp, page->client)) { - gtk_widget_set_sensitive (priv->invite, TRUE); - gtk_widget_set_sensitive (priv->add, TRUE); - gtk_widget_set_sensitive (priv->remove, TRUE); if (e_cal_get_static_capability ( page->client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) @@ -433,6 +430,7 @@ meeting_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } priv->updating = FALSE; + priv->user_org = page->flags & COMP_EDITOR_PAGE_USER_ORG; sensitize_widgets (mpage); diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 2c777e9edf..243dc19bb7 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -474,7 +474,9 @@ sensitize_recur_widgets (RecurrencePage *rpage) GtkWidget *label; priv = rpage->priv; - sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG; + + if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING) + sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG; recurs = e_dialog_toggle_get (priv->recurs); @@ -511,7 +513,7 @@ sensitize_recur_widgets (RecurrencePage *rpage) static void sensitize_buttons (RecurrencePage *rpage) { - gboolean read_only, sens = TRUE; + gboolean read_only, sensitize = TRUE; gint selected_rows; RecurrencePagePrivate *priv; icalcomponent *icalcomp; @@ -519,7 +521,7 @@ sensitize_buttons (RecurrencePage *rpage) priv = rpage->priv; if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING) - sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG; + sensitize = 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))); @@ -554,10 +556,10 @@ sensitize_buttons (RecurrencePage *rpage) else gtk_widget_set_sensitive (priv->params, FALSE); - 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); + gtk_widget_set_sensitive (priv->recurs, !read_only && sensitize); + gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp) && sensitize); + gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0 && sensitize); + gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0 && sensitize); } #if 0 diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 199e8fe78a..4a393f6bf8 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -148,7 +148,6 @@ task_editor_construct (TaskEditor *te, ECal *client, gboolean is_assigned) if (!e_cal_is_read_only (client, &read_only, NULL)) read_only = TRUE; - comp_editor_sensitize_attachment_bar (COMP_EDITOR (te), !read_only); if (priv->is_assigned) { if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) |