aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-28 09:24:41 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-28 09:24:41 +0800
commita40da8d5704e3c3eed1cc9fd9d5bf9eab554a7db (patch)
tree78f9d128af96e0ed1cbc26992c1536dfd1be9cc0
parentbb076508f07b6fa4ee2a1534d727659dd7b06cc7 (diff)
downloadgsoc2013-evolution-a40da8d5704e3c3eed1cc9fd9d5bf9eab554a7db.tar.gz
gsoc2013-evolution-a40da8d5704e3c3eed1cc9fd9d5bf9eab554a7db.tar.zst
gsoc2013-evolution-a40da8d5704e3c3eed1cc9fd9d5bf9eab554a7db.zip
Removed the etable spec string. (message_list_construct): Load the etable
2001-05-27 Jeffrey Stedfast <fejj@ximian.com> * message-list.c: Removed the etable spec string. (message_list_construct): Load the etable spec from a file. * folder-browser-factory.c: Load the etable spec from the file, not a string. * Makefile.am: Add message-list.etspec to be installed. * message-list.etspec: New file containing the ETable file specification. * mail-config.h: Prototype evolution_mail_config_get_type. svn path=/trunk/; revision=10025
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/Makefile.am6
-rw-r--r--mail/folder-browser-factory.c6
-rw-r--r--mail/message-list.c40
-rw-r--r--mail/message-list.etspec17
-rw-r--r--mail/message-list.h2
6 files changed, 40 insertions, 42 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 25a671cf97..474f9455cb 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,16 @@
2001-05-27 Jeffrey Stedfast <fejj@ximian.com>
+ * message-list.c: Removed the etable spec string.
+ (message_list_construct): Load the etable spec from a file.
+
+ * folder-browser-factory.c: Load the etable spec from the file,
+ not a string.
+
+ * Makefile.am: Add message-list.etspec to be installed.
+
+ * message-list.etspec: New file containing the ETable file
+ specification.
+
* mail-config.h: Prototype evolution_mail_config_get_type.
2001-05-27 Dan Winship <danw@ximian.com>
diff --git a/mail/Makefile.am b/mail/Makefile.am
index efb646be08..4b6f24eea8 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -24,6 +24,7 @@ INCLUDES = \
$(MAILER_CFLAGS) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
+ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
-DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
-DCAMEL_PROVIDERDIR=\""$(providerdir)"\" \
@@ -160,13 +161,16 @@ oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
gladedir = $(datadir)/evolution/glade
glade_DATA = mail-config.glade local-config.glade
+etspecdir = $(datadir)/evolution/etspec/
+etspec_DATA = message-list.etspec
+
iconsdir = $(datadir)/images/evolution
$(EVOLUTION_MAIL_CORBA_GENERATED): Mail.idl
$(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl -I `$(GNOME_CONFIG) --cflags idl` \
-I `$(GNOME_CONFIG) --datadir`/idl $(srcdir)/Mail.idl
-EXTRA_DIST = Mail.idl $(glade_DATA) $(oaf_in_files) $(oaf_DATA)
+EXTRA_DIST = Mail.idl $(glade_DATA) $(oaf_in_files) $(oaf_DATA) $(etspec_DATA)
if ENABLE_PURIFY
PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index f76c858b05..e9bd4adc87 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -155,7 +155,7 @@ folder_browser_setup_view_menus (FolderBrowser *fb,
GalViewMenus *views;
GalViewFactory *factory;
ETableSpecification *spec;
- char *spec_string, *local_dir;
+ char *local_dir;
collection = gal_view_collection_new();
/* FIXME: Memory leak. */
@@ -167,10 +167,8 @@ folder_browser_setup_view_menus (FolderBrowser *fb,
local_dir);
g_free (local_dir);
- spec_string = message_list_get_layout(fb->message_list);
spec = e_table_specification_new();
- e_table_specification_load_from_string(spec, spec_string);
- g_free(spec_string);
+ e_table_specification_load_from_file(spec, EVOLUTION_ETSPECDIR "/message-list.etspec");
factory = gal_view_factory_etable_new(spec);
gal_view_collection_add_factory(collection, factory);
diff --git a/mail/message-list.c b/mail/message-list.c
index 2abf62abb4..0690a747c8 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1083,35 +1083,6 @@ save_tree_state(MessageList *ml)
g_free(filename);
}
-#ifdef JUST_FOR_TRANSLATORS
-static char *list [] = {
- N_("Status"), N_("Flagged"), N_("Score"), N_("Attachment"),
- N_("From"), N_("Subject"), N_("Date"), N_("Received"),
- N_("To"), N_("Size")
-};
-#endif
-
-char *
-message_list_get_layout (MessageList *message_list)
-{
- /* Default: Status, Attachments, Priority, From, Subject, Date */
- return g_strdup ("<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=\"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=\"24.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_text\" compare=\"address_compare\"/>"
- "<ETableColumn model_col= \"5\" _title=\"Subject\" expansion=\"30.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_tree\" compare=\"subject_compare\"/>"
- "<ETableColumn model_col= \"6\" _title=\"Date\" expansion=\"24.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_date\" compare=\"integer\"/>"
- "<ETableColumn model_col= \"7\" _title=\"Received\" expansion=\"20.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_date\" compare=\"integer\"/>"
- "<ETableColumn model_col= \"8\" _title=\"To\" expansion=\"24.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_text\" compare=\"address_compare\"/>"
- "<ETableColumn model_col= \"9\" _title=\"Size\" expansion=\"6.0\" minimum_width=\"32\" resizable=\"true\" cell=\"render_size\" compare=\"integer\"/>"
- "<ETableState> <column source=\"0\"/> <column source=\"3\"/> <column source=\"1\"/>"
- "<column source=\"4\"/> <column source=\"5\"/> <column source=\"6\"/>"
- "<grouping> </grouping> </ETableState>"
- "</ETableSpecification>");
-}
-
static void
message_list_setup_etree(MessageList *message_list, gboolean outgoing)
{
@@ -1252,7 +1223,6 @@ static void
message_list_construct (MessageList *message_list)
{
ETableExtras *extras;
- char *spec;
message_list->model =
e_tree_memory_callbacks_new (ml_tree_icon_at,
@@ -1284,16 +1254,16 @@ message_list_construct (MessageList *message_list)
/*
* The etree
*/
- spec = message_list_get_layout (message_list);
extras = message_list_create_extras ();
- e_tree_scrolled_construct (E_TREE_SCROLLED (message_list),
- message_list->model,
- extras, spec, NULL);
+ e_tree_scrolled_construct_from_spec_file (E_TREE_SCROLLED (message_list),
+ message_list->model,
+ extras,
+ EVOLUTION_ETSPECDIR "/message-list.etspec",
+ NULL);
message_list->tree = e_tree_scrolled_get_tree(E_TREE_SCROLLED (message_list));
e_tree_root_node_set_visible (message_list->tree, FALSE);
- g_free (spec);
gtk_object_sink (GTK_OBJECT (extras));
gtk_signal_connect (GTK_OBJECT (message_list->tree), "cursor_activated",
diff --git a/mail/message-list.etspec b/mail/message-list.etspec
new file mode 100644
index 0000000000..3910f688bd
--- /dev/null
+++ b/mail/message-list.etspec
@@ -0,0 +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="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="24.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
+ <ETableColumn model_col= "5" _title="Subject" expansion="30.0" minimum_width="32" resizable="true" cell="render_tree" compare="subject_compare"/>
+ <ETableColumn model_col= "6" _title="Date" expansion="24.0" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
+ <ETableColumn model_col= "7" _title="Received" expansion="20.0" minimum_width="32" resizable="true" cell="render_date" compare="integer"/>
+ <ETableColumn model_col= "8" _title="To" expansion="24.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare"/>
+ <ETableColumn model_col= "9" _title="Size" expansion="6.0" minimum_width="32" resizable="true" cell="render_size" compare="integer"/>
+ <ETableState>
+ <column source="0"/> <column source="3"/> <column source="1"/>
+ <column source="4"/> <column source="5"/> <column source="6"/>
+ <grouping> </grouping>
+ </ETableState>
+</ETableSpecification>
diff --git a/mail/message-list.h b/mail/message-list.h
index 86c5caf3df..4ec10f61ca 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -129,8 +129,6 @@ void message_list_set_threaded(MessageList *ml, gboolean threaded);
void message_list_set_hidedeleted(MessageList *ml, gboolean hidedeleted);
void message_list_set_search(MessageList *ml, const char *search);
-char *message_list_get_layout (MessageList *message_list);
-
#define MESSAGE_LIST_LOCK(m, l) g_mutex_lock(((MessageList *)m)->l)
#define MESSAGE_LIST_UNLOCK(m, l) g_mutex_unlock(((MessageList *)m)->l)