* Migrated both the Folder and Message details dialog to Fremantle UI, now they...
[modest] / src / maemo / modest-platform.c
index 6c47d9d..24cd4bb 100644 (file)
@@ -58,6 +58,7 @@
 #include "modest-hildon-sort-dialog.h"
 #include <hildon/hildon-sound.h>
 #include <osso-mem.h>
+#include "widgets/modest-details-dialog.h"
 
 #ifdef MODEST_HAVE_MCE
 #include <mce/dbus-names.h>
@@ -531,6 +532,7 @@ entry_insert_text (GtkEditable *editable,
 
        chars = gtk_editable_get_chars (editable, 0, -1);
        chars_length = g_utf8_strlen (chars, -1);
+       g_free (chars);
 
        /* Show WID-INF036 */
        if (chars_length >= 20) {
@@ -862,28 +864,6 @@ modest_platform_run_confirmation_dialog_with_buttons (GtkWindow *parent_window,
        return response;
 }
        
-gint
-modest_platform_run_yes_no_dialog (GtkWindow *parent_window,
-                                  const gchar *message)
-{
-       GtkWidget *dialog;
-       gint response;
-       
-       dialog = hildon_note_new_confirmation_add_buttons (parent_window, message,
-                                                          _("mcen_bd_yes"), GTK_RESPONSE_YES,
-                                                          _("mcen_bd_no"), GTK_RESPONSE_NO,
-                                                          NULL);
-       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), 
-                                    GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
-       response = gtk_dialog_run (GTK_DIALOG (dialog));
-       
-       on_destroy_dialog (dialog);
-
-       return response;
-}
-
-
-
 void
 modest_platform_run_information_dialog (GtkWindow *parent_window,
                                        const gchar *message,
@@ -1615,6 +1595,8 @@ on_timeout_check_account_is_online(CheckAccountIdleData* data)
 gboolean
 modest_platform_check_and_wait_for_account_is_online(TnyAccount *account)
 {
+       gboolean is_online;
+
        g_return_val_if_fail (account, FALSE);
        
        printf ("DEBUG: %s: account id=%s\n", __FUNCTION__, tny_account_get_id (account));
@@ -1658,9 +1640,10 @@ modest_platform_check_and_wait_for_account_is_online(TnyAccount *account)
        g_main_loop_unref (data->loop);
        /* g_main_context_unref (context); */
 
+       is_online = data->is_online;
        g_slice_free (CheckAccountIdleData, data);
        
-       return data->is_online; 
+       return is_online;       
 }
 
 
@@ -2108,8 +2091,6 @@ modest_platform_get_current_connection (void)
        return retval;
 }
 
-
-
 gboolean
 modest_platform_check_memory_low (ModestWindow *win,
                                  gboolean visuals)
@@ -2131,3 +2112,43 @@ modest_platform_check_memory_low (ModestWindow *win,
 
        return lowmem;
 }
+
+void 
+modest_platform_run_folder_details_dialog (GtkWindow *parent_window,
+                                          TnyFolder *folder)
+{
+       GtkWidget *dialog;
+       
+       /* Create dialog */
+       dialog = modest_details_dialog_new_with_folder (parent_window, folder);
+
+       /* Run dialog */
+       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), 
+                                    GTK_WINDOW (dialog), 
+                                    parent_window);
+       gtk_widget_show_all (dialog);
+
+       g_signal_connect_swapped (dialog, "response", 
+                                 G_CALLBACK (gtk_widget_destroy),
+                                 dialog);
+}
+
+void
+modest_platform_run_header_details_dialog (GtkWindow *parent_window,
+                                          TnyHeader *header)
+{
+       GtkWidget *dialog;
+       
+       /* Create dialog */
+       dialog = modest_details_dialog_new_with_header (parent_window, header);
+
+       /* Run dialog */
+       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), 
+                                    GTK_WINDOW (dialog),
+                                    parent_window);
+       gtk_widget_show_all (dialog);
+
+       g_signal_connect_swapped (dialog, "response", 
+                                 G_CALLBACK (gtk_widget_destroy),
+                                 dialog);
+}