Commit 8c45a841 authored by Olivier Teulière's avatar Olivier Teulière

* ./modules/gui/win32/preferences.cpp: fixed a segfault when a module

   forgets to declare 'add_category_hint'
 * ./modules/demux/mpeg/ts.c: added a missing 'add_category_hint' :p
parent 9430cc59
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_ts.c : Transport Stream input module for vlc * mpeg_ts.c : Transport Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: ts.c,v 1.12 2003/01/07 15:12:48 jobi Exp $ * $Id: ts.c,v 1.13 2003/01/08 03:01:55 ipkiss Exp $
* *
* Authors: Henri Fallon <henri@via.ecp.fr> * Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr> * Johan Bilien <jobi@via.ecp.fr>
...@@ -109,6 +109,7 @@ vlc_module_begin(); ...@@ -109,6 +109,7 @@ vlc_module_begin();
set_capability( "demux", 170 ); set_capability( "demux", 170 );
add_shortcut( "ts_dvbpsi" ); add_shortcut( "ts_dvbpsi" );
#endif #endif
add_category_hint( N_("Miscellaneous"), NULL );
add_bool( "vls-backwards-compat", 0, NULL, add_bool( "vls-backwards-compat", 0, NULL,
VLS_BACKWARDS_COMPAT_TEXT, VLS_BACKWARDS_COMPAT_LONGTEXT ); VLS_BACKWARDS_COMPAT_TEXT, VLS_BACKWARDS_COMPAT_LONGTEXT );
set_callbacks( Activate, Deactivate ); set_callbacks( Activate, Deactivate );
......
...@@ -41,24 +41,24 @@ ...@@ -41,24 +41,24 @@
/**************************************************************************** /****************************************************************************
* A THintWindow with a limited width * A THintWindow with a limited width
****************************************************************************/ ****************************************************************************/
void __fastcall TNarrowHintWindow::ActivateHint(const Windows::TRect &Rect, void __fastcall TNarrowHintWindow::ActivateHint( const Windows::TRect &Rect,
const System::AnsiString AHint) const System::AnsiString AHint )
{ {
TRect NarrowRect = CalcHintRect ( 300 , AHint , NULL ); TRect NarrowRect = CalcHintRect( 300, AHint, NULL );
NarrowRect.Left = Rect.Left; NarrowRect.Left = Rect.Left;
NarrowRect.Top = Rect.Top; NarrowRect.Top = Rect.Top;
NarrowRect.Right += Rect.Left; NarrowRect.Right += Rect.Left;
NarrowRect.Bottom += Rect.Top; NarrowRect.Bottom += Rect.Top;
THintWindow::ActivateHint ( NarrowRect , AHint ); THintWindow::ActivateHint( NarrowRect, AHint );
} }
/**************************************************************************** /****************************************************************************
* Just a wrapper to embed an AnsiString into a TObject * Just a wrapper to embed an AnsiString into a TObject
****************************************************************************/ ****************************************************************************/
__fastcall TObjectString::TObjectString(char * String) __fastcall TObjectString::TObjectString( char * String )
{ {
FString = AnsiString(String); FString = AnsiString( String );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
AnsiString __fastcall TObjectString::String() AnsiString __fastcall TObjectString::String()
...@@ -73,9 +73,10 @@ AnsiString __fastcall TObjectString::String() ...@@ -73,9 +73,10 @@ AnsiString __fastcall TObjectString::String()
****************************************************************************/ ****************************************************************************/
__fastcall TCleanCheckListBox::~TCleanCheckListBox() __fastcall TCleanCheckListBox::~TCleanCheckListBox()
{ {
for ( int i = 0 ; i < Items->Count ; i++ ) for( int i = 0 ; i < Items->Count ; i++ )
{ {
if ( Items->Objects[i] != NULL ) delete Items->Objects[i]; if( Items->Objects[i] != NULL )
delete Items->Objects[i];
} }
} }
...@@ -214,7 +215,7 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner, ...@@ -214,7 +215,7 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
ButtonConfig->OnClick = ButtonConfigClick; ButtonConfig->OnClick = ButtonConfigClick;
/* init label */ /* init label */
AnsiString Text = AnsiString(p_config->psz_text) + ":"; AnsiString Text = AnsiString( p_config->psz_text ) + ":";
Label = CreateLabel( this, Label = CreateLabel( this,
LIBWIN32_PREFSIZE_LEFT, LIBWIN32_PREFSIZE_LEFT,
LIBWIN32_PREFSIZE_RIGHT - LIBWIN32_PREFSIZE_BUTTON_WIDTH LIBWIN32_PREFSIZE_RIGHT - LIBWIN32_PREFSIZE_BUTTON_WIDTH
...@@ -233,9 +234,9 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner, ...@@ -233,9 +234,9 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
CleanCheckListBox = CreateCleanCheckListBox( this, CleanCheckListBox = CreateCleanCheckListBox( this,
LIBWIN32_PREFSIZE_EDIT_LEFT, LIBWIN32_PREFSIZE_EDIT_LEFT,
LIBWIN32_PREFSIZE_EDIT_WIDTH, LIBWIN32_PREFSIZE_EDIT_WIDTH,
max ( Label->Top + Label->Height , ButtonConfig->Top max( Label->Top + Label->Height , ButtonConfig->Top
+ ButtonConfig->Height ) + LIBWIN32_PREFSIZE_VPAD, + ButtonConfig->Height ) + LIBWIN32_PREFSIZE_VPAD,
LIBWIN32_PREFSIZE_CHECKLISTBOX_HEIGHT ); LIBWIN32_PREFSIZE_CHECKLISTBOX_HEIGHT );
CleanCheckListBox->OnClick = CheckListBoxClick; CleanCheckListBox->OnClick = CheckListBoxClick;
CleanCheckListBox->OnClickCheck = CheckListBoxClickCheck; CleanCheckListBox->OnClickCheck = CheckListBoxClickCheck;
CleanCheckListBox->Hint = p_config->psz_longtext; CleanCheckListBox->Hint = p_config->psz_longtext;
...@@ -532,7 +533,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -532,7 +533,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
int i_pages, i_ctrl; int i_pages, i_ctrl;
TTabSheet *TabSheet; TTabSheet *TabSheet;
TScrollBox *ScrollBox; TScrollBox *ScrollBox = NULL;
TPanel *Panel; TPanel *Panel;
TPanelPlugin *PanelPlugin; TPanelPlugin *PanelPlugin;
TPanelString *PanelString; TPanelString *PanelString;
...@@ -605,21 +606,21 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name ) ...@@ -605,21 +606,21 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
{ {
AnsiString ModuleDesc; AnsiString ModuleDesc;
if ( p_parser->psz_longname != NULL ) { if ( p_parser->psz_longname != NULL ) {
ModuleDesc = AnsiString(p_parser->psz_longname) + ModuleDesc = AnsiString( p_parser->psz_longname ) +
" (" + AnsiString(p_parser->psz_object_name) + " (" + AnsiString( p_parser->psz_object_name ) +
")"; ")";
} }
else else
ModuleDesc = AnsiString(p_parser->psz_object_name); ModuleDesc = AnsiString( p_parser->psz_object_name );
int item = PanelPlugin->CleanCheckListBox->Items->AddObject( int item = PanelPlugin->CleanCheckListBox->Items->AddObject(
ModuleDesc.c_str(), ModuleDesc.c_str(),
new TObjectString(p_parser->psz_object_name) ); new TObjectString( p_parser->psz_object_name ) );
/* check the box if it's the default module */ /* check the box if it's the default module */
AnsiString Name = p_item->psz_value ? AnsiString Name = p_item->psz_value ?
p_item->psz_value : ""; p_item->psz_value : "";
if( !strcmp( p_parser->psz_object_name, Name.c_str()) ) if( !strcmp( p_parser->psz_object_name, Name.c_str() ) )
{ {
PanelPlugin->CleanCheckListBox->Checked[item] = true; PanelPlugin->CleanCheckListBox->Checked[item] = true;
} }
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
class TCleanCheckListBox : public TCheckListBox class TCleanCheckListBox : public TCheckListBox
{ {
public: public:
__fastcall TCleanCheckListBox(Classes::TComponent* AOwner) __fastcall TCleanCheckListBox( Classes::TComponent* AOwner )
: TCheckListBox( AOwner ) { }; : TCheckListBox( AOwner ) {};
virtual __fastcall ~TCleanCheckListBox(); virtual __fastcall ~TCleanCheckListBox();
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -48,8 +48,8 @@ public: ...@@ -48,8 +48,8 @@ public:
class TNarrowHintWindow : public THintWindow class TNarrowHintWindow : public THintWindow
{ {
public: public:
virtual void __fastcall ActivateHint(const Windows::TRect &Rect, virtual void __fastcall ActivateHint( const Windows::TRect &Rect,
const System::AnsiString AHint); const System::AnsiString AHint );
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/* Just a wrapper to embed an AnsiString into a TObject */ /* Just a wrapper to embed an AnsiString into a TObject */
...@@ -58,7 +58,7 @@ class TObjectString : public TObject ...@@ -58,7 +58,7 @@ class TObjectString : public TObject
private: private:
AnsiString FString; AnsiString FString;
public: public:
__fastcall TObjectString(char * String); __fastcall TObjectString( char * String );
AnsiString __fastcall String(); AnsiString __fastcall String();
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
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