evolution/evolution-2.9.3-meeting-list-view.patch

87 lines
2.8 KiB
Diff
Raw Normal View History

--- evolution-2.9.3/calendar/gui/e-meeting-list-view.c.meeting-list-view 2006-12-11 23:13:47.000000000 -0500
+++ evolution-2.9.3/calendar/gui/e-meeting-list-view.c 2006-12-11 23:14:17.000000000 -0500
@@ -623,18 +623,45 @@
}
+void
+attendee_added_cb (EMeetingStore *store, GtkTreePath *path,
+ GtkTreeIter *iter, EMeetingListView *view)
+{
+ EMeetingAttendee *attendee;
+ gint row;
+
+ /* Add the new attendee to the name selector. */
+ row = gtk_tree_path_get_indices (path) [0];
+ attendee = e_meeting_store_find_attendee_at_row (store, row);
+ e_meeting_list_view_add_attendee_to_name_selector (view, attendee);
+}
+
+void
+attendee_deleted_cb (EMeetingStore *store, GtkTreePath *path,
+ EMeetingListView *view)
+{
+ EMeetingAttendee *attendee;
+ gint row;
+
+ /* Remove the old attendee from the name selector. */
+ row = gtk_tree_path_get_indices (path) [0];
+ attendee = e_meeting_store_find_attendee_at_row (store, row);
+ e_meeting_list_view_remove_attendee_from_name_selector (view, attendee);
+}
EMeetingListView *
e_meeting_list_view_new (EMeetingStore *store)
{
- EMeetingListView *view = g_object_new (E_TYPE_MEETING_LIST_VIEW, NULL);
+ EMeetingListView *view;
GtkTreeSelection *selection;
- if (view) {
- view->priv->store = store;
- gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (store));
- build_table (view);
- }
+ view = g_object_new (E_TYPE_MEETING_LIST_VIEW, NULL);
+ view->priv->store = store;
+ gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (store));
+ build_table (view);
+
+ g_signal_connect (store, "row-inserted", G_CALLBACK (attendee_added_cb), view);
+ g_signal_connect (store, "row-deleted", G_CALLBACK (attendee_deleted_cb), view);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view));
g_signal_connect (selection, "changed", G_CALLBACK (row_activated_cb), view);
--- evolution-2.9.3/calendar/gui/e-meeting-store.c.meeting-list-view 2006-12-04 10:44:42.000000000 -0500
+++ evolution-2.9.3/calendar/gui/e-meeting-store.c 2006-12-11 23:14:17.000000000 -0500
@@ -794,14 +794,13 @@
}
if (row != -1) {
-
- g_ptr_array_remove_index (store->priv->attendees, row);
- g_object_unref (attendee);
-
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, row);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path);
gtk_tree_path_free (path);
+
+ g_ptr_array_remove_index (store->priv->attendees, row);
+ g_object_unref (attendee);
}
}
@@ -815,10 +814,10 @@
for (i = 0; i < store->priv->attendees->len; i++) {
EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, i);
- g_object_unref (attendee);
gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path);
gtk_tree_path_next (path);
+ g_object_unref (attendee);
}
g_ptr_array_set_size (store->priv->attendees, 0);