hernejj

Navigation

Recent site activity

  • Home
    edited by Jason Herne
    attachment from Jason Herne
  • View All

Home

Wondering what this is? Go here: http://hernejj.blogspot.com/2008/11/calling-all-nokia-n800-and-n810-owners.html

Index: Makefile.am

===================================================================
--- Makefile.am    (revision 9730)
+++ Makefile.am    (working copy)
@@ -3,6 +3,7 @@
 
 if HILDON
 DEPS_CFLAGS += -DIS_HILDON
+gpe_calendar_LDFLAGS = -lalarm        # hernejj: HILDON conditional alarm library
 endif
 
 INCLUDES = $(DEPS_CFLAGS) $(HILDON_CFLAGS) $(SERVERDEPS_CFLAGS) -I$(top_srcdir)/gpe -I$(top_srcdir) \
Index: main.c
===================================================================
--- main.c    (revision 9730)
+++ main.c    (working copy)
@@ -42,6 +42,7 @@
 #include <hildon/hildon-window.h>
 #include <hildon/hildon-defines.h>
 #include <hildon/hildon-banner.h>
+#include <alarmd/alarm_event.h>        // hernejj: Alarmd code for Nokia n800
 #else
 #include <hildon-widgets/hildon-app.h>
 #include <hildon-widgets/hildon-appview.h>
@@ -1331,6 +1332,8 @@
     }
 }
 
+//hernejj: This is the OLD alarm_fired function :) 
+#ifndef IS_HILDON
 static void
 alarm_fired (EventDB *edb, Event *ev)
 {
@@ -1343,7 +1346,43 @@
   soundgen_alarm_start();
   gtk_window_present (GTK_WINDOW (alarm_dialog));
 }
+#else
+/*
+  hernejj: This is the new and improved alarm_fired function which will use the
+  maemo alarm framework to fotify the user of the impending event :)
+*/
+static void alarm_fired (EventDB *edb, Event *ev)
+{
+    // Create an alarmd event to fire :)
+    alarm_event_t alarmd_event = {0};
 
+    // Set alarm parameters
+    alarmd_event.snooze=0;                        // System default snooze time
+    alarmd_event.title = event_get_location(ev,NULL);        // Location :)
+    alarmd_event.sound = "/usr/share/sounds/ui-clock_alarm.mp3";    // Alarm sound
+    alarmd_event.message = event_get_summary(ev,NULL);        // Message shows event summary (AND location?)
+    alarmd_event.icon = "/usr/share/pixmaps/bell.png";
+    alarmd_event.flags |= ALARM_EVENT_SHOW_ICON | ALARM_EVENT_RUN_DELAYED;
+    alarmd_event.alarm_time = time(NULL);                // Set alarm fire time to NOW
+
+    // We don't want any dbus actions or executables called :-)
+    alarmd_event.dbus_interface=NULL;
+    alarmd_event.dbus_service=NULL;
+    alarmd_event.dbus_path=NULL;
+    alarmd_event.dbus_name=NULL;
+    alarmd_event.exec_name=NULL;
+
+    // Queue up alarm!
+    alarm_event_add(&alarmd_event);
+
+    // Now ther we've told alarmd about the alarm
+    // we need to 'acknowlege' the alarm within gpe-cal
+    // so it does not refire the alarm later.
+     event_acknowledge (ev, NULL);
+
+}
+#endif
+
 static gboolean
 alarms_process_pending (gpointer data)
 {

Attachments (1)

  • gpe_calendar_maemo_alarm_integration.diff - on Nov 17, 2008 6:20 PM by Jason Herne (version 1)
    2k Download