aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-10-19 23:26:43 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-10-19 23:26:43 +0800
commit92d0b48b3ca0793ea7f3be32c189302ca6ec60f2 (patch)
tree0f959d7d5baceedbe4d1e04db95a9aa31861b3b2 /calendar/gui/e-day-view.c
parent971f97e0518eb19270ead8e500843685e6c5ae71 (diff)
downloadgsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar.gz
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar.bz2
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar.lz
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar.xz
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.tar.zst
gsoc2013-evolution-92d0b48b3ca0793ea7f3be32c189302ca6ec60f2.zip
keep a reference to the EvolutionShellClient component
2001-10-19 Rodrigo Moya <rodrigo@ximian.com> * gui/component-factory.c (owner_set_cb): keep a reference to the EvolutionShellClient component * gui/e-week-view.c (e_week_view_set_status_message): new function (update_query): call e_week_view_set_status_message (query_query_done_cb): (query_eval_error_cb): clean up status bar messages * gui/e-day-view.c (e_day_view_set_status_message): new function (update_query): call e_day_view_set_status_message (query_query_done_cb): (query_eval_error_cb): clean up status bar messages * gui/Makefile.am: added EVOLUTION_IMAGESDIR to CFLAGS svn path=/trunk/; revision=13793
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index ef3928a029..7aaee07062 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -97,6 +97,9 @@
we get from the server. */
#define E_DAY_VIEW_LAYOUT_TIMEOUT 100
+/* Used for the status bar messages */
+#define EVOLUTION_CALENDAR_PROGRESS_IMAGE "evolution-calendar-mini.png"
+static GdkPixbuf *progress_icon[2] = { NULL, NULL };
/* Signal IDs */
enum {
@@ -871,6 +874,8 @@ e_day_view_init (EDayView *day_view)
GTK_SIGNAL_FUNC (invisible_destroyed),
(gpointer) day_view);
day_view->clipboard_selection = NULL;
+
+ day_view->activity = NULL;
}
@@ -956,8 +961,15 @@ e_day_view_destroy (GtkObject *object)
if (day_view->invisible)
gtk_widget_destroy (day_view->invisible);
- if (day_view->clipboard_selection)
+ if (day_view->clipboard_selection) {
g_free (day_view->clipboard_selection);
+ day_view->clipboard_selection = NULL;
+ }
+
+ if (day_view->activity) {
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
+ day_view->activity = NULL;
+ }
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
@@ -1575,6 +1587,8 @@ query_query_done_cb (CalQuery *query, CalQueryDoneStatus status, const char *err
/* FIXME */
+ e_day_view_set_status_message (day_view, NULL);
+
if (status != CAL_QUERY_DONE_SUCCESS)
fprintf (stderr, "query done: %s\n", error_str);
}
@@ -1589,6 +1603,8 @@ query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data)
/* FIXME */
+ e_day_view_set_status_message (day_view, NULL);
+
fprintf (stderr, "eval error: %s\n", error_str);
}
@@ -1655,6 +1671,7 @@ update_query (EDayView *day_view)
if (!real_sexp)
return; /* No time range is set, so don't start a query */
+ e_day_view_set_status_message (day_view, _("Searching"));
day_view->query = cal_client_get_query (day_view->client, real_sexp);
g_free (real_sexp);
@@ -7026,3 +7043,33 @@ e_day_view_get_num_events_selected (EDayView *day_view)
return (day_view->editing_event_day != -1) ? 1 : 0;
}
+
+/* Displays messages on the status bar. */
+void
+e_day_view_set_status_message (EDayView *day_view, const char *message)
+{
+ extern EvolutionShellClient *global_shell_client; /* ugly */
+
+ g_return_if_fail (E_IS_DAY_VIEW (day_view));
+
+ if (!message || !*message) {
+ if (day_view->activity) {
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
+ day_view->activity = NULL;
+ }
+ }
+ else if (!day_view->activity) {
+ int display;
+ char *client_id = g_strdup_printf ("%p", day_view);
+
+ if (progress_icon[0] == NULL)
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE);
+ day_view->activity = evolution_activity_client_new (
+ global_shell_client, client_id,
+ progress_icon, message, TRUE, &display);
+
+ g_free (client_id);
+ }
+ else
+ evolution_activity_client_update (day_view->activity, message, -1.0);
+}