aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-29 07:01:32 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-29 07:01:32 +0000
commit03d5278cdd2fd4fd7b6caef33aa53b28e71ffc1c (patch)
tree56859ef1a0ac0310a47f9670113e2b2f2e0f7524 /src
parentf105a6dc818de10f476cf5f48c9c590428c661ef (diff)
added 'Junk' special folder and automatically create it when not exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2638 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/foldersel.c6
-rw-r--r--src/folderview.c6
-rw-r--r--src/icons/Makefile.am2
-rw-r--r--src/prefs_folder_item.c7
-rw-r--r--src/stock_pixmap.c2
-rw-r--r--src/stock_pixmap.h1
6 files changed, 20 insertions, 4 deletions
diff --git a/src/foldersel.c b/src/foldersel.c
index 61c9a809..bca88d0f 100644
--- a/src/foldersel.c
+++ b/src/foldersel.c
@@ -417,6 +417,10 @@ static void foldersel_append_item(GtkTreeStore *store, FolderItem *item,
if (!strcmp2(item->name, DRAFT_DIR))
name = _("Drafts");
break;
+ case F_JUNK:
+ if (!strcmp2(item->name, JUNK_DIR))
+ name = _("Junk");
+ break;
default:
break;
}
@@ -449,7 +453,7 @@ static void foldersel_append_item(GtkTreeStore *store, FolderItem *item,
pixbuf_open = no_select ? foldernoselect_pixbuf : folderopen_pixbuf;
if (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
- item->stype == F_TRASH) {
+ item->stype == F_TRASH || item->stype == F_JUNK) {
use_color = FALSE;
} else if (item->stype == F_QUEUE) {
use_color = (item->total > 0);
diff --git a/src/folderview.c b/src/folderview.c
index 66feed77..998bbe25 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -111,6 +111,7 @@ static GdkPixbuf *folderopen_pixbuf;
static GdkPixbuf *foldernoselect_pixbuf;
static GdkPixbuf *draft_pixbuf;
static GdkPixbuf *trash_pixbuf;
+static GdkPixbuf *junk_pixbuf;
static GdkPixbuf *virtual_pixbuf;
static void folderview_set_columns (FolderView *folderview);
@@ -561,6 +562,7 @@ void folderview_init(FolderView *folderview)
&foldernoselect_pixbuf);
stock_pixbuf_gdk(treeview, STOCK_PIXMAP_DRAFT, &draft_pixbuf);
stock_pixbuf_gdk(treeview, STOCK_PIXMAP_TRASH, &trash_pixbuf);
+ stock_pixbuf_gdk(treeview, STOCK_PIXMAP_SPAM_SMALL, &junk_pixbuf);
stock_pixbuf_gdk(treeview, STOCK_PIXMAP_FOLDER_SEARCH, &virtual_pixbuf);
}
@@ -1266,15 +1268,13 @@ static void folderview_update_row(FolderView *folderview, GtkTreeIter *iter)
!strcmp2(item->name, DRAFT_DIR) ? _("Drafts") :
item->name);
break;
-#if 0
case F_JUNK:
- pixbuf = folder_pixbuf;
+ pixbuf = open_pixbuf = junk_pixbuf;
open_pixbuf = folderopen_pixbuf;
name = g_strdup(FOLDER_IS_LOCAL(item->folder) &&
!strcmp2(item->name, JUNK_DIR) ? _("Junk") :
item->name);
break;
-#endif
case F_VIRTUAL:
pixbuf = open_pixbuf = virtual_pixbuf;
name = g_strdup(item->name);
diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am
index b69e078a..c1ad743b 100644
--- a/src/icons/Makefile.am
+++ b/src/icons/Makefile.am
@@ -20,6 +20,7 @@ BUILT_SOURCES = \
stock_person.h \
stock_book.h \
stock_spam.h \
+ stock_spam_16.h \
stock_notspam.h \
stock_sylpheed.h \
stock_sylpheed_16.h \
@@ -55,6 +56,7 @@ EXTRA_DIST = \
stock_person.png \
stock_book.png \
stock_spam.png \
+ stock_spam_16.png \
stock_notspam.png \
stock_sylpheed.png \
stock_sylpheed_16.png \
diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c
index a6d67220..a3e725a7 100644
--- a/src/prefs_folder_item.c
+++ b/src/prefs_folder_item.c
@@ -237,6 +237,7 @@ static void prefs_folder_item_general_create(PrefsFolderItemDialog *dialog)
MENUITEM_ADD(optmenu_menu, menuitem, _("Drafts"), F_DRAFT);
MENUITEM_ADD(optmenu_menu, menuitem, _("Queue") , F_QUEUE);
MENUITEM_ADD(optmenu_menu, menuitem, _("Trash") , F_TRASH);
+ MENUITEM_ADD(optmenu_menu, menuitem, _("Junk") , F_JUNK);
gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), optmenu_menu);
@@ -562,6 +563,12 @@ static void prefs_folder_item_apply_cb(GtkWidget *widget,
prev_item = folder->trash;
folder->trash = item;
break;
+ case F_JUNK:
+ prev_item = folder_get_junk(folder);
+ if (prev_item)
+ prev_item->stype = F_NORMAL;
+ folder_set_junk(folder, item);
+ break;
default:
type = item->stype;
break;
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
index c5497192..0da2155b 100644
--- a/src/stock_pixmap.c
+++ b/src/stock_pixmap.c
@@ -64,6 +64,7 @@
#include "icons/stock_delete.h"
#include "icons/stock_delete_16.h"
#include "icons/stock_spam.h"
+#include "icons/stock_spam_16.h"
#include "icons/stock_notspam.h"
#include "icons/stock_hand-signed.h"
#include "icons/stock_sylpheed.h"
@@ -150,6 +151,7 @@ static StockPixmapData pixmaps[] =
{NULL, NULL, NULL, NULL, sylpheed_logo, sizeof(sylpheed_logo), NULL, 0},
{NULL, NULL, NULL, NULL, stock_person, sizeof(stock_person), "stock_person", 16},
{NULL, NULL, NULL, NULL, folder_search, sizeof(folder_search), "folder-search", 0},
+ {NULL, NULL, NULL, NULL, stock_spam_16, sizeof(stock_spam_16), "stock_spam", 16},
};
diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h
index f97d564a..a7c6d392 100644
--- a/src/stock_pixmap.h
+++ b/src/stock_pixmap.h
@@ -79,6 +79,7 @@ typedef enum
STOCK_PIXMAP_SYLPHEED_LOGO,
STOCK_PIXMAP_PERSON,
STOCK_PIXMAP_FOLDER_SEARCH,
+ STOCK_PIXMAP_SPAM_SMALL,
N_STOCK_PIXMAPS
} StockPixmap;