From cea054cd54d84479352a43bbabc19c9ce9af5efb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 8 Aug 2008 04:26:12 +0000 Subject: Merge revisions 35747:35930 from trunk. svn path=/branches/kill-bonobo/; revision=35931 --- calendar/gui/alarm-notify/alarm-queue.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 9bc19d4aad..219dfdc82d 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -79,7 +79,7 @@ static GList *tray_icons_list = NULL; /* Top Tray Image */ static GtkStatusIcon *tray_icon = NULL; static int tray_blink_id = -1; -static int tray_blink_state = FALSE; +static int tray_blink_countdown = 0; static AlarmNotify *an; /* Structure that stores a client we are monitoring */ @@ -1383,11 +1383,13 @@ popup_menu (GtkStatusIcon *icon, guint button, guint activate_time) static gboolean tray_icon_blink_cb (gpointer data) { + static gboolean tray_blink_state = FALSE; GdkPixbuf *pixbuf; - tray_blink_state = tray_blink_state == TRUE ? FALSE: TRUE; + tray_blink_countdown--; + tray_blink_state = !tray_blink_state; - pixbuf = e_icon_factory_get_icon (tray_blink_state == TRUE? + pixbuf = e_icon_factory_get_icon ((tray_blink_state || tray_blink_countdown <= 0)? "stock_appointment-reminder-excl" : "stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR); @@ -1396,7 +1398,10 @@ tray_icon_blink_cb (gpointer data) gtk_status_icon_set_from_pixbuf (tray_icon, pixbuf); g_object_unref (pixbuf); - return TRUE; + if (tray_blink_countdown <= 0) + tray_blink_id = -1; + + return tray_blink_countdown > 0; } @@ -1536,8 +1541,10 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, open_alarm_dialog (tray_data); gtk_window_stick (GTK_WINDOW (alarm_notifications_dialog->dialog)); } else { - if (tray_blink_id == -1) + if (tray_blink_id == -1) { + tray_blink_countdown = 30; tray_blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data); + } } } -- cgit v1.2.3 From 7ade227e6409c98a4010992450e111cf7bb10520 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 14 Aug 2008 20:19:12 +0000 Subject: Merge revisions 35951:35992 from trunk. svn path=/branches/kill-bonobo/; revision=35994 --- calendar/gui/alarm-notify/alarm-queue.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 219dfdc82d..720a757eed 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -35,7 +35,6 @@ #include #include -#include #include #include @@ -1384,19 +1383,18 @@ static gboolean tray_icon_blink_cb (gpointer data) { static gboolean tray_blink_state = FALSE; - GdkPixbuf *pixbuf; + const gchar *icon_name; tray_blink_countdown--; tray_blink_state = !tray_blink_state; - pixbuf = e_icon_factory_get_icon ((tray_blink_state || tray_blink_countdown <= 0)? - "stock_appointment-reminder-excl" : - "stock_appointment-reminder", - E_ICON_SIZE_LARGE_TOOLBAR); + if (tray_blink_state || tray_blink_countdown <= 0) + icon_name = "stock_appointment-reminder-excl"; + else + icon_name = "stock_appointment-reminder"; if (tray_icon) - gtk_status_icon_set_from_pixbuf (tray_icon, pixbuf); - g_object_unref (pixbuf); + gtk_status_icon_set_from_icon_name (tray_icon, icon_name); if (tray_blink_countdown <= 0) tray_blink_id = -1; @@ -1480,7 +1478,8 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, /* create the tray icon */ if (tray_icon == NULL) { tray_icon = gtk_status_icon_new (); - gtk_status_icon_set_from_pixbuf (tray_icon, e_icon_factory_get_icon ("stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR)); + gtk_status_icon_set_from_icon_name ( + tray_icon, "stock_appointment-reminder"); g_signal_connect (G_OBJECT (tray_icon), "activate", G_CALLBACK (icon_activated), NULL); g_signal_connect (G_OBJECT (tray_icon), "popup-menu", -- cgit v1.2.3 From b2cda1d0c6d44f53f71bad9e256f41188677dfba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 1 Oct 2008 20:56:04 +0000 Subject: Merge revisions 36016:36533 from trunk. svn path=/branches/kill-bonobo/; revision=36534 --- calendar/gui/alarm-notify/alarm-queue.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 720a757eed..f320ccc42b 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1,21 +1,25 @@ -/* Evolution calendar - Alarm queueing engine - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - * Authors: Federico Mena-Quintero +/* + * Alarm queueing engine * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Authors: + * Federico Mena-Quintero + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -926,7 +930,7 @@ edit_component (ECal *client, ECalComponent *comp) 0, NULL, &ev); if (BONOBO_EX (&ev)) { - e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev)); + e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev), NULL); CORBA_exception_free (&ev); return; } @@ -943,7 +947,7 @@ edit_component (ECal *client, ECalComponent *comp) GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (char *) uid, corba_type, &ev); if (BONOBO_EX (&ev)) - e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev)); + e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev), NULL); CORBA_exception_free (&ev); -- cgit v1.2.3 From e89232e97e2e4a1e7e084ea32f9a078754e8ebfc Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 31 Oct 2008 16:53:15 +0000 Subject: Get composer integration working with the rest of the modules, but man do we have circular dependencies all over the place! Big house of cards. svn path=/branches/kill-bonobo/; revision=36706 --- calendar/gui/alarm-notify/alarm-queue.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index f320ccc42b..ad0abaa0e0 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -910,6 +910,7 @@ create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins) static void edit_component (ECal *client, ECalComponent *comp) { +#if 0 /* KILL-BONOBO */ const char *uid; const char *uri; ECalSourceType source_type; @@ -953,6 +954,7 @@ edit_component (ECal *client, ECalComponent *comp) /* Get rid of the factory */ bonobo_object_release_unref (factory, NULL); +#endif } typedef struct { -- cgit v1.2.3 From 4f4615a46d5ba518c1e6a0c2412b1edf1e268d99 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 24 Nov 2008 05:14:44 +0000 Subject: Merge revisions 36737:36810 from trunk. svn path=/branches/kill-bonobo/; revision=36811 --- calendar/gui/alarm-notify/alarm-queue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index ad0abaa0e0..062c3acab5 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1250,6 +1250,13 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) break; + case ALARM_NOTIFY_DISMISS: + if (alarm_notifications_dialog) { + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); + gtk_list_store_remove (GTK_LIST_STORE (model), &tray_data->iter); + } + break; + case ALARM_NOTIFY_CLOSE: d(printf("%s:%d (notify_dialog_cb) - Dialog close\n",__FILE__, __LINE__)); if (alarm_notifications_dialog) { @@ -1270,7 +1277,7 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) /* Task to remove the tray icons */ tray_list_remove_icons (); - } + } break; -- cgit v1.2.3 From c7d3c9f95609123035ebaa267f9d2e6ecfa8c2e8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 12 Jan 2009 04:12:01 +0000 Subject: Merge revisions 36866:37046 from trunk. svn path=/branches/kill-bonobo/; revision=37050 --- calendar/gui/alarm-notify/alarm-queue.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 062c3acab5..77a5574157 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include #include @@ -991,7 +989,7 @@ free_tray_icon_data (TrayIconData *tray_data) } if (tray_data->location){ - g_free (tray_data->description); + g_free (tray_data->location); tray_data->location = NULL; } -- cgit v1.2.3 From f7e298665b02f72890c6681e6d21ef5601beccbb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 15 Feb 2009 03:27:31 +0000 Subject: Merge revisions 37200:3266 from trunk. svn path=/branches/kill-bonobo/; revision=37270 --- calendar/gui/alarm-notify/alarm-queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 77a5574157..bb7508fbcd 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -57,7 +57,7 @@ -#define d(x) x +#define d(x) /* The dialog with alarm nofications */ static AlarmNotificationsDialog *alarm_notifications_dialog = NULL; @@ -477,7 +477,7 @@ add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms) ECalComponentAlarmInstance *instance; gpointer alarm_id; QueuedAlarm *qa; - time_t tnow = time(NULL); + d(time_t tnow = time(NULL)); instance = l->data; -- cgit v1.2.3 From 5f55aba5b052fb7284973f50009f8b369334d084 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 1 May 2009 06:44:36 -0400 Subject: Merge in changes from master. --- calendar/gui/alarm-notify/alarm-queue.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 531cc115cd..0328743a77 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -55,10 +55,6 @@ #include "e-util/e-popup.h" #include "e-util/e-error.h" -#if !GTK_CHECK_VERSION(2,16,0) -#define gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip -#endif - #define d(x) /* The dialog with alarm nofications */ -- cgit v1.2.3 From a538f3f3100dbdbae1ea172ae3b8344e650d529d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 16 May 2009 12:11:55 -0400 Subject: Fix several types of pedantic compiler warnings. --- calendar/gui/alarm-notify/alarm-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 17c743126a..91554a56c1 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1542,7 +1542,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, g_signal_connect (G_OBJECT (tray_data->query), "objects_removed", G_CALLBACK (on_dialog_objs_removed_cb), tray_data); - // FIXME: We should remove this check + /* FIXME: We should remove this check */ if (!config_data_get_notify_with_tray ()) { tray_blink_id = -1; open_alarm_dialog (tray_data); -- cgit v1.2.3 From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 May 2009 23:21:02 -0400 Subject: Remove trailing whitespace, again. --- calendar/gui/alarm-notify/alarm-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 887cf7f249..c293bf74a8 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see + * License along with the program; if not, see * * * Authors: -- cgit v1.2.3 From 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 10:29:19 -0400 Subject: Prefer GLib basic types over C types. --- calendar/gui/alarm-notify/alarm-queue.c | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 51aad370d6..cf95c2106a 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -76,8 +76,8 @@ static GList *tray_icons_list = NULL; /* Top Tray Image */ static GtkStatusIcon *tray_icon = NULL; -static int tray_blink_id = -1; -static int tray_blink_countdown = 0; +static gint tray_blink_id = -1; +static gint tray_blink_countdown = 0; static AlarmNotify *an; /* Structure that stores a client we are monitoring */ @@ -520,7 +520,7 @@ add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms) static void load_alarms (ClientAlarms *ca, time_t start, time_t end) { - char *str_query, *iso_start, *iso_end; + gchar *str_query, *iso_start, *iso_end; d(printf("%s:%d (load_alarms) \n",__FILE__, __LINE__)); @@ -875,7 +875,7 @@ query_objects_removed_cb (ECal *client, GList *objects, gpointer data) * compued with respect to the current time. */ static void -create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins) +create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, gint snooze_mins) { QueuedAlarm *orig_qa; time_t t; @@ -905,8 +905,8 @@ static void edit_component (ECal *client, ECalComponent *comp) { #if 0 /* KILL-BONOBO */ - const char *uid; - const char *uri; + const gchar *uid; + const gchar *uri; ECalSourceType source_type; CORBA_Environment ev; GNOME_Evolution_Calendar_CompEditorFactory factory; @@ -939,7 +939,7 @@ edit_component (ECal *client, ECalComponent *comp) corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT; } - GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (char *) uid, corba_type, &ev); + GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (gchar *) uid, corba_type, &ev); if (BONOBO_EX (&ev)) e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev), NULL); @@ -952,9 +952,9 @@ edit_component (ECal *client, ECalComponent *comp) } typedef struct { - char *summary; - char *description; - char *location; + gchar *summary; + gchar *description; + gchar *location; gboolean blink_state; gboolean snooze_set; gint blink_id; @@ -1011,7 +1011,7 @@ free_tray_icon_data (TrayIconData *tray_data) static void on_dialog_objs_removed_async (struct _query_msg *msg) { - const char *our_uid; + const gchar *our_uid; GList *l; TrayIconData *tray_data; ECal *client; @@ -1027,7 +1027,7 @@ on_dialog_objs_removed_async (struct _query_msg *msg) g_return_if_fail (our_uid && *our_uid); for (l = objects; l != NULL; l = l->next) { - const char *uid = l->data; + const gchar *uid = l->data; if (!uid) continue; @@ -1199,7 +1199,7 @@ tray_list_remove_data (TrayIconData *data) } static void -notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) +notify_dialog_cb (AlarmNotifyResult result, gint snooze_mins, gpointer data) { TrayIconData *tray_data = data; @@ -1439,11 +1439,11 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, { QueuedAlarm *qa; ECalComponent *comp; - const char *summary, *description, *location; + const gchar *summary, *description, *location; TrayIconData *tray_data; ECalComponentText text; GSList *text_list; - char *str, *start_str, *end_str, *alarm_str, *time_str; + gchar *str, *start_str, *end_str, *alarm_str, *time_str; icaltimezone *current_zone; ECalComponentOrganizer organiser; @@ -1523,7 +1523,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, tray_list_add_new (tray_data); if (g_list_length (tray_icons_list) > 1) { - char *tip; + gchar *tip; tip = g_strdup_printf (_("You have %d alarms"), g_list_length (tray_icons_list)); gtk_status_icon_set_tooltip_text (tray_icon, tip); @@ -1561,13 +1561,13 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, { QueuedAlarm *qa; ECalComponent *comp; - const char *summary, *location; + const gchar *summary, *location; ECalComponentText text; - char *str, *start_str, *end_str, *alarm_str, *time_str; + gchar *str, *start_str, *end_str, *alarm_str, *time_str; icaltimezone *current_zone; ECalComponentOrganizer organiser; NotifyNotification *n; - char *body; + gchar *body; d(printf("%s:%d (popup_notification)\n",__FILE__, __LINE__)); @@ -1654,7 +1654,7 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, e_cal_component_alarm_free (alarm); if (attach && icalattach_get_is_url (attach)) { - const char *url; + const gchar *url; url = icalattach_get_url (attach); @@ -1704,11 +1704,11 @@ mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id) /* Performs notification of a procedure alarm */ static gboolean -procedure_notification_dialog (const char *cmd, const char *url) +procedure_notification_dialog (const gchar *cmd, const gchar *url) { GtkWidget *dialog, *label, *checkbox; - char *str; - int btn; + gchar *str; + gint btn; d(printf("%s:%d (procedure_notification_dialog)\n",__FILE__, __LINE__)); @@ -1757,8 +1757,8 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id ECalComponentAlarm *alarm; ECalComponentText description; icalattach *attach; - const char *url; - char *cmd; + const gchar *url; + gchar *cmd; gboolean result = TRUE; d(printf("%s:%d (procedure_notification)\n",__FILE__, __LINE__)); @@ -1791,12 +1791,12 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id if (description.value) cmd = g_strconcat (url, " ", description.value, NULL); else - cmd = (char *) url; + cmd = (gchar *) url; if (procedure_notification_dialog (cmd, url)) result = g_spawn_command_line_async (cmd, NULL); - if (cmd != (char *) url) + if (cmd != (gchar *) url) g_free (cmd); icalattach_unref (attach); @@ -2170,7 +2170,7 @@ update_cqa (CompQueuedAlarms *cqa, ECalComponent *newcomp) /* Update auids in Queued Alarms*/ for (qa_list = cqa->queued_alarms; qa_list; qa_list = qa_list->next) { QueuedAlarm *qa = qa_list->data; - char *check_auid = (char *) qa->instance->auid; + gchar *check_auid = (gchar *) qa->instance->auid; ECalComponentAlarm *alarm; alarm = e_cal_component_get_alarm (newcomp, check_auid); @@ -2209,7 +2209,7 @@ update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) for (instance_list = alarms->alarms; instance_list; instance_list = instance_list->next) { al_inst = instance_list->data; if (al_inst->trigger == qa->orig_trigger) { /* FIXME if two or more alarm instances (audio, note) for same component have same trigger */ - g_free ((char *) qa->instance->auid); + g_free ((gchar *) qa->instance->auid); qa->instance->auid = g_strdup (al_inst->auid); break; } -- cgit v1.2.3 From 14f8eee012382f04090ea9277e9567d5f32e8bf0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 28 May 2009 13:06:29 -0400 Subject: Whitespace cleanup. --- calendar/gui/alarm-notify/alarm-queue.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index cf95c2106a..d5fd1afdfb 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1461,7 +1461,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, if (text.value) summary = text.value; else - summary = _("No summary available."); + summary = _("No summary available."); e_cal_component_get_description_list (comp, &text_list); @@ -1480,7 +1480,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, e_cal_component_get_location (comp, &location); if (!location) - location = _("No location information available."); + location = _("No location information available."); /* create the tray icon */ if (tray_icon == NULL) { @@ -1557,7 +1557,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, #ifdef HAVE_LIBNOTIFY static void popup_notification (time_t trigger, CompQueuedAlarms *cqa, - gpointer alarm_id, gboolean use_description) + gpointer alarm_id, gboolean use_description) { QueuedAlarm *qa; ECalComponent *comp; @@ -1586,7 +1586,7 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, if (text.value) summary = text.value; else - summary = _("No summary available."); + summary = _("No summary available."); e_cal_component_get_location (comp, &location); @@ -2051,8 +2051,8 @@ remove_comp_by_id (gpointer key, gpointer value, gpointer userdata) { d(printf("%s:%d (remove_comp_by_id)\n",__FILE__, __LINE__)); -/* if (!g_hash_table_size (ca->uid_alarms_hash)) */ -/* return; */ +/* if (!g_hash_table_size (ca->uid_alarms_hash)) */ +/* return; */ remove_cqa (ca, (ECalComponentId *)key, (CompQueuedAlarms *) value); @@ -2208,7 +2208,7 @@ update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) d(printf("%s:%d (update_qa)\n",__FILE__, __LINE__)); for (instance_list = alarms->alarms; instance_list; instance_list = instance_list->next) { al_inst = instance_list->data; - if (al_inst->trigger == qa->orig_trigger) { /* FIXME if two or more alarm instances (audio, note) for same component have same trigger */ + if (al_inst->trigger == qa->orig_trigger) { /* FIXME if two or more alarm instances (audio, note) for same component have same trigger */ g_free ((gchar *) qa->instance->auid); qa->instance->auid = g_strdup (al_inst->auid); break; -- cgit v1.2.3 From 433eac7844481b8ceda0bae8bf08f6bb623185b0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 1 Jun 2009 19:09:19 -0400 Subject: More code cleanup. --- calendar/gui/alarm-notify/alarm-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index d5fd1afdfb..e4aca02699 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1638,7 +1638,7 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, ECalComponent *comp; ECalComponentAlarm *alarm; icalattach *attach; - int flag = 0; + gint flag = 0; d(printf("%s:%d (audio_notification)\n",__FILE__, __LINE__)); -- cgit v1.2.3 From 374bd42f69aca2e132fd854c9619f3d7491f1f96 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 12 Jul 2009 23:33:07 -0400 Subject: Fix excessive whitespace. --- calendar/gui/alarm-notify/alarm-queue.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index e4aca02699..052340fbca 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -39,7 +39,6 @@ #include #include - #ifdef HAVE_LIBNOTIFY #include #endif @@ -1347,8 +1346,6 @@ tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_da g_source_remove (tray_blink_id); tray_blink_id = -1; - - gtk_status_icon_set_visible (tray_icon, FALSE); g_object_unref (tray_icon); tray_icon = NULL; @@ -1409,7 +1406,6 @@ tray_icon_blink_cb (gpointer data) return tray_blink_countdown > 0; } - /* Add a new data to tray list */ static void @@ -1582,7 +1578,6 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, e_cal_component_get_summary (comp, &text); e_cal_component_get_organizer (comp, &organiser); - if (text.value) summary = text.value; else @@ -1625,7 +1620,6 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, g_free (time_str); g_free (str); - } #endif @@ -2059,7 +2053,6 @@ remove_comp_by_id (gpointer key, gpointer value, gpointer userdata) { return TRUE; } - /* Removes all the alarms queued for a particular calendar client */ static void remove_client_alarms (ClientAlarms *ca) -- cgit v1.2.3 From fa360fde289f9b850191f89059d1a5e6d67c07c7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 18 Jul 2009 14:07:42 -0400 Subject: More whitespace cleanup. --- calendar/gui/alarm-notify/alarm-queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 052340fbca..e7fbdc7090 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -973,17 +973,17 @@ free_tray_icon_data (TrayIconData *tray_data) { g_return_if_fail (tray_data != NULL); - if (tray_data->summary){ + if (tray_data->summary) { g_free (tray_data->summary); tray_data->summary = NULL; } - if (tray_data->description){ + if (tray_data->description) { g_free (tray_data->description); tray_data->description = NULL; } - if (tray_data->location){ + if (tray_data->location) { g_free (tray_data->location); tray_data->location = NULL; } @@ -1130,7 +1130,7 @@ tray_list_remove_async (Message *msg) TrayIconData *tray_data = list->data; - if (!tray_data->snooze_set){ + if (!tray_data->snooze_set) { GList *temp = list->next; gboolean status; -- cgit v1.2.3 From fe2f720c14d3f39ca6694f1b56b7f4e8121e732b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 27 Jul 2009 17:06:20 +0200 Subject: Bug #579646 - Remember alarm's last notified per calendar --- calendar/gui/alarm-notify/alarm-queue.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index e7fbdc7090..b500d8cd89 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -61,12 +61,6 @@ static AlarmNotificationsDialog *alarm_notifications_dialog = NULL; /* Whether the queueing system has been initialized */ static gboolean alarm_queue_inited = FALSE; -/* When the alarm queue system is inited, this gets set to the last time an - * alarm notification was issued. This lets us present any notifications that - * should have happened while the alarm daemon was not running. - */ -static time_t saved_notification_time; - /* Clients we are monitoring for alarms */ static GHashTable *client_alarms_hash = NULL; @@ -395,9 +389,8 @@ alarm_trigger_cb (gpointer alarm_id, time_t trigger, gpointer data) cqa = data; comp = cqa->alarms->comp; - config_data_set_last_notification_time (trigger); + config_data_set_last_notification_time (cqa->parent_client->client, trigger); d(printf("%s:%d (alarm_trigger_cb) - Setting Last notification time to %s\n",__FILE__, __LINE__, ctime (&trigger))); - saved_notification_time = trigger; qa = lookup_queued_alarm (cqa, alarm_id); if (!qa) @@ -577,11 +570,11 @@ load_alarms_for_today (ClientAlarms *ca) day_start = time_day_begin_with_zone (now, zone); /* Make sure we don't miss some events from the last notification. - * We add 1 to the saved_notification_time to make the time ranges + * We add 1 to the saved notification time to make the time ranges * half-open; we do not want to display the "last" displayed alarm * twice, once when it occurs and once when the alarm daemon restarts. */ - from = MAX (config_data_get_last_notification_time () + 1, day_start); + from = MAX (config_data_get_last_notification_time (ca->client) + 1, day_start); day_end = time_day_end_with_zone (now, zone); d(printf("%s:%d (load_alarms_for_today) - From %s to %s\n",__FILE__, __LINE__, ctime (&from), ctime(&day_end))); @@ -713,7 +706,7 @@ query_objects_changed_async (struct _query_msg *msg) ca = msg->data; objects = msg->objects; - from = config_data_get_last_notification_time (); + from = config_data_get_last_notification_time (client); if (from == -1) from = time (NULL); else @@ -1847,11 +1840,10 @@ alarm_queue_init (gpointer data) client_alarms_hash = g_hash_table_new (g_direct_hash, g_direct_equal); queue_midnight_refresh (); - saved_notification_time = config_data_get_last_notification_time (); - if (saved_notification_time == -1) { - saved_notification_time = time (NULL); - d(printf("%s:%d (alarm_queue_init) - Setting last notification time to %s\n",__FILE__, __LINE__, ctime(&saved_notification_time))); - config_data_set_last_notification_time (saved_notification_time); + if (config_data_get_last_notification_time (NULL) == -1) { + time_t tmval = time (NULL); + d(printf("%s:%d (alarm_queue_init) - Setting last notification time to %s\n",__FILE__, __LINE__, ctime(&tmval))); + config_data_set_last_notification_time (NULL, tmval); } /* install timeout handler (every 30 mins) for not missing the midnight refresh */ -- cgit v1.2.3 From b5725a7a07acdd5231125adb70b519e4dcde08c2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 22 Aug 2009 20:20:08 -0400 Subject: Kill EPopup. --- calendar/gui/alarm-notify/alarm-queue.c | 1 - 1 file changed, 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index b500d8cd89..1aaca186ca 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -50,7 +50,6 @@ #include "alarm-notify.h" #include "config-data.h" #include "util.h" -#include "e-util/e-popup.h" #include "e-util/e-error.h" #define d(x) -- cgit v1.2.3 From ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976 Mon Sep 17 00:00:00 2001 From: "H.Habighorst" Date: Sun, 23 Aug 2009 08:31:14 -0400 Subject: Bug 571488 - Migrate from deprecated gnome_sound to libcanberra --- calendar/gui/alarm-notify/alarm-queue.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 1aaca186ca..8d272764bd 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -1641,13 +1641,23 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, if (attach && icalattach_get_is_url (attach)) { const gchar *url; + gchar *filename; + GError *error = NULL; url = icalattach_get_url (attach); + filename = g_filename_from_uri (url, NULL, &error); - if (url && *url && g_file_test (url, G_FILE_TEST_EXISTS)) { + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } else if (g_file_test (filename, G_FILE_TEST_EXISTS)) { flag = 1; - gnome_sound_play (url); /* this sucks */ + ca_context_play ( + ca_gtk_context_get(), 0, + CA_PROP_MEDIA_FILENAME, filename, NULL); } + + g_free (filename); } if (!flag) -- cgit v1.2.3 From 0f7f4cfe38b3c4cd83efbe9922ae15c5aee00317 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Aug 2009 00:48:57 -0400 Subject: Coding style and whitespace cleanup. --- calendar/gui/alarm-notify/alarm-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify/alarm-queue.c') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 8d272764bd..ef6e77d386 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -1654,7 +1654,7 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, flag = 1; ca_context_play ( ca_gtk_context_get(), 0, - CA_PROP_MEDIA_FILENAME, filename, NULL); + CA_PROP_MEDIA_FILENAME, filename, NULL); } g_free (filename); -- cgit v1.2.3