aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-14 02:53:51 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-14 02:53:51 +0800
commitc144d2091888813efe3b7ae4414b356fd080b610 (patch)
tree727511bf87a68e794081e42191009a5a67b440ea /widgets/table/e-table.c
parent9704f5dbf64e9f34d4ef7b4c0844b82319d4a2cf (diff)
downloadgsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.tar.gz
gsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.tar.zst
gsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.zip
Added e-table-config-field.lo.
2000-10-13 Christopher James Lahey <clahey@helixcode.com> * gal/Makefile.am: Added e-table-config-field.lo. * tests/test-tree-2.c: Changed this to use cursor-mode in the xml instead of the no longer existing gtk argument. From gal/e-table/ChangeLog: 2000-10-13 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-config-field.c and e-table-config-field.h. * e-table-column-specification.c: Cleaned this up a bit. Made it leak less memory. * e-table-config-field.c, e-table-config-field.h: New files. This is the configuration widgets for sorting or grouping. * e-table-config.c, e-table-config.h: Nuked these and replaced them with a widget that handles all the ETable configuration. * e-table-config.glade, e-table-config.glade.h: Updated this a bit to match what's actually being used better. This isn't used in actual code. * e-table-header-item.c, e-table-header-item.h: Added a pointer to the table in the header item structure so that we can launch the configuration from the header item right click menu. Made the header item launch the ETable configuration dialog. * e-table.c, e-table.h: Keep the spec given to us around. Added a get_state_object function which returns an ETableState *. Set the "table" argument on the header item. svn path=/trunk/; revision=5901
Diffstat (limited to 'widgets/table/e-table.c')
-rw-r--r--widgets/table/e-table.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index e51bc39506..8794e2142e 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -144,6 +144,8 @@ et_destroy (GtkObject *object)
gtk_object_unref (GTK_OBJECT (et->sort_info));
gtk_object_unref (GTK_OBJECT (et->sorter));
gtk_object_unref (GTK_OBJECT (et->selection));
+ if (et->spec)
+ gtk_object_unref (GTK_OBJECT (et->spec));
if (et->header_canvas != NULL)
gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
@@ -193,6 +195,7 @@ e_table_init (GtkObject *object)
e_table->sorter = NULL;
e_table->selection = e_table_selection_model_new();
e_table->cursor_loc = E_TABLE_CURSOR_LOC_NONE;
+ e_table->spec = NULL;
}
static void
@@ -235,6 +238,7 @@ e_table_setup_header (ETable *e_table)
"full_header", e_table->full_header,
"sort_info", e_table->sort_info,
"dnd_code", "(unset)",
+ "table", e_table,
NULL);
gtk_signal_connect (
@@ -602,19 +606,20 @@ et_col_spec_to_col (ETable *e_table, ETableColumnSpecification *col_spec, ETable
compare = e_table_extras_get_compare(ete, col_spec->compare);
if (cell && compare) {
- if (col_spec->title_ && *col_spec->title_) {
- col = e_table_col_new (col_spec->model_col, col_spec->title_,
- col_spec->expansion, col_spec->minimum_width,
- cell, compare, col_spec->resizable);
- } else if (col_spec->pixbuf && *col_spec->pixbuf) {
+ if (col_spec->pixbuf && *col_spec->pixbuf) {
GdkPixbuf *pixbuf;
-
+
pixbuf = e_table_extras_get_pixbuf(ete, col_spec->pixbuf);
if (pixbuf) {
col = e_table_col_new_with_pixbuf (col_spec->model_col, pixbuf,
col_spec->expansion, col_spec->minimum_width,
cell, compare, col_spec->resizable);
}
+ }
+ if (col == NULL && col_spec->title_ && *col_spec->title_) {
+ col = e_table_col_new (col_spec->model_col, col_spec->title_,
+ col_spec->expansion, col_spec->minimum_width,
+ cell, compare, col_spec->resizable);
}
}
return col;
@@ -733,8 +738,8 @@ void e_table_load_state (ETable *e_table
gtk_object_sink(GTK_OBJECT(state));
}
-static ETableState *
-et_get_state (ETable *e_table)
+ETableState *
+e_table_get_state_object (ETable *e_table)
{
ETableState *state;
int full_col_count;
@@ -767,9 +772,9 @@ gchar *e_table_get_state (ETable *e_table
ETableState *state;
gchar *string;
- state = et_get_state(e_table);
+ state = e_table_get_state_object(e_table);
string = e_table_state_save_to_string(state);
- gtk_object_sink(state);
+ gtk_object_sink(GTK_OBJECT(state));
return string;
}
@@ -778,9 +783,9 @@ void e_table_save_state (ETable *e_table
{
ETableState *state;
- state = et_get_state(e_table);
+ state = e_table_get_state_object(e_table);
e_table_state_save_to_file(state, filename);
- gtk_object_sink(state);
+ gtk_object_sink(GTK_OBJECT(state));
}
@@ -885,7 +890,7 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
e_table = et_real_construct (e_table, etm, ete, specification, state);
- gtk_object_unref(GTK_OBJECT(specification));
+ e_table->spec = specification;
gtk_object_unref(GTK_OBJECT(state));
return e_table;
@@ -925,7 +930,7 @@ e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtra
e_table = et_real_construct (e_table, etm, ete, specification, state);
- gtk_object_unref(GTK_OBJECT(specification));
+ e_table->spec = specification;
gtk_object_unref(GTK_OBJECT(state));
return e_table;