X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-hildon2-window-mgr.c;h=d79fcc4b1144eba4fa2f857fdbac53165b5bf7a2;hb=9edfe44eba9e0b83f6fde3eab558e069a648590c;hp=f7251f77342f8807841df329d3185d4f7a7e6ff5;hpb=5b154aa953f8d887437f91e0ad75288051fb498a;p=modest diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index f7251f7..d79fcc4 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -28,6 +28,7 @@ */ #include +#include #include "modest-hildon2-window-mgr.h" #include "modest-msg-edit-window.h" #include "modest-main-window.h" @@ -39,7 +40,8 @@ #include "modest-ui-actions.h" #include "modest-debug.h" #include "modest-tny-folder.h" -#include +#include "modest-folder-window.h" +#include "modest-accounts-window.h" /* 'private'/'protected' functions */ static void modest_hildon2_window_mgr_class_init (ModestHildon2WindowMgrClass *klass); @@ -74,19 +76,20 @@ static GList *modest_hildon2_window_mgr_get_window_list (ModestWindowMgr *self); static gboolean modest_hildon2_window_mgr_close_all_windows (ModestWindowMgr *self); static gboolean window_can_close (ModestWindow *window); static gboolean window_has_modals (ModestWindow *window); +static ModestWindow *modest_hildon2_window_mgr_show_initial_window (ModestWindowMgr *self); typedef struct _ModestHildon2WindowMgrPrivate ModestHildon2WindowMgrPrivate; struct _ModestHildon2WindowMgrPrivate { GList *window_list; GMutex *queue_lock; GQueue *modal_windows; - + gboolean fullscreen_mode; - + GHashTable *destroy_handlers; GHashTable *viewer_handlers; GSList *window_state_uids; - + guint closing_time; GSList *modal_handler_uids; @@ -144,6 +147,7 @@ modest_hildon2_window_mgr_class_init (ModestHildon2WindowMgrClass *klass) mgr_class->find_registered_header = modest_hildon2_window_mgr_find_registered_header; mgr_class->get_window_list = modest_hildon2_window_mgr_get_window_list; mgr_class->close_all_windows = modest_hildon2_window_mgr_close_all_windows; + mgr_class->show_initial_window = modest_hildon2_window_mgr_show_initial_window; g_type_class_add_private (gobject_class, sizeof(ModestHildon2WindowMgrPrivate)); @@ -719,3 +723,28 @@ modest_hildon2_window_mgr_set_modal (ModestWindowMgr *self, gtk_window_set_destroy_with_parent (window, TRUE); } +static ModestWindow * +modest_hildon2_window_mgr_show_initial_window (ModestWindowMgr *self) +{ + ModestWindow *window = NULL; + ModestAccountMgr *mgr; + GSList *account_names; + gint count; + + mgr = modest_runtime_get_account_mgr (); + account_names = modest_account_mgr_account_names (mgr, TRUE); + count = g_slist_length (account_names); + + if (count > 1) { + window = MODEST_WINDOW (modest_accounts_window_new ()); + } else { + window = MODEST_WINDOW (modest_folder_window_new (NULL)); + if (count == 1) + modest_folder_window_set_account (MODEST_FOLDER_WINDOW (window), + account_names->data); + } + modest_account_mgr_free_account_names (account_names); + modest_window_mgr_register_window (self, window, NULL); + + return window; +}