#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>
G_CALLBACK (entry_changed),
dialog);
+
+ /* Some locales like pt_BR need this to get the full window
+ title shown */
+ gtk_widget_set_size_request (GTK_WIDGET (dialog), 300, -1);
+
/* Create the hbox */
hbox = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
/* Add hbox to dialog */
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
hbox, FALSE, FALSE, 0);
-
- gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
- gtk_window_set_transient_for (GTK_WINDOW (dialog), parent_window);
-
- /* Some locales like pt_BR need this to get the full window
- title shown */
- gtk_widget_set_size_request (GTK_WIDGET (dialog), 300, -1);
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (dialog));
+ gtk_widget_show_all (GTK_WIDGET(dialog));
result = gtk_dialog_run (GTK_DIALOG(dialog));
if (result == GTK_RESPONSE_ACCEPT)
GtkWidget *note;
note = hildon_note_new_information (parent_window, message);
- modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
- GTK_WINDOW (note));
+ if (block)
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (note));
if (block) {
gtk_dialog_run (GTK_DIALOG (note));
const gchar *text)
{
GtkWidget *banner;
- ModestWindowMgr *mgr;
+ ModestWindowMgr *mgr = modest_runtime_get_window_mgr ();
+
+ if (modest_window_mgr_num_windows (mgr) == 0)
+ return;
- mgr = modest_runtime_get_window_mgr ();
banner = hildon_banner_show_information (parent, icon_name, text);
modest_window_mgr_register_banner (mgr);
gint timeout)
{
GtkWidget *banner;
+
+ if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ return;
+
banner = hildon_banner_show_information (parent, icon_name, text);
hildon_banner_set_timeout(HILDON_BANNER(banner), timeout);
}
g_return_val_if_fail (text != NULL, NULL);
+ if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ return 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;
}
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 visuals)
+{
+ gboolean lowmem;
+
+ /* are we in low memory state? */
+ lowmem = osso_mem_in_lowmem_state () ? TRUE : FALSE;
+
+ if (win && lowmem && visuals)
+ modest_platform_run_information_dialog (
+ GTK_WINDOW(win),
+ dgettext("ke-recv","memr_ib_operation_disabled"),
+ TRUE);
+
+ if (lowmem)
+ g_debug ("%s: low memory reached. disallowing some operations",
+ __FUNCTION__);
+
+ return lowmem;
+}