[evolution-patches] [Calendar] Edit button - Attendees - Implementation
- From: Johnny Jacob <johnnyjacob gmail com>
- To: evolution-patches gnome org
- Subject: [evolution-patches] [Calendar] Edit button - Attendees - Implementation
- Date: Tue, 10 Jan 2006 15:04:13 +0530
Hi
Implemented Edit button for attendees in event-page
Please review
Thanks
Johnny
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2926
diff -u -p -r1.2926 ChangeLog
--- calendar/ChangeLog 10 Jan 2006 08:08:20 -0000 1.2926
+++ calendar/ChangeLog 10 Jan 2006 09:06:57 -0000
@@ -1,3 +1,15 @@
+2006-01-10 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-10 Simon Zheng <simon zheng sun com>
* gui/calendar-component.c: (calendar_component_peek):
Index: calendar/gui/e-meeting-list-view.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-meeting-list-view.h,v
retrieving revision 1.4
diff -u -p -r1.4 e-meeting-list-view.h
--- calendar/gui/e-meeting-list-view.h 15 Dec 2005 07:46:25 -0000 1.4
+++ calendar/gui/e-meeting-list-view.h 10 Jan 2006 09:14:22 -0000
@@ -63,6 +63,7 @@ void e_meeting_list_view_edit (EMe
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
Index: calendar/gui/e-meeting-list-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-meeting-list-view.c,v
retrieving revision 1.25
diff -u -p -r1.25 e-meeting-list-view.c
--- calendar/gui/e-meeting-list-view.c 22 Dec 2005 10:12:06 -0000 1.25
+++ calendar/gui/e-meeting-list-view.c 10 Jan 2006 09:14:29 -0000
@@ -851,3 +851,24 @@ e_meeting_list_view_invite_others_dialog
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);
+}
Index: calendar/gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.98
diff -u -p -r1.98 event-page.c
--- calendar/gui/dialogs/event-page.c 6 Jan 2006 06:29:07 -0000 1.98
+++ calendar/gui/dialogs/event-page.c 10 Jan 2006 09:14:49 -0000
@@ -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);
@@ -1641,6 +1643,27 @@ static hour_minute_changed ( EventPage *
}
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;
@@ -1880,14 +1903,28 @@ button_press_event (GtkWidget *widget, G
guint32 disable_mask = ~0;
GSList *menus = NULL;
ECalPopup *ep;
+ gboolean read_only, sens = TRUE, sensitize, delegate;
int i;
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;
+
+ delegate = COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE;
+ sensitize = !read_only && sens;
+
/* only process right-clicks */
if (event->button != 3 || event->type != GDK_BUTTON_PRESS)
return FALSE;
+ /* Check wheather the r-menu is valid */
+ if (!(sensitize || delegate))
+ return;
+
/* only if we right-click on an attendee */
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->list_view), event->x, event->y, &path, NULL, NULL, NULL)) {
GtkTreeSelection *selection;
@@ -2181,6 +2218,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");
@@ -2778,6 +2816,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]