From 61a1d10cef0beaa1627fef70db8771d10dd0a147 Mon Sep 17 00:00:00 2001 From: Felipe Erias Morandeira Date: Tue, 23 Oct 2007 16:37:58 +0000 Subject: [PATCH] patch for NB#73896 pmo-trunk-r3563 --- src/gnome/modest-main-window.c | 8 -------- src/maemo/modest-main-window.c | 23 --------------------- src/widgets/modest-main-window.h | 11 ---------- src/widgets/modest-window-mgr.c | 41 +++++++++++++++++++++++++------------- 4 files changed, 27 insertions(+), 56 deletions(-) diff --git a/src/gnome/modest-main-window.c b/src/gnome/modest-main-window.c index d987c29..09a7541 100644 --- a/src/gnome/modest-main-window.c +++ b/src/gnome/modest-main-window.c @@ -692,14 +692,6 @@ on_header_status_update (ModestHeaderView *header_view, modest_gnome_info_bar_set_message (MODEST_GNOME_INFO_BAR (priv->main_bar), msg); } -gboolean -modest_main_window_close_all (ModestMainWindow *self) -{ - /* TODO: show a dialog to ask the user for permission to close - all */ - return TRUE; -} - void modest_main_window_set_style (ModestMainWindow *self, ModestMainWindowStyle style) diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index c444b74..73eed0f 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -1219,29 +1219,6 @@ modest_main_window_new (void) return MODEST_WINDOW(self); } -gboolean -modest_main_window_close_all (ModestMainWindow *self) -{ - GtkWidget *note; - GtkResponseType response; - - /* Create the confirmation dialog MSG-NOT308 */ - note = hildon_note_new_confirmation_add_buttons (GTK_WINDOW (self), - _("emev_nc_close_windows"), - _("mcen_bd_yes"), GTK_RESPONSE_YES, - _("mcen_bd_no"), GTK_RESPONSE_NO, - NULL); - - response = gtk_dialog_run (GTK_DIALOG (note)); - gtk_widget_destroy (GTK_WIDGET (note)); - - if (response == GTK_RESPONSE_YES) - return TRUE; - else - return FALSE; -} - - void modest_main_window_set_style (ModestMainWindow *self, ModestMainWindowStyle style) diff --git a/src/widgets/modest-main-window.h b/src/widgets/modest-main-window.h index edf9a90..1256cc2 100644 --- a/src/widgets/modest-main-window.h +++ b/src/widgets/modest-main-window.h @@ -129,17 +129,6 @@ typedef enum { GtkWidget* modest_main_window_get_child_widget (ModestMainWindow *self, ModestMainWindowWidgetType widget_type); -/** - * modest_main_window_close_all: - * @self: - * - * this function will ask the user about if the user wants to close - * all the windows or just the main one - * - * Returns: TRUE if the user selected to close all the windows, otherwise FALSE - **/ -gboolean modest_main_window_close_all (ModestMainWindow *self); - /** * modest_main_window_set_style: diff --git a/src/widgets/modest-window-mgr.c b/src/widgets/modest-window-mgr.c index a4153be..ced34cc 100644 --- a/src/widgets/modest-window-mgr.c +++ b/src/widgets/modest-window-mgr.c @@ -512,6 +512,8 @@ on_window_destroy (ModestWindow *window, GdkEvent *event, ModestWindowMgr *self) { + gint dialog_response = GTK_RESPONSE_NONE; + /* Specific stuff first */ if (MODEST_IS_MAIN_WINDOW (window)) { ModestWindowMgrPrivate *priv; @@ -520,21 +522,32 @@ on_window_destroy (ModestWindow *window, /* If more than one window already opened */ if (g_list_length (priv->window_list) > 1) { + /* Create the confirmation dialog MSG-NOT308 */ + dialog_response = modest_platform_run_confirmation_dialog ( + GTK_WINDOW (window), _("emev_nc_close_windows")); + /* If the user wants to close all the windows */ - if (modest_main_window_close_all (MODEST_MAIN_WINDOW (window))) { - GList *iter = priv->window_list; - do { - if (iter->data != window) { - GList *tmp = iter->next; - on_window_destroy (MODEST_WINDOW (iter->data), - event, - self); - iter = tmp; - } else { - iter = g_list_next (iter); - } - } while (iter); - } + if ((dialog_response == GTK_RESPONSE_OK) + || (dialog_response == GTK_RESPONSE_ACCEPT) + || (dialog_response == GTK_RESPONSE_YES)) + { + GList *iter = priv->window_list; + do { + if (iter->data != window) { + GList *tmp = iter->next; + on_window_destroy (MODEST_WINDOW (iter->data), + event, + self); + iter = tmp; + } else { + iter = g_list_next (iter); + } + } while (iter); + } + else + { + return TRUE; + } } } else { -- 1.7.9.5