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)
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)
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:
GdkEvent *event,
ModestWindowMgr *self)
{
+ gint dialog_response = GTK_RESPONSE_NONE;
+
/* Specific stuff first */
if (MODEST_IS_MAIN_WINDOW (window)) {
ModestWindowMgrPrivate *priv;
/* 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 {