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,
+ * ie strip that ,*/
+ if (idle_data->attachments && idle_data->attachments[0]==',') {
+ gchar *tmp = g_strdup (idle_data->attachments + 1);
+ g_free(idle_data->attachments);
+ idle_data->attachments = tmp;
+ }
+
list = g_strsplit(idle_data->attachments, ",", 0);
for (i=0; list[i] != NULL; i++) {
modest_msg_edit_window_attach_file_noninteractive(
(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 ());
/* TODO: check the auto-update parameter in the configuration */
modest_ui_actions_do_send_receive_all (win);
- gdk_threads_leave();
+ gdk_threads_leave ();
return FALSE; /* Do not call this callback again. */
}
static gboolean
on_idle_open_default_inbox(gpointer user_data)
{
- gdk_threads_enter();
+ gdk_threads_enter ();
ModestWindow *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();
+ gdk_threads_leave ();
return FALSE; /* Do not call this callback again. */
}
if (TNY_IS_FOLDER (folder_store)) {
add_single_folder_to_list (TNY_FOLDER (folder_store), list);
}
-
/* Recurse into child folders: */
TnyIterator *iter = tny_list_create_iterator (all_folders);
while (!tny_iterator_is_done (iter)) {
+
+ /* Do not recurse, because the osso-global-search UI specification
+ * does not seem to want the sub-folders, though that spec seems to
+ * be generally unsuitable for Modest.
+ */
TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter));
+ add_single_folder_to_list (TNY_FOLDER (folder), list);
+
+ #if 0
if (TNY_IS_FOLDER_STORE (folder))
add_folders_to_list (TNY_FOLDER_STORE (folder), list);
else {
add_single_folder_to_list (TNY_FOLDER (folder), list);
}
+ #endif
tny_iterator_next (iter);
}