Changed "Sort Attribute Options" to a per-attribute setting

SVN revision: 2252
This commit is contained in:
Stefan Ritt 2009-08-11 06:38:02 +00:00
parent a7bcf0015e
commit 7cb5f15e1d
2 changed files with 6 additions and 5 deletions

View File

@ -2568,9 +2568,9 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
otherwise the first thread is displayed. Default for this setting is <b>1</b>. otherwise the first thread is displayed. Default for this setting is <b>1</b>.
</li> </li>
<li> <li>
<b><code>Sort Attribute Options = 0|1</code></b><br> <b><code>Sort Attribute Options &lt;attribute&gt; = 0|1</code></b><br>
If this opeion is 1, all attribute options are sorted alphanumerically. This If this opeion is 1, the options for this attribute are sorted alphanumerically.
can be handy when locating options from long lists in drop-down boxes in This can be handy when locating options from long lists in drop-down boxes in
quick filters for example. Default for this setting is <b>0</b>. quick filters for example. Default for this setting is <b>0</b>.
</li> </li>
</ul> </ul>

View File

@ -7105,7 +7105,7 @@ int scan_attributes(char *logbook)
/* scan configuration file for attributes and fill attr_list, attr_options /* scan configuration file for attributes and fill attr_list, attr_options
and attr_flags arrays */ and attr_flags arrays */
{ {
char list[10000], str[NAME_LENGTH], type[NAME_LENGTH], tmp_list[MAX_N_ATTR][NAME_LENGTH]; char list[10000], str[NAME_LENGTH], str2[NAME_LENGTH], type[NAME_LENGTH], tmp_list[MAX_N_ATTR][NAME_LENGTH];
int i, j, n, m, n_options; int i, j, n, m, n_options;
if (getcfg(logbook, "Attributes", list, sizeof(list))) { if (getcfg(logbook, "Attributes", list, sizeof(list))) {
@ -7158,7 +7158,8 @@ int scan_attributes(char *logbook)
attr_flags[i] |= AF_ICON; attr_flags[i] |= AF_ICON;
} }
if (n_options && getcfg(logbook, "Sort Attribute Options", str, sizeof(str)) && atoi(str) == 1) { sprintf(str2, "Sort Attribute Options %s", attr_list[i]);
if (n_options && getcfg(logbook, str2, str, sizeof(str)) && atoi(str) == 1) {
qsort(attr_options[i], n_options, NAME_LENGTH, ascii_compare2); qsort(attr_options[i], n_options, NAME_LENGTH, ascii_compare2);
} }
} }