From: Jose Dapena Paz Date: Sun, 31 May 2009 19:53:34 +0000 (+0200) Subject: New modest_platform_system_banner (show even if no windows visible) X-Git-Tag: 3.0.17-rc10~31 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=853a43324034550e4ff24d9f90045ed9ab11b071 New modest_platform_system_banner (show even if no windows visible) --- diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index 485b26b..11d5093 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -373,6 +373,14 @@ modest_platform_information_banner (GtkWidget *widget, g_warning ("NOT IMPLEMENTED");; } +void +modest_platform_system_banner (GtkWidget *widget, + const gchar *icon_name, + const gchar *text) +{ + g_warning ("NOT IMPLEMENTED");; +} + void modest_platform_information_banner_with_timeout (GtkWidget *widget, const gchar *icon_name, diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 1f14c74..5ca70eb 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -1803,7 +1803,7 @@ modest_platform_information_banner (GtkWidget *parent, const gchar *icon_name, const gchar *text) { - GtkWidget *banner, *banner_parent = NULL; + GtkWidget *banner_parent = NULL; ModestWindowMgr *mgr = modest_runtime_get_window_mgr (); if (modest_window_mgr_get_num_windows (mgr) == 0) @@ -1826,8 +1826,23 @@ modest_platform_information_banner (GtkWidget *parent, return; } + modest_platform_system_banner (banner_parent, icon_name, text); +} + +void +modest_platform_system_banner (GtkWidget *parent, + const gchar *icon_name, + const gchar *text) +{ + GtkWidget *banner = NULL; + ModestWindowMgr *mgr = modest_runtime_get_window_mgr (); - banner = hildon_banner_show_information (banner_parent, icon_name, text); + if (parent && GTK_IS_WINDOW (parent)) { + if (!gtk_window_is_active (GTK_WINDOW (parent))) + parent = NULL; + } + + banner = hildon_banner_show_information (parent, icon_name, text); modest_window_mgr_register_banner (mgr); g_object_ref (mgr); diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index af89e7b..bb472f1 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -1461,7 +1461,7 @@ modest_platform_information_banner (GtkWidget *parent, const gchar *icon_name, const gchar *text) { - GtkWidget *banner, *banner_parent = NULL; + GtkWidget *banner_parent = NULL; ModestWindowMgr *mgr = modest_runtime_get_window_mgr (); if (modest_window_mgr_get_num_windows (mgr) == 0) @@ -1484,8 +1484,25 @@ modest_platform_information_banner (GtkWidget *parent, return; } + modest_platform_system_banner (banner_parent, icon_name, text); - banner = hildon_banner_show_information (banner_parent, icon_name, text); +} + +void +modest_platform_system_banner (GtkWidget *parent, + const gchar *icon_name, + const gchar *text) +{ + GtkWidget *banner = NULL; + ModestWindowMgr *mgr = modest_runtime_get_window_mgr (); + + + if (parent && GTK_IS_WINDOW (parent)) { + if (!gtk_window_is_active (GTK_WINDOW (parent))) + parent = NULL; + } + + banner = hildon_banner_show_information (parent, icon_name, text); modest_window_mgr_register_banner (mgr); g_object_ref (mgr); diff --git a/src/modest-platform.h b/src/modest-platform.h index f3e5404..dcb4f2e 100644 --- a/src/modest-platform.h +++ b/src/modest-platform.h @@ -346,6 +346,10 @@ void modest_platform_information_banner (GtkWidget *widget, const gchar *icon_name, const gchar *text); +void modest_platform_system_banner (GtkWidget *widget, + const gchar *icon_name, + const gchar *text); + /* Timeout is in miliseconds */ void modest_platform_information_banner_with_timeout (GtkWidget *parent, const gchar *icon_name,