TnyHeader *header,
ModestWindow **win);
static GList *modest_hildon1_window_mgr_get_window_list (ModestWindowMgr *self);
+static gboolean modest_hildon1_window_mgr_close_all_windows (ModestWindowMgr *self);
typedef struct _ModestHildon1WindowMgrPrivate ModestHildon1WindowMgrPrivate;
struct _ModestHildon1WindowMgrPrivate {
mgr_class->set_modal = modest_hildon1_window_mgr_set_modal;
mgr_class->find_registered_header = modest_hildon1_window_mgr_find_registered_header;
mgr_class->get_window_list = modest_hildon1_window_mgr_get_window_list;
+ mgr_class->close_all_windows = modest_hildon1_window_mgr_close_all_windows;
g_type_class_add_private (gobject_class, sizeof(ModestHildon1WindowMgrPrivate));
return MODEST_WINDOW_MGR(g_object_new(MODEST_TYPE_HILDON1_WINDOW_MGR, NULL));
}
-void
+static gboolean
modest_hildon1_window_mgr_close_all_windows (ModestWindowMgr *self)
{
ModestHildon1WindowMgrPrivate *priv = NULL;
gboolean ret_value = FALSE;
ModestWindow *main_window;
- g_return_if_fail (MODEST_IS_HILDON1_WINDOW_MGR (self));
+ g_return_val_if_fail (MODEST_IS_HILDON1_WINDOW_MGR (self), FALSE);
priv = MODEST_HILDON1_WINDOW_MGR_GET_PRIVATE (self);
/* If there is a main window then try to close it, and it will
main_window = modest_window_mgr_get_main_window (self, FALSE);
if (main_window) {
g_signal_emit_by_name (main_window, "delete-event", NULL, &ret_value);
+ return ret_value;
} else {
GList *wins = NULL, *next = NULL;
while (wins) {
next = g_list_next (wins);
g_signal_emit_by_name (G_OBJECT (wins->data), "delete-event", NULL, &ret_value);
+ if (ret_value)
+ break;
wins = next;
}
}
+
+ return ret_value;
}
static gint
cancel_window_operations (window);
/* Fake the window system, make it think that there is no window */
- if (modest_window_mgr_num_windows (MODEST_WINDOW_MGR (self)) == 0)
+ if (modest_window_mgr_get_num_windows (MODEST_WINDOW_MGR (self)) == 0)
g_signal_emit_by_name (self, "window-list-empty");
no_propagate = TRUE;
MODEST_WINDOW_MGR_CLASS (parent_class)->unregister_window (self, window);
/* If there are no more windows registered emit the signal */
- if (modest_window_mgr_num_windows (self) == 0)
+ if (modest_window_mgr_get_num_windows (self) == 0)
g_signal_emit_by_name (self, "window-list-empty");
}