Commit 2fedaa09 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: small fixes and improvements.
parent 55bfbe3c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc * menus.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.8 2003/05/13 23:41:17 gbazin Exp $ * $Id: menus.cpp,v 1.9 2003/05/15 15:59:35 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -147,6 +147,8 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface, ...@@ -147,6 +147,8 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "navigation"; ppsz_varnames[i] = "navigation";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "program";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "video-es"; ppsz_varnames[i] = "video-es";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
...@@ -243,8 +245,8 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface ) ...@@ -243,8 +245,8 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface ) wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
{ {
vlc_object_t *p_object; vlc_object_t *p_object;
char *ppsz_varnames[4]; char *ppsz_varnames[6];
int pi_objects[4]; int pi_objects[6];
int i = 0; int i = 0;
/* Initializations */ /* Initializations */
...@@ -261,6 +263,8 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface ) ...@@ -261,6 +263,8 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
ppsz_varnames[i] = "navigation"; ppsz_varnames[i] = "navigation";
pi_objects[i++] = p_object->i_object_id; pi_objects[i++] = p_object->i_object_id;
vlc_object_release( p_object ); vlc_object_release( p_object );
ppsz_varnames[i] = "program";
pi_objects[i++] = p_object->i_object_id;
} }
/* Build menu */ /* Build menu */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.21 2003/05/13 22:33:33 gbazin Exp $ * $Id: open.cpp,v 1.22 2003/05/15 15:59:35 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -154,6 +154,10 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -154,6 +154,10 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
p_intf = _p_intf; p_intf = _p_intf;
p_parent = _p_parent; p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
file_dialog = NULL;
sout_dialog = NULL;
subsfile_dialog = NULL;
demuxdump_dialog = NULL;
/* Create a panel to put everything in */ /* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 ); wxPanel *panel = new wxPanel( this, -1 );
...@@ -315,6 +319,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -315,6 +319,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
OpenDialog::~OpenDialog() OpenDialog::~OpenDialog()
{ {
/* Clean up */
if( file_dialog ) delete file_dialog;
if( sout_dialog ) delete sout_dialog;
if( subsfile_dialog ) delete subsfile_dialog;
if( demuxdump_dialog ) delete demuxdump_dialog;
} }
/***************************************************************************** /*****************************************************************************
...@@ -587,12 +596,13 @@ void OpenDialog::OnFilePanelChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -587,12 +596,13 @@ void OpenDialog::OnFilePanelChange( wxCommandEvent& WXUNUSED(event) )
void OpenDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
{ {
wxFileDialog dialog( this, wxU(_("Open file")), if( file_dialog == NULL )
file_dialog = new wxFileDialog( this, wxU(_("Open file")),
wxT(""), wxT(""), wxT("*.*"), wxOPEN ); wxT(""), wxT(""), wxT("*.*"), wxOPEN );
if( dialog.ShowModal() == wxID_OK ) if( file_dialog && file_dialog->ShowModal() == wxID_OK )
{ {
file_combo->SetValue( dialog.GetPath() ); file_combo->SetValue( file_dialog->GetPath() );
UpdateMRL( FILE_ACCESS ); UpdateMRL( FILE_ACCESS );
} }
} }
...@@ -688,16 +698,17 @@ void OpenDialog::OnSubsFileEnable( wxCommandEvent& event ) ...@@ -688,16 +698,17 @@ void OpenDialog::OnSubsFileEnable( wxCommandEvent& event )
void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
SubsFileDialog dialog( p_intf, p_parent ); if( subsfile_dialog == NULL )
subsfile_dialog = new SubsFileDialog( p_intf, p_parent );
if( dialog.ShowModal() == wxID_OK ) if( subsfile_dialog && subsfile_dialog->ShowModal() == wxID_OK )
{ {
config_PutPsz( p_intf, "sub-file", config_PutPsz( p_intf, "sub-file",
(const char *)dialog.file_combo->GetValue().mb_str() ); (const char *)subsfile_dialog->file_combo->GetValue().mb_str() );
config_PutInt( p_intf, "sub-delay", config_PutInt( p_intf, "sub-delay",
dialog.delay_spinctrl->GetValue() ); subsfile_dialog->delay_spinctrl->GetValue() );
config_PutFloat( p_intf, "sub-fps", config_PutFloat( p_intf, "sub-fps",
dialog.fps_spinctrl->GetValue() ); subsfile_dialog->fps_spinctrl->GetValue() );
} }
} }
...@@ -723,11 +734,13 @@ void OpenDialog::OnSoutEnable( wxCommandEvent& event ) ...@@ -723,11 +734,13 @@ void OpenDialog::OnSoutEnable( wxCommandEvent& event )
void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
SoutDialog dialog( p_intf, p_parent ); if( sout_dialog == NULL )
sout_dialog = new SoutDialog( p_intf, p_parent );
if( dialog.ShowModal() == wxID_OK ) if( sout_dialog && sout_dialog->ShowModal() == wxID_OK )
{ {
config_PutPsz( p_intf, "sout", (const char *)dialog.mrl.mb_str() ); config_PutPsz( p_intf, "sout",
(const char *)sout_dialog->mrl.mb_str() );
} }
} }
...@@ -754,12 +767,13 @@ void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event ) ...@@ -754,12 +767,13 @@ void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event )
void OpenDialog::OnDemuxDumpBrowse( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnDemuxDumpBrowse( wxCommandEvent& WXUNUSED(event) )
{ {
wxFileDialog dialog( this, wxU(_("Save file")), if( demuxdump_dialog == NULL )
demuxdump_dialog = new wxFileDialog( this, wxU(_("Save file")),
wxT(""), wxT(""), wxT("*.*"), wxSAVE ); wxT(""), wxT(""), wxT("*.*"), wxSAVE );
if( dialog.ShowModal() == wxID_OK ) if( demuxdump_dialog && demuxdump_dialog->ShowModal() == wxID_OK )
{ {
demuxdump_textctrl->SetValue( dialog.GetPath() ); demuxdump_textctrl->SetValue( demuxdump_dialog->GetPath() );
wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); wxCommandEvent event = wxCommandEvent( wxEVT_NULL );
OnDemuxDumpChange( event ); OnDemuxDumpChange( event );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.10 2003/05/15 01:33:53 gbazin Exp $ * $Id: streamout.cpp,v 1.11 2003/05/15 15:59:35 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -217,7 +217,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -217,7 +217,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
SetSizerAndFit( main_sizer ); SetSizerAndFit( main_sizer );
/* Update all the values */ /* Update all the values */
ParseMRL(); //ParseMRL();
} }
SoutDialog::~SoutDialog() SoutDialog::~SoutDialog()
...@@ -337,7 +337,7 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent ) ...@@ -337,7 +337,7 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
wxStaticBox *panel_box = new wxStaticBox( panel, -1, wxStaticBox *panel_box = new wxStaticBox( panel, -1,
wxU(_("Output Methods")) ); wxU(_("Output Methods")) );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box, wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxHORIZONTAL ); wxVERTICAL );
static const wxString access_output_array[] = static const wxString access_output_array[] =
{ {
...@@ -409,15 +409,17 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent ) ...@@ -409,15 +409,17 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
for( i=0; i < ACCESS_OUT_NUM; i++ ) for( i=1; i < ACCESS_OUT_NUM; i++ )
{ {
sizer->Add( access_checkboxes[i], 0, sizer->Add( access_checkboxes[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL
| wxALIGN_LEFT ); | wxALIGN_LEFT | wxALL, 5 );
} }
panel_sizer->Add( sizer, 1, wxEXPAND, 0 ); panel_sizer->Add( access_checkboxes[0], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel_sizer->Add( sizer, 1, wxEXPAND | wxTOP, 3 );
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
...@@ -457,13 +459,13 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent ) ...@@ -457,13 +459,13 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
new wxRadioButton( panel, EncapsulationRadio1_Event + i, new wxRadioButton( panel, EncapsulationRadio1_Event + i,
encapsulation_array[i] ); encapsulation_array[i] );
panel_sizer->Add( encapsulation_radios[i], 0, panel_sizer->Add( encapsulation_radios[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 8 );
} }
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
/* Update encapsulation panel */ /* Update encapsulation panel */
encapsulation_radios[0]->Enable(); encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
i_encapsulation_type = TS_ENCAPSULATION; i_encapsulation_type = TS_ENCAPSULATION;
return panel; return panel;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.26 2003/05/15 01:33:53 gbazin Exp $ * $Id: wxwindows.h,v 1.27 2003/05/15 15:59:35 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -190,6 +190,8 @@ private: ...@@ -190,6 +190,8 @@ private:
}; };
/* Open Dialog */ /* Open Dialog */
class SoutDialog;
class SubsFileDialog;
class OpenDialog: public wxDialog class OpenDialog: public wxDialog
{ {
public: public:
...@@ -250,6 +252,7 @@ private: ...@@ -250,6 +252,7 @@ private:
/* Controls for the file panel */ /* Controls for the file panel */
wxComboBox *file_combo; wxComboBox *file_combo;
wxFileDialog *file_dialog;
/* Controls for the disc panel */ /* Controls for the disc panel */
wxRadioBox *disc_type; wxRadioBox *disc_type;
...@@ -268,15 +271,18 @@ private: ...@@ -268,15 +271,18 @@ private:
/* Controls for the subtitles file */ /* Controls for the subtitles file */
wxButton *subsfile_button; wxButton *subsfile_button;
wxCheckBox *subsfile_checkbox; wxCheckBox *subsfile_checkbox;
SubsFileDialog *subsfile_dialog;
/* Controls for the stream output */ /* Controls for the stream output */
wxButton *sout_button; wxButton *sout_button;
wxCheckBox *sout_checkbox; wxCheckBox *sout_checkbox;
SoutDialog *sout_dialog;
/* Controls for the demux dump */ /* Controls for the demux dump */
wxTextCtrl *demuxdump_textctrl; wxTextCtrl *demuxdump_textctrl;
wxButton *demuxdump_button; wxButton *demuxdump_button;
wxCheckBox *demuxdump_checkbox; wxCheckBox *demuxdump_checkbox;
wxFileDialog *demuxdump_dialog;
}; };
enum enum
......
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