2007-04-27 Murray Cumming <murrayc@murrayc.com>
+ * src/modest-platform.h:
+ * src/gnome/modest-platform.c: (modest_platform_connect_and_wait):
+ * src/maemo/modest-platform.c: (modest_platform_connect_and_wait):
+ * src/modest-main.c: Implement this function so we can avoid using
+ maemo-specific API from cross-platform code.
+ (main):
+ * src/modest-tny-account-store.c:
+ (get_smtp_specific_transport_account_for_open_connection):
+ * src/modest-ui-actions.c: (check_for_connection),
+ (modest_ui_actions_on_item_not_found):
+ Use modest_platform_connect_and_wait() and put #idefs around other
+ maemo-specific code, because only maemo currently has a way to
+ identify connection names.
+
+2007-04-27 Murray Cumming <murrayc@murrayc.com>
+
* src/modest-tny-account-store.h:
* src/modest-tny-account-store.c:
Added modest_tny_account_store_get_transport_account_for_open_connection(), which respects
(modest_ui_actions_on_send_receive):
Check that a connection is open before proceeding.
- Receive and then send, instead of vice-versa, as per the specification
+ Receive and then send, instead of vice-versa, as per the specification.
2007-04-26 Murray Cumming <murrayc@murrayc.com>
/* TODO: implement a information dialog */
}
+
+gboolean modest_platform_connect_and_wait (GtkWindow *parent_window)
+{
+ /* TODO: Do something with network-manager?
+ Otherwise, maybe it is safe to assume that we would already be online if we could be. */
+ return TRUE;
+}
+
#include <config.h>
#include <glib/gi18n.h>
#include <modest-platform.h>
+#include <modest-runtime.h>
#include <dbus_api/modest-dbus-callbacks.h>
#include <libosso.h>
gtk_widget_destroy (GTK_WIDGET (dialog));
}
+
+gboolean modest_platform_connect_and_wait (GtkWindow *parent_window)
+{
+ TnyDevice *device = modest_runtime_get_device();
+
+ 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;
+}
+
#include <tny-account-store.h>
#include <tny-list.h>
#include <tny-simple-list.h>
-#include <tny-maemo-conic-device.h> /* For tny_maemo_conic_device_connect() */
#include <modest-runtime.h>
+#include <modest-platform.h>
#include <modest-init.h>
#include <modest-defs.h>
} else {
if (modest_conf_get_bool (modest_runtime_get_conf(),
MODEST_CONF_CONNECT_AT_STARTUP, NULL))
- tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (modest_runtime_get_device()), NULL);
+ modest_platform_connect_and_wait(NULL);
retval = start_ui (account_or_default,
mailto, cc, bcc, subject, body);
**/
void modest_platform_run_information_dialog (GtkWindow *parent_window,
ModestInformationDialogType type);
+
+/*
+ * modest_platform_connect_and_wait:
+ * @parent_window: the parent #GtkWindow for any interactive or progress feedback UI.
+ * @return value: Whether a connection was make.
+ *
+ * Attempts to make a connection, possibly showing interactive UI to achieve this.
+ * This will return TRUE immediately if a connection is already open.
+ * Otherwise, this function blocks until the connection attempt has either succeded or failed.
+ */
+gboolean modest_platform_connect_and_wait (GtkWindow *parent_window);
G_END_DECLS
#include <tny-transport-account.h>
#include <tny-simple-list.h>
#include <tny-account-store.h>
-#include <tny-maemo-conic-device.h> /* For ConIcIap */
#include <tny-camel-transport-account.h>
#include <tny-camel-imap-store-account.h>
#include <tny-camel-pop-store-account.h>
+
#include <modest-runtime.h>
#include <modest-marshal.h>
#include <modest-protocol-info.h>
#include <tny-gtk-lockable.h>
#include <camel/camel.h>
+#ifdef MODEST_PLATFORM_MAEMO
+#include <tny-maemo-conic-device.h>
+#endif
+
/* 'private'/'protected' functions */
static void modest_tny_account_store_class_init (ModestTnyAccountStoreClass *klass);
//static void modest_tny_account_store_init (ModestTnyAccountStore *obj);
if (!tny_device_is_online (device))
return NULL;
+#ifdef MODEST_PLATFORM_MAEMO
g_assert (TNY_IS_MAEMO_CONIC_DEVICE (device));
TnyMaemoConicDevice *maemo_device = TNY_MAEMO_CONIC_DEVICE (device);
const gchar* iap_id = tny_maemo_conic_device_get_current_iap_id (maemo_device);
g_object_unref (connection);
return account;
+#else
+ return NULL; /* TODO: Implement this for GNOME, instead of just Maemo? */
+#endif /* MODEST_PLATFORM_MAEMO */
}
#include "modest-account-mgr-helpers.h"
#include "modest-mail-operation.h"
#include "modest-text-utils.h"
-#include <tny-maemo-conic-device.h> /* For ConIcIap */
#ifdef MODEST_HAVE_EASYSETUP
#include "easysetup/modest-easysetup-wizard.h"
if (tny_device_is_online (device))
return TRUE;
else {
- tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (device), NULL);
+ modest_platform_connect_and_wait (NULL);
/* TODO: Wait until a result. */
return TRUE;
gtk_window_set_default_size (GTK_WINDOW(dialog), 300, 300);
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
-// tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (modest_runtime_get_device());
+// modest_platform_connect_and_wait ();;
}
}
gtk_widget_destroy (dialog);