aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm-notify.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-11-24 23:28:11 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-11-24 23:28:11 +0800
commit25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b (patch)
tree47828615efb7cefb23ca816cda38a35423cc5697 /calendar/gui/alarm-notify/alarm-notify.c
parent9c0eef3dd90ab8e7db04901b3079e097cdd7f400 (diff)
downloadgsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar.gz
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar.bz2
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar.lz
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar.xz
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.tar.zst
gsoc2013-evolution-25d053c312af01acc9cb2ba1672f3f7ed4ea5e8b.zip
Changes for alarm notification bubble
svn path=/trunk/; revision=30661
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-notify.c')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index a74908bb2c..edef6d34bb 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -33,7 +33,6 @@
#include "config-data.h"
#include "common/authentication.h"
-
/* Private part of the AlarmNotify structure */
struct _AlarmNotifyPrivate {
/* Mapping from EUri's to LoadedClient structures */
@@ -41,6 +40,7 @@ struct _AlarmNotifyPrivate {
just need to hash based on source */
GHashTable *uri_client_hash [E_CAL_SOURCE_TYPE_LAST];
ESourceList *source_lists [E_CAL_SOURCE_TYPE_LAST];
+ ESourceList *selected_calendars;
GMutex *mutex;
};
@@ -54,7 +54,6 @@ static void alarm_notify_finalize (GObject *object);
static BonoboObjectClass *parent_class;
-
BONOBO_TYPE_FUNC_FULL(AlarmNotify, GNOME_Evolution_Calendar_AlarmNotify, BONOBO_TYPE_OBJECT, alarm_notify)
/* Class initialization function for the alarm notify service */
@@ -140,6 +139,10 @@ list_changed_cb (ESourceList *source_list, gpointer data)
for (q = sources; q != NULL; q = q->next) {
ESource *source = E_SOURCE (q->data);
char *uri;
+ const char *uid = e_source_peek_uid (source);
+
+ if (!e_source_list_peek_source_by_uid (priv->selected_calendars, uid))
+ continue;
uri = e_source_get_uri (source);
if (!g_hash_table_lookup (priv->uri_client_hash[source_type], uri)) {
@@ -163,6 +166,11 @@ list_changed_cb (ESourceList *source_list, gpointer data)
g_list_free (prd.removals);
}
+ESourceList *
+alarm_notify_get_selected_calendars (AlarmNotify *an)
+{
+ return an->priv->selected_calendars;
+}
static void
load_calendars (AlarmNotify *an, ECalSourceType source_type)
{
@@ -187,6 +195,10 @@ load_calendars (AlarmNotify *an, ECalSourceType source_type)
for (q = sources; q != NULL; q = q->next) {
ESource *source = E_SOURCE (q->data);
char *uri;
+ const char *uid = e_source_peek_uid (source);
+
+ if (!e_source_list_peek_source_by_uid (priv->selected_calendars, uid))
+ continue;
uri = e_source_get_uri (source);
g_message ("Loading %s", uri);
@@ -224,11 +236,13 @@ alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass)
priv = g_new0 (AlarmNotifyPrivate, 1);
an->priv = priv;
priv->mutex = g_mutex_new ();
+ priv->selected_calendars = config_data_get_calendars ("/apps/evolution/calendar/notify/calendars");
+
for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++)
priv->uri_client_hash[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
- alarm_queue_init ();
+ alarm_queue_init (an);
for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++)
load_calendars (an, i);
@@ -344,6 +358,7 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource
if (g_hash_table_lookup (priv->uri_client_hash[source_type], str_uri)) {
g_mutex_unlock (an->priv->mutex);
g_free (str_uri);
+ g_free (pass_key);
return;
}
/* if loading of this requires password and password is not currently availble in e-password
@@ -356,6 +371,7 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource
g_free (pass_key);
return;
}
+
client = auth_new_cal_from_source (source, source_type);
if (client) {
@@ -363,8 +379,8 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource
g_signal_connect (G_OBJECT (client), "cal_opened", G_CALLBACK (cal_opened_cb), an);
e_cal_open_async (client, FALSE);
}
- g_free (pass_key);
g_free (str_uri);
+ g_free (pass_key);
g_mutex_unlock (an->priv->mutex);
}