aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-02-14 06:03:40 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-02-14 06:03:40 +0800
commit0c420d13663f68e1a42178171066174429952e62 (patch)
treeb015bd29528d06ceffe67c3dd42a76e8e7369785 /calendar/gui
parent8c466a7b1c6b54816450ffca209eb5610331d8c2 (diff)
downloadgsoc2013-evolution-0c420d13663f68e1a42178171066174429952e62.tar.gz
gsoc2013-evolution-0c420d13663f68e1a42178171066174429952e62.tar.zst
gsoc2013-evolution-0c420d13663f68e1a42178171066174429952e62.zip
override value to string virtual method (calendar_model_value_to_string):
2001-02-13 JP Rosevear <jpr@ximian.com> * gui/calendar-model.c (calendar_model_class_init): override value to string virtual method (calendar_model_value_to_string): implement value to string for etable (necessary for group by) svn path=/trunk/; revision=8211
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-model.c48
-rw-r--r--calendar/gui/e-calendar-table.c4
2 files changed, 46 insertions, 6 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 3e4e41ea45..3e8f3359ab 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -41,6 +41,7 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-messagebox.h>
+#include <gal/widgets/e-unicode.h>
#include <cal-util/timeutil.h>
#include "calendar-model.h"
#include "calendar-commands.h"
@@ -103,9 +104,7 @@ static void *calendar_model_duplicate_value (ETableModel *etm, int col, const vo
static void calendar_model_free_value (ETableModel *etm, int col, void *value);
static void *calendar_model_initialize_value (ETableModel *etm, int col);
static gboolean calendar_model_value_is_empty (ETableModel *etm, int col, const void *value);
-#if 0
static char * calendar_model_value_to_string (ETableModel *etm, int col, const void *value);
-#endif
static void load_objects (CalendarModel *model);
static int remove_object (CalendarModel *model, const char *uid);
static void ensure_task_complete (CalComponent *comp,
@@ -186,9 +185,7 @@ calendar_model_class_init (CalendarModelClass *class)
etm_class->free_value = calendar_model_free_value;
etm_class->initialize_value = calendar_model_initialize_value;
etm_class->value_is_empty = calendar_model_value_is_empty;
-#if 0
etm_class->value_to_string = calendar_model_value_to_string;
-#endif
class->categories_changed = NULL;
}
@@ -1526,6 +1523,49 @@ calendar_model_value_is_empty (ETableModel *etm, int col, const void *value)
}
}
+static char *
+calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
+{
+ g_return_val_if_fail (col >= 0 && col < CAL_COMPONENT_FIELD_NUM_FIELDS, NULL);
+
+ switch (col) {
+ case CAL_COMPONENT_FIELD_CATEGORIES:
+ case CAL_COMPONENT_FIELD_CLASSIFICATION:
+ case CAL_COMPONENT_FIELD_COMPLETED:
+ case CAL_COMPONENT_FIELD_DTEND:
+ case CAL_COMPONENT_FIELD_DTSTART:
+ case CAL_COMPONENT_FIELD_DUE:
+ case CAL_COMPONENT_FIELD_GEO:
+ case CAL_COMPONENT_FIELD_PERCENT:
+ case CAL_COMPONENT_FIELD_PRIORITY:
+ case CAL_COMPONENT_FIELD_SUMMARY:
+ case CAL_COMPONENT_FIELD_TRANSPARENCY:
+ case CAL_COMPONENT_FIELD_URL:
+ return e_utf8_from_locale_string (value);
+
+ case CAL_COMPONENT_FIELD_ICON:
+ if ((int)value == 0)
+ return e_utf8_from_locale_string (_("Normal"));
+ else if ((int)value == 1)
+ return e_utf8_from_locale_string (_("Recurring"));
+ else
+ return e_utf8_from_locale_string (_("Assigned"));
+
+ case CAL_COMPONENT_FIELD_HAS_ALARMS:
+ case CAL_COMPONENT_FIELD_COMPLETE:
+ case CAL_COMPONENT_FIELD_RECURRING:
+ case CAL_COMPONENT_FIELD_OVERDUE:
+ return e_utf8_from_locale_string (value ? _("Yes") : _("No"));
+
+ case CAL_COMPONENT_FIELD_COLOR:
+ return NULL;
+
+ default:
+ g_message ("calendar_model_value_as_string(): Requested invalid column %d", col);
+ return NULL;
+ }
+}
+
/**
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index eb3bf5e2b4..6b063ec2cf 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -211,10 +211,10 @@ static char *list [] = {
" <ETableColumn model_col=\"12\" _title=\"Alarms\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
- " <ETableColumn model_col=\"13\" pixbuf=\"icon\" " \
+ " <ETableColumn model_col=\"13\" pixbuf=\"icon\" _title=\"Type\" "\
" expansion=\"1.0\" minimum_width=\"16\" resizable=\"false\" "\
" cell=\"icon\" compare=\"integer\"/>" \
- " <ETableColumn model_col=\"14\" pixbuf=\"complete\" " \
+ " <ETableColumn model_col=\"14\" pixbuf=\"complete\" _title=\"Compelete\" " \
" expansion=\"1.0\" minimum_width=\"16\" resizable=\"false\" "\
" cell=\"checkbox\" compare=\"integer\"/>" \
" <ETableState>" \