diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-10-13 05:52:49 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-10-13 05:52:49 +0800 |
commit | a5931319b6e19fdcbe18e077a2305cf41ccaea9e (patch) | |
tree | 7aa5a91b02815bf30928e52c2144cda58b26c06b /widgets/table/e-table-click-to-add.c | |
parent | 0ad57aa1b9f67bf68920cf6a8bbaad773f105108 (diff) | |
download | gsoc2013-evolution-a5931319b6e19fdcbe18e077a2305cf41ccaea9e.tar.gz gsoc2013-evolution-a5931319b6e19fdcbe18e077a2305cf41ccaea9e.tar.zst gsoc2013-evolution-a5931319b6e19fdcbe18e077a2305cf41ccaea9e.zip |
Use new e_table_header_prioritized_column field.
2001-10-12 Christopher James Lahey <clahey@ximian.com>
* e-table-click-to-add.c (set_initial_selection): Use new
e_table_header_prioritized_column field.
* e-table-header.c, e-table-header.h
(e_table_header_prioritized_column): New function. Refactors the
code from ETableClickToAdd to find the column with the highest
priority.
* e-table-selection-model.c, e-table-selection-model.h
(model_changed_idle): Changed this function to use the
e_table_header_prioritized_column function. Added an argument to
set the "header" on this selection model.
* e-table-utils.h: Indentation cleanup.
* e-table.c (et_real_construct): Set the "header" argument on the
selection model here.
* e-table.h: #include <gal/e-table/e-table-sorter.h>
svn path=/trunk/; revision=13633
Diffstat (limited to 'widgets/table/e-table-click-to-add.c')
-rw-r--r-- | widgets/table/e-table-click-to-add.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index aef0d06564..81d3b49d50 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -284,25 +284,9 @@ item_key_press (ETableItem *item, int row, int col, GdkEvent *event, ETableClick static void set_initial_selection (ETableClickToAdd *etcta) { - int best_model_col = 0; - int best_priority; - int i; - int count; - - count = e_table_header_count (etcta->eth); - if (count == 0) - return; - best_priority = e_table_header_get_column (etcta->eth, 0)->priority; - best_model_col = e_table_header_get_column (etcta->eth, 0)->col_idx; - for (i = 1; i < count; i++) { - int priority = e_table_header_get_column (etcta->eth, i)->priority; - if (priority > best_priority) { - best_priority = priority; - best_model_col = e_table_header_get_column (etcta->eth, i)->col_idx; - } - - } - e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection), 0, best_model_col, 0); + e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection), + 0, e_table_header_prioritized_column (etcta->eth), + 0); } static void |