PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9, hildon1=yes, hildon1=no)
if test "$hildon1" == "yes"; then # the 'new' hildon
- PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-1 libosso libhildonmime osso-addressbook-1.0 wpeditor hildon-help libebook-1.2 libalarm)
+ PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-1 libosso libhildonmime osso-addressbook-1.0 wpeditor hildon-help libebook-1.2 libalarm hildon-notify libnotify)
else # the old hildon
- PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-libs >= 0.12.0 libosso libossomime libossohelp osso-addressbook-1.0 libwpeditor-plus libebook-1.2 libalarm gnome-vfs-module-2.0)
+ PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_MAEMO, conic libtinymail-maemo-1.0 hildon-libs >= 0.12.0 libosso libossomime libossohelp osso-addressbook-1.0 libwpeditor-plus libebook-1.2 libalarm gnome-vfs-module-2.0 hildon-notify libnotify)
AC_DEFINE_UNQUOTED(MODEST_HILDON_VERSION_0, 1, ["The Hildon version we support."])
fi
# gnome frontend
AC_MSG_ERROR([Sorry, the GNOME Frontend is currently not working])
- PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10)
+ PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify)
AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS)
AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)
AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."])
#include <gtk/gtkmenuitem.h>
#include <gtk/gtkmain.h>
#include <string.h>
-
+#include <hildon/hildon-notification.h>
#define HILDON_OSSO_URI_ACTION "uri-action"
void
modest_platform_on_new_msg (void)
{
- /* TODO: play sound SR-SND-18 */
- /* TODO: LED lightning pattern */
- /* TODO: update the application icon in the task navigator */
- g_print ("--------------- NEW MESSAGE ARRIVED ---------------\n");
+ HildonNotification *not;
+
+ /* Create a new notification. FIXME put the right values, need
+ some more specs */
+ not = hildon_notification_new ("Summary",
+ "Description",
+ "qgn_contact_group_chat_invitation",
+ "system.note.dialog");
+
+ /* Play sound SR-SND-18. TODO: play the right file */
+/* hildon_notification_set_sound (not, "/usr/share/sounds/ui-battery_low.wav"); */
+
+ /* Set the led pattern */
+ notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (not), "led-pattern", 3);
+
+ /* Notify. We need to do this in an idle because this function
+ could be called from a thread */
+ if (!notify_notification_show (NOTIFY_NOTIFICATION (not), NULL))
+ g_error ("Failed to send notification");
+
+ g_object_unref (not);
}
#include <modest-icon-names.h>
#include "widgets/modest-global-settings-dialog.h"
#include "modest-tny-msg.h"
+#ifdef MODEST_PLATFORM_MAEMO
+#include <hildon/hildon-notification.h>
+#else
+#include <libnotify/notify.h>
+#endif
static gboolean init_header_columns (ModestConf *conf, gboolean overwrite);
static gboolean init_default_account_maybe (ModestAccountMgr *acc_mgr);
g_set_application_name (modest_platform_get_app_name());
/* g_message (modest_platform_get_app_name()); */
+ /* Init stock icons */
init_stock_icons ();
+
+ /* Init notification system */
+ notify_init ("Basics");
+
return TRUE;
}
return FALSE;
}
+static gboolean
+idle_notify_added_headers (gpointer data)
+{
+ modest_platform_on_new_msg ();
+
+ return FALSE;
+}
+
static void
folder_monitor_update (TnyFolderObserver *self,
TnyFolderChange *change)
changed = tny_folder_change_get_changed (change);
- if (changed & TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS) {
-/* TnyIterator *iter; */
-/* TnyList *list; */
-/* /\* The added headers *\/ */
-/* list = tny_simple_list_new (); */
-/* tny_folder_change_get_added_headers (change, list); */
-/* iter = tny_list_create_iterator (list); */
-/* while (!tny_iterator_is_done (iter)) */
-/* { */
-/* TnyHeader *header = TNY_HEADER (tny_iterator_get_current (iter)); */
-/* g_object_unref (G_OBJECT (header)); */
-/* tny_iterator_next (iter); */
-/* } */
-/* g_object_unref (G_OBJECT (iter)); */
-/* g_object_unref (G_OBJECT (list)); */
- modest_platform_on_new_msg ();
- }
+ /* We need an idle because this function is called from within
+ a thread, so it could cause problems if the modest platform
+ code calls dbus for example */
+ if (changed & TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS)
+ g_idle_add (idle_notify_added_headers, NULL);
g_mutex_unlock (priv->observers_lock);
}