return result_to;
}
-
static gboolean
on_idle_mail_to(gpointer user_data)
{
- gdk_threads_enter ();
-
/* This is based on the implemenation of main.c:start_uil(): */
gchar *uri = (gchar*)user_data;
} else {
tny_folder_add_msg (folder, msg, NULL); /* TODO: check err */
-
+ gdk_threads_enter ();
+
ModestWindow *win = modest_msg_edit_window_new (msg, account_name);
+ modest_window_mgr_register_window (modest_runtime_get_window_mgr (), win);
gtk_widget_show_all (GTK_WIDGET (win));
+
+ gdk_threads_leave ();
g_object_unref (G_OBJECT(folder));
+ g_object_unref (win);
}
g_object_unref (G_OBJECT(msg));
g_free(to);
g_free(uri);
-
- gdk_threads_leave ();
return FALSE; /* Do not call this callback again. */
}
static gboolean
on_idle_compose_mail(gpointer user_data)
{
- gdk_threads_enter ();
-
ComposeMailIdleData *idle_data = (ComposeMailIdleData*)user_data;
gchar **list = NULL;
gint i = 0;
} else {
tny_folder_add_msg (folder, msg, NULL); /* TODO: check err */
-
+
+ gdk_threads_enter ();
+
ModestWindow *win = modest_msg_edit_window_new (msg, account_name);
/* it seems Sketch at least sends a leading ',' -- take that into account,
(ModestMsgEditWindow *)win, list[i]);
}
g_strfreev(list);
-
+
+ modest_window_mgr_register_window (modest_runtime_get_window_mgr (), win);
gtk_widget_show_all (GTK_WIDGET (win));
+
+ gdk_threads_leave ();
g_object_unref (G_OBJECT(folder));
+ g_object_unref (win);
}
g_object_unref (G_OBJECT(msg));
g_free (account_name);
- gdk_threads_leave ();
-
return FALSE; /* Do not call this callback again. */
}
static gboolean
on_idle_open_message (gpointer user_data)
{
- gdk_threads_enter ();
-
ModestWindow *msg_view;
TnyMsg *msg;
TnyAccount *account;
if (msg == NULL) {
g_debug (" %s: message not found.", __FUNCTION__);
- gdk_threads_leave ();
return FALSE;
}
g_debug (" %s: Found message.", __FUNCTION__);
account_name = tny_account_get_name (account);
msg_uid = tny_header_get_uid (header);
+ gdk_threads_enter ();
+
msg_view = modest_msg_view_window_new (msg,
account_name,
msg_uid);
- /* TODO: does that leak the msg_view ?! */
+ modest_window_mgr_register_window (modest_runtime_get_window_mgr (), msg_view);
gtk_widget_show_all (GTK_WIDGET (msg_view));
+ gdk_threads_leave ();
+
g_object_unref (header);
g_object_unref (account);
-
- gdk_threads_leave ();
+ g_object_unref (msg_view);
return FALSE; /* Do not call this callback again. */
}
static gboolean
on_idle_send_receive(gpointer user_data)
{
- gdk_threads_enter ();
ModestWindow *win;
+ gdk_threads_enter ();
+
/* Pick the main window if it exists */
win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
/* Get the folder view */
GtkWidget *folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),
MODEST_WIDGET_TYPE_FOLDER_VIEW);
- modest_folder_view_select_first_inbox_or_local (
- MODEST_FOLDER_VIEW (folder_view));
+ modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (folder_view));
gdk_threads_leave ();