diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-calendar-table.c | 58 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.c | 59 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.h | 3 |
4 files changed, 102 insertions, 21 deletions
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index eaf020bb27..4c029d46f3 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -108,27 +108,36 @@ static void calendar_table_emit_open_component (ECalendarTable *cal_table, ECalModelComponent *comp_data) { - g_signal_emit (cal_table, signals[OPEN_COMPONENT], 0, comp_data); + guint signal_id = signals[OPEN_COMPONENT]; + + g_signal_emit (cal_table, signal_id, 0, comp_data); } static void calendar_table_emit_popup_event (ECalendarTable *cal_table, GdkEvent *event) { - g_signal_emit (cal_table, signals[POPUP_EVENT], 0, event); + guint signal_id = signals[POPUP_EVENT]; + + g_signal_emit (cal_table, signal_id, 0, event); } static void calendar_table_emit_status_message (ECalendarTable *cal_table, - const gchar *message) + const gchar *message, + gdouble percent) { - g_signal_emit (cal_table, signals[STATUS_MESSAGE], 0, message); + guint signal_id = signals[STATUS_MESSAGE]; + + g_signal_emit (cal_table, signal_id, 0, message, percent); } static void calendar_table_emit_user_created (ECalendarTable *cal_table) { - g_signal_emit (cal_table, signals[USER_CREATED], 0); + guint signal_id = signals[USER_CREATED]; + + g_signal_emit (cal_table, signal_id, 0); } static gint @@ -235,6 +244,25 @@ calendar_table_double_click_cb (ECalendarTable *cal_table, calendar_table_emit_open_component (cal_table, comp_data); } +static void +calendar_table_model_cal_view_progress_cb (ECalendarTable *cal_table, + const gchar *message, + gint progress, + ECalSourceType type) +{ + gdouble percent = (gdouble) progress; + + calendar_table_emit_status_message (cal_table, message, percent); +} + +static void +calendar_table_model_cal_view_done_cb (ECalendarTable *cal_table, + ECalendarStatus status, + ECalSourceType type) +{ + calendar_table_emit_status_message (cal_table, NULL, -1.0); +} + static gboolean calendar_table_query_tooltip_cb (ECalendarTable *cal_table, gint x, @@ -438,6 +466,7 @@ calendar_table_query_tooltip_cb (ECalendarTable *cal_table, return TRUE; } + static gboolean calendar_table_popup_menu_cb (ECalendarTable *cal_table) { @@ -604,10 +633,21 @@ calendar_table_init (ECalendarTable *cal_table) /* Create the model */ cal_table->model = (ECalModel *) e_cal_model_tasks_new (); + g_signal_connect_swapped ( cal_table->model, "row_appended", G_CALLBACK (calendar_table_emit_user_created), cal_table); + g_signal_connect_swapped ( + cal_table->model, "cal-view-progress", + G_CALLBACK (calendar_table_model_cal_view_progress_cb), + cal_table); + + g_signal_connect_swapped ( + cal_table->model, "cal-view-done", + G_CALLBACK (calendar_table_model_cal_view_done_cb), + cal_table); + /* Create the header columns */ extras = e_table_extras_new (); @@ -980,7 +1020,7 @@ delete_selected_components (ECalendarTable *cal_table) objs = e_calendar_table_get_selected (cal_table); status_message = _("Deleting selected objects"); - calendar_table_emit_status_message (cal_table, status_message); + calendar_table_emit_status_message (cal_table, status_message, -1.0); for (l = objs; l; l = l->next) { ECalModelComponent *comp_data = (ECalModelComponent *) l->data; @@ -992,7 +1032,7 @@ delete_selected_components (ECalendarTable *cal_table) g_clear_error (&error); } - calendar_table_emit_status_message (cal_table, NULL); + calendar_table_emit_status_message (cal_table, NULL, -1.0); g_slist_free (objs); } @@ -1274,7 +1314,7 @@ clipboard_get_calendar_data (ECalendarTable *cal_table, const gchar *text) client = e_cal_model_get_default_client (cal_table->model); status_message = _("Updating objects"); - calendar_table_emit_status_message (cal_table, _("Updating objects")); + calendar_table_emit_status_message (cal_table, status_message, -1.0); if (kind == ICAL_VCALENDAR_COMPONENT) { icalcomponent_kind child_kind; @@ -1319,7 +1359,7 @@ clipboard_get_calendar_data (ECalendarTable *cal_table, const gchar *text) g_object_unref (comp); } - calendar_table_emit_status_message (cal_table, NULL); + calendar_table_emit_status_message (cal_table, NULL, -1.0); } static void diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index 2378f9dec9..edd9b2b53f 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -84,7 +84,8 @@ struct _ECalendarTableClass { void (*popup_event) (ECalendarTable *cal_table, GdkEvent *event); void (*status_message) (ECalendarTable *cal_table, - const gchar *message); + const gchar *message, + gdouble percent); void (*user_created) (ECalendarTable *cal_table); }; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 12aa2d9db2..b844030264 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -109,27 +109,36 @@ static void memo_table_emit_open_component (EMemoTable *memo_table, ECalModelComponent *comp_data) { - g_signal_emit (memo_table, signals[OPEN_COMPONENT], 0, comp_data); + guint signal_id = signals[OPEN_COMPONENT]; + + g_signal_emit (memo_table, signal_id, 0, comp_data); } static void memo_table_emit_popup_event (EMemoTable *memo_table, GdkEvent *event) { - g_signal_emit (memo_table, signals[POPUP_EVENT], 0, event); + guint signal_id = signals[POPUP_EVENT]; + + g_signal_emit (memo_table, signal_id, 0, event); } static void memo_table_emit_status_message (EMemoTable *memo_table, - const gchar *message) + const gchar *message, + gdouble percent) { - g_signal_emit (memo_table, signals[STATUS_MESSAGE], 0, message); + guint signal_id = signals[STATUS_MESSAGE]; + + g_signal_emit (memo_table, signal_id, 0, message, percent); } static void memo_table_emit_user_created (EMemoTable *memo_table) { - g_signal_emit (memo_table, signals[USER_CREATED], 0); + guint signal_id = signals[USER_CREATED]; + + g_signal_emit (memo_table, signal_id, 0); } static gint @@ -173,6 +182,25 @@ memo_table_double_click_cb (EMemoTable *memo_table, memo_table_emit_open_component (memo_table, comp_data); } +static void +memo_table_model_cal_view_progress_cb (EMemoTable *memo_table, + const gchar *message, + gint progress, + ECalSourceType type) +{ + gdouble percent = (gdouble) progress; + + memo_table_emit_status_message (memo_table, message, percent); +} + +static void +memo_table_model_cal_view_done_cb (EMemoTable *memo_table, + ECalendarStatus status, + ECalSourceType type) +{ + memo_table_emit_status_message (memo_table, NULL, -1.0); +} + static gboolean memo_table_query_tooltip_cb (EMemoTable *memo_table, gint x, @@ -541,10 +569,21 @@ memo_table_init (EMemoTable *memo_table) /* Create the model */ memo_table->model = (ECalModel *) e_cal_model_memos_new (); + g_signal_connect_swapped ( - memo_table->model, "row_appended", + memo_table->model, "row-appended", G_CALLBACK (memo_table_emit_user_created), memo_table); + g_signal_connect_swapped ( + memo_table->model, "cal-view-progress", + G_CALLBACK (memo_table_model_cal_view_progress_cb), + memo_table); + + g_signal_connect_swapped ( + memo_table->model, "cal-view-done", + G_CALLBACK (memo_table_model_cal_view_done_cb), + memo_table); + /* Create the header columns */ extras = e_table_extras_new (); @@ -776,7 +815,7 @@ delete_selected_components (EMemoTable *memo_table) objs = e_memo_table_get_selected (memo_table); status_message = _("Deleting selected objects"); - memo_table_emit_status_message (memo_table, status_message); + memo_table_emit_status_message (memo_table, status_message, -1.0); for (l = objs; l; l = l->next) { ECalModelComponent *comp_data = (ECalModelComponent *) l->data; @@ -788,7 +827,7 @@ delete_selected_components (EMemoTable *memo_table) g_clear_error (&error); } - memo_table_emit_status_message (memo_table, NULL); + memo_table_emit_status_message (memo_table, NULL, -1.0); g_slist_free (objs); } @@ -995,7 +1034,7 @@ clipboard_get_calendar_data (EMemoTable *memo_table, const gchar *text) client = e_cal_model_get_default_client (memo_table->model); status_message = _("Updating objects"); - memo_table_emit_status_message (memo_table, _("Updating objects")); + memo_table_emit_status_message (memo_table, status_message, -1.0); if (kind == ICAL_VCALENDAR_COMPONENT) { icalcomponent_kind child_kind; @@ -1040,7 +1079,7 @@ clipboard_get_calendar_data (EMemoTable *memo_table, const gchar *text) g_object_unref (comp); } - memo_table_emit_status_message (memo_table, NULL); + memo_table_emit_status_message (memo_table, NULL, -1.0); } static void diff --git a/calendar/gui/e-memo-table.h b/calendar/gui/e-memo-table.h index 12f51cb5e8..39838b4caa 100644 --- a/calendar/gui/e-memo-table.h +++ b/calendar/gui/e-memo-table.h @@ -90,7 +90,8 @@ struct _EMemoTableClass { void (*popup_event) (EMemoTable *memo_table, GdkEvent *event); void (*status_message) (EMemoTable *memo_table, - const gchar *message); + const gchar *message, + gdouble percent); void (*user_created) (EMemoTable *memo_table); }; |