* Removed a duplicated method
authorSergio Villar Senin <svillar@igalia.com>
Fri, 14 Sep 2007 10:01:46 +0000 (10:01 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 14 Sep 2007 10:01:46 +0000 (10:01 +0000)
* Fixed an error in my last commit 3298, we can not use maemo specific calls in the ui actions
* Fixes NB#67017, a dbus callback was storing a new message in the drafts even before editing it

pmo-trunk-r3299

src/dbus_api/modest-dbus-callbacks.c
src/maemo/modest-maemo-utils.c
src/maemo/modest-maemo-utils.h
src/maemo/modest-platform.c
src/modest-ui-actions.c

index 89fd2e7..e92cdfe 100644 (file)
@@ -280,35 +280,21 @@ on_idle_mail_to(gpointer user_data)
                                
                        if (!msg) {
                                g_printerr ("modest: failed to create message\n");
-                       } else
-                       {
-                               /* Add the message to a folder and show its UI for editing: */
-                               TnyFolder *folder = modest_tny_account_get_special_folder (account,
-                                                                       TNY_FOLDER_TYPE_DRAFTS);
-                               if (!folder) {
-                                       g_printerr ("modest: failed to find Drafts folder\n");
-                               } else {
-                       
-                                       tny_folder_add_msg (folder, msg, NULL); /* TODO: check err */
-
-                                       /* This is a GDK lock because we are an idle callback and
-                                        * the code below is or does Gtk+ code */
-
-                                       gdk_threads_enter (); /* CHECKED */
-
-                                       ModestWindow *win = modest_msg_edit_window_new (msg, account_name, FALSE);
-                                       modest_window_mgr_register_window (modest_runtime_get_window_mgr (), win);
-                                       gtk_widget_show_all (GTK_WIDGET (win));
-
-                                       gdk_threads_leave (); /* CHECKED */
+                       } else {                        
+                               ModestWindow *win;
+
+                               /* This is a GDK lock because we are an idle callback and
+                                * the code below is or does Gtk+ code */
+                               gdk_threads_enter ();
+                               win = modest_msg_edit_window_new (msg, account_name, FALSE);
+                               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_object_unref (win);
                        }
                        
+                       g_object_unref (G_OBJECT(msg));                 
                        g_object_unref (G_OBJECT(account));
                }
        }
@@ -325,7 +311,8 @@ on_idle_mail_to(gpointer user_data)
        return FALSE; /* Do not call this callback again. */
 }
 
-static gint on_mail_to(GArray * arguments, gpointer data, osso_rpc_t * retval)
+static gint 
+on_mail_to(GArray * arguments, gpointer data, osso_rpc_t * retval)
 {
        if (arguments->len != MODEST_DBUS_MAIL_TO_ARGS_COUNT)
        return OSSO_ERROR;
index 4baa10e..2c38a9e 100644 (file)
@@ -564,16 +564,6 @@ modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser)
 
 }
 
-void
-modest_maemo_show_information_note_and_forget (GtkWindow *parent_window, const gchar* message)
-{
-       GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_window, message));
-       
-       /* Destroy the dialog when it is closed: */
-       g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (gtk_widget_destroy), NULL);
-       gtk_widget_show (GTK_WIDGET (dialog));
-}
-
 #if 0
 static void
 on_hide (GtkDialog *dialog, gpointer user_data)
index 10b02e5..a147024 100644 (file)
@@ -122,16 +122,6 @@ GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTra
  */
 void modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser);
 
-/** modest_maemo_show_information_note_and_forget:
- * @parent_window: The window for which the note should be transient.
- * @message: The text to show.
- * 
- * Show the information note and destroy it when it is closed, without 
- * blocking. Use this when you don't want to use gtk_dialog_run(), which might lead 
- * to hangs.
- */
-void modest_maemo_show_information_note_and_forget (GtkWindow *parent_window, const gchar* message);
-
 /** modest_maemo_show_information_note_in_main_context_and_forget:
  * @parent_window: The window for which the note should be transient.
  * @message: The text to show.
index d44ffb6..e934108 100644 (file)
@@ -1559,8 +1559,8 @@ modest_platform_run_alert_dialog (const gchar* prompt,
                
        } else {
                /* Just show the error text and use the default response: */
-               modest_maemo_show_information_note_and_forget(GTK_WINDOW (main_window), 
-                                                             prompt);
+               modest_platform_run_information_dialog (GTK_WINDOW (main_window), 
+                                                       prompt);
        }
        return retval;
 }
index 68ba9cd..796ce29 100644 (file)
@@ -4707,7 +4707,7 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
           should show the Accounts Settings dialog or the Connection
           specific SMTP server window */
 
-       modest_maemo_show_information_note_and_forget (NULL, message);
+       modest_platform_run_information_dialog (NULL, message);
        g_free (message);
 }