2007-07-26 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Thu, 26 Jul 2007 07:33:06 +0000 (07:33 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Thu, 26 Jul 2007 07:33:06 +0000 (07:33 +0000)
* src/modest-ui-actions.h:
* src/modest-ui-actions.c: Added
modest_do_refresh_current_folder() containing some code from
modest_ui_actions_on_send_receive().
* src/dbus_api/modest-dbus-callbacks.c: (on_idle_send_receive):
Call modest_do_refresh_current_folder() before refreshing the
requested account, as in modest_ui_actions_on_send_receive().
This is strange, but seems to be necessary to show new mails.
Now new emails are finally visible in the UI when downloaded
via the automatic update interval, fixing bug NB#57458.
This also works because bug NB#57458 has been fixed somehow.

pmo-trunk-r2798

ChangeLog2
src/dbus_api/modest-dbus-callbacks.c
src/modest-ui-actions.c
src/modest-ui-actions.h

index e15da88..37b01ad 100644 (file)
@@ -1,5 +1,19 @@
 2007-07-26  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/modest-ui-actions.h:
+       * src/modest-ui-actions.c: Added 
+       modest_do_refresh_current_folder() containing some code from 
+       modest_ui_actions_on_send_receive().
+       * src/dbus_api/modest-dbus-callbacks.c: (on_idle_send_receive):
+       Call modest_do_refresh_current_folder() before refreshing the 
+       requested account, as in modest_ui_actions_on_send_receive(). 
+       This is strange, but seems to be necessary to show new mails.
+       Now new emails are finally visible in the UI when downloaded 
+       via the automatic update interval, fixing bug NB#57458.
+       This also works because bug NB#57458 has been fixed somehow.
+
+2007-07-26  Murray Cumming  <murrayc@murrayc.com>
+
        * src/dbus_api/modest-dbus-callbacks.c: (modest_dbus_req_filter):
        printf more details when we get unhandled D-Bus methods, because 
        it is interesting.
index 5a977de..6ab191d 100644 (file)
@@ -807,6 +807,11 @@ on_idle_send_receive(gpointer user_data)
        /* Pick the main window if it exists */
        win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
 
+       /* This seems to be necessary to show new messages in the current window.
+        * I would expect this to be after the send_receive, but maybe 
+        * this makes a connection too. murrayc. */
+       modest_do_refresh_current_folder (win);
+
        /* Send & receive all if "Update automatically" is set */
        /* TODO: check the auto-update parameter in the configuration */
        modest_ui_actions_do_send_receive_all (win);
@@ -1391,7 +1396,6 @@ modest_dbus_req_filter (DBusConnection *con,
                        DBusMessage    *message,
                        void           *user_data)
 {
-       printf ("DEBUG: %s\n", __FUNCTION__);
        gboolean handled = FALSE;
 
        if (dbus_message_is_method_call (message,
@@ -1408,7 +1412,8 @@ modest_dbus_req_filter (DBusConnection *con,
                handled = TRUE;                         
        }
        else {
-               g_debug ("  debug: %s: Unexpected D-Bus method: Interface=%s, Member=%s\n", 
+               /* Note that this mentions methods that were already handled in modest_dbus_req_handler(). */
+               g_debug ("  debug: %s: Unexpected (maybe already handled) D-Bus method:\n   Interface=%s, Member=%s\n", 
                        __FUNCTION__, dbus_message_get_interface (message),
                        dbus_message_get_member(message));
        }
index 46e99ef..e13fe00 100644 (file)
@@ -1483,22 +1483,11 @@ modest_ui_actions_do_send_receive_all (ModestWindow *win)
        account_names = NULL;
 }
 
-/*
- * Handler of the click on Send&Receive button in the main toolbar
- */
-void
-modest_ui_actions_on_send_receive (GtkAction *action,  ModestWindow *win)
+void 
+modest_do_refresh_current_folder(ModestWindow *win)
 {
-       /* Check if accounts exist */
-       gboolean accounts_exist = 
-               modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
-       
-       /* If not, allow the user to create an account before trying to send/receive. */
-       if (!accounts_exist)
-               modest_ui_actions_on_accounts (NULL, win);
-
        /* Refresh currently selected folder. Note that if we only
-          want to retrive the headers, then the refresh only will
+          want to retreive the headers, then the refresh only will
           invoke a poke_status over all folders, i.e., only the
           total/unread count will be updated */
        if (MODEST_IS_MAIN_WINDOW (win)) {
@@ -1530,6 +1519,24 @@ modest_ui_actions_on_send_receive (GtkAction *action,  ModestWindow *win)
                if (folder_store)
                        g_object_unref (folder_store);
        }
+}
+
+
+/*
+ * Handler of the click on Send&Receive button in the main toolbar
+ */
+void
+modest_ui_actions_on_send_receive (GtkAction *action, ModestWindow *win)
+{
+       /* Check if accounts exist */
+       gboolean accounts_exist = 
+               modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
+       
+       /* If not, allow the user to create an account before trying to send/receive. */
+       if (!accounts_exist)
+               modest_ui_actions_on_accounts (NULL, win);
+
+       modest_do_refresh_current_folder (win);
        
        /* Refresh the active account */
        modest_ui_actions_do_send_receive (NULL, win);
index e20b93a..d6af486 100644 (file)
@@ -213,6 +213,9 @@ void    modest_ui_actions_do_send_receive_all          (ModestWindow *win);
 void    modest_ui_actions_do_send_receive              (const gchar *account_name,
                                                        ModestWindow *win);
 
+void 
+modest_do_refresh_current_folder(ModestWindow *win);
+
 /**
  * modest_ui_actions_on_send_receive:
  * @action: a #GtkAction