*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "defs.h"
FOLDERSEL_FOLDERITEM,
FOLDERSEL_PIXBUF,
FOLDERSEL_PIXBUF_OPEN,
- FOLDERSEL_EXPANDER,
+ FOLDERSEL_FOREGROUND,
+ FOLDERSEL_BOLD,
N_FOLDERSEL_COLUMNS
};
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE);
gtk_window_set_wmclass
- (GTK_WINDOW(window), "folder_selection", "Sylpheed");
+ (GTK_WINDOW(window), "folder_selection", "Sylpheed-Claws");
gtk_widget_realize(window);
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(delete_event), NULL);
G_TYPE_POINTER,
GDK_TYPE_PIXBUF,
GDK_TYPE_PIXBUF,
+ GDK_TYPE_COLOR,
G_TYPE_BOOLEAN);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(tree_store),
FOLDERSEL_FOLDERNAME,
gtk_tree_view_column_pack_start(column, renderer, FALSE);
gtk_tree_view_column_set_attributes
(column, renderer,
- "is-expander", FOLDERSEL_EXPANDER,
"pixbuf", FOLDERSEL_PIXBUF,
"pixbuf-expander-open", FOLDERSEL_PIXBUF_OPEN,
"pixbuf-expander-closed", FOLDERSEL_PIXBUF,
/* create text renderer */
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_column_pack_start(column, renderer, TRUE);
- gtk_tree_view_column_set_attributes(column, renderer,
- "text", FOLDERSEL_FOLDERNAME,
- NULL);
+ gtk_tree_view_column_set_attributes
+ (column, renderer,
+ "text", FOLDERSEL_FOLDERNAME,
+ "foreground-gdk", FOLDERSEL_FOREGROUND,
+ "weight-set", FOLDERSEL_BOLD,
+ NULL);
+ g_object_set(G_OBJECT(renderer), "weight", PANGO_WEIGHT_BOLD, NULL);
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
{
gchar *name, *tmpname;
GdkPixbuf *pixbuf, *pixbuf_open;
+ gboolean use_bold, use_color;
+ GdkColor *foreground = NULL;
+ static GdkColor color_noselect = {0, COLOR_DIM, COLOR_DIM, COLOR_DIM};
+ static GdkColor color_new;
+
+ gtkut_convert_int_to_gdk_color(prefs_common.color_new, &color_new);
name = tmpname = folder_item_get_name(item);
}
#endif
- gtk_tree_store_append(store, iter, parent);
+ if (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0) {
+ name = g_strdup_printf("%s (%d)", name, item->total_msgs);
+ } else if (item->unread_msgs > 0) {
+ name = g_strdup_printf("%s (%d)", name, item->unread_msgs);
+ } else
+ name = g_strdup(name);
- pixbuf = item->no_select ? foldernoselect_pixbuf : folder_pixbuf,
+ pixbuf = item->no_select ? foldernoselect_pixbuf : folder_pixbuf;
pixbuf_open =
- item->no_select ? foldernoselect_pixbuf : folderopen_pixbuf,
+ item->no_select ? foldernoselect_pixbuf : folderopen_pixbuf;
+
+ if (folder_has_parent_of_type(item, F_DRAFT) ||
+ folder_has_parent_of_type(item, F_OUTBOX) ||
+ folder_has_parent_of_type(item, F_TRASH)) {
+ use_bold = use_color = FALSE;
+ } else if (folder_has_parent_of_type(item, F_QUEUE)) {
+ use_bold = use_color = (item->total_msgs > 0);
+ } else {
+ use_bold = (item->unread_msgs > 0);
+ use_color = (item->new_msgs > 0);
+ }
+
+ if (item->no_select)
+ foreground = &color_noselect;
+ else if (use_color)
+ foreground = &color_new;
/* insert this node */
+ gtk_tree_store_append(store, iter, parent);
gtk_tree_store_set(store, iter,
FOLDERSEL_FOLDERNAME, name,
FOLDERSEL_FOLDERITEM, item,
FOLDERSEL_PIXBUF, pixbuf,
FOLDERSEL_PIXBUF_OPEN, pixbuf_open,
- FOLDERSEL_EXPANDER,
- item->node->children ? TRUE : FALSE,
+ FOLDERSEL_FOREGROUND, foreground,
+ FOLDERSEL_BOLD, use_bold,
-1);
g_free(tmpname);
if ((p && FOLDER_TYPE(selected_item->folder) != F_IMAP) ||
(p && FOLDER_TYPE(selected_item->folder) == F_IMAP &&
*(p + 1) != '\0')) {
- alertpanel_error(_("`%c' can't be included in folder name."),
+ alertpanel_error(_("'%c' can't be included in folder name."),
G_DIR_SEPARATOR);
return;
}
/* find whether the directory already exists */
if (folder_find_child_item_by_name(selected_item, new_folder)) {
- alertpanel_error(_("The folder `%s' already exists."),
+ alertpanel_error(_("The folder '%s' already exists."),
disp_name);
return;
}
new_item = folder_create_folder(selected_item, new_folder);
if (!new_item) {
- alertpanel_error(_("Can't create the folder `%s'."), disp_name);
+ alertpanel_error(_("Can't create the folder '%s'."), disp_name);
return;
}
- /* parent can expand */
- gtk_tree_store_set(store, &selected, FOLDERSEL_EXPANDER, TRUE,
- -1);
-
/* add new child */
foldersel_append_item(store, new_item, &new_child, &selected);