* vlm_panel.cpp: VLM Panel
*****************************************************************************
* Copyright (C) 2000-2005 the VideoLAN team
- * $Id: playlist.cpp 12582 2005-09-17 14:15:32Z zorglub $
+ * $Id$
*
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clément Stenac <zorglub@videolan.org>
*
* This program is free software; you can redistribute it and/OR MODIFy
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "dialogs/vlm/vlm_panel.hpp"
#include "dialogs/vlm/vlm_streampanel.hpp"
#include <wx/statline.h>
+#include "charset.h"
+
enum
{
Notebook_Event,
Timer_Event,
- Close_Event,
Load_Event,
- Save_Event,
};
BEGIN_EVENT_TABLE( VLMPanel, wxPanel)
EVT_TIMER( Timer_Event, VLMPanel::OnTimer )
- EVT_BUTTON( Close_Event, VLMPanel::OnClose )
+ EVT_BUTTON( wxID_CLOSE, VLMPanel::OnClose )
EVT_BUTTON( Load_Event, VLMPanel::OnLoad )
- EVT_BUTTON( Save_Event, VLMPanel::OnSave )
+ EVT_BUTTON( wxID_SAVE, VLMPanel::OnSave )
END_EVENT_TABLE()
wxNotebookSizer *notebook_sizer = new wxNotebookSizer( p_notebook );
#endif
p_notebook->AddPage( BroadcastPanel( p_notebook ), wxU( _("Broadcasts") ) );
+#if 0
p_notebook->AddPage( VODPanel( p_notebook ), wxU( _("VOD") ) );
+#endif
#if (!wxCHECK_VERSION(2,5,0))
panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
#else
#endif
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
- button_sizer->Add( new wxButton( this, Close_Event, wxU(_("Close") ) ) );
+ button_sizer->Add( new wxButton( this, wxID_CLOSE, wxU(_("&Close") ) ) );
button_sizer->Add( 0, 0, 1 );
button_sizer->Add( new wxButton( this, Load_Event, wxU(_("Load") ) ), 0, wxRIGHT, 10 );
- button_sizer->Add( new wxButton( this, Save_Event, wxU(_("Save") ) ) );
+ button_sizer->Add( new wxButton( this, wxID_SAVE, wxU(_("&Save") ) ) );
panel_sizer->Add( button_sizer, 0 , wxEXPAND | wxALL, 5 );
panel_sizer->Layout();
wxT("*"), wxOPEN | wxMULTIPLE );
if( p_file_dialog == NULL ) return;
- p_file_dialog->SetTitle( wxU(_("Load configuration") ) );
+ p_file_dialog->SetTitle( wxU(_("Load Configuration") ) );
if( p_file_dialog->ShowModal() == wxID_OK )
{
- vlm_Load( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str() );
+ vlm_Load( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str(wxConvUTF8) );
}
Update();
}
wxT("*"), wxSAVE | wxOVERWRITE_PROMPT );
if( p_file_dialog == NULL ) return;
- p_file_dialog->SetTitle( wxU(_("Save configuration") ) );
+ p_file_dialog->SetTitle( wxU(_("Save Configuration") ) );
if( p_file_dialog->ShowModal() == wxID_OK )
{
- vlm_Save( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str() );
+ vlm_Save( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str(wxConvUTF8) );
}
}
wxPanel( _p_parent, -1, wxDefaultPosition, wxDefaultSize )
{
p_intf = _p_intf;
+ p_parent = _p_parent;
p_vlm = _p_vlm;
b_edit = _b_edit;
b_broadcast = _b_broadcast;
upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Name") ) ), 0,
wxALIGN_CENTER_VERTICAL, 0 );
- name_text = new wxTextCtrl( this, -1, wxU( _("") ), wxDefaultPosition,
+ name_text = new wxTextCtrl( this, -1, wxU( "" ), wxDefaultPosition,
wxSize( 150, -1 ) );
upper_sizer->Add( name_text , 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Input") ) ), 0,
wxALIGN_CENTER_VERTICAL, 0 );
- input_text = new wxTextCtrl( this, -1, wxU( _("") ) ,
+ input_text = new wxTextCtrl( this, -1, wxU( "" ) ,
wxDefaultPosition, wxSize( 150, -1 ) );
upper_sizer->Add( input_text , 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
upper_sizer->Add( new wxButton( this, ChooseInput_Event, wxU( _("Choose") ) ) );
upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Output") ) ), 0,
wxALIGN_CENTER_VERTICAL, 0 );
- output_text = new wxTextCtrl( this, -1, wxU( _("") ) ,
+ output_text = new wxTextCtrl( this, -1, wxU( "" ) ,
wxDefaultPosition, wxSize( 150, -1 ) );
upper_sizer->Add( output_text, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
upper_sizer->Add( new wxButton( this, ChooseOutput_Event,
panel_sizer->Add( upper_sizer, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer *lower_sizer = new wxBoxSizer( wxHORIZONTAL );
- lower_sizer->Add( new wxButton( this, Create_Event,
- wxU( _( b_edit ? "Edit" : "Create" ) ) ),
- 0 , wxEXPAND | wxALL , 5 );
- lower_sizer->Add( new wxButton( this, Clear_Event, wxU( _( "Clear" ) ) ),
- 0 , wxEXPAND | wxALL , 5 );
-
enabled_checkbox = new wxCheckBox( this, -1, wxU( _("Enabled" ) ) );
enabled_checkbox->SetValue( true );
lower_sizer->Add( enabled_checkbox, 1 , wxEXPAND | wxALL , 5 );
lower_sizer->Add( loop_checkbox, 1 , wxEXPAND | wxALL , 5 );
}
+ if( !b_edit )
+ {
+ lower_sizer->Add( new wxButton( this, wxID_CLEAR,
+ wxU( _( "&Clear" ) ) ),
+ 0 , wxEXPAND | wxALL , 5 );
+ }
+ lower_sizer->Add( new wxButton( this, Create_Event,
+ wxU( _( b_edit ? "OK" : "Create" ) ) ),
+ 0 , wxEXPAND | wxALL , 5 );
+
+
panel_sizer->Add( lower_sizer, 0 , wxEXPAND| wxALL, 5 );
panel_sizer->Layout();
SetSizerAndFit( panel_sizer );
void VLMAddStreamPanel::OnCreate( wxCommandEvent &event )
{
- char *psz_name = FromLocale( name_text->GetValue().mb_str() );
- char *psz_input = FromLocale( input_text->GetValue().mb_str() );
- char *psz_output = FromLocale( output_text->GetValue().mb_str() );
+ char *psz_name = wxFromLocale( name_text->GetValue() );
+ char *psz_input = wxFromLocale( input_text->GetValue() );
+ char *psz_output = wxFromLocale( output_text->GetValue() );
if( b_broadcast && ! b_edit )
{
p_vlm->AddBroadcast( psz_name, psz_input, psz_output,
enabled_checkbox->IsChecked() ? VLC_TRUE: VLC_FALSE,
loop_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE );
}
- LocaleFree( psz_name) ; LocaleFree( psz_input ) ;
- LocaleFree( psz_output);
+ wxLocaleFree( psz_name) ; wxLocaleFree( psz_input ) ;
+ wxLocaleFree( psz_output);
if( !b_edit )
OnClear( event );
+ if( b_edit )
+ p_parent->Hide();
}
void VLMAddStreamPanel::OnClear( wxCommandEvent &event )
if( p_sout_dialog && p_sout_dialog->ShowModal() == wxID_OK )
{
- output_text->SetValue( (p_sout_dialog->GetOptions())[0] );
+ wxString sout = (p_sout_dialog->GetOptions())[0] ;
+ sout = sout.AfterFirst( '=' );
+ output_text->SetValue( sout );
}
}
END_EVENT_TABLE()
VLMFrame::VLMFrame( intf_thread_t *_p_intf, wxWindow *_p_parent ) :
- wxFrame( _p_parent, -1, wxU( _("VLM configuration") ),
+ wxFrame( _p_parent, -1, wxU( _("VLM") ),
wxDefaultPosition, wxSize( 640,480 ), wxDEFAULT_FRAME_STYLE )
{
SetIcon( *_p_intf->p_sys->p_icon );
wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL );
vlm_panel = new VLMPanel( _p_intf, this );
+#if defined(WIN32)
+ main_sizer->Add( vlm_panel, 1, wxGROW, 0 );
+#else
main_sizer->Add( vlm_panel, 1, wxEXPAND | wxALL, 5 );
+#endif
main_sizer->Layout();
SetSizerAndFit( main_sizer );
}