Commit 76e16cfd authored by Olivier Teulière's avatar Olivier Teulière

 * plugins/win32/preferences.cpp: fixed a compilation bug
parent fbe65af6
...@@ -357,9 +357,8 @@ void __fastcall TPreferencesDlg::FormHide( TObject *Sender ) ...@@ -357,9 +357,8 @@ void __fastcall TPreferencesDlg::FormHide( TObject *Sender )
void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
{ {
module_t *p_module; module_t *p_module, *p_module_plugins;
module_t *p_module_plugins; module_config_t *p_item;
unsigned int i;
int i_pages, i_ctrl; int i_pages, i_ctrl;
TTabSheet *TabSheet; TTabSheet *TabSheet;
...@@ -385,16 +384,17 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -385,16 +384,17 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
*/ */
/* Enumerate config options and add corresponding config boxes */ /* Enumerate config options and add corresponding config boxes */
for( i = 0; i < p_module->i_config_lines; i++ ) p_item = p_module->p_config;
do
{ {
switch( p_module->p_config[i].i_type ) switch( p_item->i_type )
{ {
case MODULE_CONFIG_HINT_CATEGORY: case MODULE_CONFIG_HINT_CATEGORY:
/* create a new tabsheet. */ /* create a new tabsheet. */
TabSheet = new TTabSheet( this ); TabSheet = new TTabSheet( this );
TabSheet->PageControl = PageControlPref; TabSheet->PageControl = PageControlPref;
TabSheet->Caption = p_module->p_config[i].psz_text; TabSheet->Caption = p_item->psz_text;
TabSheet->Visible = true; TabSheet->Visible = true;
/* pack a scrollbox into the tabsheet */ /* pack a scrollbox into the tabsheet */
...@@ -410,7 +410,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -410,7 +410,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
case MODULE_CONFIG_ITEM_MODULE: case MODULE_CONFIG_ITEM_MODULE:
/* add new groupbox for the config option */ /* add new groupbox for the config option */
GroupBoxPlugin = new TGroupBoxPlugin( this, &p_module->p_config[i] ); GroupBoxPlugin = new TGroupBoxPlugin( this, p_item );
GroupBoxPlugin->Parent = ScrollBox; GroupBoxPlugin->Parent = ScrollBox;
/* add panel as separator */ /* add panel as separator */
...@@ -422,7 +422,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -422,7 +422,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
p_module_plugins = p_module_plugins->next ) p_module_plugins = p_module_plugins->next )
{ {
if( p_module_plugins->i_capabilities & if( p_module_plugins->i_capabilities &
( 1 << p_module->p_config[i].i_value ) ) ( 1 << p_item->i_value ) )
{ {
ListItem = GroupBoxPlugin->ListView->Items->Add(); ListItem = GroupBoxPlugin->ListView->Items->Add();
ListItem->Caption = p_module_plugins->psz_name; ListItem->Caption = p_module_plugins->psz_name;
...@@ -436,7 +436,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -436,7 +436,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
case MODULE_CONFIG_ITEM_STRING: case MODULE_CONFIG_ITEM_STRING:
/* add new groupbox for the config option */ /* add new groupbox for the config option */
GroupBoxString = new TGroupBoxString( this, &p_module->p_config[i] ); GroupBoxString = new TGroupBoxString( this, p_item );
GroupBoxString->Parent = ScrollBox; GroupBoxString->Parent = ScrollBox;
/* add panel as separator */ /* add panel as separator */
...@@ -447,7 +447,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -447,7 +447,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
case MODULE_CONFIG_ITEM_INTEGER: case MODULE_CONFIG_ITEM_INTEGER:
/* add new groupbox for the config option */ /* add new groupbox for the config option */
GroupBoxInteger = new TGroupBoxInteger( this, &p_module->p_config[i] ); GroupBoxInteger = new TGroupBoxInteger( this, p_item );
GroupBoxInteger->Parent = ScrollBox; GroupBoxInteger->Parent = ScrollBox;
/* add panel as separator */ /* add panel as separator */
...@@ -458,7 +458,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -458,7 +458,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
case MODULE_CONFIG_ITEM_BOOL: case MODULE_CONFIG_ITEM_BOOL:
/* add new groupbox for the config option */ /* add new groupbox for the config option */
GroupBoxBool = new TGroupBoxBool( this, &p_module->p_config[i] ); GroupBoxBool = new TGroupBoxBool( this, p_item );
GroupBoxBool->Parent = ScrollBox; GroupBoxBool->Parent = ScrollBox;
/* add panel as separator */ /* add panel as separator */
...@@ -466,7 +466,10 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -466,7 +466,10 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
break; break;
} }
p_item++;
} }
while( p_item->i_type != MODULE_CONFIG_HINT_END );
/* Reorder groupboxes inside the tabsheets */ /* Reorder groupboxes inside the tabsheets */
for( i_pages = 0; i_pages < PageControlPref->PageCount; i_pages++ ) for( i_pages = 0; i_pages < PageControlPref->PageCount; i_pages++ )
......
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