#include <modest-account-settings-dialog.h>
#include <easysetup/modest-easysetup-wizard-dialog.h>
#include <hildon/hildon-sound.h>
+#include <osso-mem.h>
#ifdef MODEST_HAVE_MCE
#include <mce/dbus-names.h>
TnyFolder *folder = tny_header_get_folder (header);
gboolean first_notification = TRUE;
gint notif_id;
+ gchar *str;
/* constant string, don't free */
display_date = modest_text_utils_get_display_date (tny_header_get_date_received (header));
- display_address = g_strdup(tny_header_get_from (header));
+ display_address = tny_header_dup_from (header);
modest_text_utils_get_display_address (display_address); /* string is changed in-place */
summary = g_strdup_printf ("%s - %s", display_date, display_address);
+ str = tny_header_dup_subject (header);
notification = hildon_notification_new (summary,
- tny_header_get_subject (header),
+ str,
"qgn_list_messagin",
"email.arrive");
+ g_free (str);
/* Create the message URL */
+ str = tny_header_dup_uid (header);
url = g_strdup_printf ("%s/%s", tny_folder_get_url_string (folder),
- tny_header_get_uid (header));
+ str);
+ g_free (str);
hildon_notification_add_dbus_action(notification,
"default",
g_return_val_if_fail (text != NULL, NULL);
+ /* If the parent is not visible then do not show */
+ if (parent && !GTK_WIDGET_VISIBLE (parent))
+ return NULL;
+
inf_note = hildon_banner_show_animation (parent, animation_name, text);
return inf_note;
} else if (TNY_IS_FOLDER (folder_store)) {
/* Get the folder's parent account: */
- account = tny_folder_get_account(TNY_FOLDER (folder_store));
+ account = tny_folder_get_account (TNY_FOLDER (folder_store));
} else if (TNY_IS_ACCOUNT (folder_store)) {
/* Use the folder store as an account: */
- account = TNY_ACCOUNT (folder_store);
+ account = TNY_ACCOUNT (g_object_ref (folder_store));
}
if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) {
if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) &&
!TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) {
-
- /* This IS a local account like a maildir account, which does not require
- * a connection. (original comment had a vague assumption in its language
- * usage. There's no assuming needed, this IS what it IS: a local account), */
- /* We promise to instantly perform the callback, so ... */
- if (callback) {
+ /* No need to connect a local account */
+ if (callback)
callback (FALSE, NULL, parent_window, account, user_data);
- }
-
- return;
+
+ goto clean;
}
}
+ modest_platform_connect_and_perform (parent_window, force, account, callback, user_data);
- modest_platform_connect_and_perform (parent_window, force, account, callback, user_data);
-
- return;
+ clean:
+ if (account)
+ g_object_unref (account);
}
static void
}
GtkWidget *
-modest_platform_get_account_settings_wizard ()
+modest_platform_get_account_settings_wizard (void)
{
ModestEasysetupWizardDialog *dialog = modest_easysetup_wizard_dialog_new ();
#endif /* MODEST_HAVE_CONIC */
return retval;
}
+
+
+
+gboolean
+modest_platform_check_memory_low (ModestWindow *win)
+{
+ gboolean lowmem;
+
+ g_return_val_if_fail (win == NULL || MODEST_IS_WINDOW(win), FALSE);
+
+ /* are we in low memory state? */
+ lowmem = osso_mem_in_lowmem_state () ? TRUE : FALSE;
+
+ if (win && lowmem)
+ modest_platform_run_information_dialog (
+ GTK_WINDOW(win),
+ dgettext("ke-recv","memr_ib_operation_disabled"),
+ TRUE);
+
+ if (lowmem)
+ g_warning ("%s: low memory reached. disallowing some operations",
+ __FUNCTION__);
+
+ return lowmem;
+}