View | Details | Raw Unified | Return to bug 192540 | Differences between
and this patch

Collapse All | Expand All

(-)dialog4ports.c (-4 / +31 lines)
Lines 50-60 Link Here
50
static StringList *enable_items = NULL;
50
static StringList *enable_items = NULL;
51
/* New items */
51
/* New items */
52
static StringList *new_items = NULL;
52
static StringList *new_items = NULL;
53
/* Items set by default */
54
static StringList *default_items = NULL;
55
/* Globally set/unset items */
56
static StringList *global_set_items = NULL;
57
static StringList *global_unset_items = NULL;
53
58
54
/* add item to items */
59
/* add item to items */
55
static void
60
static void
56
add_item(dialog_mixedlist **items, char const *name, char const *text,
61
add_item(dialog_mixedlist **items, char const *name, char const *text,
57
		bool state, bool new, int type, int grp)
62
		bool state, bool new, bool deft, char global, int type, int grp)
58
{
63
{
59
64
60
	if ((list_no + 1 > items_sz) || *items == NULL) {
65
	if ((list_no + 1 > items_sz) || *items == NULL) {
Lines 71-76 Link Here
71
	(*items)[list_no].type = type;
76
	(*items)[list_no].type = type;
72
	(*items)[list_no].group = grp;
77
	(*items)[list_no].group = grp;
73
	(*items)[list_no].new = new;
78
	(*items)[list_no].new = new;
79
	(*items)[list_no].deft = deft;
80
	(*items)[list_no].global = global;
74
	list_no++;
81
	list_no++;
75
}
82
}
76
83
Lines 103-108 Link Here
103
	return (sl_find(new_items, name) != NULL);
110
	return (sl_find(new_items, name) != NULL);
104
}
111
}
105
112
113
static bool
114
is_deft(char *name)
115
{
116
	return (sl_find(default_items, name) != NULL);
117
}
118
119
static char
120
get_global(char *name)
121
{
122
	if (sl_find(global_set_items, name) != NULL)
123
		return 'Y';
124
	if (sl_find(global_unset_items, name) != NULL)
125
		return 'N';
126
	return ' ';
127
}
128
106
static StringList *
129
static StringList *
107
parse_env_sl(char const *env_name)
130
parse_env_sl(char const *env_name)
108
{
131
{
Lines 146-152 Link Here
146
			if (token[0] == '\0')
169
			if (token[0] == '\0')
147
				continue;
170
				continue;
148
			add_item(items, token, get_desc(token, ""), is_enable(token),
171
			add_item(items, token, get_desc(token, ""), is_enable(token),
149
					is_new(token), type, group);
172
					is_new(token), is_deft(token), get_global(token), type, group);
150
		}
173
		}
151
		free(tofree);
174
		free(tofree);
152
	} else {
175
	} else {
Lines 155-161 Link Here
155
			if (token[0] == '\0')
178
			if (token[0] == '\0')
156
				continue;
179
				continue;
157
			if (list_no != 0)
180
			if (list_no != 0)
158
				add_item(items, get_desc(token, token), "", false, false,
181
				add_item(items, get_desc(token, token), "", false, false, false, ' ',
159
						ITEM_SEPARATOR, group);
182
						ITEM_SEPARATOR, group);
160
183
161
			snprintf(buf, sizeof(buf), "%s_%s", env_name, token);
184
			snprintf(buf, sizeof(buf), "%s_%s", env_name, token);
Lines 167-173 Link Here
167
				if (token2[0] == '\0')
190
				if (token2[0] == '\0')
168
					continue;
191
					continue;
169
				add_item(items, token2, get_desc(token2, ""),
192
				add_item(items, token2, get_desc(token2, ""),
170
						is_enable(token2), is_new(token2), type, group);
193
						is_enable(token2), is_new(token2), is_deft(token2), get_global(token2),
194
						type, group);
171
			}
195
			}
172
			free(tofree2);
196
			free(tofree2);
173
			group++;
197
			group++;
Lines 190-195 Link Here
190
214
191
	enable_items = parse_env_sl("PORT_OPTIONS");
215
	enable_items = parse_env_sl("PORT_OPTIONS");
192
	new_items = parse_env_sl("NEW_OPTIONS");
216
	new_items = parse_env_sl("NEW_OPTIONS");
217
	default_items = parse_env_sl("OPTIONS_DEFAULT");
218
	global_set_items = parse_env_sl("OPTIONS_GLOBAL_SET");
219
	global_unset_items = parse_env_sl("OPTIONS_GLOBAL_UNSET");
193
220
194
	parsing_env(&items, "ALL_OPTIONS", ITEM_CHECK);
221
	parsing_env(&items, "ALL_OPTIONS", ITEM_CHECK);
195
	parsing_env(&items, "OPTIONS_GROUP", ITEM_CHECK);
222
	parsing_env(&items, "OPTIONS_GROUP", ITEM_CHECK);
(-)mixedlist.c (-3 / +20 lines)
Lines 153-158 Link Here
153
	const int *indx;
153
	const int *indx;
154
	int limit, itype;
154
	int limit, itype;
155
	char const *states;
155
	char const *states;
156
	char label;
157
	int label_attr;
158
	int x_attr;
156
159
157
	itype = items->type;
160
	itype = items->type;
158
	/* x for [ ], * for ( ) */
161
	/* x for [ ], * for ( ) */
Lines 194-203 Link Here
194
		}
197
		}
195
	} /* No ;) */
198
	} /* No ;) */
196
	else {
199
	else {
200
		if (items->new) {
201
			label = '+';
202
			label_attr = tag_key_attr;
203
		} else if (items->global != ' ' && items->global != (items->deft ? 'Y' : 'N')) {
204
			label = 'o';
205
			label_attr = button_label_inactive_attr;
206
		} else {
207
			label = ' ';
208
			label_attr = item_attr;
209
		}
210
		if (items->state != (items->global != ' ' ? items->global == 'Y' : items->deft))
211
			x_attr = tag_key_attr;
212
		else
213
			x_attr = check_attr;
197
		wmove(win, choice, check_x - 1);
214
		wmove(win, choice, check_x - 1);
198
		wattrset(win, tag_key_attr);
215
		wattrset(win, label_attr);
199
		waddch(win, items->new ? '+' : ' ');
216
		waddch(win, label);
200
		wattrset(win, selected ? check_selected_attr : check_attr);
217
		wattrset(win, x_attr);
201
		wprintw(win,
218
		wprintw(win,
202
				itype == ITEM_CHECK ? "[%c]" : "(%c)",
219
				itype == ITEM_CHECK ? "[%c]" : "(%c)",
203
				states[items->state]);
220
				states[items->state]);
(-)mixedlist.h (+2 lines)
Lines 12-17 Link Here
12
        int group;
12
        int group;
13
        bool state;
13
        bool state;
14
        bool new;
14
        bool new;
15
        bool deft;
16
        char global;
15
} dialog_mixedlist;
17
} dialog_mixedlist;
16
18
17
/*
19
/*

Return to bug 192540