aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-conduit.c
diff options
context:
space:
mode:
authorEskil Olsen <deity@eskil.dk>1999-11-04 22:20:13 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-11-04 22:20:13 +0800
commitee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1 (patch)
treeb86e053a84983e8604cdb5c7f34d440ad9a477f9 /calendar/gui/calendar-conduit.c
parenta6c4b535334a6da5c8d1622b11a0893d0c55abee (diff)
downloadgsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar.gz
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar.bz2
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar.lz
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar.xz
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.tar.zst
gsoc2013-evolution-ee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1.zip
Uses the PISOCK_LIBDIR, for people with odd install dirs for their
1999-11-04 Eskil Olsen <deity@eskil.dk> * Makefile.am: Uses the PISOCK_LIBDIR, for people with odd install dirs for their pilot-link. Also install a pretty icon for the calendar-conduit. * calendar-conduit-control-applet.c: Modfied the try/revert/ok/cancel scheme to be more intuitive, also uses a GtkOptionMenu for the possible sync methods. * calendar-conduit-control-applet.desktop: use the nice icon... * calendar-conduit.c: Ack, had to define debug_alarms and alarm_default, otherwise they are undefined. Is gncal code messy or is this considered a way of configuring the cal engine ? Implemented delete_all syncabs methods. * calendar-pilot-sync.c: also had to declare debug_alarms and alarm_defaults, just as ugly. svn path=/trunk/; revision=1367
Diffstat (limited to 'calendar/gui/calendar-conduit.c')
-rw-r--r--calendar/gui/calendar-conduit.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/calendar/gui/calendar-conduit.c b/calendar/gui/calendar-conduit.c
index 400824186a..cd2c061023 100644
--- a/calendar/gui/calendar-conduit.c
+++ b/calendar/gui/calendar-conduit.c
@@ -30,6 +30,15 @@
#include "calendar-conduit.h"
+int debug_alarms = 0; /* needed to satisfy some other part of gncal */
+/* Default values for alarms */ /* needed to satisfy some other part of gncal */
+CalendarAlarm alarm_defaults[4] = {
+ { ALARM_MAIL, 0, 15, ALARM_MINUTES },
+ { ALARM_PROGRAM, 0, 15, ALARM_MINUTES },
+ { ALARM_DISPLAY, 0, 15, ALARM_MINUTES },
+ { ALARM_AUDIO, 0, 15, ALARM_MINUTES }
+};
+
GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
void local_record_from_icalobject(GCalLocalRecord *local,iCalObject *obj);
@@ -81,6 +90,7 @@ calendar_notify (time_t time, CalendarAlarm *which, void *data)
static GList *
get_calendar_objects(GnomePilotConduitStandardAbs *conduit,
+ gboolean *status,
GCalConduitContext *ctxt)
{
GList *result;
@@ -96,21 +106,25 @@ get_calendar_objects(GnomePilotConduitStandardAbs *conduit,
INFO ("Object did not exist");
show_exception(&(ctxt->ev));
CORBA_exception_free(&(ctxt->ev));
+ if(status!=NULL) (*status) = FALSE;
return NULL;
} else if(ctxt->ev._major != CORBA_NO_EXCEPTION) {
WARN (_("Error while communicating with calendar server"));
show_exception(&(ctxt->ev));
CORBA_exception_free(&(ctxt->ev));
+ if(status!=NULL) (*status) = FALSE;
return NULL;
}
+ if(status!=NULL) (*status) = TRUE;
if(uids->_length>0) {
int i;
for(i=0;i<uids->_length;i++) {
result = g_list_prepend(result,g_strdup(uids->_buffer[i]));
}
- } else
+ } else {
INFO ("No entries found");
+ }
CORBA_free(uids);
@@ -705,7 +719,7 @@ iterate (GnomePilotConduitStandardAbs *conduit,
if(*local==NULL) {
LOG ("beginning iteration");
- events = get_calendar_objects(conduit,ctxt);
+ events = get_calendar_objects(conduit,NULL,ctxt);
hest = 0;
if(events!=NULL) {
@@ -938,8 +952,32 @@ static gint
delete_all (GnomePilotConduitStandardAbs *conduit,
GCalConduitContext *ctxt)
{
- LOG ("entering delete_all");
+ GList *events,*it;
+ gboolean error;
+ events = get_calendar_objects(conduit,&error,ctxt);
+
+ if (error == FALSE) return -1;
+ for (it=events;it;it = g_slist_next(it)) {
+ GNOME_Calendar_Repository_delete_object(ctxt->calendar,
+ it->data,
+ &(ctxt->ev));
+ if (ctxt->ev._major == CORBA_USER_EXCEPTION){
+ INFO ("Object did not exist");
+ show_exception(&(ctxt->ev));
+ CORBA_exception_free(&(ctxt->ev));
+ } else if(ctxt->ev._major != CORBA_NO_EXCEPTION) {
+ WARN (_("Error while communicating with calendar server"));
+ show_exception(&(ctxt->ev));
+ CORBA_exception_free(&(ctxt->ev));
+ /* destroy loop, free data */
+ for (it=events;it;it = g_slist_next(it)) g_free(it->data);
+ g_slist_free(events);
+ return -1;
+ }
+ g_free(it->data);
+ }
+ g_slist_free(events);
return -1;
}