[Fix bug #4389: ETableSpecification still in .c file]

2001-07-11  Jason Leach  <jleach@ximian.com>

	[Fix bug #4389: ETableSpecification still in .c file]

	* gui/e-calendar-table.etspec: New file containing the spec that
	was in e-calendar-table.c as a big string.

	* gui/e-calendar-table.c (e_calendar_table_init): Use the spec
	file instead of a string.
	(e_calendar_table_get_spec): Removed this function, we don't need
	it anymore.

	* gui/e-tasks.c (e_tasks_setup_menus): Don't load from string,
	from file instead.

	* gui/Makefile.am: Necessary changes to get the new .etspec file
	installed.

svn path=/trunk/; revision=10986
This commit is contained in:
Jason Leach
2001-07-11 05:32:14 +00:00
committed by Jacob Leach
parent 4763f25379
commit e415f609d2
6 changed files with 54 additions and 93 deletions

View File

@ -1,3 +1,21 @@
2001-07-11 Jason Leach <jleach@ximian.com>
[Fix bug #4389: ETableSpecification still in .c file]
* gui/e-calendar-table.etspec: New file containing the spec that
was in e-calendar-table.c as a big string.
* gui/e-calendar-table.c (e_calendar_table_init): Use the spec
file instead of a string.
(e_calendar_table_get_spec): Removed this function, we don't need
it anymore.
* gui/e-tasks.c (e_tasks_setup_menus): Don't load from string,
from file instead.
* gui/Makefile.am: Necessary changes to get the new .etspec file
installed.
2001-07-10 Jason Leach <jleach@ximian.com>
[Fix bug #4388: ETableSpecification still in .c file]

View File

@ -51,14 +51,17 @@ INCLUDES = \
$(BONOBO_CONF_CFLAGS) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\"
gladedir = $(datadir)/evolution/glade
glade_DATA = \
e-itip-control.glade \
goto-dialog.glade
etspecdir = $(datadir)/evolution/etspec/
etspec_DATA = e-calendar-table.etspec
evolution_calendar_SOURCES = \
$(IDL_GENERATED) \
calendar-config.c \

View File

@ -243,87 +243,6 @@ task_compare_cb (gconstpointer a, gconstpointer b)
return retval;
}
#ifdef JUST_FOR_TRANSLATORS
static char *list [] = {
N_("Categories"),
N_("Classification"),
N_("Completion Date"),
N_("End Date"),
N_("Start Date"),
N_("Due Date"),
N_("Geographical Position"),
N_("Percent complete"),
N_("Priority"),
N_("Summary"),
N_("Transparency"),
N_("URL"),
N_("Alarms"),
N_("Click here to add a task")
};
#endif
#define E_CALENDAR_TABLE_SPEC \
"<ETableSpecification click-to-add=\"true\" " \
" _click-to-add-message=\"Click here to add a task\" " \
" draw-grid=\"true\">" \
" <ETableColumn model_col= \"0\" _title=\"Categories\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
" <ETableColumn model_col= \"1\" _title=\"Classification\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"classification\" compare=\"string\"/>" \
" <ETableColumn model_col= \"2\" _title=\"Completion Date\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"dateedit\" compare=\"string\"/>" \
" <ETableColumn model_col= \"3\" _title=\"End Date\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"dateedit\" compare=\"string\"/>" \
" <ETableColumn model_col= \"4\" _title=\"Start Date\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"dateedit\" compare=\"string\"/>" \
" <ETableColumn model_col= \"5\" _title=\"Due Date\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"dateedit\" compare=\"string\"/>" \
" <ETableColumn model_col= \"6\" _title=\"Geographical Position\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
" <ETableColumn model_col= \"7\" _title=\"% Complete\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"percent\" compare=\"string\"/>" \
" <ETableColumn model_col= \"8\" _title=\"Priority\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"priority\" compare=\"string\"/>" \
" <ETableColumn model_col= \"9\" _title=\"Summary\" " \
" expansion=\"3.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
" <ETableColumn model_col=\"10\" _title=\"Transparency\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"transparency\" compare=\"string\"/>" \
" <ETableColumn model_col=\"11\" _title=\"URL\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
" <ETableColumn model_col=\"12\" _title=\"Alarms\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstring\" compare=\"string\"/>" \
" <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\" _title=\"Complete\" " \
" expansion=\"1.0\" minimum_width=\"16\" resizable=\"false\" "\
" cell=\"checkbox\" compare=\"integer\"/>" \
" <ETableColumn model_col=\"18\" _title=\"Status\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
" cell=\"calstatus\" compare=\"string\"/>" \
" <ETableColumn model_col=\"19\" _title=\"Task sort\" " \
" cell=\"task-sort\" compare=\"task-sort\"/>" \
" <ETableState>" \
" <column source=\"13\"/>" \
" <column source=\"14\"/>" \
" <column source= \"9\"/>" \
" <grouping></grouping>" \
" </ETableState>" \
"</ETableSpecification>"
static void
e_calendar_table_init (ECalendarTable *cal_table)
{
@ -553,8 +472,10 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Create the table */
table = e_table_scrolled_new (cal_table->subset_model, extras,
E_CALENDAR_TABLE_SPEC, NULL);
table = e_table_scrolled_new_from_spec_file (cal_table->subset_model,
extras,
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec",
NULL);
gtk_object_unref (GTK_OBJECT (extras));
cal_table->etable = table;
@ -1218,12 +1139,6 @@ e_calendar_table_on_rows_deleted (ETableModel *model,
e_calendar_table_apply_filter (cal_table);
}
const gchar *
e_calendar_table_get_spec (void)
{
return E_CALENDAR_TABLE_SPEC;
}
static void
invisible_destroyed (GtkWidget *invisible, ECalendarTable *cal_table)
{

View File

@ -0,0 +1,26 @@
<ETableSpecification click-to-add="true" _click-to-add-message="Click here to add a task" draw-grid="true">
<ETableColumn model_col= "0" _title="Categories" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
<ETableColumn model_col= "1" _title="Classification" expansion="1.0" minimum_width="10" resizable="true" cell="classification" compare="string"/>
<ETableColumn model_col= "2" _title="Completion Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="string"/>
<ETableColumn model_col= "3" _title="End Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="string"/>
<ETableColumn model_col= "4" _title="Start Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="string"/>
<ETableColumn model_col= "5" _title="Due Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="string"/>
<ETableColumn model_col= "6" _title="Geographical Position" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
<ETableColumn model_col= "7" _title="% Complete" expansion="1.0" minimum_width="10" resizable="true" cell="percent" compare="string"/>
<ETableColumn model_col= "8" _title="Priority" expansion="1.0" minimum_width="10" resizable="true" cell="priority" compare="string"/>
<ETableColumn model_col= "9" _title="Summary" expansion="3.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
<ETableColumn model_col="10" _title="Transparency" expansion="1.0" minimum_width="10" resizable="true" cell="transparency" compare="string"/>
<ETableColumn model_col="11" _title="URL" expansion="2.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
<ETableColumn model_col="12" _title="Alarms" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
<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" _title="Complete" expansion="1.0" minimum_width="16" resizable="false" cell="checkbox" compare="integer"/>
<ETableColumn model_col="18" _title="Status" expansion="1.0" minimum_width="10" resizable="true" cell="calstatus" compare="string"/>
<ETableColumn model_col="19" _title="Task sort" cell="task-sort" compare="task-sort"/>
<ETableState>
<column source="13"/>
<column source="14"/>
<column source= "9"/>
<grouping></grouping>
</ETableState>
</ETableSpecification>

View File

@ -127,8 +127,6 @@ gboolean e_calendar_table_filter_by_category (ECalendarTable *cal_table,
CalComponent *comp,
gpointer filter_data);
const gchar *e_calendar_table_get_spec (void);
#ifdef __cplusplus
}

View File

@ -614,7 +614,8 @@ e_tasks_setup_menus (ETasks *tasks,
g_free (dir);
spec = e_table_specification_new ();
e_table_specification_load_from_string (spec, e_calendar_table_get_spec());
e_table_specification_load_from_file (spec,
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec");
factory = gal_view_factory_etable_new (spec);
gal_view_collection_add_factory (collection, factory);