Commit 65a983cf authored by David Fuhrmann's avatar David Fuhrmann

macosx: advanced prefs: implement controls for CONFIG_ITEM_MODULE_LIST

fixes #7493
parent eab8b4ac
......@@ -1958,9 +1958,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
{
if (_p_item->i_type == CONFIG_ITEM_MODULE_LIST)
//TODO....
return nil;
BOOL b_by_cat = _p_item->i_type == CONFIG_ITEM_MODULE_LIST_CAT;
//Fill our array to know how may items we have...
module_t *p_parser, **p_list;
......@@ -1979,6 +1977,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
if (module_is_main(p_parser))
continue;
if (b_by_cat) {
unsigned int confsize;
module_config_t *p_configlist = module_config_get(p_parser, &confsize);
......@@ -1991,6 +1990,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
/* Hack: required subcategory is stored in i_min */
if (p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == _p_item->min.i) {
o_modulelongname = [NSString stringWithUTF8String:module_get_name(p_parser, TRUE)];
o_modulename = [NSString stringWithUTF8String:module_get_object(p_parser)];
......@@ -2014,21 +2014,40 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
p_config->value.i == _p_item->min.i) {
#define addLuaIntf(shortname, longname) \
if (_p_item->value.psz && strstr(_p_item->value.psz, shortname))\
if (_p_item->value.psz && strstr(_p_item->value.psz, shortname))\
o_moduleenabled = [NSNumber numberWithBool:YES];\
else\
else\
o_moduleenabled = [NSNumber numberWithBool:NO];\
[o_modulearray addObject:[NSMutableArray arrayWithObjects: @shortname, _NS(longname), o_moduleenabled, nil]]
addLuaIntf("http", "Web");
addLuaIntf("telnet", "Telnet");
addLuaIntf("cli", "Console");
#undef addLuaIntf
}
}
module_config_free(p_configlist);
} else if (module_provides(p_parser, _p_item->psz_type)) {
NSString *o_modulelongname = toNSStr(module_get_name(p_parser, TRUE));
NSString *o_modulename = toNSStr(module_get_object(p_parser));
NSNumber *o_moduleenabled = nil;
if (_p_item->value.psz &&
strstr(_p_item->value.psz, module_get_object(p_parser)))
o_moduleenabled = [NSNumber numberWithBool:YES];
else
o_moduleenabled = [NSNumber numberWithBool:NO];
[o_modulearray addObject:[NSMutableArray
arrayWithObjects: o_modulename, o_modulelongname,
o_moduleenabled, nil]];
}
} /* FOR i_module_index */
module_list_free(p_list);
mainFrame.size.height = 30 + 20 * [o_modulearray count];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment