return (src_is_pop && !uncached_msgs);
}
+
+/* FIXME: this should be merged with the similar code in modest-account-view-window */
/* Show the account creation wizard dialog.
* returns: TRUE if an account was created. FALSE if the user cancelled.
*/
modest_run_account_setup_wizard (ModestWindow *win)
{
gboolean result = FALSE;
- GtkDialog *wizard;
-
- wizard = modest_window_mgr_get_easysetup_dialog
- (modest_runtime_get_window_mgr());
- if (wizard) {
- /* old wizard is active already; present it and
- * act as if the user cancelled the non-existing
- * new one
+ GtkDialog *wizard, *dialog;
+
+ /* Show the easy-setup wizard: */
+ dialog = modest_window_mgr_get_modal_dialog (modest_runtime_get_window_mgr());
+ if (dialog && MODEST_IS_EASYSETUP_WIZARD_DIALOG(dialog)) {
+ /* old wizard is active already;
*/
- printf ("wizard already active\n");
+ gtk_window_present (GTK_WINDOW(dialog));
return FALSE;
- } else {
- /* there is no such wizard yet */
- wizard = GTK_DIALOG(modest_easysetup_wizard_dialog_new ());
- modest_window_mgr_set_easysetup_dialog
- (modest_runtime_get_window_mgr(), GTK_DIALOG(wizard));
- }
+ }
+
+ /* there is no such wizard yet */
+
+ wizard = GTK_DIALOG(modest_easysetup_wizard_dialog_new ());
+ if (!wizard) {
+ g_printerr ("modest: failed to create easysetup wizard\n");
+ return FALSE;
+ }
+ modest_window_mgr_set_modal_dialog
+ (modest_runtime_get_window_mgr(), GTK_DIALOG(wizard));
+
+
+ /* there is no such wizard yet */
+ wizard = GTK_DIALOG(modest_easysetup_wizard_dialog_new ());
+ modest_window_mgr_set_modal_dialog (modest_runtime_get_window_mgr(),
+ GTK_DIALOG(wizard));
+
+ /* make it non-modal; if though we register it as a modal dialog above
+ * apparently, making it modal *at all* gives hangs -- FIXME: check this*/
+ gtk_window_set_modal (GTK_WINDOW(dialog), FALSE);
+
/* always present a main window in the background
* we do it here, so we cannot end up with to wizards (as this
* function might be called in modest_window_mgr_get_main_window as well */
gtk_widget_destroy (GTK_WIDGET (wizard));
/* clear it from the window mgr */
- modest_window_mgr_set_easysetup_dialog
+ modest_window_mgr_set_modal_dialog
(modest_runtime_get_window_mgr(), NULL);
return result;
gint response = 0;
/* Ask for user confirmation */
- response = msgs_move_to_confirmation (GTK_WINDOW (window),
- TNY_FOLDER (folder_store),
- delete,
- data);
+ response =
+ modest_ui_actions_msgs_move_to_confirmation (GTK_WINDOW (window),
+ TNY_FOLDER (folder_store),
+ delete,
+ data);
if (response == GTK_RESPONSE_OK) {
/* Launch notification */
* drag_and_drop_from_header_view (for d&d in modest_folder_view.c)
*/
gint
-msgs_move_to_confirmation (GtkWindow *win,
- TnyFolder *dest_folder,
- gboolean delete,
- TnyList *headers)
+modest_ui_actions_msgs_move_to_confirmation (GtkWindow *win,
+ TnyFolder *dest_folder,
+ gboolean delete,
+ TnyList *headers)
{
gint response = GTK_RESPONSE_OK;
tny_iterator_next (iter);
}
+ g_object_unref (iter);
+
if (pending_purges>0) {
gint response;
if (response == GTK_RESPONSE_OK) {
modest_platform_information_banner (NULL, NULL, _("mcen_ib_removing_attachment"));
- tny_iterator_first (iter);
+ iter = tny_list_create_iterator (parts);
while (!tny_iterator_is_done (iter)) {
TnyMimePart *part;
} else {
modest_platform_information_banner (NULL, NULL, _("mail_ib_attachment_already_purged"));
}
+ g_object_unref (iter);
- /* remove attachments */
- tny_iterator_first (iter);
- while (!tny_iterator_is_done (iter)) {
- TnyMimePart *part;
-
- part = TNY_MIME_PART (tny_iterator_get_current (iter));
- if (part) {
- /* One for the reference given by tny_iterator_get_current(): */
- g_object_unref (part);
-
- /* TODO: Is this meant to remove the attachment by doing another unref()?
- * Otherwise, this seems useless. */
- }
-
- tny_iterator_next (iter);
- }
modest_window_mgr_unregister_header (mgr, header);
- g_object_unref (iter);
g_object_unref (parts);
}