2012-03-14 [pawel] 3.8.0cvs32
* src/folder.c * src/messageview.c * src/messageview.h * src/procmsg.h * src/summaryview.c * src/textview.c * src/textview.h Better fix for bug #2501 Instead of leaving blank window after message move or delete, update separate view to next message in message list or display info why view is blank. This was discussed in bug #2621 comments.
This commit is contained in:
parent
e5da787174
commit
13cf689943
10 changed files with 82 additions and 50 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2012-03-14 [pawel] 3.8.0cvs32
|
||||
|
||||
* src/folder.c
|
||||
* src/messageview.c
|
||||
* src/messageview.h
|
||||
* src/procmsg.h
|
||||
* src/summaryview.c
|
||||
* src/textview.c
|
||||
* src/textview.h
|
||||
Better fix for bug #2501
|
||||
Instead of leaving blank window after message move or delete,
|
||||
update separate view to next message in message list or
|
||||
display info why view is blank. This was discussed
|
||||
in bug #2621 comments.
|
||||
|
||||
2012-03-11 [colin] 3.8.0cvs31
|
||||
|
||||
* src/gtk/gtkcmctree.c
|
||||
|
|
|
@ -4348,3 +4348,4 @@
|
|||
( cvs diff -u -r 1.94.2.227 -r 1.94.2.228 src/messageview.c; ) > 3.8.0cvs29.patchset
|
||||
( cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/gtk/gtkcmctree.c; ) > 3.8.0cvs30.patchset
|
||||
( cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/gtk/gtkcmctree.c; cvs diff -u -r 1.1.2.76 -r 1.1.2.77 src/gtk/authors.h; cvs diff -u -r 1.100.2.81 -r 1.100.2.82 AUTHORS; ) > 3.8.0cvs31.patchset
|
||||
( cvs diff -u -r 1.213.2.205 -r 1.213.2.206 src/folder.c; cvs diff -u -r 1.94.2.228 -r 1.94.2.229 src/messageview.c; cvs diff -u -r 1.19.2.28 -r 1.19.2.29 src/messageview.h; cvs diff -u -r 1.60.2.59 -r 1.60.2.60 src/procmsg.h; cvs diff -u -r 1.395.2.444 -r 1.395.2.445 src/summaryview.c; cvs diff -u -r 1.96.2.237 -r 1.96.2.238 src/textview.c; cvs diff -u -r 1.12.2.29 -r 1.12.2.30 src/textview.h; ) > 3.8.0cvs32.patchset
|
||||
|
|
|
@ -12,7 +12,7 @@ MINOR_VERSION=8
|
|||
MICRO_VERSION=0
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
EXTRA_VERSION=31
|
||||
EXTRA_VERSION=32
|
||||
EXTRA_RELEASE=
|
||||
EXTRA_GTK2_VERSION=
|
||||
|
||||
|
|
|
@ -3066,8 +3066,6 @@ static void copy_msginfo_flags(MsgInfo *source, MsgInfo *dest)
|
|||
|
||||
static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo *flagsource)
|
||||
{
|
||||
MsgInfoUpdate msginfo_update;
|
||||
|
||||
/* update folder stats */
|
||||
if (MSG_IS_NEW(newmsginfo->flags))
|
||||
item->new_msgs++;
|
||||
|
@ -3094,10 +3092,6 @@ static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo
|
|||
if (!item->cache)
|
||||
folder_item_read_cache(item);
|
||||
|
||||
msginfo_update.msginfo = newmsginfo;
|
||||
msginfo_update.flags = MSGINFO_UPDATE_ADDED;
|
||||
hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
|
||||
|
||||
msgcache_add_msg(item->cache, newmsginfo);
|
||||
copy_msginfo_flags(flagsource, newmsginfo);
|
||||
folder_item_update_with_msg(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_ADDMSG, newmsginfo);
|
||||
|
|
|
@ -180,7 +180,6 @@ static void about_cb (GtkAction *action,
|
|||
static void messageview_update (MessageView *msgview,
|
||||
MsgInfo *old_msginfo);
|
||||
static gboolean messageview_update_msg (gpointer source, gpointer data);
|
||||
static gboolean messageview_msg_moved (gpointer source, gpointer data);
|
||||
|
||||
static void messageview_nothing_cb (GtkAction *action, gpointer data)
|
||||
{
|
||||
|
@ -410,10 +409,10 @@ MessageView *messageview_create(MainWindow *mainwin)
|
|||
messageview->statusbar_cid = 0;
|
||||
|
||||
messageview->show_full_text= FALSE;
|
||||
messageview->update_needed = FALSE;
|
||||
|
||||
messageview->msginfo_update_callback_id =
|
||||
hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, messageview_update_msg, (gpointer) messageview);
|
||||
messageview->msginfo_moved_callback_id = 0;
|
||||
|
||||
return messageview;
|
||||
}
|
||||
|
@ -718,8 +717,6 @@ static MessageView *messageview_create_with_new_window_visible(MainWindow *mainw
|
|||
g_signal_connect(G_OBJECT(window), "key_press_event",
|
||||
G_CALLBACK(key_pressed), msgview);
|
||||
#endif
|
||||
msgview->msginfo_moved_callback_id = hooks_register_hook(MSGINFO_UPDATE_HOOKLIST,
|
||||
messageview_msg_moved, (gpointer) msgview);
|
||||
messageview_add_toolbar(msgview, window);
|
||||
|
||||
if (show) {
|
||||
|
@ -1556,6 +1553,13 @@ void messageview_clear(MessageView *messageview)
|
|||
procmsg_msginfo_free(messageview->msginfo);
|
||||
messageview->msginfo = NULL;
|
||||
messageview->filtered = FALSE;
|
||||
|
||||
if (messageview->window) {
|
||||
gtk_window_set_title(GTK_WINDOW(messageview->window),
|
||||
_("Claws Mail - Message View"));
|
||||
GTK_EVENTS_FLUSH();
|
||||
}
|
||||
|
||||
mimeview_clear(messageview->mimeview);
|
||||
headerview_clear(messageview->headerview);
|
||||
noticeview_hide(messageview->noticeview);
|
||||
|
@ -1574,13 +1578,9 @@ void messageview_destroy(MessageView *messageview)
|
|||
messageview->mainwin->summaryview->displayed = NULL;
|
||||
messageview->mainwin->summaryview->ext_messageview = NULL;
|
||||
}
|
||||
if (!messageview->deferred_destroy) {
|
||||
if (!messageview->deferred_destroy)
|
||||
hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
|
||||
messageview->msginfo_update_callback_id);
|
||||
if (messageview->new_window)
|
||||
hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
|
||||
messageview->msginfo_moved_callback_id);
|
||||
}
|
||||
|
||||
if (messageview->updating) {
|
||||
debug_print("uh oh, better not touch that now (fetching)\n");
|
||||
|
@ -2876,44 +2876,35 @@ static gboolean messageview_update_msg(gpointer source, gpointer data)
|
|||
{
|
||||
MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
|
||||
MessageView *messageview = (MessageView *)data;
|
||||
MsgInfo *old_msginfo = messageview->msginfo;
|
||||
|
||||
if (messageview->msginfo != msginfo_update->msginfo)
|
||||
return FALSE;
|
||||
|
||||
if ((msginfo_update->flags & MSGINFO_UPDATE_DELETED) &&
|
||||
!messageview->new_window)
|
||||
if ((msginfo_update->flags & MSGINFO_UPDATE_DELETED) ||
|
||||
MSG_IS_DELETED(old_msginfo->flags))
|
||||
{
|
||||
MsgInfo *old_msginfo = messageview->msginfo;
|
||||
messageview_clear(messageview);
|
||||
messageview_update(messageview, old_msginfo);
|
||||
}
|
||||
if (messageview->new_window) {
|
||||
if (old_msginfo->folder && old_msginfo->folder->total_msgs == 0) {
|
||||
messageview_clear(messageview);
|
||||
textview_show_info(messageview->mimeview->textview,
|
||||
_("\n There are no messages in this folder"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!prefs_common.always_show_msg) {
|
||||
messageview_clear(messageview);
|
||||
textview_show_info(messageview->mimeview->textview,
|
||||
_("\n Message has been deleted"));
|
||||
} else
|
||||
messageview->update_needed = TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
messageview_clear(messageview);
|
||||
messageview_update(messageview, old_msginfo);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean messageview_msg_moved(gpointer source, gpointer data)
|
||||
{
|
||||
MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
|
||||
MessageView *messageview = (MessageView *) data;
|
||||
MsgInfo *msg_old = messageview->msginfo;
|
||||
MsgInfo *msg_new = msginfo_update->msginfo;
|
||||
|
||||
if (msg_new == NULL || msg_old == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (strcmp2(msg_new->msgid, msg_old->msgid))
|
||||
return FALSE;
|
||||
|
||||
if ((msginfo_update->flags & MSGINFO_UPDATE_ADDED) &&
|
||||
(folder_item_get_msginfo(msg_old->folder, msg_old->msgnum) == NULL))
|
||||
{
|
||||
if (folder_has_parent_of_type(msg_new->folder, F_TRASH))
|
||||
messageview_destroy(messageview);
|
||||
else
|
||||
messageview_show(messageview, msg_new,
|
||||
messageview->all_headers);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,12 +75,12 @@ struct _MessageView
|
|||
gboolean all_headers;
|
||||
|
||||
gint msginfo_update_callback_id;
|
||||
gint msginfo_moved_callback_id;
|
||||
gboolean updating;
|
||||
gboolean deferred_destroy;
|
||||
|
||||
gboolean show_full_text;
|
||||
gboolean partial_display_shown;
|
||||
gboolean update_needed;
|
||||
GtkUIManager *ui_manager;
|
||||
GList *trail;
|
||||
gint trail_pos;
|
||||
|
|
|
@ -174,8 +174,7 @@ typedef guint32 MsgTmpFlags;
|
|||
|
||||
typedef enum {
|
||||
MSGINFO_UPDATE_FLAGS = 1 << 0,
|
||||
MSGINFO_UPDATE_DELETED = 1 << 1,
|
||||
MSGINFO_UPDATE_ADDED = 1 << 2
|
||||
MSGINFO_UPDATE_DELETED = 1 << 1
|
||||
} MsgInfoUpdateFlags;
|
||||
|
||||
#include "procmime.h"
|
||||
|
|
|
@ -6817,6 +6817,8 @@ static void summary_unselected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
|||
static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
||||
gint column, SummaryView *summaryview)
|
||||
{
|
||||
GList *list, *cur;
|
||||
MessageView *msgview;
|
||||
MsgInfo *msginfo;
|
||||
gboolean marked_unread = FALSE;
|
||||
|
||||
|
@ -6908,6 +6910,17 @@ static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
|
|||
break;
|
||||
}
|
||||
|
||||
list = messageview_get_msgview_list();
|
||||
for (cur = list; cur != NULL; cur = cur->next) {
|
||||
msgview = (MessageView *) cur->data;
|
||||
|
||||
if (msgview->new_window && msgview->update_needed) {
|
||||
MsgInfo *new_msginfo = summary_get_selected_msg(summaryview);
|
||||
messageview_show(msgview, new_msginfo, msgview->all_headers);
|
||||
msgview->update_needed = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (summaryview->display_msg ||
|
||||
(prefs_common.always_show_msg &&
|
||||
messageview_is_visible(summaryview->messageview))) {
|
||||
|
|
|
@ -862,6 +862,23 @@ void textview_show_error(TextView *textview)
|
|||
textview_show_icon(textview, GTK_STOCK_DIALOG_ERROR);
|
||||
}
|
||||
|
||||
void textview_show_info(TextView *textview, const gchar *info_str)
|
||||
{
|
||||
GtkTextView *text;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
|
||||
textview_set_font(textview, NULL);
|
||||
textview_clear(textview);
|
||||
|
||||
text = GTK_TEXT_VIEW(textview->text);
|
||||
buffer = gtk_text_view_get_buffer(text);
|
||||
gtk_text_buffer_get_start_iter(buffer, &iter);
|
||||
|
||||
TEXTVIEW_INSERT(info_str);
|
||||
textview_show_icon(textview, GTK_STOCK_DIALOG_INFO);
|
||||
}
|
||||
|
||||
void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
|
||||
{
|
||||
GtkTextView *text;
|
||||
|
|
|
@ -90,6 +90,8 @@ void textview_show_part (TextView *textview,
|
|||
MimeInfo *mimeinfo,
|
||||
FILE *fp);
|
||||
void textview_show_error (TextView *textview);
|
||||
void textview_show_info (TextView *textview,
|
||||
const gchar *info_str);
|
||||
void textview_show_mime_part (TextView *textview,
|
||||
MimeInfo *partinfo);
|
||||
void textview_clear (TextView *textview);
|
||||
|
|
Loading…
Reference in a new issue