* Fixes NB#86171, show the proper error banner when account could not connect due...
[modest] / src / maemo / modest-maemo-global-settings-dialog.c
index ad4e4c5..48c96bf 100644 (file)
@@ -217,7 +217,11 @@ modest_maemo_global_settings_dialog_init (ModestMaemoGlobalSettingsDialog *self)
 
        ppriv->updating_page = create_updating_page (self);
        ppriv->composing_page = create_composing_page (self);
-    
+
+       /* Add the buttons: */
+       gtk_dialog_add_button (GTK_DIALOG (self), _("mcen_bd_dialog_ok"), GTK_RESPONSE_OK);
+       gtk_dialog_add_button (GTK_DIALOG (self), _("mcen_bd_dialog_cancel"), GTK_RESPONSE_CANCEL);
+
        /* Set the default focusable widgets */
        g_object_set_data (G_OBJECT(ppriv->updating_page), DEFAULT_FOCUS_WIDGET,
                           (gpointer)ppriv->auto_update);
@@ -233,7 +237,7 @@ modest_maemo_global_settings_dialog_init (ModestMaemoGlobalSettingsDialog *self)
        gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), ppriv->notebook);
        gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (self)->vbox), MODEST_MARGIN_HALF);
 
-       gtk_window_set_default_size (GTK_WINDOW (self), -1, 300);
+       gtk_window_set_default_size (GTK_WINDOW (self), 700, 300);
 
        g_signal_connect (G_OBJECT (self), "key-press-event",
                          G_CALLBACK (on_inner_tabs_key_pressed), self);
@@ -497,40 +501,7 @@ on_size_notify         (HildonNumberEditor *editor,
 static ModestConnectedVia
 current_connection (void)
 {
-       TnyAccountStore *account_store = NULL;
-       TnyDevice *device = NULL;
-       ModestConnectedVia retval = MODEST_CONNECTED_VIA_ANY;
-       
-       account_store = TNY_ACCOUNT_STORE (modest_runtime_get_account_store ());
-       device = tny_account_store_get_device (account_store);
-
-       if (!tny_device_is_online (device))
-               return MODEST_CONNECTED_VIA_ANY;
-
-#ifdef MODEST_HAVE_CONIC
-       /* Get iap id */
-       const gchar *iap_id = tny_maemo_conic_device_get_current_iap_id (TNY_MAEMO_CONIC_DEVICE (device));
-       if (iap_id) {
-               ConIcIap *iap = tny_maemo_conic_device_get_iap (
-                       TNY_MAEMO_CONIC_DEVICE (device), iap_id);
-               const gchar *bearer_type = con_ic_iap_get_bearer_type (iap);
-               if (bearer_type) {
-                       if (!strcmp (bearer_type, CON_IC_BEARER_WLAN_INFRA) ||
-                           !strcmp (bearer_type, CON_IC_BEARER_WLAN_ADHOC))
-                               retval = MODEST_CONNECTED_VIA_WLAN;
-                       else
-                               retval = MODEST_CONNECTED_VIA_ANY;
-               }
-       
-               g_object_unref (iap);
-       }
-#else
-       retval = MODEST_CONNECTED_VIA_WLAN; /* assume WLAN (fast) internet */  
-#endif /* MODEST_HAVE_CONIC */
-       
-       g_object_unref (device);
-
-       return retval;
+       return modest_platform_get_current_connection ();
 }
 
 static gboolean