aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-list-view.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-03-26 01:56:07 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-03-26 01:56:07 +0800
commit41810f55a293ed42e3c1cfc19accad1f1fc174e9 (patch)
tree37ce26e31863f7ab3cf9fad4e4af45741fbf4558 /calendar/gui/e-cal-list-view.c
parent61c49c3f7c94940fc356c08cdd66fde5fee49090 (diff)
downloadgsoc2013-evolution-41810f55a293ed42e3c1cfc19accad1f1fc174e9.tar.gz
gsoc2013-evolution-41810f55a293ed42e3c1cfc19accad1f1fc174e9.tar.zst
gsoc2013-evolution-41810f55a293ed42e3c1cfc19accad1f1fc174e9.zip
Fixes #53499
2004-03-25 JP Rosevear <jpr@ximian.com> Fixes #53499 * gui/gnome-cal.c (setup_widgets): don't give the state file to the list view (set_view): ensure that if the list view was in custom mode it stays that way (display_view_cb): attach to the etable of the list view (gnome_calendar_setup_view_menus): use an etable gal view for the list view and don't set the view twice * gui/e-tasks.c (e_tasks_setup_view_menus): the instance should no longer be per task uri since all the uris are shown together * gui/e-cal-list-view.h: update/add protos * gui/e-cal-list-view.etspec: limit the available columns to what product design agreed on * gui/e-calendar-table.etspec: ditto * gui/e-cal-list-view.c (e_cal_list_view_class_init): ignore update query calls (e_cal_list_view_load_state): make public (e_cal_list_view_save_state): ditto (setup_e_table): don't handle state saving ourselves (e_cal_list_view_construct): ditto (e_cal_list_view_new): ditto (e_cal_list_view_destroy): ditto * gui/calendar-view.c (calendar_view_get_type_code): we don't handle the list view here * gui/calendar-view-factory.c (calendar_view_factory_get_type_code): we don't handle the list view here (calendar_view_factory_get_title): ditto svn path=/trunk/; revision=25185
Diffstat (limited to 'calendar/gui/e-cal-list-view.c')
-rw-r--r--calendar/gui/e-cal-list-view.c73
1 files changed, 16 insertions, 57 deletions
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
index 19134800d3..73e10e0065 100644
--- a/calendar/gui/e-cal-list-view.c
+++ b/calendar/gui/e-cal-list-view.c
@@ -73,7 +73,6 @@
static void e_cal_list_view_class_init (ECalListViewClass *class);
static void e_cal_list_view_init (ECalListView *cal_list_view);
static void e_cal_list_view_destroy (GtkObject *object);
-static void e_cal_list_view_update_query (ECalendarView *cal_view);
static GList *e_cal_list_view_get_selected_events (ECalendarView *cal_view);
static gboolean e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
@@ -112,8 +111,6 @@ e_cal_list_view_class_init (ECalListViewClass *class)
view_class->get_selected_events = e_cal_list_view_get_selected_events;
view_class->get_selected_time_range = e_cal_list_view_get_selected_time_range;
view_class->get_visible_time_range = e_cal_list_view_get_visible_time_range;
-
- view_class->update_query = e_cal_list_view_update_query;
}
static gint
@@ -177,28 +174,27 @@ get_current_time_cb (ECellDateEdit *ecde, gpointer data)
return tmp_tm;
}
-static void
-load_table_state (ECalListView *cal_list_view)
+void
+e_cal_list_view_load_state (ECalListView *cal_list_view, gchar *filename)
{
struct stat st;
- if (!cal_list_view->table_state_path)
- return;
+ g_return_if_fail (cal_list_view != NULL);
+ g_return_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view));
+ g_return_if_fail (filename != NULL);
- if (stat (cal_list_view->table_state_path, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode)) {
- e_table_load_state (e_table_scrolled_get_table (cal_list_view->table_scrolled),
- cal_list_view->table_state_path);
- }
+ if (stat (filename, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode))
+ e_table_load_state (e_table_scrolled_get_table (cal_list_view->table_scrolled), filename);
}
-static void
-save_table_state (ECalListView *cal_list_view)
+void
+e_cal_list_view_save_state (ECalListView *cal_list_view, gchar *filename)
{
- if (!cal_list_view->table_state_path)
- return;
+ g_return_if_fail (cal_list_view != NULL);
+ g_return_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view));
+ g_return_if_fail (filename != NULL);
- e_table_save_state (e_table_scrolled_get_table (cal_list_view->table_scrolled),
- cal_list_view->table_state_path);
+ e_table_save_state (e_table_scrolled_get_table (cal_list_view->table_scrolled), filename);
}
static void
@@ -213,11 +209,6 @@ setup_e_table (ECalListView *cal_list_view)
model = E_CAL_MODEL_CALENDAR (e_calendar_view_get_model (E_CALENDAR_VIEW (cal_list_view)));
- if (cal_list_view->table_scrolled) {
- save_table_state (cal_list_view);
- gtk_widget_destroy (GTK_WIDGET (cal_list_view->table_scrolled));
- }
-
/* Create the header columns */
extras = e_table_extras_new();
@@ -291,12 +282,7 @@ setup_e_table (ECalListView *cal_list_view)
style->fg [GTK_STATE_ACTIVE] = style->text [GTK_STATE_NORMAL];
gtk_widget_set_style (GTK_WIDGET (canvas), style);
- /* Load state, if possible */
-
- load_table_state (cal_list_view);
-
/* Connect signals */
-
g_signal_connect (e_table_scrolled_get_table (cal_list_view->table_scrolled),
"right-click", G_CALLBACK (e_cal_list_view_on_table_right_click), cal_list_view);
@@ -308,13 +294,8 @@ setup_e_table (ECalListView *cal_list_view)
}
GtkWidget *
-e_cal_list_view_construct (ECalListView *cal_list_view, const gchar *table_state_path)
+e_cal_list_view_construct (ECalListView *cal_list_view)
{
- if (table_state_path)
- cal_list_view->table_state_path = g_strdup (table_state_path);
- else
- cal_list_view->table_state_path = NULL;
-
setup_e_table (cal_list_view);
return GTK_WIDGET (cal_list_view);
@@ -327,7 +308,7 @@ e_cal_list_view_construct (ECalListView *cal_list_view, const gchar *table_state
* Creates a new #ECalListView.
**/
GtkWidget *
-e_cal_list_view_new (const gchar *table_state_path)
+e_cal_list_view_new (void)
{
ECalListView *cal_list_view;
ECalModel *model;
@@ -335,7 +316,7 @@ e_cal_list_view_new (const gchar *table_state_path)
model = E_CAL_MODEL (e_cal_model_calendar_new ());
cal_list_view = g_object_new (e_cal_list_view_get_type (), "model", model, NULL);
- if (!e_cal_list_view_construct (cal_list_view, table_state_path)) {
+ if (!e_cal_list_view_construct (cal_list_view)) {
g_message (G_STRLOC ": Could not construct the calendar list GUI");
g_object_unref (cal_list_view);
return NULL;
@@ -365,12 +346,6 @@ e_cal_list_view_destroy (GtkObject *object)
cal_list_view->set_table_id = 0;
}
- if (cal_list_view->table_state_path) {
- save_table_state (cal_list_view);
- g_free (cal_list_view->table_state_path);
- cal_list_view->table_state_path = NULL;
- }
-
if (cal_list_view->cursor_event) {
g_free (cal_list_view->cursor_event);
cal_list_view->cursor_event = NULL;
@@ -384,22 +359,6 @@ e_cal_list_view_destroy (GtkObject *object)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
-static gboolean
-setup_e_table_cb (gpointer data)
-{
- setup_e_table (E_CAL_LIST_VIEW (data));
- E_CAL_LIST_VIEW (data)->set_table_id = 0;
- return FALSE;
-}
-
-static void
-e_cal_list_view_update_query (ECalendarView *cal_list_view)
-{
- if (!E_CAL_LIST_VIEW (cal_list_view)->set_table_id)
- E_CAL_LIST_VIEW (cal_list_view)->set_table_id =
- g_idle_add (setup_e_table_cb, cal_list_view);
-}
-
static void
e_cal_list_view_show_popup_menu (ECalListView *cal_list_view, gint row, GdkEvent *gdk_event)
{