aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-config.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-01-16 07:21:40 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-01-16 07:21:40 +0800
commitc152134378a6567dd69d6570017fc2ab1cb37f52 (patch)
treed7b8b9206af57c41dac8ea32a7e3b6fa0f9c9b84 /widgets/table/e-table-config.c
parentcab9d633da616bc98a9b1479f8d79796a36c0b38 (diff)
downloadgsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar.gz
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar.bz2
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar.lz
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar.xz
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.tar.zst
gsoc2013-evolution-c152134378a6567dd69d6570017fc2ab1cb37f52.zip
Make output pretier by using newlines when there is a lot of information
2001-01-15 Miguel de Icaza <miguel@ximian.com> * e-table-config.c (config_fields_info_update): Make output pretier by using newlines when there is a lot of information to display. (config_group_info_update): ditto. (config_sort_info_update): ditto. svn path=/trunk/; revision=7517
Diffstat (limited to 'widgets/table/e-table-config.c')
-rw-r--r--widgets/table/e-table-config.c78
1 files changed, 42 insertions, 36 deletions
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
index eec0de388f..1745c181ed 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -133,18 +133,18 @@ config_sort_info_update (ETableConfig *config)
ETableColumnSpecification **column;
for (column = config->spec->columns; *column; column++) {
- if (col.column == (*column)->model_col) {
- g_string_append (res, (*column)->title_);
- g_string_append_c (res, ' ');
- g_string_append (
- res,
- col.ascending ?
- _("(Ascending)") : _("(Descending)"));
- items++;
- if (items > 4)
- g_string_append_c (res, '\n');
- break;
- }
+ if (col.column != (*column)->model_col)
+ continue;
+
+ g_string_append (res, (*column)->title_);
+ g_string_append_c (res, ' ');
+ g_string_append (
+ res,
+ col.ascending ?
+ _("(Ascending)") : _("(Descending)"));
+ items++;
+ if (items > 4)
+ g_string_append_c (res, '\n');
}
}
if (res->str [0] == 0)
@@ -170,19 +170,19 @@ config_group_info_update (ETableConfig *config)
ETableColumnSpecification **column;
for (column = config->spec->columns; *column; column++) {
- if (col.column == (*column)->model_col) {
- g_string_append (res, (*column)->title_);
- g_string_append_c (res, ' ');
- g_string_append (
- res,
- col.ascending ?
- _("(Ascending)") : _("(Descending)"));
-
- items++;
- if (items > 4)
- g_string_append_c (res, '\n');
- break;
- }
+ if (col.column != (*column)->model_col)
+ continue;
+
+ g_string_append (res, (*column)->title_);
+ g_string_append_c (res, ' ');
+ g_string_append (
+ res,
+ col.ascending ?
+ _("(Ascending)") : _("(Descending)"));
+
+ items++;
+ if (items > 4)
+ g_string_append_c (res, '\n');
}
}
if (res->str [0] == 0)
@@ -197,18 +197,24 @@ config_fields_info_update (ETableConfig *config)
{
ETableColumnSpecification **column;
GString *res = g_string_new ("");
- int items = 0;
-
- for (column = config->spec->columns; *column; *column++){
- g_string_append (res, (*column)->title_);
- if (column [1])
- g_string_append (res, ", ");
- items++;
-
- if (items > 5)
- g_string_append_c (res, '\n');
+ int i, items = 0;
+
+ for (i = 0; i < config->state->col_count; i++){
+ for (column = config->spec->columns; *column; *column++){
+
+ if (config->state->columns [i] != (*column)->model_col)
+ continue;
+
+ g_string_append (res, (*column)->title_);
+ if (column [1])
+ g_string_append (res, ", ");
+ items++;
+
+ if (items > 5)
+ g_string_append_c (res, '\n');
+ }
}
-
+
gtk_label_set_text (GTK_LABEL (config->fields_label), res->str);
g_string_free (res, TRUE);
}