diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-07-02 22:54:44 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-07-02 22:54:44 +0800 |
commit | cb9a6f71878dc639b0711d97ec3bc8e16d4ffcf6 (patch) | |
tree | e583bf6e4342672df9191e9869ad7e812da7ed22 /calendar/gui/e-cal-model.c | |
parent | 10315aabac9f3cab20fc54527af82b06b8588ff9 (diff) | |
download | gsoc2013-evolution-cb9a6f71878dc639b0711d97ec3bc8e16d4ffcf6.tar.gz gsoc2013-evolution-cb9a6f71878dc639b0711d97ec3bc8e16d4ffcf6.tar.zst gsoc2013-evolution-cb9a6f71878dc639b0711d97ec3bc8e16d4ffcf6.zip |
show the progress indication in the view while downloading calendar items
from EDS
svn path=/trunk/; revision=29618
Diffstat (limited to 'calendar/gui/e-cal-model.c')
-rw-r--r-- | calendar/gui/e-cal-model.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index ff8872d129..95bb927164 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -100,6 +100,8 @@ static void remove_client (ECalModel *model, ECalModelClient *client_data); enum { TIME_RANGE_CHANGED, ROW_APPENDED, + CAL_VIEW_PROGRESS, + CAL_VIEW_DONE, LAST_SIGNAL }; @@ -148,6 +150,23 @@ e_cal_model_class_init (ECalModelClass *klass) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[CAL_VIEW_PROGRESS] = + g_signal_new ("cal_view_progress", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_progress), + NULL, NULL, + e_calendar_marshal_VOID__STRING_INT_INT, + G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); + signals[CAL_VIEW_DONE] = + g_signal_new ("cal_view_done", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_done), + NULL, NULL, + e_calendar_marshal_VOID__INT_INT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); + } static void @@ -1417,20 +1436,25 @@ static void e_cal_view_progress_cb (ECalView *query, const char *message, int percent, gpointer user_data) { ECalModel *model = (ECalModel *) user_data; + ECal *client = e_cal_view_get_client (query); g_return_if_fail (E_IS_CAL_MODEL (model)); - /* FIXME Update status bar */ + g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_PROGRESS], 0, message, + percent, e_cal_get_source_type (client)); } static void e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer user_data) { ECalModel *model = (ECalModel *) user_data; + ECal *client = e_cal_view_get_client (query); g_return_if_fail (E_IS_CAL_MODEL (model)); - /* FIXME Clear status bar */ + /* emit the signal on the model and let the view catch it to display */ + g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_DONE], 0, status, + e_cal_get_source_type (client)); } static void |