aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-04-21 10:35:18 +0800
committerSeth Alves <alves@src.gnome.org>2000-04-21 10:35:18 +0800
commit115bdd59278dbbc2111c88b80be065db72e08528 (patch)
tree25e84e4daab30639c65a30af8be5902779bef2f5 /calendar/gui/gnome-cal.c
parent0ebe18356658bb57a0c69f872a38ceb58259bfe1 (diff)
downloadgsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar.gz
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar.bz2
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar.lz
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar.xz
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.tar.zst
gsoc2013-evolution-115bdd59278dbbc2111c88b80be065db72e08528.zip
new function: callback for listener's object updated signal.
* gui/gnome-cal.c (gnome_calendar_changed_cb): new function: callback for listener's object updated signal. (gnome_calendar_object_removed_cb): new function: callback for listener's object removed signal. (gnome_calendar_new): hook up listener's "obj_updated" and "obj_removed" signals so if evolution is running twice, they will both see changes right away. (gnome_calendar_object_changed): don't call update_all, since it will be called by the listener. (gnome_calendar_remove_object): don't call update_all (gnome_calendar_add_object): don't call update_all svn path=/trunk/; revision=2539
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index ad4c95168d..6229dbf30b 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -238,11 +238,23 @@ gnome_calendar_update_all (GnomeCalendar *cal, iCalObject *object, int flags)
static void
-gnome_calendar_changed_cb (GtkWidget *cal_client,
- const char *uid,
- GnomeCalendar *gcal)
+gnome_calendar_object_updated_cb (GtkWidget *cal_client,
+ const char *uid,
+ GnomeCalendar *gcal)
{
- printf ("gnome-cal: got changed_cb, uid='%s'\n", uid?uid:"<NULL>");
+ printf ("gnome-cal: got object changed_cb, uid='%s'\n",
+ uid?uid:"<NULL>");
+ gnome_calendar_update_all (gcal, NULL, CHANGE_NEW);
+}
+
+
+static void
+gnome_calendar_object_removed_cb (GtkWidget *cal_client,
+ const char *uid,
+ GnomeCalendar *gcal)
+{
+ printf ("gnome-cal: got object removed _cb, uid='%s'\n",
+ uid?uid:"<NULL>");
gnome_calendar_update_all (gcal, NULL, CHANGE_ALL);
}
@@ -262,9 +274,9 @@ gnome_calendar_new (char *title)
setup_widgets (gcal);
gtk_signal_connect (GTK_OBJECT (gcal->client), "obj_updated",
- gnome_calendar_changed_cb, gcal);
+ gnome_calendar_object_updated_cb, gcal);
gtk_signal_connect (GTK_OBJECT (gcal->client), "obj_removed",
- gnome_calendar_changed_cb, gcal);
+ gnome_calendar_object_removed_cb, gcal);
return retval;
}
@@ -361,7 +373,6 @@ gnome_calendar_add_object (GnomeCalendar *gcal, iCalObject *obj)
obj_string = ical_object_to_string (obj);
cal_client_update_object (gcal->client, obj->uid, obj_string);
g_free (obj_string);
- gnome_calendar_update_all (gcal, obj, CHANGE_NEW);
}
void
@@ -373,9 +384,7 @@ gnome_calendar_remove_object (GnomeCalendar *gcal, iCalObject *obj)
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
g_return_if_fail (obj != NULL);
- /* calendar_remove_object (gcal->cal, obj); DELETE */
r = cal_client_remove_object (gcal->client, obj->uid);
- gnome_calendar_update_all (gcal, obj, CHANGE_ALL);
}
void
@@ -389,7 +398,6 @@ gnome_calendar_object_changed (GnomeCalendar *gcal, iCalObject *obj, int flags)
obj_string = ical_object_to_string (obj);
cal_client_update_object (gcal->client, obj->uid, obj_string);
g_free (obj_string);
- gnome_calendar_update_all (gcal, obj, CHANGE_NEW);
}
static int