* menu.cpp: functions to handle menu items
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: menu.cpp,v 1.11 2003/01/27 17:41:01 ipkiss Exp $
+ * $Id: menu.cpp,v 1.12 2003/02/01 22:21:44 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
}
/*
- * Modules\r
- */\r
-\r
-/* Interface modules: we spawn a new interface */\r
-void __fastcall TMenusGen::InterfaceModuleClick( TObject *Sender )\r
-{\r
- TMenuItem * Item = (TMenuItem *)Sender;\r
-\r
- AnsiString IntfName = CleanCaption( Item->Caption );\r
-\r
- intf_thread_t *p_newintf;\r
- char *psz_oldmodule = config_GetPsz( p_intf->p_vlc, "intf" );\r
-\r
- config_PutPsz( p_intf->p_vlc, "intf", IntfName.c_str() );\r
- p_newintf = intf_Create( p_intf->p_vlc );\r
- config_PutPsz( p_intf->p_vlc, "intf", psz_oldmodule );\r
-\r
- if( psz_oldmodule )\r
- {\r
- free( psz_oldmodule );\r
- }\r
-\r
- if( p_newintf )\r
- {\r
- p_newintf->b_block = VLC_FALSE;\r
- if( intf_RunThread( p_newintf ) )\r
- {\r
- vlc_object_detach( p_newintf );\r
- intf_Destroy( p_newintf );\r
- }\r
- }\r
-}\r
-\r
+ * Modules
+ */
+
+/* Interface modules: we spawn a new interface */
+void __fastcall TMenusGen::InterfaceModuleClick( TObject *Sender )
+{
+ TMenuItem * Item = (TMenuItem *)Sender;
+
+ AnsiString IntfName = CleanCaption( Item->Caption );
+
+ intf_thread_t *p_newintf;
+ char *psz_oldmodule = config_GetPsz( p_intf->p_vlc, "intf" );
+
+ config_PutPsz( p_intf->p_vlc, "intf", IntfName.c_str() );
+ p_newintf = intf_Create( p_intf->p_vlc );
+ config_PutPsz( p_intf->p_vlc, "intf", psz_oldmodule );
+
+ if( psz_oldmodule )
+ {
+ free( psz_oldmodule );
+ }
+
+ if( p_newintf )
+ {
+ p_newintf->b_block = VLC_FALSE;
+ if( intf_RunThread( p_newintf ) )
+ {
+ vlc_object_detach( p_newintf );
+ intf_Destroy( p_newintf );
+ }
+ }
+}
+
/*
* Audio
*/
}
/* This function deletes all the '&' characters in the caption string,
- * because Borland automatically adds one when (and only when!) you click on\r
- * the menuitem. Grrrrr... */\r
-AnsiString __fastcall TMenusGen::CleanCaption( AnsiString Caption )\r
-{\r
- while( Caption.LastDelimiter( "&" ) != 0 )\r
- {\r
- Caption.Delete( Caption.LastDelimiter( "&" ), 1 );\r
- }\r
-\r
- return Caption;\r
-}\r
-\r
+ * because Borland automatically adds one when (and only when!) you click on
+ * the menuitem. Grrrrr... */
+AnsiString __fastcall TMenusGen::CleanCaption( AnsiString Caption )
+{
+ while( Caption.LastDelimiter( "&" ) != 0 )
+ {
+ Caption.Delete( Caption.LastDelimiter( "&" ), 1 );
+ }
+
+ return Caption;
+}
+
/****************************************************************************
* VarChange: change a variable in a vlc_object_t
****************************************************************************