* Fixes NB#84535, server errors are now shown over the contacts dialog
[modest] / src / maemo / modest-platform.c
index d2e97b4..4d61dbd 100644 (file)
@@ -56,6 +56,7 @@
 #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>
@@ -1688,6 +1689,10 @@ modest_platform_animation_banner (GtkWidget *parent,
 
        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;
@@ -2216,7 +2221,7 @@ modest_platform_get_account_settings_dialog (ModestAccountSettings *settings)
 }
 
 GtkWidget *
-modest_platform_get_account_settings_wizard ()
+modest_platform_get_account_settings_wizard (void)
 {
        ModestEasysetupWizardDialog *dialog = modest_easysetup_wizard_dialog_new ();
 
@@ -2257,3 +2262,28 @@ modest_platform_get_current_connection (void)
 #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;
+}