\r
void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )\r
{\r
- module_t *p_module;\r
- module_t *p_module_plugins;\r
- unsigned int i;\r
+ module_t *p_module, *p_module_plugins;\r
+ module_config_t *p_item;\r
int i_pages, i_ctrl;\r
\r
TTabSheet *TabSheet;\r
*/\r
\r
/* Enumerate config options and add corresponding config boxes */\r
- for( i = 0; i < p_module->i_config_lines; i++ )\r
+ p_item = p_module->p_config;\r
+ do\r
{\r
- switch( p_module->p_config[i].i_type )\r
+ switch( p_item->i_type )\r
{\r
case MODULE_CONFIG_HINT_CATEGORY:\r
\r
/* create a new tabsheet. */\r
TabSheet = new TTabSheet( this );\r
TabSheet->PageControl = PageControlPref;\r
- TabSheet->Caption = p_module->p_config[i].psz_text;\r
+ TabSheet->Caption = p_item->psz_text;\r
TabSheet->Visible = true;\r
\r
/* pack a scrollbox into the tabsheet */\r
case MODULE_CONFIG_ITEM_MODULE:\r
\r
/* add new groupbox for the config option */\r
- GroupBoxPlugin = new TGroupBoxPlugin( this, &p_module->p_config[i] );\r
+ GroupBoxPlugin = new TGroupBoxPlugin( this, p_item );\r
GroupBoxPlugin->Parent = ScrollBox;\r
\r
/* add panel as separator */\r
p_module_plugins = p_module_plugins->next )\r
{\r
if( p_module_plugins->i_capabilities &\r
- ( 1 << p_module->p_config[i].i_value ) )\r
+ ( 1 << p_item->i_value ) )\r
{\r
ListItem = GroupBoxPlugin->ListView->Items->Add();\r
ListItem->Caption = p_module_plugins->psz_name;\r
case MODULE_CONFIG_ITEM_STRING:\r
\r
/* add new groupbox for the config option */\r
- GroupBoxString = new TGroupBoxString( this, &p_module->p_config[i] );\r
+ GroupBoxString = new TGroupBoxString( this, p_item );\r
GroupBoxString->Parent = ScrollBox;\r
\r
/* add panel as separator */\r
case MODULE_CONFIG_ITEM_INTEGER:\r
\r
/* add new groupbox for the config option */\r
- GroupBoxInteger = new TGroupBoxInteger( this, &p_module->p_config[i] );\r
+ GroupBoxInteger = new TGroupBoxInteger( this, p_item );\r
GroupBoxInteger->Parent = ScrollBox;\r
\r
/* add panel as separator */\r
case MODULE_CONFIG_ITEM_BOOL:\r
\r
/* add new groupbox for the config option */\r
- GroupBoxBool = new TGroupBoxBool( this, &p_module->p_config[i] );\r
+ GroupBoxBool = new TGroupBoxBool( this, p_item );\r
GroupBoxBool->Parent = ScrollBox;\r
\r
/* add panel as separator */\r
\r
break;\r
}\r
+ \r
+ p_item++;\r
}\r
+ while( p_item->i_type != MODULE_CONFIG_HINT_END );\r
\r
/* Reorder groupboxes inside the tabsheets */\r
for( i_pages = 0; i_pages < PageControlPref->PageCount; i_pages++ )\r