diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-08-30 06:36:38 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-08-30 06:36:38 +0800 |
commit | 1b087914b96c5fafdcde98d29079dce539a53cf1 (patch) | |
tree | bb5bfebe79c34d5a2c46fa84c340d607d4c78852 /calendar/gui/gnome-cal.c | |
parent | 8b546f3dfa39bceb5d28c2b9b09f3445b46b6b6d (diff) | |
download | gsoc2013-evolution-1b087914b96c5fafdcde98d29079dce539a53cf1.tar.gz gsoc2013-evolution-1b087914b96c5fafdcde98d29079dce539a53cf1.tar.zst gsoc2013-evolution-1b087914b96c5fafdcde98d29079dce539a53cf1.zip |
Now the views monitor the client by themselves; it does not make sense to
2000-08-29 Federico Mena Quintero <federico@helixcode.com>
Now the views monitor the client by themselves; it does not make
sense to proxy all notifications through the GnomeCal. The
GnomeCal should just be a meta-widget that holds all the views.
At some later point we'll want to decouple the views from the
GnomeCal so that they can be embedded anywhere; they should emit
signals to request appropriate actions from the toplevel GUI
instead of calling the GnomeCal directly.
* gui/e-day-view.c (e_day_view_set_cal_client): New function; now
the day view monitors the client by itself.
(cal_loaded_cb): New callback; moved over from
e_day_view_update_all_events().
(obj_updated_cb): New callback; moved over from
e_day_view_update_event().
(obj_removed_cb): New callback; moved over from
e_day_view_remove_event().
(e_day_view_update_all_events): Removed function.
(e_day_view_update_event): Removed function.
(e_day_view_remove_event): Removed function.
(*): Use the day_view->client directly instead of fetching it from
the GnomeCal.
(e_day_view_destroy): Unref the client.
(e_day_view_reload_events): Check if the client is loaded.
(e_day_view_key_press): Set the vtype of the new component.
* gui/e-week-view.c (e_week_view_set_cal_client): New function.
(cal_loaded_cb): New callback.
(obj_updated_cb): New callback.
(obj_removed_cb): New callback.
(e_week_view_update_all_events): Removed function.
(e_week_view_update_event): Removed function.
(e_week_view_remove_event): Removed function.
(*): Use the week_view->client directly.
(e_week_view_destroy): Unref the client.
(e_week_view_reload_events): Check if the client is loaded.
* gui/gnome-cal.c (setup_widgets): Set the cal_client on all the
views.
(gnome_calendar_update_all): Do not update the views, since now
they do it themselves.
(gnome_calendar_object_updated_cb): Likewise.
(gnome_calendar_object_removed_cb): Likewise.
(setup_widgets): Remove all to-do list cruft.
(gnome_calendar_colors_changed): Likewise.
(gnome_calendar_todo_properties_changed): Likewise.
* gui/calendar-commands.h (todo_style_changed): Removed variable.
* gui/gncal-todo.c: Removed old clist cruft; just left in the
temporary dialog box for now.
svn path=/trunk/; revision=5105
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index c767ae59eb..ea61dafabc 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -204,11 +204,6 @@ setup_widgets (GnomeCalendar *gcal) gcal); /* The ToDo list. */ -#if 0 - gcal->todo = gncal_todo_new (gcal); - e_paned_pack2 (E_PANED (vpane), gcal->todo, TRUE, TRUE); - gtk_widget_show (gcal->todo); -#endif gcal->todo = e_calendar_table_new (); e_paned_pack2 (E_PANED (vpane), gcal->todo, TRUE, TRUE); @@ -220,6 +215,7 @@ setup_widgets (GnomeCalendar *gcal) /* The Day View. */ gcal->day_view = e_day_view_new (); e_day_view_set_calendar (E_DAY_VIEW (gcal->day_view), gcal); + e_day_view_set_cal_client (E_DAY_VIEW (gcal->day_view), gcal->client); gtk_widget_show (gcal->day_view); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->sub_notebook), gcal->day_view, gtk_label_new ("")); @@ -228,6 +224,7 @@ setup_widgets (GnomeCalendar *gcal) gcal->work_week_view = e_day_view_new (); e_day_view_set_days_shown (E_DAY_VIEW (gcal->work_week_view), 5); e_day_view_set_calendar (E_DAY_VIEW (gcal->work_week_view), gcal); + e_day_view_set_cal_client (E_DAY_VIEW (gcal->work_week_view), gcal->client); gtk_widget_show (gcal->work_week_view); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->sub_notebook), gcal->work_week_view, gtk_label_new ("")); @@ -235,6 +232,7 @@ setup_widgets (GnomeCalendar *gcal) /* The Week View. */ gcal->week_view = e_week_view_new (); e_week_view_set_calendar (E_WEEK_VIEW (gcal->week_view), gcal); + e_week_view_set_cal_client (E_WEEK_VIEW (gcal->week_view), gcal->client); gtk_widget_show (gcal->week_view); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->sub_notebook), gcal->week_view, gtk_label_new ("")); @@ -242,6 +240,7 @@ setup_widgets (GnomeCalendar *gcal) /* The Month View. */ gcal->month_view = e_week_view_new (); e_week_view_set_calendar (E_WEEK_VIEW (gcal->month_view), gcal); + e_week_view_set_cal_client (E_WEEK_VIEW (gcal->month_view), gcal->client); e_week_view_set_display_month (E_WEEK_VIEW (gcal->month_view), TRUE); gtk_widget_show (gcal->month_view); gtk_notebook_append_page (GTK_NOTEBOOK (gcal->main_notebook), @@ -812,15 +811,6 @@ static void gnome_calendar_update_all (GnomeCalendar *cal) { load_alarms (cal); - - e_day_view_update_all_events (E_DAY_VIEW (cal->day_view)); - e_day_view_update_all_events (E_DAY_VIEW (cal->work_week_view)); - e_week_view_update_all_events (E_WEEK_VIEW (cal->week_view)); - e_week_view_update_all_events (E_WEEK_VIEW (cal->month_view)); - -#if 0 - gncal_todo_update (GNCAL_TODO (cal->todo), NULL, TRUE); -#endif gnome_calendar_tag_calendar (cal, cal->gtk_calendar); } @@ -880,23 +870,9 @@ gnome_calendar_object_updated_cb (GtkWidget *cal_client, const char *uid, GnomeCalendar *gcal) { - g_message ("gnome-cal: got object changed_cb, uid='%s'", - uid?uid:"<NULL>"); - remove_alarms_for_object (gcal, uid); add_alarms_for_object (gcal, uid); - /* FIXME: do we really want each view to reload the event itself? - Maybe we should keep track of events globally, maybe with ref - counts. We also need to sort out where they get freed. */ - e_day_view_update_event (E_DAY_VIEW (gcal->day_view), uid); - e_day_view_update_event (E_DAY_VIEW (gcal->work_week_view), uid); - e_week_view_update_event (E_WEEK_VIEW (gcal->week_view), uid); - e_week_view_update_event (E_WEEK_VIEW (gcal->month_view), uid); - -#if 0 - gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, TRUE); -#endif gnome_calendar_tag_calendar (gcal, gcal->gtk_calendar); } @@ -906,19 +882,8 @@ gnome_calendar_object_removed_cb (GtkWidget *cal_client, const char *uid, GnomeCalendar *gcal) { - g_message ("gnome-cal: got object removed _cb, uid='%s'", - uid?uid:"<NULL>"); - remove_alarms_for_object (gcal, uid); - e_day_view_remove_event (E_DAY_VIEW (gcal->day_view), uid); - e_day_view_remove_event (E_DAY_VIEW (gcal->work_week_view), uid); - e_week_view_remove_event (E_WEEK_VIEW (gcal->week_view), uid); - e_week_view_remove_event (E_WEEK_VIEW (gcal->month_view), uid); - -#if 0 - gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, CHANGE_ALL); -#endif gnome_calendar_tag_calendar (gcal, gcal->gtk_calendar); } @@ -969,13 +934,10 @@ gnome_calendar_load_cb (CalClient *cal_client, switch (status) { case CAL_CLIENT_LOAD_SUCCESS: gnome_calendar_update_all (locd->gcal); - g_message ("gnome_calendar_load_cb: success"); break; case CAL_CLIENT_LOAD_ERROR: - g_message ("gnome_calendar_load_cb: load error"); if (locd->gcom == CALENDAR_OPEN_OR_CREATE) { - g_message ("gnome_calendar_load_cb: trying create..."); /* FIXME: connect to the cal_loaded signal of the * CalClient and get theasynchronous notification * properly! */ @@ -1033,7 +995,7 @@ gnome_calendar_open (GnomeCalendar *gcal, gnome_calendar_load_cb, locd); - if (cal_client_load_calendar (gcal->client, file) == FALSE){ + if (cal_client_load_calendar (gcal->client, file) == FALSE) { g_message ("Error loading calendar: %s", file); return 0; } @@ -1281,11 +1243,6 @@ gnome_calendar_colors_changed (GnomeCalendar *gcal) { g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - - todo_style_changed = 1; -#if 0 - gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, 0); -#endif } void @@ -1293,11 +1250,6 @@ gnome_calendar_todo_properties_changed (GnomeCalendar *gcal) { g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - - todo_style_changed = 1; -#if 0 - gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, 0); -#endif } |