aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-10-13 09:29:14 +0800
committerDan Winship <danw@src.gnome.org>2001-10-13 09:29:14 +0800
commit29175904b018da8bc93587736018eaec2e10451e (patch)
treed8f281525bd055e88b51effad61220f650e318cb /mail
parent5a9173f1b76a95314e421eb5d0d2da805af8c311 (diff)
downloadgsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar.gz
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar.bz2
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar.lz
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar.xz
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.tar.zst
gsoc2013-evolution-29175904b018da8bc93587736018eaec2e10451e.zip
Revert the change to remove the Score column until Chris can fix ETable so
* message-list.c, message-list.h, message-list.etspec: Revert the change to remove the Score column until Chris can fix ETable so it's possible to remove a column without breaking everyone's exisiting settings. svn path=/trunk/; revision=13646
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/message-list.c54
-rw-r--r--mail/message-list.etspec19
-rw-r--r--mail/message-list.h1
4 files changed, 70 insertions, 11 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5ac7fbdbda..9b0e9f4b08 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-12 Dan Winship <danw@ximian.com>
+
+ * message-list.c, message-list.h, message-list.etspec: Revert the
+ change to remove the Score column until Chris can fix ETable so
+ it's possible to remove a column without breaking everyone's
+ exisiting settings.
+
2001-10-12 Iain Holmes <iain@ximian.com>
* importers/evolution-mbox-importer.c (load_file_fn): Don't ever create
diff --git a/mail/message-list.c b/mail/message-list.c
index 88e10f2f84..fdb6e912c7 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -50,6 +50,13 @@
#include "art/attachment.xpm"
#include "art/priority-high.xpm"
#include "art/empty.xpm"
+#include "art/score-lowest.xpm"
+#include "art/score-lower.xpm"
+#include "art/score-low.xpm"
+#include "art/score-normal.xpm"
+#include "art/score-high.xpm"
+#include "art/score-higher.xpm"
+#include "art/score-highest.xpm"
/*#define TIMEIT */
@@ -136,6 +143,13 @@ static struct {
{ empty_xpm, NULL },
{ attachment_xpm, NULL },
{ priority_high_xpm, NULL },
+ { score_lowest_xpm, NULL },
+ { score_lower_xpm, NULL },
+ { score_low_xpm, NULL },
+ { score_normal_xpm, NULL },
+ { score_high_xpm, NULL },
+ { score_higher_xpm, NULL },
+ { score_highest_xpm, NULL },
{ NULL, NULL }
};
@@ -525,6 +539,7 @@ ml_duplicate_value (ETreeModel *etm, int col, const void *value, void *data)
switch (col){
case COL_MESSAGE_STATUS:
case COL_FLAGGED:
+ case COL_SCORE:
case COL_ATTACHMENT:
case COL_DELETED:
case COL_UNREAD:
@@ -550,6 +565,7 @@ ml_free_value (ETreeModel *etm, int col, void *value, void *data)
switch (col){
case COL_MESSAGE_STATUS:
case COL_FLAGGED:
+ case COL_SCORE:
case COL_ATTACHMENT:
case COL_DELETED:
case COL_UNREAD:
@@ -574,6 +590,7 @@ ml_initialize_value (ETreeModel *etm, int col, void *data)
switch (col){
case COL_MESSAGE_STATUS:
case COL_FLAGGED:
+ case COL_SCORE:
case COL_ATTACHMENT:
case COL_DELETED:
case COL_UNREAD:
@@ -599,6 +616,7 @@ ml_value_is_empty (ETreeModel *etm, int col, const void *value, void *data)
switch (col){
case COL_MESSAGE_STATUS:
case COL_FLAGGED:
+ case COL_SCORE:
case COL_ATTACHMENT:
case COL_DELETED:
case COL_UNREAD:
@@ -625,6 +643,16 @@ static const char *status_map[] = {
N_("Multiple Messages"),
};
+static const char *score_map[] = {
+ N_("Lowest"),
+ N_("Lower"),
+ N_("Low"),
+ N_("Normal"),
+ N_("High"),
+ N_("Higher"),
+ N_("Highest"),
+};
+
static char *
ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data)
{
@@ -637,6 +665,12 @@ ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data)
return g_strdup("");
return g_strdup(_(status_map[i]));
+ case COL_SCORE:
+ i = (unsigned int)value + 3;
+ if (i > 6)
+ i = 3;
+ return g_strdup(_(score_map[i]));
+
case COL_ATTACHMENT:
case COL_FLAGGED:
case COL_DELETED:
@@ -773,6 +807,16 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data)
}
case COL_FLAGGED:
return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_FLAGGED) != 0);
+ case COL_SCORE: {
+ const char *tag;
+ int score = 0;
+
+ tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "score");
+ if (tag)
+ score = atoi (tag);
+
+ return GINT_TO_POINTER (score);
+ }
case COL_ATTACHMENT:
return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_ATTACHMENTS) != 0);
case COL_FROM:
@@ -918,6 +962,7 @@ message_list_create_extras (void)
extras = e_table_extras_new();
e_table_extras_add_pixbuf(extras, "status", states_pixmaps [0].pixbuf);
+ e_table_extras_add_pixbuf(extras, "score", states_pixmaps [13].pixbuf);
e_table_extras_add_pixbuf(extras, "attachment", states_pixmaps [6].pixbuf);
e_table_extras_add_pixbuf(extras, "flagged", states_pixmaps [7].pixbuf);
@@ -937,6 +982,11 @@ message_list_create_extras (void)
images [1] = states_pixmaps [7].pixbuf;
e_table_extras_add_cell(extras, "render_flagged", e_cell_toggle_new (0, 2, images));
+ for (i = 0; i < 7; i++)
+ images[i] = states_pixmaps [i + 7].pixbuf;
+
+ e_table_extras_add_cell(extras, "render_score", e_cell_toggle_new (0, 7, images));
+
/* date cell */
cell = e_cell_date_new (NULL, GTK_JUSTIFY_LEFT);
gtk_object_set (GTK_OBJECT (cell),
@@ -1018,8 +1068,8 @@ message_list_setup_etree (MessageList *message_list, gboolean outgoing)
/* Swap From/To for Drafts, Sent, Outbox */
char *state = "<ETableState>"
"<column source=\"0\"/> <column source=\"1\"/> "
- "<column source=\"7\"/> <column source=\"4\"/> "
- "<column source=\"5\"/> <grouping> </grouping> </ETableState>";
+ "<column source=\"8\"/> <column source=\"5\"/> "
+ "<column source=\"6\"/> <grouping> </grouping> </ETableState>";
e_tree_set_state (message_list->tree, state);
}
diff --git a/mail/message-list.etspec b/mail/message-list.etspec
index c8a3ebcb8d..5f80afcbb1 100644
--- a/mail/message-list.etspec
+++ b/mail/message-list.etspec
@@ -1,16 +1,17 @@
<ETableSpecification cursor-mode="line" draw-grid="false" draw-focus="true" selection-mode="browse">
<ETableColumn model_col= "0" _title="Status" pixbuf="status" expansion="0.0" minimum_width="18" resizable="false" cell="render_message_status" compare="integer" sortable="false"/>
<ETableColumn model_col= "1" _title="Flagged" pixbuf="flagged" expansion="0.0" minimum_width="18" resizable="false" cell="render_flagged" compare="integer"/>
- <ETableColumn model_col= "2" _title="Attachment" pixbuf="attachment" expansion="0.0" minimum_width="18" resizable="false" cell="render_attachment" compare="integer" sortable="false"/>
- <ETableColumn model_col= "3" _title="From" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
- <ETableColumn model_col= "4" _title="Subject" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="subject_compare"/>
- <ETableColumn model_col= "5" _title="Sent" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
- <ETableColumn model_col= "6" _title="Received" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
- <ETableColumn model_col= "7" _title="To" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
- <ETableColumn model_col= "8" _title="Size" expansion="0.2" minimum_width="32" resizable="true" cell="render_size" compare="integer"/>
+ <ETableColumn model_col= "2" _title="Score" pixbuf="score" expansion="0.0" minimum_width="18" resizable="false" cell="render_score" compare="integer"/>
+ <ETableColumn model_col= "3" _title="Attachment" pixbuf="attachment" expansion="0.0" minimum_width="18" resizable="false" cell="render_attachment" compare="integer" sortable="false"/>
+ <ETableColumn model_col= "4" _title="From" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
+ <ETableColumn model_col= "5" _title="Subject" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="subject_compare"/>
+ <ETableColumn model_col= "6" _title="Sent" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
+ <ETableColumn model_col= "7" _title="Received" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
+ <ETableColumn model_col= "8" _title="To" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
+ <ETableColumn model_col= "9" _title="Size" expansion="0.2" minimum_width="32" resizable="true" cell="render_size" compare="integer"/>
<ETableState>
- <column source="0"/> <column source="2"/> <column source="1"/>
- <column source="3"/> <column source="4" expansion="1.60"/> <column source="5" expansion="0.40"/>
+ <column source="0"/> <column source="3"/> <column source="1"/>
+ <column source="4"/> <column source="5" expansion="1.60"/> <column source="6" expansion="0.40"/>
<grouping> </grouping>
</ETableState>
</ETableSpecification>
diff --git a/mail/message-list.h b/mail/message-list.h
index f07e251435..380d57d46d 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -18,6 +18,7 @@
enum {
COL_MESSAGE_STATUS,
COL_FLAGGED,
+ COL_SCORE,
COL_ATTACHMENT,
COL_FROM,
COL_SUBJECT,