aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-12-04 02:22:12 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-12-04 02:22:12 +0800
commitcf649a8408918e3cd5a185dabaa7b9ba497ad250 (patch)
tree855a04774f7918fd7523a7e5fcdba09691c3d1ca /calendar
parent796e7ca63b134fca7767d1b009aa973c03fd46a6 (diff)
downloadgsoc2013-evolution-cf649a8408918e3cd5a185dabaa7b9ba497ad250.tar.gz
gsoc2013-evolution-cf649a8408918e3cd5a185dabaa7b9ba497ad250.tar.zst
gsoc2013-evolution-cf649a8408918e3cd5a185dabaa7b9ba497ad250.zip
** Fix for bug #440497
2007-12-03 Milan Crha <mcrha@redhat.com> ** Fix for bug #440497 * gui/e-meeting-list-view.h: (e_meeting_list_view_column_set_visible): Prototype changed to refer to column based on enum identifier. * gui/e-meeting-list-view.c: (build_table): Store column enum identifier in column datas, for later use. * gui/e-meeting-list-view.c: (e_meeting_list_view_column_set_visible): * gui/dialogs/task-page.c: * gui/dialogs/event-page.c: * gui/e-meeting-time-sel.c: Refer for column based on the enum, not on the column title. svn path=/trunk/; revision=34628
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog14
-rw-r--r--calendar/gui/dialogs/event-page.c19
-rw-r--r--calendar/gui/dialogs/task-page.c19
-rw-r--r--calendar/gui/e-meeting-list-view.c10
-rw-r--r--calendar/gui/e-meeting-list-view.h2
-rw-r--r--calendar/gui/e-meeting-time-sel.c8
6 files changed, 45 insertions, 27 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index db0a0582e9..ffb360a0c2 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,17 @@
+2007-12-03 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #440497
+
+ * gui/e-meeting-list-view.h: (e_meeting_list_view_column_set_visible):
+ Prototype changed to refer to column based on enum identifier.
+ * gui/e-meeting-list-view.c: (build_table): Store column enum
+ identifier in column datas, for later use.
+ * gui/e-meeting-list-view.c: (e_meeting_list_view_column_set_visible):
+ * gui/dialogs/task-page.c:
+ * gui/dialogs/event-page.c:
+ * gui/e-meeting-time-sel.c:
+ Refer for column based on the enum, not on the column title.
+
2007-12-03 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #392747
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 5105773b8b..2c1eea16ce 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -752,7 +752,7 @@ event_page_set_view_role (EventPage *epage, gboolean state)
{
EventPagePrivate *priv = epage->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Role", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, state);
}
void
@@ -760,7 +760,7 @@ event_page_set_view_status (EventPage *epage, gboolean state)
{
EventPagePrivate *priv = epage->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Status", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, state);
}
void
@@ -768,7 +768,7 @@ event_page_set_view_type (EventPage *epage, gboolean state)
{
EventPagePrivate *priv = epage->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Type", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, state);
}
void
@@ -776,7 +776,7 @@ event_page_set_view_rsvp (EventPage *epage, gboolean state)
{
EventPagePrivate *priv = epage->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, state);
}
void
@@ -2984,12 +2984,11 @@ init_widgets (EventPage *epage)
g_signal_connect((priv->start_timezone), "changed",
G_CALLBACK (start_timezone_changed_cb), epage);
- e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ",
- TRUE);
- e_meeting_list_view_column_set_visible (priv->list_view, "Role", calendar_config_get_show_role());
- e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", calendar_config_get_show_rsvp());
- e_meeting_list_view_column_set_visible (priv->list_view, "Status", calendar_config_get_show_status());
- e_meeting_list_view_column_set_visible (priv->list_view, "Type", calendar_config_get_show_type());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, calendar_config_get_show_role ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, calendar_config_get_show_rsvp ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, calendar_config_get_show_status ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, calendar_config_get_show_type ());
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index f0864edd5e..f4cf1ecd3b 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -356,7 +356,7 @@ task_page_set_view_role (TaskPage *page, gboolean state)
{
TaskPagePrivate *priv = page->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Role", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, state);
}
void
@@ -364,7 +364,7 @@ task_page_set_view_status (TaskPage *page, gboolean state)
{
TaskPagePrivate *priv = page->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Status", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, state);
}
void
@@ -372,7 +372,7 @@ task_page_set_view_type (TaskPage *page, gboolean state)
{
TaskPagePrivate *priv = page->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "Type", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, state);
}
void
@@ -380,7 +380,7 @@ task_page_set_view_rsvp (TaskPage *page, gboolean state)
{
TaskPagePrivate *priv = page->priv;
- e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", state);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, state);
}
void
@@ -2050,12 +2050,11 @@ init_widgets (TaskPage *tpage)
task_page_set_show_timezone (tpage, calendar_config_get_show_timezone());
- e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ",
- TRUE);
- e_meeting_list_view_column_set_visible (priv->list_view, "Role", calendar_config_get_show_role());
- e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", calendar_config_get_show_rsvp());
- e_meeting_list_view_column_set_visible (priv->list_view, "Status", calendar_config_get_show_status());
- e_meeting_list_view_column_set_visible (priv->list_view, "Type", calendar_config_get_show_type());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_ROLE_COL, calendar_config_get_show_role ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_RSVP_COL, calendar_config_get_show_rsvp ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_STATUS_COL, calendar_config_get_show_status ());
+ e_meeting_list_view_column_set_visible (priv->list_view, E_MEETING_STORE_TYPE_COL, calendar_config_get_show_type ());
task_page_set_show_categories (tpage, calendar_config_get_show_categories());
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 8d1a97208d..2e35fde081 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -491,6 +491,7 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable(col, TRUE);
g_object_set (col, "min-width", 50, NULL);
+ g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL));
g_signal_connect (renderer, "cell_edited", G_CALLBACK (attendee_edited_cb), view);
g_signal_connect (renderer, "editing-canceled", G_CALLBACK (attendee_editing_canceled_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer);
@@ -503,6 +504,7 @@ build_table (EMeetingListView *lview)
col = gtk_tree_view_get_column (view, pos -1);
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable(col, TRUE);
+ g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL));
g_signal_connect (renderer, "edited", G_CALLBACK (type_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer);
@@ -514,6 +516,7 @@ build_table (EMeetingListView *lview)
col = gtk_tree_view_get_column (view, pos -1);
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable(col, TRUE);
+ g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_ROLE_COL));
g_signal_connect (renderer, "edited", G_CALLBACK (role_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ROLE_COL), renderer);
@@ -526,6 +529,7 @@ build_table (EMeetingListView *lview)
col = gtk_tree_view_get_column (view, pos -1);
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable(col, TRUE);
+ g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL));
g_signal_connect (renderer, "edited", G_CALLBACK (rsvp_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL), renderer);
@@ -537,6 +541,7 @@ build_table (EMeetingListView *lview)
col = gtk_tree_view_get_column (view, pos -1);
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable(col, TRUE);
+ g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_STATUS_COL));
g_signal_connect (renderer, "edited", G_CALLBACK (status_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_STATUS_COL), renderer);
@@ -642,7 +647,7 @@ e_meeting_list_view_new (EMeetingStore *store)
}
void
-e_meeting_list_view_column_set_visible (EMeetingListView *view, const gchar *col_name, gboolean visible)
+e_meeting_list_view_column_set_visible (EMeetingListView *view, EMeetingStoreColumns column, gboolean visible)
{
GList *cols, *l;
@@ -650,8 +655,9 @@ e_meeting_list_view_column_set_visible (EMeetingListView *view, const gchar *col
for (l = cols; l; l = l->next) {
GtkTreeViewColumn *col = (GtkTreeViewColumn *) l->data;
+ EMeetingStoreColumns store_colum = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (col), "mtg-store-col"));
- if (strcmp (gtk_tree_view_column_get_title (col), col_name) == 0) {
+ if (store_colum == column) {
gtk_tree_view_column_set_visible (col, visible);
break;
}
diff --git a/calendar/gui/e-meeting-list-view.h b/calendar/gui/e-meeting-list-view.h
index f565381382..f93d6e9c46 100644
--- a/calendar/gui/e-meeting-list-view.h
+++ b/calendar/gui/e-meeting-list-view.h
@@ -57,7 +57,7 @@ GType e_meeting_list_view_get_type (void);
EMeetingListView *e_meeting_list_view_new (EMeetingStore *store);
-void e_meeting_list_view_column_set_visible (EMeetingListView *emlv, const gchar *col_name, gboolean visible);
+void e_meeting_list_view_column_set_visible (EMeetingListView *emlv, EMeetingStoreColumns column, gboolean visible);
void e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee);
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index cadb1d3c9a..5367cd3335 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -327,10 +327,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
g_signal_connect (mts->model, "row_deleted", G_CALLBACK (row_deleted_cb), mts);
mts->list_view = e_meeting_list_view_new (mts->model);
- e_meeting_list_view_column_set_visible (mts->list_view, "Role", FALSE);
- e_meeting_list_view_column_set_visible (mts->list_view, "RSVP", FALSE);
- e_meeting_list_view_column_set_visible (mts->list_view, "Status", FALSE);
- e_meeting_list_view_column_set_visible (mts->list_view, "Type", FALSE);
+ e_meeting_list_view_column_set_visible (mts->list_view, E_MEETING_STORE_ROLE_COL, FALSE);
+ e_meeting_list_view_column_set_visible (mts->list_view, E_MEETING_STORE_RSVP_COL, FALSE);
+ e_meeting_list_view_column_set_visible (mts->list_view, E_MEETING_STORE_STATUS_COL, FALSE);
+ e_meeting_list_view_column_set_visible (mts->list_view, E_MEETING_STORE_TYPE_COL, FALSE);
gtk_widget_show (GTK_WIDGET (mts->list_view));