gtk_entry_set_text (GTK_ENTRY (entry), suggested_name);
else
gtk_entry_set_text (GTK_ENTRY (entry), _("mcen_ia_default_folder_name"));
+ gtk_entry_set_width_chars (GTK_ENTRY (entry),
+ g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (entry)), -1));
gtk_entry_select_region (GTK_ENTRY (entry), 0, -1);
/* Connect to the response method to avoid closing the dialog
GtkWidget *note;
gint response;
ModestWindow *main_win;
- GList *buttons, *iter;
- gboolean found = FALSE;
if (!modest_window_mgr_main_window_exists (modest_runtime_get_window_mgr())) {
g_warning ("%s: don't show dialogs if there's no main window; assuming 'Cancel'",
_("mcen_bd_view"), GTK_RESPONSE_APPLY, /* abusing this... */
_("mcen_bd_dialog_cancel"), GTK_RESPONSE_CANCEL,
NULL, NULL);
-
- /* Focus the View button */
- buttons = gtk_container_get_children (GTK_CONTAINER ((GTK_DIALOG (note))->action_area));
- iter = buttons;
- while (!found && iter) {
- if (!strcmp (gtk_button_get_label (GTK_BUTTON (iter->data)), _("mcen_bd_view"))) {
- found = TRUE;
- gtk_widget_grab_focus (GTK_WIDGET (iter->data));
- } else {
- iter = g_list_next (iter);
- }
- }
g_signal_connect (G_OBJECT(note), "response",
G_CALLBACK(on_cert_dialog_response),
return GTK_WIDGET (dialog);
}
+
+ModestConnectedVia
+modest_platform_get_current_connection (void)
+{
+ TnyDevice *device = NULL;
+ ModestConnectedVia retval = MODEST_CONNECTED_VIA_ANY;
+
+ device = modest_runtime_get_device ();
+
+ 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) ||
+ !strcmp (bearer_type, "WIMAX")) {
+ retval = MODEST_CONNECTED_VIA_WLAN_OR_WIMAX;
+ } else {
+ retval = MODEST_CONNECTED_VIA_ANY;
+ }
+ }
+
+ g_object_unref (iap);
+ }
+#else
+ retval = MODEST_CONNECTED_VIA_WLAN_OR_WIMAX; /* assume WLAN (fast) internet */
+#endif /* MODEST_HAVE_CONIC */
+ return retval;
+}