2005-06-22 [colin] 1.9.11cvs89

* src/summaryview.c
	* src/summaryview.h
	* src/mainwindow.c
		Rename "Message/Delete" to "Message/Move to trash"
		Add "Message/Delete..." that directly destroys the
		selected messages after asking for a confirmation.
This commit is contained in:
Colin Leroy 2005-06-22 18:23:15 +00:00
parent 6ba7efd1c1
commit bdc513e7bc
6 changed files with 61 additions and 30 deletions

View file

@ -1,3 +1,12 @@
2005-06-22 [colin] 1.9.11cvs89
* src/summaryview.c
* src/summaryview.h
* src/mainwindow.c
Rename "Message/Delete" to "Message/Move to trash"
Add "Message/Delete..." that directly destroys the
selected messages after asking for a confirmation.
2005-06-22 [colin] 1.9.11cvs88
* src/imap.c

View file

@ -577,3 +577,4 @@
( cvs diff -u -r 1.213.2.36 -r 1.213.2.37 src/folder.c; cvs diff -u -r 1.207.2.43 -r 1.207.2.44 src/folderview.c; cvs diff -u -r 1.179.2.36 -r 1.179.2.37 src/imap.c; cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/imap_gtk.c; cvs diff -u -r 1.2.2.6 -r 1.2.2.7 src/mh_gtk.c; ) > 1.9.11cvs86.patchset
( cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/gtk/foldersort.c; ) > 1.9.11cvs87.patchset
( cvs diff -u -r 1.179.2.37 -r 1.179.2.38 src/imap.c; ) > 1.9.11cvs88.patchset
( cvs diff -u -r 1.395.2.83 -r 1.395.2.84 src/summaryview.c; cvs diff -u -r 1.68.2.8 -r 1.68.2.9 src/summaryview.h; cvs diff -u -r 1.274.2.42 -r 1.274.2.43 src/mainwindow.c; ) > 1.9.11cvs89.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=9
MICRO_VERSION=11
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=88
EXTRA_VERSION=89
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -229,6 +229,9 @@ static void copy_to_cb (MainWindow *mainwin,
static void delete_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void delete_trash_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
static void cancel_cb (MainWindow *mainwin,
guint action,
@ -681,7 +684,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/M_ove..."), "<control>O", move_to_cb, 0, NULL},
{N_("/_Message/_Copy..."), "<shift><control>O", copy_to_cb, 0, NULL},
{N_("/_Message/_Delete"), "<control>D", delete_cb, 0, NULL},
{N_("/_Message/Move to _trash"), "<control>D", delete_trash_cb, 0, NULL},
{N_("/_Message/_Delete..."), NULL, delete_cb, 0, NULL},
{N_("/_Message/Cancel a news message"), "", cancel_cb, 0, NULL},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Mark"), NULL, NULL, 0, "<Branch>"},
@ -1804,7 +1808,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
{"/Message/Redirect" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
{"/Message/Move..." , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
{"/Message/Copy..." , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
{"/Message/Delete" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Message/Move to trash" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Message/Delete..." , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Message/Cancel a news message" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NEWS},
{"/Message/Mark" , M_TARGET_EXIST},
{"/Message/Re-edit" , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
@ -2646,6 +2651,11 @@ static void delete_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
summary_delete(mainwin->summaryview);
}
static void delete_trash_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
summary_delete_trash(mainwin->summaryview);
}
static void cancel_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
{
summary_cancel(mainwin->summaryview);

View file

@ -404,7 +404,8 @@ static GtkItemFactoryEntry summary_popup_entries[] =
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/M_ove..."), "<control>O", summary_move_to, 0, NULL},
{N_("/_Copy..."), "<shift><control>O", summary_copy_to, 0, NULL},
{N_("/_Delete"), "<control>D", summary_delete, 0, NULL},
{N_("/Move to _trash"), "<control>D", summary_delete_trash, 0, NULL},
{N_("/_Delete..."), NULL, summary_delete, 0, NULL},
{N_("/Cancel a news message"), NULL, summary_cancel, 0, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Mark"), NULL, NULL, 0, "<Branch>"},
@ -1215,7 +1216,8 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
{"/Move..." , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Copy..." , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
{"/Delete" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Move to trash" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Delete..." , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
{"/Cancel a news message" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NEWS},
{"/Mark" , M_TARGET_EXIST},
@ -3065,30 +3067,28 @@ void summary_delete(SummaryView *summaryview)
GList *cur;
GtkCTreeNode *sel_last = NULL;
GtkCTreeNode *node;
AlertValue aval;
MsgInfo *msginfo;
if (!item) return;
if (summary_is_locked(summaryview)) return;
/* if current folder is trash, ask for confirmation */
if (item->stype == F_TRASH) {
AlertValue aval;
MsgInfo *msginfo;
if (!summaryview->folder_item ||
FOLDER_TYPE(summaryview->folder_item->folder) == F_NEWS) return;
aval = alertpanel(_("Delete message(s)"),
_("Do you really want to delete message(s) from the trash?"),
GTK_STOCK_YES, GTK_STOCK_NO, NULL);
if (aval != G_ALERTDEFAULT) return;
aval = alertpanel(_("Delete message(s)"),
_("Do you really want to delete selected message(s)?"),
GTK_STOCK_YES, GTK_STOCK_NO, NULL);
if (aval != G_ALERTDEFAULT) return;
for (cur = GTK_CLIST(ctree)->selection; cur != NULL && cur->data != NULL;
cur = cur->next) {
GtkCTreeNode *row = GTK_CTREE_NODE(cur->data);
msginfo = gtk_ctree_node_get_row_data(ctree, row);
if (msginfo->total_size != 0 &&
msginfo->size != (off_t)msginfo->total_size)
partial_mark_for_delete(msginfo);
}
for (cur = GTK_CLIST(ctree)->selection; cur != NULL && cur->data != NULL;
cur = cur->next) {
GtkCTreeNode *row = GTK_CTREE_NODE(cur->data);
msginfo = gtk_ctree_node_get_row_data(ctree, row);
if (msginfo->total_size != 0 &&
msginfo->size != (off_t)msginfo->total_size)
partial_mark_for_delete(msginfo);
}
main_window_cursor_wait(summaryview->mainwin);
@ -3123,6 +3123,22 @@ void summary_delete(SummaryView *summaryview)
main_window_cursor_normal(summaryview->mainwin);
}
void summary_delete_trash(SummaryView *summaryview)
{
FolderItem *to_folder;
if (!summaryview->folder_item ||
FOLDER_TYPE(summaryview->folder_item->folder) == F_NEWS) return;
to_folder = summaryview->folder_item->folder->trash;
if (to_folder == NULL || to_folder == summaryview->folder_item)
summary_delete(summaryview);
else
summary_move_selected_to(summaryview, to_folder);
}
static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
@ -3640,22 +3656,16 @@ static void summary_execute_copy_func(GtkCTree *ctree, GtkCTreeNode *node,
static void summary_execute_delete(SummaryView *summaryview)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
FolderItem *trash;
GSList *cur;
trash = summaryview->folder_item->folder->trash;
/* search deleting messages and execute */
gtk_ctree_pre_recursive
(ctree, NULL, summary_execute_delete_func, summaryview);
if (!summaryview->mlist) return;
if (trash == NULL || summaryview->folder_item == trash)
folder_item_remove_msgs(summaryview->folder_item,
summaryview->mlist);
else
folder_item_move_msgs(trash, summaryview->mlist);
folder_item_remove_msgs(summaryview->folder_item,
summaryview->mlist);
for (cur = summaryview->mlist; cur != NULL && cur->data != NULL; cur = cur->next)
procmsg_msginfo_free((MsgInfo *)cur->data);

View file

@ -210,6 +210,7 @@ void summary_sort (SummaryView *summaryview,
FolderSortType sort_type);
void summary_delete (SummaryView *summaryview);
void summary_delete_trash (SummaryView *summaryview);
void summary_cancel (SummaryView *summaryview);