X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=48cbf05705711c46e255f97eb06682956be212bd;hp=021a1bbe966e5911f784f709db6ffb9c818aa4f8;hb=b758827b283a5a19b35bdd5a55cf81f90a49b83e;hpb=a180d1ed637c939fa538d8de4abf8d73eb9bffe4 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 021a1bb..48cbf05 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -223,14 +223,38 @@ modest_ui_actions_run_account_setup_wizard (ModestWindow *win) wizard = GTK_WINDOW (modest_platform_get_account_settings_wizard ()); modest_window_mgr_set_modal (modest_runtime_get_window_mgr(), GTK_WINDOW (wizard), (GtkWindow *) win); +#ifndef MODEST_TOOLKIT_HILDON2 /* always present a main window in the background * we do it here, so we cannot end up with two wizards (as this * function might be called in modest_window_mgr_get_main_window as well */ - if (!win) + if (!win) win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(), TRUE); /* create if not existent */ +#else + if (!win) { + GList *window_list; + ModestWindowMgr *mgr; + + mgr = modest_runtime_get_window_mgr (); + + window_list = modest_window_mgr_get_window_list (mgr); + if (window_list == NULL) { + win = MODEST_WINDOW (modest_accounts_window_new ()); + modest_window_mgr_register_window (mgr, win, NULL); + gtk_widget_show_all (GTK_WIDGET (win)); - gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win)); + win = MODEST_WINDOW (modest_folder_window_new (NULL)); + modest_window_mgr_register_window (mgr, win, NULL); + + gtk_widget_show_all (GTK_WIDGET (win)); + } else { + g_list_free (window_list); + } + } +#endif + + if (win) + gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win)); /* make sure the mainwindow is visible. We need to present the wizard again to give it the focus back. show_all are needed @@ -995,7 +1019,6 @@ get_info_from_header (TnyHeader *header, gboolean *is_draft, gboolean *can_open) outbox which is not in failed state */ *can_open = FALSE; - g_object_unref(traccount); } #endif } @@ -1434,7 +1457,7 @@ open_msg_from_header (TnyHeader *header, GtkTreeRowReference *rowref, ModestWind GtkWidget *header_view = NULL; OpenMsgHelper *helper; ModestWindow *window; - + g_return_if_fail (header != NULL && rowref != NULL); mgr = modest_runtime_get_window_mgr (); @@ -1451,7 +1474,7 @@ open_msg_from_header (TnyHeader *header, GtkTreeRowReference *rowref, ModestWind window = NULL; found = modest_window_mgr_find_registered_header (mgr, header, &window); - + /* Do not open again the message and present the window to the user */ if (found) { @@ -3357,22 +3380,12 @@ modest_ui_actions_create_folder(GtkWidget *parent_window, TnyFolderStore *parent_folder; #ifdef MODEST_TOOLKIT_HILDON2 - const gchar *active_account; - TnyAccount *account; ModestTnyAccountStore *acc_store; - /* In hildon 2.2 we use the current account as default parent */ acc_store = modest_runtime_get_account_store (); - active_account = modest_window_get_active_account (MODEST_WINDOW (parent_window)); - if (active_account) { - account = modest_tny_account_store_get_server_account (acc_store, - active_account, - TNY_ACCOUNT_TYPE_STORE); - parent_folder = TNY_FOLDER_STORE (account); - } else { - parent_folder = (TnyFolderStore *) - modest_tny_account_store_get_local_folders_account (acc_store); - } + + parent_folder = (TnyFolderStore *) + modest_tny_account_store_get_local_folders_account (acc_store); #else parent_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view)); #endif