+2007-06-29 Murray Cumming,,, <set EMAIL_ADDRESS environment variable>
+
+ reviewed by: <delete if not using a buddy>
+
+ * src/maemo/modest-maemo-utils.c:
+ (modest_maemo_utils_get_supported_secure_authentication_methods):
+ * src/maemo/modest-main-window.c:
+ (on_zoom_minus_plus_not_implemented),
+ (modest_main_window_set_offline):
+ * src/modest-defs.h:
+ * src/modest-init.c: (init_default_settings):
+ * src/modest-mail-operation.c:
+ (modest_mail_operation_update_account):
+ * src/modest-main.c: (on_show):
+ * src/modest-tny-account.c: (on_connection_status_changed),
+ (modest_tny_account_new_from_server_account):
+ * src/modest-ui-actions.h:
+ * src/widgets/modest-main-window.h:
+
* please check the svn log instead
-2007-06-29 Murray Cumming <murrayc@murrayc-desktop>
+2007-06-29 Murray Cumming <murrayc@murrayc.com
+
+ * src/modest-tny-account.c:
+ (modest_tny_account_new_from_server_account):
+ Handle the TnyAccount::"connection-status-changed" signal, which tinymail
+ now uses to request a connection when it needs one, and which it uses
+ to tell us that something is wrong with the connection, so we can force
+ the accounts offline to prevent further problems.
+
+ * src/modest-defs.h:
+ * src/modest-init.c: (init_default_settings):
+ * src/modest-mail-operation.c:
+ (modest_mail_operation_update_account):
+ * src/modest-main.c: (on_show): Do not try to connect explicitly on startup.
+ This should not be necessary anymore. Do not set the conf key that
+ determined this (it was always TRUE and not set anywhere else).
+
+ * src/modest-ui-actions.h: Remove unused and unimplemented
+ modest_ui_actions_on_online_toggle_toggled().
+
+2007-06-29 Murray Cumming <murrayc@murrayc.com
* src/maemo/modest-main-window.c: (connect_signals):
Don't connect to delete_event twice. Maybe this was harmless.
default:
tny_account = NULL;
}
+
+ /* TODO: Handle connection requests. */
if (!tny_account) {
g_printerr ("%s could not create tny account.", __FUNCTION__);
#define MODEST_ACCOUNT_NAMESPACE MODEST_CONF_NAMESPACE "/accounts"
#define MODEST_CONF_DEFAULT_ACCOUNT MODEST_CONF_NAMESPACE "/default_account"
-#define MODEST_CONF_CONNECT_AT_STARTUP MODEST_CONF_NAMESPACE "/connect_at_startup"
+/* Not used: #define MODEST_CONF_CONNECT_AT_STARTUP MODEST_CONF_NAMESPACE "/connect_at_startup" */
#define MODEST_CONF_SHOW_CC MODEST_CONF_NAMESPACE "/show_cc"
#define MODEST_CONF_SHOW_BCC MODEST_CONF_NAMESPACE "/show_bcc"
if (!modest_conf_key_exists (conf, MODEST_CONF_SHOW_BCC, NULL))
modest_conf_set_bool (conf, MODEST_CONF_SHOW_BCC, FALSE, NULL);
+/* Not used:
if (!modest_conf_key_exists (conf, MODEST_CONF_CONNECT_AT_STARTUP, NULL))
modest_conf_set_bool (conf, MODEST_CONF_CONNECT_AT_STARTUP, TRUE, NULL);
+*/
/* Global settings */
if (!modest_conf_key_exists (conf, MODEST_CONF_AUTO_UPDATE, NULL))
priv->done = 0;
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
- /* Make sure that we have a connection, and request one
- * if necessary:
- * TODO: Is there some way to trigger this for every attempt to
- * use the network? */
- if (!modest_platform_connect_and_wait(NULL))
- goto error;
-
/* Get the Modest account */
modest_account = (TnyStoreAccount *)
modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
static void
on_show (GtkWidget *widget, gpointer user_data)
{
+ /* This key is not used by any preferences UI and
+ * I don't think this behavior is specified in the UI specification. murrayc: */
+/*
if (modest_conf_get_bool (modest_runtime_get_conf(),
MODEST_CONF_CONNECT_AT_STARTUP, NULL))
modest_platform_connect_and_wait(NULL);
+*/
}
int
#include <modest-tny-account-store.h>
#include <modest-tny-local-folders-account.h>
#include <modest-runtime.h>
+#include <modest-platform.h>
#include <tny-simple-list.h>
#include <modest-tny-folder.h>
#include <modest-tny-outbox-account.h>
return special_folder;
}
+static void
+on_connection_status_changed (TnyAccount *account, TnyConnectionStatus status, gpointer user_data)
+{
+ printf ("DEBUG: %s: status=%d\n", __FUNCTION__, status);
+
+ if (status == TNY_CONNECTION_STATUS_DISCONNECTED) {
+ /* We are trying to use the network with an account,
+ * but the accounts are set as offline, because our TnyDevice is offline,
+ * because libconic says we are offline.
+ * So ask the user to go online:
+ */
+ modest_platform_connect_and_wait(NULL);
+ } else if (status == TNY_CONNECTION_STATUS_CONNECTED_BROKEN) {
+ printf ("DEBUG: %s: Connection broken. Forcing TnyDevice offline.\n",
+ __FUNCTION__);
+
+ /* Something went wrong during some network operation.
+ * Stop trying to use the network now,
+ * by forcing accounts into offline mode:
+ *
+ * When libconic reconnects, it will set the device back online again,
+ * regardless of it being forced offline before.
+ */
+ TnyDevice *device = modest_runtime_get_device ();
+ tny_device_force_offline (device);
+ }
+}
+
/* Camel options: */
/* These seem to be listed in
}
tny_account_set_id (tny_account, account_data->account_name);
+ /* Handle connection requests:
+ * This (badly-named) signal will be called when we try to use an offline account. */
+ g_signal_connect (G_OBJECT (tny_account), "connection-status-changed",
+ G_CALLBACK (on_connection_status_changed), NULL);
+
/* Proto */
const gchar* proto_name =
modest_protocol_info_get_transport_store_protocol_name(account_data->proto);
gboolean selected,
ModestMainWindow *main_window);
-void modest_ui_actions_on_online_toggle_toggled (GtkToggleButton *toggle,
- ModestMainWindow *main_window);
-
void modest_ui_actions_on_item_not_found (ModestHeaderView *header_view,
ModestItemType type,
ModestWindow *window);