New modest_platform_system_banner (show even if no windows visible)
authorJose Dapena Paz <jdapena@igalia.com>
Sun, 31 May 2009 19:53:34 +0000 (21:53 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Sun, 31 May 2009 19:53:34 +0000 (21:53 +0200)
src/gnome/modest-platform.c
src/hildon2/modest-platform.c
src/maemo/modest-platform.c
src/modest-platform.h

index 485b26b..11d5093 100644 (file)
@@ -373,6 +373,14 @@ modest_platform_information_banner (GtkWidget *widget,
        g_warning ("NOT IMPLEMENTED");;
 }
 
        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,
 void
 modest_platform_information_banner_with_timeout (GtkWidget *widget,
                                                 const gchar *icon_name,
index 1f14c74..5ca70eb 100644 (file)
@@ -1803,7 +1803,7 @@ modest_platform_information_banner (GtkWidget *parent,
                                    const gchar *icon_name,
                                    const gchar *text)
 {
                                    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)
        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;
        }
 
                        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);
 
        modest_window_mgr_register_banner (mgr);
        g_object_ref (mgr);
index af89e7b..bb472f1 100644 (file)
@@ -1461,7 +1461,7 @@ modest_platform_information_banner (GtkWidget *parent,
                                    const gchar *icon_name,
                                    const gchar *text)
 {
                                    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)
        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;
        }
 
                        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);
 
        modest_window_mgr_register_banner (mgr);
        g_object_ref (mgr);
index f3e5404..dcb4f2e 100644 (file)
@@ -346,6 +346,10 @@ void modest_platform_information_banner (GtkWidget *widget,
                                         const gchar *icon_name,
                                         const gchar *text);
 
                                         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,
 /* Timeout is in miliseconds */
 void modest_platform_information_banner_with_timeout (GtkWidget *parent,
                                                      const gchar *icon_name,