win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(),
TRUE); /* create if not existent */
- /* make sure the mainwindow is visible */
gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win));
- gtk_widget_show_all (GTK_WIDGET(win));
- gtk_window_present (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
+ in order to get the widgets properly drawn (MainWindow main
+ paned won't be in its right position and the dialog will be
+ missplaced */
+ gtk_widget_show_all (GTK_WIDGET (win));
+ gtk_widget_show_all (GTK_WIDGET (wizard));
+ gtk_window_present (GTK_WINDOW (win));
+ gtk_window_present (GTK_WINDOW (wizard));
dialog_response = gtk_dialog_run (GTK_DIALOG (wizard));
gtk_widget_destroy (GTK_WIDGET (wizard));
/* Select next or previous row */
if (gtk_tree_row_reference_valid (next_row_reference)) {
-/* next_path = gtk_tree_row_reference_get_path (row_reference); */
gtk_tree_selection_select_path (sel, next_path);
}
else if (gtk_tree_row_reference_valid (prev_row_reference)) {
}
/* Update toolbar dimming state */
- if (main_window)
+ if (main_window) {
+ modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (main_window));
modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (main_window));
+ }
/* Free */
g_list_foreach (sel_list, (GFunc) gtk_tree_path_free, NULL);
g_object_unref (G_OBJECT(account));
if (folder)
g_object_unref (G_OBJECT(folder));
- if (msg_win)
- g_object_unref (G_OBJECT(msg_win));
if (msg)
g_object_unref (G_OBJECT(msg));
}
if (win != NULL) {
mgr = modest_runtime_get_window_mgr ();
modest_window_mgr_register_window (mgr, win);
- g_object_unref (win);
gtk_widget_show_all (GTK_WIDGET(win));
}
gtk_widget_show_all (GTK_WIDGET (msg_win));
cleanup:
- if (msg_win)
- g_object_unref (msg_win);
if (new_msg)
g_object_unref (G_OBJECT (new_msg));
if (account)
modest_msg_edit_window_remove_attachments (window, NULL);
}
+
+#ifdef MODEST_PLATFORM_MAEMO
+typedef struct {
+ guint handler;
+ gchar *name;
+ GtkWindow *win;
+ TnyFolderStore *folder;
+} CreateFolderHelper;
+
+static gboolean
+show_create_folder_in_timeout (gpointer data)
+{
+ CreateFolderHelper *helper = (CreateFolderHelper *) data;
+
+ /* Remove the timeout ASAP, we can not wait until the dialog
+ is shown because it could take a lot of time and so the
+ timeout could be called twice or more times */
+ g_source_remove (helper->handler);
+
+ gdk_threads_enter ();
+ do_create_folder (helper->win, helper->folder, helper->name);
+ gdk_threads_leave ();
+
+ g_object_unref (helper->win);
+ g_object_unref (helper->folder);
+ g_free (helper->name);
+ g_slice_free (CreateFolderHelper, helper);
+
+ return FALSE;
+}
+#endif
+
static void
do_create_folder_cb (ModestMailOperation *mail_op,
TnyFolderStore *parent_folder,
/* Try again. Do *NOT* show any error because the mail
operations system will do it for us because we
created the mail_op with new_with_error_handler */
+#ifdef MODEST_PLATFORM_MAEMO
+ CreateFolderHelper *helper;
+ helper = g_slice_new0 (CreateFolderHelper);
+ helper->name = g_strdup (suggested_name);
+ helper->folder = g_object_ref (parent_folder);
+ helper->win = g_object_ref (source_win);
+
+ /* Ugly but neccesary stuff. The problem is that the
+ dialog when is shown calls a function that destroys
+ all the temporary windows, so the banner is
+ destroyed */
+ helper->handler = g_timeout_add (2000, show_create_folder_in_timeout, helper);
+#else
do_create_folder (source_win, parent_folder, (const gchar *) suggested_name);
+#endif
} else {
/* the 'source_win' is either the ModestMainWindow, or the 'Move to folder'-dialog
* FIXME: any other? */
/* Set focuse on header view */
gtk_widget_grab_focus (header_view);
-
/* Enable window dimming management */
modest_window_enable_dimming (MODEST_WINDOW(window));
+ modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (window));
modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (window));
}