From d842e1a20e3ab2fd38582d2ccc863e4bbcb87d0d Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Mon, 5 Mar 2001 00:11:35 +0000 Subject: keep list of all Tasks folders so we can update the preference settings 2001-03-05 Damon Chaplin * gui/e-tasks.c: keep list of all Tasks folders so we can update the preference settings when necessary. * gui/gnome-cal.c: configure the TaskPad according to the settings. * gui/e-calendar-table.c: use ECellCombo and ECellDateEdit for fields, so the tasks folders is almost usable now. * gui/calendar-model.c: added support for the Status property. * gui/calendar-config.[hc]: added convenience functions to setup ECalendarTable and ECellDateEdit objects. * gui/calendar-commands.c: connected to "destroy" signal of calendars so we can remove them from all_calendars list. * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config): call e_tasks_update_all_config_settings() to update all the settings in the Tasks folders as well. * cal-util/cal-component.h: added CAL_COMPONENT_FIELD_STATUS. * cal-util/cal-component.c (cal_component_get_transparency): fixed calls to strcasecmp so they check for '== 0'. Applied patch from Miguel... 2001-02-27 Miguel de Icaza * gui/e-day-view.c (e_day_view_on_event_right_click): Reorganize the menus to have entries always in a consistent fashion, as reported to the genepool mailing list. (e_day_view_on_event_right_click): Added a FIXME comment to the FIXME comment without a FIXME. Now we use e_popup_menu. This allows us to hide/show items on demand, and to sensitize/de-sensitize items depending on their state. This will also let us add icon support (when we get nice icons for this) * gui/e-week-view.c (e_week_view_show_popup_menu): Ditto. The files popup-menu.c and popup-menu.h can now be removed. svn path=/trunk/; revision=8549 --- calendar/gui/e-calendar-table.c | 174 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 163 insertions(+), 11 deletions(-) (limited to 'calendar/gui/e-calendar-table.c') diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index ba3d1dedb3..f173ac3783 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include "e-calendar-table.h" #include "calendar-model.h" #include "dialogs/delete-comp.h" @@ -158,7 +160,7 @@ static char *list [] = { N_("Start Date"), N_("Due Date"), N_("Geographical Position"), - N_("Precent complete"), + N_("Percent complete"), N_("Priority"), N_("Summary"), N_("Transparency"), @@ -177,34 +179,34 @@ static char *list [] = { " cell=\"calstring\" compare=\"string\"/>" \ " " \ + " cell=\"classification\" compare=\"string\"/>" \ " " \ + " cell=\"dateedit\" compare=\"string\"/>" \ " " \ + " cell=\"dateedit\" compare=\"string\"/>" \ " " \ + " cell=\"dateedit\" compare=\"string\"/>" \ " " \ + " cell=\"dateedit\" compare=\"string\"/>" \ " " \ " " \ + " cell=\"percent\" compare=\"string\"/>" \ " " \ + " cell=\"priority\" compare=\"string\"/>" \ " " \ " " \ + " cell=\"transparency\" compare=\"string\"/>" \ " " \ @@ -214,9 +216,12 @@ static char *list [] = { " " \ - " " \ + " " \ " " \ " " \ " " \ @@ -230,13 +235,14 @@ e_calendar_table_init (ECalendarTable *cal_table) { GtkWidget *table; ETable *e_table; - ECell *cell; + ECell *cell, *popup_cell; ETableExtras *extras; gint i; GdkPixbuf *pixbuf; GdkColormap *colormap; gboolean success[E_CALENDAR_TABLE_COLOR_LAST]; gint nfailed; + GList *strings; /* Allocate the colors we need. */ @@ -271,14 +277,160 @@ e_calendar_table_init (ECalendarTable *cal_table) extras = e_table_extras_new(); + /* + * Normal string fields. + */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); gtk_object_set (GTK_OBJECT (cell), "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, "bold_column", CAL_COMPONENT_FIELD_OVERDUE, "color_column", CAL_COMPONENT_FIELD_COLOR, NULL); + e_table_extras_add_cell (extras, "calstring", cell); + + /* + * Date fields. + */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + NULL); + + popup_cell = e_cell_date_edit_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + e_table_extras_add_cell (extras, "dateedit", popup_cell); + cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell); + + + /* + * Combo fields. + */ + + /* Classification field. */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + "editable", FALSE, + NULL); + + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, _("None")); + strings = g_list_append (strings, _("Public")); + strings = g_list_append (strings, _("Private")); + strings = g_list_append (strings, _("Confidential")); + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), + strings); + + e_table_extras_add_cell (extras, "classification", popup_cell); + + /* Priority field. */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + "editable", FALSE, + NULL); + + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, _("High")); + strings = g_list_append (strings, _("Normal")); + strings = g_list_append (strings, _("Low")); + strings = g_list_append (strings, _("Undefined")); + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), + strings); + + e_table_extras_add_cell (extras, "priority", popup_cell); + + /* Percent field. */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + NULL); + + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, _("0%")); + strings = g_list_append (strings, _("10%")); + strings = g_list_append (strings, _("20%")); + strings = g_list_append (strings, _("30%")); + strings = g_list_append (strings, _("40%")); + strings = g_list_append (strings, _("50%")); + strings = g_list_append (strings, _("60%")); + strings = g_list_append (strings, _("70%")); + strings = g_list_append (strings, _("80%")); + strings = g_list_append (strings, _("90%")); + strings = g_list_append (strings, _("100%")); + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), + strings); + + e_table_extras_add_cell (extras, "percent", popup_cell); + + /* Transparency field. */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + "editable", FALSE, + NULL); + + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, _("None")); + strings = g_list_append (strings, _("Opaque")); + strings = g_list_append (strings, _("Transparent")); + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), + strings); + + e_table_extras_add_cell (extras, "transparency", popup_cell); + + /* Status field. */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + "editable", FALSE, + NULL); + + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, _("Not Started")); + strings = g_list_append (strings, _("In Progress")); + strings = g_list_append (strings, _("Completed")); + strings = g_list_append (strings, _("Cancelled")); + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), + strings); + + e_table_extras_add_cell (extras, "calstatus", popup_cell); + /* Create pixmaps */ if (!icon_pixbufs[0]) -- cgit v1.2.3