* Removed invalid conic include
[modest] / src / maemo / modest-maemo-global-settings-dialog.c
index ad4e4c5..3d192ea 100644 (file)
 #include <config.h>
 #endif /*HAVE_CONFIG_H*/
 
-#ifdef MODEST_HAVE_CONIC
-#include <coniciap.h>
-#endif /*MODEST_HAVE_CONIC*/
-
 #include <modest-hildon-includes.h>
 #include <modest-maemo-utils.h>
 
@@ -52,7 +48,6 @@
 #include "maemo/modest-maemo-global-settings-dialog.h"
 #include "widgets/modest-ui-constants.h"
 #include <tny-account-store.h>
-#include <tny-maemo-conic-device.h>
 
 
 #define MSG_SIZE_MAX_VAL 5000
@@ -217,7 +212,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 +232,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 +496,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
@@ -543,7 +509,7 @@ on_inner_tabs_key_pressed (GtkWidget *widget,
 
        ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (user_data);
 
-       if (widget == user_data) {
+       if (widget == ppriv->notebook) {
                if (event->keyval == GDK_Right) {
                        gtk_notebook_next_page (GTK_NOTEBOOK (ppriv->notebook));
                        retval = TRUE;