diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 12 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 34 | ||||
-rw-r--r-- | calendar/gui/e-meeting-list-view.c | 21 | ||||
-rw-r--r-- | calendar/gui/e-meeting-list-view.h | 1 |
4 files changed, 65 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 38fcafa81e..769932fc71 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,15 @@ +2006-01-16 Johnny Jacob <johnnyjacob@gmail.com> + + * gui/dialogs/event-page.c (edit_button_cb): Added. + edit the selected attendee. + (sensitize_widgets) : enable/disable edit button and + Attendee list view. + (button_press_event) : don't popup the menu if editing is + disabled. + (get_widgets) : get and connect signals for edit button + * gui/e-meetings-list-view.ch (e_meeting_list_view_set_editable ) : + Added. set/unset the editable property of list view. + 2006-01-16 Harish Krishnaswamy <kharish@novell.com> * gui/calendar-component.c: (impl__get_userCreatableItems): diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 550462d154..c27481d1db 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -835,6 +835,8 @@ sensitize_widgets (EventPage *epage) gtk_widget_set_sensitive (priv->organizer, !read_only); gtk_widget_set_sensitive (priv->add, (!read_only && sens) || delegate); + gtk_widget_set_sensitive (priv->edit, (!read_only && sens) || delegate); + e_meeting_list_view_set_editable (priv->list_view, (!read_only && sens) || delegate); gtk_widget_set_sensitive (priv->remove, (!read_only && sens) || delegate); gtk_widget_set_sensitive (priv->invite, (!read_only && sens) || delegate); gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only); @@ -968,7 +970,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) epage = EVENT_PAGE (page); priv = epage->priv; - if (!e_cal_component_has_organizer (comp)) + if (!e_cal_component_has_organizer (comp)) page->flags |= COMP_EDITOR_PAGE_USER_ORG; /* Don't send off changes during this time */ @@ -1034,6 +1036,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) gtk_widget_set_sensitive (priv->invite, FALSE); gtk_widget_set_sensitive (priv->add, FALSE); + gtk_widget_set_sensitive (priv->edit, FALSE); gtk_widget_set_sensitive (priv->remove, FALSE); priv->user_org = FALSE; } @@ -1650,6 +1653,27 @@ static hour_minute_changed ( EventPage *epage) } static void +edit_clicked_cb (GtkButton *btn, EventPage *epage) +{ + EventPagePrivate *priv; + EMeetingAttendee *attendee; + GtkTreePath *path = NULL; + GtkTreeViewColumn *focus_col; + gint row = 0; + + priv = epage->priv; + + gtk_tree_view_get_cursor (GTK_TREE_VIEW (priv->list_view), &path, NULL); + g_return_if_fail (path != NULL); + + row = gtk_tree_path_get_indices (path)[0]; + + gtk_tree_view_get_cursor (GTK_TREE_VIEW (priv->list_view), &path, &focus_col); + gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->list_view), path, focus_col, TRUE); + gtk_tree_path_free (path); +} + +static void add_clicked_cb (GtkButton *btn, EventPage *epage) { EMeetingAttendee *attendee; @@ -1833,6 +1857,7 @@ attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *ia, gpointer user_d gtk_widget_set_sensitive (priv->invite, FALSE); gtk_widget_set_sensitive (priv->add, FALSE); + gtk_widget_set_sensitive (priv->edit, FALSE); } } } @@ -1868,7 +1893,7 @@ enum { static EPopupItem context_menu_items[] = { { E_POPUP_ITEM, "10.delete", N_("_Remove"), popup_delete_cb, NULL, GTK_STOCK_REMOVE, ATTENDEE_CAN_DELETE }, - { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD }, + { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD, ATTENDEE_CAN_ADD }, }; static void @@ -1890,7 +1915,6 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, EventPage *epage) GSList *menus = NULL; ECalPopup *ep; int i; - priv = epage->priv; /* only process right-clicks */ @@ -2190,6 +2214,7 @@ get_widgets (EventPage *epage) priv->invite = GW ("invite"); priv->add = GW ("add-attendee"); priv->remove = GW ("remove-attendee"); + priv->edit = GW ("edit-attendee"); priv->list_box = GW ("list-box"); priv->calendar_label = GW ("calendar-label"); @@ -2821,6 +2846,9 @@ init_widgets (EventPage *epage) /* Remove attendee button */ g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), epage); + /* Edit attendee button */ + g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), epage); + /* Contacts button */ g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), epage); diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 2c82d89bd6..96982269e3 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -851,3 +851,24 @@ e_meeting_list_view_invite_others_dialog (EMeetingListView *view) dialog = e_name_selector_peek_dialog (view->priv->name_selector); gtk_widget_show (GTK_WIDGET (dialog)); } + +void +e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) +{ + GtkCellRenderer *renderer; + EMeetingListViewPrivate *priv; + + priv = lview->priv; + + gint edit_level = set; + + g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); +} + +static void +set_editable (gpointer key, gpointer value, gpointer user_data) +{ + GtkCellRenderer *renderer = (GtkCellRenderer *) value; + guint edit_level = GPOINTER_TO_INT (user_data); + g_object_set (G_OBJECT (renderer), "editable", GINT_TO_POINTER (edit_level), NULL); +} diff --git a/calendar/gui/e-meeting-list-view.h b/calendar/gui/e-meeting-list-view.h index b9a4607aa3..76db532b70 100644 --- a/calendar/gui/e-meeting-list-view.h +++ b/calendar/gui/e-meeting-list-view.h @@ -63,6 +63,7 @@ void e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *a void e_meeting_list_view_invite_others_dialog (EMeetingListView *emlv); void e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, EMeetingAttendee *ma); void e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeetingAttendee *ma); +void e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set); G_END_DECLS |