X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-platform.c;h=49136a09ea9f07ddce0026c4976dbca85f5604ab;hp=06ece71d2c7a11cc0f4b3f10c0ac72e3ff82e2ba;hb=564a7388a2f74368147b0a241ca4a0b65c68167f;hpb=a7be4d9c27d5a6074f3a1701b12bcc2c45887022 diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 06ece71..49136a0 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -33,12 +33,12 @@ #include #include #include -#include "maemo/modest-maemo-global-settings-dialog.h" +#include "modest-maemo-global-settings-dialog.h" #include "modest-widget-memory.h" #include #include #include -#include +#include #include #include #include @@ -55,9 +55,10 @@ #include #include #include -#include "modest-hildon-sort-dialog.h" +#include "modest-hildon2-sort-dialog.h" #include #include +#include "hildon2/modest-hildon2-details-dialog.h" #ifdef MODEST_HAVE_MCE #include @@ -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) { @@ -716,7 +718,7 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window, gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0); modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (dialog)); + GTK_WINDOW (dialog), parent_window); gtk_widget_show_all (GTK_WIDGET(dialog)); result = gtk_dialog_run (GTK_DIALOG(dialog)); @@ -830,7 +832,7 @@ modest_platform_run_confirmation_dialog (GtkWindow *parent_window, dialog = hildon_note_new_confirmation (parent_window, message); modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (dialog)); + GTK_WINDOW (dialog), parent_window); response = gtk_dialog_run (GTK_DIALOG (dialog)); @@ -852,8 +854,9 @@ modest_platform_run_confirmation_dialog_with_buttons (GtkWindow *parent_window, button_accept, GTK_RESPONSE_ACCEPT, button_cancel, GTK_RESPONSE_CANCEL, NULL); + modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (dialog)); + GTK_WINDOW (dialog), parent_window); response = gtk_dialog_run (GTK_DIALOG (dialog)); @@ -862,27 +865,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)); - 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, @@ -893,7 +875,7 @@ modest_platform_run_information_dialog (GtkWindow *parent_window, note = hildon_note_new_information (parent_window, message); if (block) modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (note)); + GTK_WINDOW (note), parent_window); if (block) { gtk_dialog_run (GTK_DIALOG (note)); @@ -1084,7 +1066,7 @@ modest_platform_create_sort_dialog (GtkWindow *parent_window) { GtkWidget *dialog; - dialog = modest_hildon_sort_dialog_new (parent_window); + dialog = modest_hildon2_sort_dialog_new (parent_window); hildon_help_dialog_help_enable (GTK_DIALOG(dialog), "applications_email_sort", @@ -1600,6 +1582,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)); @@ -1643,9 +1627,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; } @@ -1708,7 +1693,7 @@ modest_platform_run_certificate_confirmation_dialog (const gchar* server_name, (gpointer) certificate); modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (note)); + GTK_WINDOW (note), GTK_WINDOW (main_win)); response = gtk_dialog_run(GTK_DIALOG(note)); on_destroy_dialog (note); @@ -1741,7 +1726,7 @@ modest_platform_run_alert_dialog (const gchar* prompt, GtkWidget *dialog = GTK_WIDGET (hildon_note_new_confirmation (GTK_WINDOW (main_win), prompt)); modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), - GTK_WINDOW (dialog)); + GTK_WINDOW (dialog), GTK_WINDOW (main_win)); const int response = gtk_dialog_run (GTK_DIALOG (dialog)); retval = (response == GTK_RESPONSE_YES) || (response == GTK_RESPONSE_OK); @@ -2116,3 +2101,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_hildon2_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_hildon2_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); +}