Fixes NB#125952, "lose changes confirmation dialog" is now modal do easysetup wizard...
authorSergio Villar Senin <svillar@igalia.com>
Wed, 1 Jul 2009 11:10:24 +0000 (13:10 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 1 Jul 2009 11:10:34 +0000 (13:10 +0200)
src/hildon2/modest-easysetup-wizard-dialog.c
src/hildon2/modest-hildon2-window-mgr.c
src/maemo/easysetup/modest-easysetup-wizard-dialog.c

index 611d5cf..de573a7 100644 (file)
@@ -1230,12 +1230,17 @@ on_response_before (ModestWizardDialog *wizard_dialog,
                /* This is mostly copied from
                 * src/maemo/modest-account-settings-dialog.c */
                if (priv->dirty) {
                /* This is mostly copied from
                 * src/maemo/modest-account-settings-dialog.c */
                if (priv->dirty) {
-                       GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self),
-                               _("imum_nc_wizard_confirm_lose_changes")));
-                       /* TODO: These button names will be ambiguous, and not
-                        * specified in the UI specification. */
+                       gint dialog_response;
+                       GtkWidget *dialog;
 
 
-                       const gint dialog_response = gtk_dialog_run (dialog);
+                       dialog = hildon_note_new_confirmation ((GtkWindow *) self,
+                                                              _("imum_nc_wizard_confirm_lose_changes"));
+
+                       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+                                                    (GtkWindow *) dialog,
+                                                    (GtkWindow *) wizard_dialog);
+
+                       dialog_response = gtk_dialog_run ((GtkDialog *) dialog);
                        gtk_widget_destroy (GTK_WIDGET (dialog));
 
                        if (dialog_response != GTK_RESPONSE_OK) {
                        gtk_widget_destroy (GTK_WIDGET (dialog));
 
                        if (dialog_response != GTK_RESPONSE_OK) {
index 8b16d4a..3922dd6 100644 (file)
@@ -445,6 +445,15 @@ modest_hildon2_window_mgr_register_window (ModestWindowMgr *self,
        while (modal && GTK_IS_DIALOG (modal)) {
                GtkWidget *parent;
 
        while (modal && GTK_IS_DIALOG (modal)) {
                GtkWidget *parent;
 
+               /* If it's a hildon note then don't try to close it as
+                  this is the default behaviour of WM, delete event
+                  is not issued for this kind of notes as we want the
+                  user to always click on a button */
+               if (HILDON_IS_NOTE (modal)) {
+                       gtk_window_present (GTK_WINDOW (modal));
+                       return FALSE;
+               }
+
                /* Get the parent */
                parent = (GtkWidget *) gtk_window_get_transient_for (GTK_WINDOW (modal));
 
                /* Get the parent */
                parent = (GtkWidget *) gtk_window_get_transient_for (GTK_WINDOW (modal));
 
index 743a9dc..84ae7e9 100644 (file)
@@ -1139,12 +1139,17 @@ on_response_before (ModestWizardDialog *wizard_dialog,
                /* This is mostly copied from
                 * src/maemo/modest-account-settings-dialog.c */
                if (priv->dirty) {
                /* This is mostly copied from
                 * src/maemo/modest-account-settings-dialog.c */
                if (priv->dirty) {
-                       GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self), 
-                               _("imum_nc_wizard_confirm_lose_changes")));
-                       /* TODO: These button names will be ambiguous, and not
-                        * specified in the UI specification. */
+                       gint dialog_response;
+                       GtkWidget *dialog;
 
 
-                       const gint dialog_response = gtk_dialog_run (dialog);
+                       dialog = hildon_note_new_confirmation ((GtkWindow *) self,
+                                                              _("imum_nc_wizard_confirm_lose_changes"));
+
+                       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+                                                    (GtkWindow *) dialog,
+                                                    (GtkWindow *) wizard_dialog);
+
+                       dialog_response = gtk_dialog_run ((GtkDialog *) dialog);
                        gtk_widget_destroy (GTK_WIDGET (dialog));
 
                        if (dialog_response != GTK_RESPONSE_OK) {
                        gtk_widget_destroy (GTK_WIDGET (dialog));
 
                        if (dialog_response != GTK_RESPONSE_OK) {