MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=40
+EXTRA_VERSION=41
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
[ --enable-maemo Build for the Maemo platform [default=no]],
[ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
if test $ac_cv_enable_maemo = yes; then
- PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm, ac_cv_enable_maemo=yes,
+ PKG_CHECK_MODULES(MAEMO, libosso conic hildon-libs hildon-fm, ac_cv_enable_maemo=yes,
ac_cv_enable_maemo=no)
AC_SUBST(MAEMO_CFLAGS)
AC_SUBST(MAEMO_LIBS)
if test $ac_cv_enable_maemo = no; then
- AC_MSG_ERROR(libosso, hildon-libs or hildon-fm not found)
+ AC_MSG_ERROR(libosso, conic, hildon-libs or hildon-fm not found)
else
AC_DEFINE(MAEMO, 1, Build for maemo)
fi
#include "log.h"
#include "hooks.h"
+#ifdef MAEMO
+#include <hildon-widgets/hildon-banner.h>
+#include <conicconnection.h>
+#include <conicconnectionevent.h>
+
+static ConIcConnection *maemo_connection = NULL;
+static gboolean maemo_warned_offline = FALSE;
+#endif
+
static GList *inc_dialog_list = NULL;
static guint inc_lock_count = 0;
g_free(buf);
}
-
+
+#ifdef MAEMO
+static void maemo_connection_event(ConIcConnection *connection,
+ ConIcConnectionEvent *event,
+ gpointer user_data)
+{
+ ConIcConnectionStatus status =
+ con_ic_connection_event_get_status(event);
+ MainWindow *mainwin = (MainWindow *)user_data;
+ switch(status) {
+ case CON_IC_STATUS_CONNECTED:
+ debug_print("we're connected\n");
+ main_window_toggle_work_offline(mainwin, FALSE, FALSE);
+ break;
+ default:
+ debug_print("we're disconnected\n");
+ main_window_toggle_work_offline(mainwin, TRUE, FALSE);
+ maemo_warned_offline = FALSE;
+ break;
+ }
+}
+
+#endif
+
void inc_autocheck_timer_init(MainWindow *mainwin)
{
+#ifdef MAEMO
+ GValue *val = g_new0(GValue, 1);
+ maemo_connection = con_ic_connection_new();
+
+ g_value_init(val, G_TYPE_BOOLEAN);
+ g_value_set_boolean(val, TRUE);
+ g_object_set_property(G_OBJECT(maemo_connection),
+ "automatic-connection-events", val);
+ g_free(val);
+ g_signal_connect (maemo_connection, "connection-event",
+ G_CALLBACK(maemo_connection_event), mainwin);
+ con_ic_connection_connect (maemo_connection,
+ CON_IC_CONNECT_FLAG_AUTOMATICALLY_TRIGGERED);
+ autocheck_data = mainwin;
+#else
autocheck_data = mainwin;
inc_autocheck_timer_set();
+#endif
}
static void inc_autocheck_timer_set_interval(guint interval)
void inc_autocheck_timer_set(void)
{
inc_autocheck_timer_set_interval(prefs_common.autochk_itv * 60000);
+#ifdef MAEMO
+ con_ic_connection_connect (maemo_connection,
+ CON_IC_CONNECT_FLAG_AUTOMATICALLY_TRIGGERED);
+#endif
}
void inc_autocheck_timer_remove(void)
static time_t overridden_no = 0;
int length = 10; /* minutes */
gint answer = G_ALERTDEFAULT;
-
+
+#ifdef MAEMO
+ if (prefs_common.work_offline) {
+ if (force_ask && !maemo_warned_offline) {
+ if (mainwindow_get_mainwindow())
+ hildon_banner_show_information(
+ mainwindow_get_mainwindow()->window,
+ NULL,
+ _("Unable to connect: you are offline."));
+ maemo_warned_offline = TRUE;
+ }
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+#endif
+
if (prefs_common.autochk_newmail)
length = prefs_common.autochk_itv; /* minutes */
#include "log.h"
#include "hooks.h"
+#ifdef MAEMO
+#include <hildon-widgets/hildon-banner.h>
+#endif
+
+
#define BUFFSIZE 1024
static GList *statusbar_list = NULL;
statusbar_puts(statusbar, buf);
}
+#ifdef MAEMO
+static GSList *banner_texts = NULL;
+static GtkWidget *banner = NULL;
+#endif
+
void statusbar_print_all(const gchar *format, ...)
{
va_list args;
for (cur = statusbar_list; cur != NULL; cur = cur->next)
statusbar_puts(GTK_STATUSBAR(cur->data), buf);
+#ifdef MAEMO
+ if (mainwindow_get_mainwindow()) {
+ if (banner == NULL) {
+ banner = hildon_banner_show_animation(
+ mainwindow_get_mainwindow()->window,
+ NULL,
+ buf);
+ g_object_ref(banner);
+ banner_texts = g_slist_prepend(banner_texts, g_strdup(buf));
+ } else {
+ hildon_banner_set_text(HILDON_BANNER(banner), buf);
+ banner_texts = g_slist_prepend(banner_texts, g_strdup(buf));
+ }
+ }
+#endif
}
void statusbar_pop_all(void)
"Standard Output");
gtk_statusbar_pop(GTK_STATUSBAR(cur->data), cid);
}
+#ifdef MAEMO
+ if (banner && banner_texts) {
+ gchar *old_text = (gchar *)banner_texts->data;
+ gchar *prev_text = NULL;
+ banner_texts = g_slist_remove(banner_texts, old_text);
+ g_free(old_text);
+ if (banner_texts) {
+ prev_text = (gchar *)banner_texts->data;
+ hildon_banner_set_text(HILDON_BANNER(banner), prev_text);
+ } else {
+ gtk_widget_destroy(banner);
+ g_object_unref(banner);
+ banner = NULL;
+ }
+ }
+#endif
}
static gboolean statusbar_puts_all_hook (gpointer source, gpointer data)