diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-25 06:53:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-25 06:53:07 +0000 |
commit | 34a24148d4315d15e092760c983ff45115a32e00 (patch) | |
tree | 0592ef51839ecb8ebc2d01ccff57bc11dcb91eb5 | |
parent | eca7e29772e97171adbcdad759c11dbd945c7f66 (diff) |
don't show 'Empty trash' dialog if trashed messages don't exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@927 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.ja | 8 | ||||
-rw-r--r-- | libsylph/procmsg.c | 14 | ||||
-rw-r--r-- | libsylph/procmsg.h | 1 | ||||
-rw-r--r-- | src/folderview.c | 6 | ||||
-rw-r--r-- | src/mainwindow.c | 3 |
6 files changed, 38 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2006-01-25 + * libsylph/procmsg.[ch]: procmsg_trash_messages_exist(): added. + * src/folderview.c: folderview_menu_popup(): don't make 'Empty trash' + active if trashed messages don't exist. + src/mainwindow.c: main_window_empty_trash(): return immediately + when trashed messages don't exist. + +2006-01-25 + * src/compose.c: 'File/Insert signature' now inserts signature into current cursor position. 'File/Append signature' was added for the previous behavior. diff --git a/ChangeLog.ja b/ChangeLog.ja index 1719cad3..a3da4e6c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,13 @@ 2006-01-25 + * libsylph/procmsg.[ch]: procmsg_trash_messages_exist(): 追加。 + * src/folderview.c: folderview_menu_popup(): ごみ箱のメッセージが存在 + しなければ「ごみ箱を空にする」を有効にしないようにした。 + * src/mainwindow.c: main_window_empty_trash(): ごみ箱のメッセージが存在 + しなければすぐに返るようにした。 + +2006-01-25 + * src/compose.c: 「ファイル/署名を挿入」で署名を現在のカーソル位置に 挿入するようにした。「ファイル/署名を追加」を以前の動作として追加。 diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 26abee6a..3487bdf0 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -1188,6 +1188,20 @@ gboolean procmsg_msg_exist(MsgInfo *msginfo) return ret; } +gboolean procmsg_trash_messages_exist(void) +{ + FolderItem *trash; + GList *cur; + + for (cur = folder_get_list(); cur != NULL; cur = cur->next) { + trash = FOLDER(cur->data)->trash; + if (trash && trash->total > 0) + return TRUE; + } + + return FALSE; +} + void procmsg_empty_trash(FolderItem *trash) { if (trash && trash->total > 0) { diff --git a/libsylph/procmsg.h b/libsylph/procmsg.h index 87af5b75..19de310e 100644 --- a/libsylph/procmsg.h +++ b/libsylph/procmsg.h @@ -287,6 +287,7 @@ FILE *procmsg_open_message_decrypted (MsgInfo *msginfo, gboolean procmsg_msg_exist (MsgInfo *msginfo); +gboolean procmsg_trash_messages_exist (void); void procmsg_empty_trash (FolderItem *trash); void procmsg_empty_all_trash (void); diff --git a/src/folderview.c b/src/folderview.c index 8349b9e5..5a903324 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -1605,8 +1605,10 @@ static gboolean folderview_menu_popup(FolderView *folderview, rename_folder = delete_folder = TRUE; if (folder->klass->move_folder) move_folder = TRUE; - } else if (item->stype == F_TRASH) - empty_trash = TRUE; + } else if (item->stype == F_TRASH) { + if (item->total > 0) + empty_trash = TRUE; + } } else if (FOLDER_TYPE(folder) == F_NEWS) { if (item->parent != NULL) delete_folder = TRUE; diff --git a/src/mainwindow.c b/src/mainwindow.c index e42f6f89..632355de 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -1616,6 +1616,9 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm) { GList *list; + if (!procmsg_trash_messages_exist()) + return; + if (confirm) { if (alertpanel(_("Empty all trash"), _("Delete all messages in trash folders?"), |