2007-06-05 Murray Cumming <murrayc@murrayc.com>modest/trunk] > more ChangeLog2
[modest] / src / maemo / modest-platform.c
index f3a66bb..4a6a6a3 100644 (file)
@@ -65,7 +65,8 @@ on_modest_conf_update_interval_changed (ModestConf* self, const gchar *key,
 gboolean
 modest_platform_init (void)
 {
-       osso_hw_state_t hw_state = { 0 };       
+       osso_hw_state_t hw_state = { 0 };
+       DBusConnection *con;    
        osso_context =
                osso_initialize(PACKAGE,PACKAGE_VERSION,
                                FALSE, NULL);   
@@ -74,6 +75,21 @@ modest_platform_init (void)
                return FALSE;
        }
 
+       if ((con = osso_get_dbus_connection (osso_context)) == NULL) {
+               g_printerr ("Could not get dbus connection\n");
+               return FALSE;
+
+       }
+
+       if (!dbus_connection_add_filter (con,
+                                        modest_dbus_req_filter,
+                                        NULL,
+                                        NULL)) {
+
+               g_printerr ("Could not add dbus filter\n");
+               return FALSE;
+       }
+
        /* Register our D-Bus callbacks, via the osso API: */
        osso_return_t result = osso_rpc_set_cb_f(osso_context, 
                                MODEST_DBUS_SERVICE, 
@@ -651,12 +667,8 @@ gboolean modest_platform_connect_and_wait (GtkWindow *parent_window)
        if (tny_device_is_online (device))
                return TRUE;
                
-       /* TODO: Block on the result: */
-       gboolean request_sent = tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (device), NULL);
-       if (!request_sent)
-               return FALSE;
-
-       return TRUE;
+       /* This blocks on the result: */
+       return tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (device), NULL);
 }
 
 void
@@ -791,7 +803,11 @@ modest_platform_show_help (GtkWindow *parent_window,
        g_return_if_fail (osso_context);
 
        /* Show help */
+#ifdef MODEST_HILDON_VERSION_0
        result = ossohelp_show (osso_context, help_id, OSSO_HELP_SHOW_DIALOG);
+#else
+       result = hildon_help_show (osso_context, help_id, OSSO_HELP_SHOW_DIALOG);
+#endif
 
        if (result != OSSO_OK) {
                gchar *error_msg;