Commit 2fd77aa1 authored by Olivier Teulière's avatar Olivier Teulière

* ./modules/gui/win32: deletd a dependancy with a global variable

parent ffddb1ea
...@@ -633,7 +633,7 @@ void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name ) ...@@ -633,7 +633,7 @@ void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name )
else else
{ {
/* create the config dialog */ /* create the config dialog */
Preferences = new TPreferencesDlg( this ); Preferences = new TPreferencesDlg( this, p_intf );
Preferences->CreateConfigDialog( Name.c_str() ); Preferences->CreateConfigDialog( Name.c_str() );
/* save it */ /* save it */
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#pragma link "CSPIN" #pragma link "CSPIN"
#pragma resource "*.dfm" #pragma resource "*.dfm"
extern intf_thread_t *p_intfGlobal;
/**************************************************************************** /****************************************************************************
* A THintWindow with a limited width * A THintWindow with a limited width
****************************************************************************/ ****************************************************************************/
...@@ -200,8 +198,11 @@ void __fastcall TPanelPref::UpdateChanges() ...@@ -200,8 +198,11 @@ void __fastcall TPanelPref::UpdateChanges()
* Panel for module management * Panel for module management
****************************************************************************/ ****************************************************************************/
__fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner, __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
module_config_t *p_config ) : TPanelPref( Owner, p_config ) module_config_t *p_config, intf_thread_t *_p_intf )
: TPanelPref( Owner, p_config )
{ {
p_intf = _p_intf;
/* init configure button */ /* init configure button */
ButtonConfig = CreateButton( this, ButtonConfig = CreateButton( this,
LIBWIN32_PREFSIZE_RIGHT - LIBWIN32_PREFSIZE_BUTTON_WIDTH, LIBWIN32_PREFSIZE_RIGHT - LIBWIN32_PREFSIZE_BUTTON_WIDTH,
...@@ -261,7 +262,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -261,7 +262,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
return; return;
/* look for module 'Name' */ /* look for module 'Name' */
p_list = vlc_list_find( p_intfGlobal, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( pp_parser = (module_t **)p_list->pp_objects ; for( pp_parser = (module_t **)p_list->pp_objects ;
*pp_parser ; *pp_parser ;
...@@ -295,7 +296,7 @@ void __fastcall TPanelPlugin::CheckListBoxClickCheck( TObject *Sender ) ...@@ -295,7 +296,7 @@ void __fastcall TPanelPlugin::CheckListBoxClickCheck( TObject *Sender )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPanelPlugin::ButtonConfigClick( TObject *Sender ) void __fastcall TPanelPlugin::ButtonConfigClick( TObject *Sender )
{ {
p_intfGlobal->p_sys->p_window-> p_intf->p_sys->p_window->
CreatePreferences( ModuleSelected->psz_object_name ); CreatePreferences( ModuleSelected->psz_object_name );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -436,10 +437,11 @@ void __fastcall TPanelBool::UpdateChanges() ...@@ -436,10 +437,11 @@ void __fastcall TPanelBool::UpdateChanges()
/**************************************************************************** /****************************************************************************
* Callbacks for the dialog * Callbacks for the dialog
****************************************************************************/ ****************************************************************************/
__fastcall TPreferencesDlg::TPreferencesDlg( TComponent* Owner ) __fastcall TPreferencesDlg::TPreferencesDlg( TComponent* Owner,
: TForm( Owner ) intf_thread_t *_p_intf ) : TForm( Owner )
{ {
Icon = p_intfGlobal->p_sys->p_window->Icon; p_intf = _p_intf;
Icon = p_intf->p_sys->p_window->Icon;
Application->HintHidePause = 0x1000000; Application->HintHidePause = 0x1000000;
HintWindowClass = __classid ( TNarrowHintWindow ); HintWindowClass = __classid ( TNarrowHintWindow );
/* prevent the form from being resized horizontally */ /* prevent the form from being resized horizontally */
...@@ -484,7 +486,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -484,7 +486,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
TPanelBool *PanelBool; TPanelBool *PanelBool;
/* Look for the selected module */ /* Look for the selected module */
p_list = vlc_list_find( p_intfGlobal, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( pp_parser = (module_t **)p_list->pp_objects ; for( pp_parser = (module_t **)p_list->pp_objects ;
*pp_parser ; *pp_parser ;
...@@ -536,7 +538,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -536,7 +538,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
/* add new panel for the config option */ /* add new panel for the config option */
PanelPlugin = new TPanelPlugin( this, p_item ); PanelPlugin = new TPanelPlugin( this, p_item, p_intf );
PanelPlugin->Parent = ScrollBox; PanelPlugin->Parent = ScrollBox;
/* Look for valid modules */ /* Look for valid modules */
...@@ -659,7 +661,7 @@ void __fastcall TPreferencesDlg::ButtonApplyClick( TObject *Sender ) ...@@ -659,7 +661,7 @@ void __fastcall TPreferencesDlg::ButtonApplyClick( TObject *Sender )
void __fastcall TPreferencesDlg::ButtonSaveClick( TObject *Sender ) void __fastcall TPreferencesDlg::ButtonSaveClick( TObject *Sender )
{ {
ButtonApplyClick( Sender ); ButtonApplyClick( Sender );
config_SaveConfigFile( p_intfGlobal, NULL ); config_SaveConfigFile( p_intf, NULL );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TPreferencesDlg::ButtonCancelClick( TObject *Sender ) void __fastcall TPreferencesDlg::ButtonCancelClick( TObject *Sender )
...@@ -674,12 +676,12 @@ void __fastcall TPreferencesDlg::SaveValue( module_config_t *p_config ) ...@@ -674,12 +676,12 @@ void __fastcall TPreferencesDlg::SaveValue( module_config_t *p_config )
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
config_PutPsz( p_intfGlobal, p_config->psz_name, config_PutPsz( p_intf, p_config->psz_name,
*p_config->psz_value ? p_config->psz_value : NULL ); *p_config->psz_value ? p_config->psz_value : NULL );
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_BOOL: case CONFIG_ITEM_BOOL:
config_PutInt( p_intfGlobal, p_config->psz_name, config_PutInt( p_intf, p_config->psz_name,
p_config->i_value ); p_config->i_value );
break; break;
} }
......
...@@ -87,7 +87,8 @@ public: ...@@ -87,7 +87,8 @@ public:
class TPanelPlugin : public TPanelPref class TPanelPlugin : public TPanelPref
{ {
public: public:
__fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config ); __fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config,
intf_thread_t *_p_intf );
TCleanCheckListBox *CleanCheckListBox; TCleanCheckListBox *CleanCheckListBox;
TButton *ButtonConfig; TButton *ButtonConfig;
TLabel *Label; TLabel *Label;
...@@ -96,6 +97,8 @@ public: ...@@ -96,6 +97,8 @@ public:
void __fastcall CheckListBoxClick( TObject *Sender ); void __fastcall CheckListBoxClick( TObject *Sender );
void __fastcall CheckListBoxClickCheck( TObject *Sender ); void __fastcall CheckListBoxClickCheck( TObject *Sender );
void __fastcall ButtonConfigClick( TObject *Sender ); void __fastcall ButtonConfigClick( TObject *Sender );
private:
intf_thread_t *p_intf;
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class TPanelString : public TPanelPref class TPanelString : public TPanelPref
...@@ -138,8 +141,9 @@ __published: // IDE-managed Components ...@@ -138,8 +141,9 @@ __published: // IDE-managed Components
void __fastcall ButtonCancelClick( TObject *Sender ); void __fastcall ButtonCancelClick( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action ); void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
private: // User declarations private: // User declarations
intf_thread_t *p_intf;
public: // User declarations public: // User declarations
__fastcall TPreferencesDlg( TComponent* Owner ); __fastcall TPreferencesDlg( TComponent* Owner, intf_thread_t *_p_intf );
void __fastcall CreateConfigDialog( char *psz_module_name ); void __fastcall CreateConfigDialog( char *psz_module_name );
void __fastcall SaveValue( module_config_t *p_config ); void __fastcall SaveValue( module_config_t *p_config );
}; };
......
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