-* please check the svn log instead
+ please check the svn log instead
+2007-07-12 Murray Cumming <murrayc@murrayc.com>
+
+ * src/dbus_api/modest-dbus-callbacks.c: (on_idle_open_message),
+ Pass the modest account name, not the TnyAccount display name to
+ modest_msg_view_window_new() so that the reply feature works,
+ fixing projects.maemo.org bug NB#62892.
+
+ * src/gnome/modest-msg-view-window.c: (modest_msg_view_window_new),
+ (modest_msg_view_window_new_with_header_model):
+ * src/maemo/modest-msg-view-window.c:
+ (modest_msg_view_window_new_with_header_model),
+ (modest_msg_view_window_new):
+ * src/modest-ui-actions.c: (reply_forward):
+ * src/widgets/modest-msg-view-window.h:
+ * src/widgets/modest-window.c: (modest_window_set_active_account):
+ Rename an account parameter to modest_account_name to make this clearer.
+
+2007-07-11 Murray Cumming <murrayc@murrayc.com>
+
+ * src/modest-ui-actions.h:
+ * src/modest-ui-actions.c: (headers_action_delete): Moved some code into
+ modest_do_message_delete().
+ * src/dbus_api/modest-dbus-callbacks.c: (on_idle_delete_message):
+ Call modest_do_message_delete(), hoping that this would cause messages
+ to be really deleted from search instead of just marked with strike through.
+ Does not seem to help.
+
2007-07-11 Armin Burgmeier <armin@openismus.com>
* src/widgets/maemo-folder-view.c (modest_folder_view_on_map): Set
on_idle_open_message (gpointer user_data)
{
ModestWindow *msg_view = NULL;
- TnyMsg *msg;
+ TnyMsg *msg = NULL;
TnyAccount *account = NULL;
- TnyHeader *header;
- const char *msg_uid;
- const char *account_name;
- char *uri;
- ModestWindowMgr *win_mgr;
+ TnyHeader *header = NULL;
+ const char *msg_uid = NULL;
+ char *uri = NULL;
+ ModestWindowMgr *win_mgr = NULL;
TnyFolder *folder = NULL;
uri = (char *) user_data;
}
header = tny_msg_get_header (msg);
- account_name = tny_account_get_name (account);
+
msg_uid = modest_tny_folder_get_header_unique_id(header);
/* FIXME: modest_tny_folder_get_header_unique_id warns against this */
win_mgr = modest_runtime_get_window_mgr ();
} else {
/* g_debug ("creating new window for this msg"); */
modest_window_mgr_register_header (win_mgr, header);
- msg_view = modest_msg_view_window_new (msg,account_name,
+
+ const gchar *modest_account_name =
+ modest_tny_account_get_parent_modest_account_name_for_server_account (account);
+ msg_view = modest_msg_view_window_new (msg, modest_account_name,
msg_uid);
modest_window_mgr_register_window (win_mgr, msg_view);
gtk_widget_show_all (GTK_WIDGET (msg_view));
error = NULL;
res = OSSO_OK;
- tny_folder_remove_msg (folder, header, &error);
- tny_header_set_flags (header, TNY_HEADER_FLAG_SEEN);
+
+ gdk_threads_enter ();
+ ModestWindow *win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
+ modest_do_message_delete (header, win);
if (error != NULL) {
res = OSSO_ERROR;
g_error_free (error);
}
- gdk_threads_enter ();
+
ModestWindowMgr *win_mgr = modest_runtime_get_window_mgr ();
ModestWindow *msg_view = NULL;
ModestWindow *
modest_msg_view_window_new (TnyMsg *msg,
- const gchar *account,
+ const gchar *modest_account_name,
const gchar *msg_uid)
{
GObject *obj;
ModestWindow*
modest_msg_view_window_new_with_header_model (TnyMsg *msg,
- const gchar *account,
+ const gchar *modest_account_name,
const gchar *msg_uid,
GtkTreeModel *model,
GtkTreeRowReference *row_reference)
ModestWindow *
modest_msg_view_window_new_with_header_model (TnyMsg *msg,
- const gchar *account_name,
+ const gchar *modest_account_name,
const gchar *msg_uid,
GtkTreeModel *model,
GtkTreeRowReference *row_reference)
ModestMsgViewWindow *window = NULL;
ModestMsgViewWindowPrivate *priv = NULL;
- window = MODEST_MSG_VIEW_WINDOW(modest_msg_view_window_new (msg, account_name, msg_uid));
+ window = MODEST_MSG_VIEW_WINDOW(modest_msg_view_window_new (msg, modest_account_name, msg_uid));
g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window), NULL);
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window);
ModestWindow *
modest_msg_view_window_new (TnyMsg *msg,
- const gchar *account_name,
+ const gchar *modest_account_name,
const gchar *msg_uid)
{
ModestMsgViewWindow *self = NULL;
G_CALLBACK (on_queue_changed),
obj);
- modest_window_set_active_account (MODEST_WINDOW(obj), account_name);
+ modest_window_set_active_account (MODEST_WINDOW(obj), modest_account_name);
priv->last_search = NULL;
}
}
-
-static void
-headers_action_delete (TnyHeader *header,
- ModestWindow *win,
- gpointer user_data)
+/** A convenience method, because deleting a message is
+ * otherwise complicated, and it's best to change it in one place
+ * when we change it.
+ */
+void modest_do_message_delete (TnyHeader *header, ModestWindow *win)
{
ModestMailOperation *mail_op = NULL;
-
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_DELETE, G_OBJECT(win));
+ mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_DELETE,
+ win ? G_OBJECT(win) : NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
/* Always delete. TODO: Move to trash still not supported */
modest_mail_operation_remove_msg (mail_op, header, FALSE);
g_object_unref (G_OBJECT (mail_op));
+}
- /* refilter treemodel to hide marked-as-deleted rows */
+static void
+headers_action_delete (TnyHeader *header,
+ ModestWindow *win,
+ gpointer user_data)
+{
+ modest_do_message_delete (header, win);
+
+/* refilter treemodel to hide marked-as-deleted rows */
/* if (MODEST_IS_HEADER_VIEW (user_data)) */
/* modest_header_view_refilter (MODEST_HEADER_VIEW (user_data)); */
}
rf_helper->reply_forward_type = reply_forward_type;
rf_helper->action = action;
rf_helper->account_name = g_strdup (modest_window_get_active_account (win));
+
if ((win != NULL) && (MODEST_IS_WINDOW (win)))
rf_helper->parent_window = GTK_WIDGET (win);
if (!rf_helper->account_name)
void modest_ui_actions_get_msgs_full_error_handler (ModestMailOperation *mail_op,
gpointer user_data);
+/** A convenience method, because deleting a message is
+ * otherwise complicated, and it's best to change it in one place
+ * when we change it.
+ **/
+void modest_do_message_delete (TnyHeader *header, ModestWindow *win);
G_END_DECLS
#endif /* __MODEST_UI_ACTIONS_H__ */
/**
* modest_msg_view_window_new:
* @msg: an #TnyMsg instance
- * @account: the account name
+ * @modest_account_name: the account name
*
* instantiates a new #ModestMsgViewWindow widget. The account name is used to
* set the proper account when choosing reply/forward from the msg view window
* Returns: a new #ModestMsgViewWindow, or NULL in case of error
*/
ModestWindow* modest_msg_view_window_new (TnyMsg *msg,
- const gchar *account,
+ const gchar *modest_account_name,
const gchar *msg_uid);
/**
* Returns: a new #ModestMsgViewWindow, or NULL in case of error
*/
ModestWindow* modest_msg_view_window_new_with_header_model (TnyMsg *msg,
- const gchar *account,
+ const gchar *modest_account_name,
const gchar *msg_uid,
GtkTreeModel *model,
GtkTreeRowReference *row_reference);
void
modest_window_set_active_account (ModestWindow *self, const gchar *active_account)
{
+ printf ("DEBUG: %s: active_account=%s\n", __FUNCTION__, active_account);
+
ModestWindowPrivate *priv;
priv = MODEST_WINDOW_GET_PRIVATE(self);