Implement, return a text description of the localfolder.
2002-06-01 Not Zed <NotZed@Ximian.com> * mail-local.c (mlf_getv): Implement, return a text description of the localfolder. * message-list.c (ml_duplicate_value): (ml_free_value): (ml_initialize_value): (ml_value_is_empty): (ml_value_to_string): (ml_tree_value_at): Implement COL_LOCATION, original location of message (useful for vfolder). svn path=/trunk/; revision=17072
This commit is contained in:
@ -1,3 +1,16 @@
|
||||
2002-06-01 Not Zed <NotZed@Ximian.com>
|
||||
|
||||
* mail-local.c (mlf_getv): Implement, return a text description of
|
||||
the localfolder.
|
||||
|
||||
* message-list.c (ml_duplicate_value):
|
||||
(ml_free_value):
|
||||
(ml_initialize_value):
|
||||
(ml_value_is_empty):
|
||||
(ml_value_to_string):
|
||||
(ml_tree_value_at): Implement COL_LOCATION, original location of
|
||||
message (useful for vfolder).
|
||||
|
||||
2002-06-02 Larry Ewing <lewing@ximian.com>
|
||||
|
||||
* mail-tools.c (mail_tool_quote_message): make these citations as
|
||||
|
||||
@ -111,6 +111,7 @@ typedef struct {
|
||||
CamelFolder *real_folder;
|
||||
CamelStore *real_store;
|
||||
|
||||
char *description;
|
||||
char *real_path;
|
||||
|
||||
struct _local_meta *meta;
|
||||
@ -512,6 +513,48 @@ mlf_set_folder(MailLocalFolder *mlf, guint32 flags, CamelException *ex)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
mlf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
|
||||
{
|
||||
CamelFolder *folder = (CamelFolder *)object;
|
||||
MailLocalFolder *mlf = (MailLocalFolder *)object;
|
||||
int i, count=args->argc;
|
||||
guint32 tag;
|
||||
|
||||
for (i=0;i<args->argc;i++) {
|
||||
CamelArgGet *arg = &args->argv[i];
|
||||
|
||||
tag = arg->tag;
|
||||
|
||||
switch (tag & CAMEL_ARG_TAG) {
|
||||
/* CamelObject args */
|
||||
case CAMEL_OBJECT_ARG_DESCRIPTION:
|
||||
if (mlf->description == NULL) {
|
||||
int pathlen;
|
||||
|
||||
/* string to describe a local folder as the location of a message */
|
||||
pathlen = strlen(evolution_dir) + strlen("local") + 1;
|
||||
if (strlen(folder->full_name) > pathlen)
|
||||
mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->full_name+pathlen);
|
||||
else
|
||||
mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->name);
|
||||
}
|
||||
*arg->ca_str = mlf->description;
|
||||
break;
|
||||
default:
|
||||
count--;
|
||||
continue;
|
||||
}
|
||||
|
||||
arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
|
||||
}
|
||||
|
||||
if (count)
|
||||
return ((CamelObjectClass *)mlf_parent_class)->getv(object, ex, args);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
mlf_class_init (CamelObjectClass *camel_object_class)
|
||||
{
|
||||
@ -533,6 +576,8 @@ mlf_class_init (CamelObjectClass *camel_object_class)
|
||||
camel_folder_class->set_message_user_tag = mlf_set_message_user_tag;
|
||||
|
||||
camel_folder_class->rename = mlf_rename;
|
||||
|
||||
camel_object_class->getv = mlf_getv;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@ -575,6 +575,7 @@ ml_duplicate_value (ETreeModel *etm, int col, const void *value, void *data)
|
||||
case COL_SUBJECT:
|
||||
case COL_TO:
|
||||
case COL_FOLLOWUP_FLAG:
|
||||
case COL_LOCATION:
|
||||
return g_strdup (value);
|
||||
|
||||
default:
|
||||
@ -604,6 +605,7 @@ ml_free_value (ETreeModel *etm, int col, void *value, void *data)
|
||||
case COL_SUBJECT:
|
||||
case COL_TO:
|
||||
case COL_FOLLOWUP_FLAG:
|
||||
case COL_LOCATION:
|
||||
g_free (value);
|
||||
break;
|
||||
default:
|
||||
@ -632,6 +634,7 @@ ml_initialize_value (ETreeModel *etm, int col, void *data)
|
||||
case COL_SUBJECT:
|
||||
case COL_TO:
|
||||
case COL_FOLLOWUP_FLAG:
|
||||
case COL_LOCATION:
|
||||
return g_strdup ("");
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
@ -661,6 +664,7 @@ ml_value_is_empty (ETreeModel *etm, int col, const void *value, void *data)
|
||||
case COL_SUBJECT:
|
||||
case COL_TO:
|
||||
case COL_FOLLOWUP_FLAG:
|
||||
case COL_LOCATION:
|
||||
return !(value && *(char *)value);
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
@ -724,6 +728,7 @@ ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data)
|
||||
case COL_SUBJECT:
|
||||
case COL_TO:
|
||||
case COL_FOLLOWUP_FLAG:
|
||||
case COL_LOCATION:
|
||||
return g_strdup (value);
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
@ -950,6 +955,19 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data)
|
||||
}
|
||||
return (void *)colour;
|
||||
}
|
||||
case COL_LOCATION: {
|
||||
CamelFolder *folder;
|
||||
char *name;
|
||||
|
||||
if (CAMEL_IS_VEE_FOLDER(message_list->folder)) {
|
||||
folder = camel_vee_folder_get_location((CamelVeeFolder *)message_list->folder, (CamelVeeMessageInfo *)msg_info, NULL);
|
||||
} else {
|
||||
folder = message_list->folder;
|
||||
}
|
||||
|
||||
camel_object_get(folder, NULL, CAMEL_OBJECT_DESCRIPTION, &name, 0);
|
||||
return name;
|
||||
}
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
@ -1114,7 +1132,7 @@ message_list_create_extras (void)
|
||||
"color_column", COL_COLOUR,
|
||||
NULL);
|
||||
e_table_extras_add_cell (extras, "render_size", cell);
|
||||
|
||||
|
||||
return extras;
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
<ETableColumn model_col= "12" _title="Due By" expansion="0.2" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
|
||||
|
||||
<ETableColumn model_col= "13" _title="Original Location" expansion="0.2" minimum_width="32" resizable="true" cell="render_text" compare="string"/>
|
||||
|
||||
<ETableState>
|
||||
<column source="0"/> <column source="3"/> <column source="1"/>
|
||||
<column source="4"/> <column source="5" expansion="1.60"/> <column source="6" expansion="0.40"/>
|
||||
|
||||
@ -29,7 +29,8 @@ enum {
|
||||
COL_FOLLOWUP_FLAG_STATUS,
|
||||
COL_FOLLOWUP_FLAG,
|
||||
COL_FOLLOWUP_DUE_BY,
|
||||
|
||||
COL_LOCATION, /* vfolder location? */
|
||||
|
||||
COL_LAST,
|
||||
|
||||
/* Invisible columns */
|
||||
|
||||
Reference in New Issue
Block a user