[evolution-patches] [Calendar] Task Page edit button implementation



Hi

Implemented functionality for task page edit button.

Please review

Thanks
Johnny
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2945
diff -u -p -r1.2945 ChangeLog
--- calendar/ChangeLog	16 Jan 2006 16:22:33 -0000	1.2945
+++ calendar/ChangeLog	17 Jan 2006 10:16:11 -0000
@@ -1,3 +1,13 @@
+2006-01-17  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
+
 2006-01-16  Johnny Jacob <johnnyjacob gmail com>
 
 	* gui/dialogs/event-page.c (edit_button_cb): Added.
Index: calendar/gui/dialogs/task-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.c,v
retrieving revision 1.79
diff -u -p -r1.79 task-page.c
--- calendar/gui/dialogs/task-page.c	13 Jan 2006 10:31:05 -0000	1.79
+++ calendar/gui/dialogs/task-page.c	17 Jan 2006 10:17:57 -0000
@@ -406,6 +406,8 @@ sensitize_widgets (TaskPage *tpage)
 
 	gtk_widget_set_sensitive (priv->organizer, !read_only);
 	gtk_widget_set_sensitive (priv->add, (!read_only &&  sens));
+	gtk_widget_set_sensitive (priv->edit, (!read_only && sens));
+	e_meeting_list_view_set_editable (priv->list_view, (!read_only && sens));
 	gtk_widget_set_sensitive (priv->remove, (!read_only &&  sens));
 	gtk_widget_set_sensitive (priv->invite, (!read_only &&  sens));
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only);	
@@ -684,6 +686,7 @@ task_page_fill_widgets (CompEditorPage *
 								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;
 				}
@@ -978,6 +981,25 @@ add_clicked_cb (GtkButton *btn, TaskPage
 	e_meeting_list_view_edit (page->priv->list_view, attendee);
 }
 
+edit_clicked_cb (GtkButton *btn, TaskPage *tpage)
+{
+	TaskPagePrivate *priv;
+	EMeetingAttendee *attendee;
+	GtkTreePath *path = NULL;
+	GtkTreeViewColumn *focus_col;
+	gint row = 0;
+
+	priv = tpage->priv;
+
+	gtk_tree_view_get_cursor (GTK_TREE_VIEW (priv->list_view), &path, NULL);
+	g_return_if_fail (path != NULL);
+
+	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 gboolean
 existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) 
 {
@@ -1146,6 +1168,7 @@ attendee_added_cb (EMeetingListView *eml
 
 			   gtk_widget_set_sensitive (priv->invite, FALSE);
 			   gtk_widget_set_sensitive (priv->add, FALSE);
+			   gtk_widget_set_sensitive (priv->edit, FALSE);
 		   }
 	   }
    }
@@ -1181,7 +1204,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
@@ -1410,6 +1433,7 @@ get_widgets (TaskPage *tpage)
 	priv->organizer = GW ("organizer");
 	priv->invite = GW ("invite");
 	priv->add = GW ("add-attendee");
+	priv->edit = GW ("edit-attendee");
 	priv->remove = GW ("remove-attendee");
 	priv->list_box = GW ("list-box");
 	priv->calendar_label = GW ("group-label");
@@ -1756,6 +1780,9 @@ init_widgets (TaskPage *tpage)
 	
 	/* Add attendee button */
 	g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), tpage);
+
+	/* Edit attendee button */
+	g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), tpage);
 
 	/* Remove attendee button */
 	g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), tpage);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]