Commit 46d0ff68 authored by Clément Stenac's avatar Clément Stenac

* Made the open dialog a wxDialog to be able to call it from the wizard....

* Made the open dialog a wxDialog to be able to call it from the wizard. Please test on win32 and interaction with win32-skins2
parent a9288be1
...@@ -269,7 +269,6 @@ void DialogsProvider::OnStreamWizardDialog( wxCommandEvent& WXUNUSED(event) ) ...@@ -269,7 +269,6 @@ void DialogsProvider::OnStreamWizardDialog( wxCommandEvent& WXUNUSED(event) )
void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) ) void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) )
{ {
fprintf(stderr,"AHAH %p\n",p_intf);
p_wizard_dialog = new WizardDialog( p_intf, this ); p_wizard_dialog = new WizardDialog( p_intf, this );
if( p_wizard_dialog ) if( p_wizard_dialog )
......
...@@ -77,7 +77,8 @@ enum ...@@ -77,7 +77,8 @@ enum
AdvancedOptions_Event AdvancedOptions_Event
}; };
BEGIN_EVENT_TABLE(OpenDialog, wxFrame) //BEGIN_EVENT_TABLE(OpenDialog, wxFrame)
BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
/* Button events */ /* Button events */
EVT_BUTTON(wxID_OK, OpenDialog::OnOk) EVT_BUTTON(wxID_OK, OpenDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, OpenDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, OpenDialog::OnCancel)
...@@ -337,7 +338,8 @@ void AutoBuiltPanel::UpdateAdvancedMRL() ...@@ -337,7 +338,8 @@ void AutoBuiltPanel::UpdateAdvancedMRL()
*****************************************************************************/ *****************************************************************************/
OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
int i_access_method, int i_arg ): int i_access_method, int i_arg ):
wxFrame( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition, // wxFrame( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition,
wxDialog( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE ) wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
OpenDialog( _p_intf, _p_parent, i_access_method, i_arg, OPEN_NORMAL ); OpenDialog( _p_intf, _p_parent, i_access_method, i_arg, OPEN_NORMAL );
...@@ -345,7 +347,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -345,7 +347,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
int i_access_method, int i_arg, int _i_method ): int i_access_method, int i_arg, int _i_method ):
wxFrame( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition, // wxFrame( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition,
wxDialog( _p_parent, -1, wxU(_("Open...")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE ) wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
...@@ -357,6 +360,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -357,6 +360,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
i_disc_type_selection = 0; i_disc_type_selection = 0;
i_open_arg = i_arg; i_open_arg = i_arg;
b_modal = VLC_TRUE;
sout_dialog = NULL; sout_dialog = NULL;
subsfile_dialog = NULL; subsfile_dialog = NULL;
b_disc_device_changed = false; b_disc_device_changed = false;
...@@ -518,19 +523,23 @@ int OpenDialog::Show( int i_access_method, int i_arg ) ...@@ -518,19 +523,23 @@ int OpenDialog::Show( int i_access_method, int i_arg )
{ {
int i_ret; int i_ret;
notebook->SetSelection( i_access_method ); notebook->SetSelection( i_access_method );
i_ret = wxFrame::Show(); // i_ret = wxFrame::Show();
i_ret = wxDialog::Show();
Raise(); Raise();
SetFocus(); SetFocus();
i_open_arg = i_arg; i_open_arg = i_arg;
b_modal = VLC_FALSE;
return i_ret; return i_ret;
} }
int OpenDialog::Show() int OpenDialog::Show()
{ {
int i_ret; int i_ret;
i_ret = wxFrame::Show(); // i_ret = wxFrame::Show();
i_ret = wxDialog::Show();
Raise(); Raise();
SetFocus(); SetFocus();
b_modal = VLC_FALSE;
return i_ret; return i_ret;
} }
...@@ -956,6 +965,10 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -956,6 +965,10 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
if( i_method == OPEN_STREAM ) if( i_method == OPEN_STREAM )
{ {
Hide(); Hide();
if( b_modal)
{
EndModal( wxID_OK );
}
return; return;
} }
...@@ -1011,11 +1024,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -1011,11 +1024,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
Hide(); Hide();
if( b_modal) EndModal( wxID_OK );
} }
void OpenDialog::OnCancel( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
{ {
Hide(); Hide();
if( b_modal) EndModal( wxID_CANCEL );
} }
void OpenDialog::OnPageChange( wxNotebookEvent& event ) void OpenDialog::OnPageChange( wxNotebookEvent& event )
......
This diff is collapsed.
...@@ -269,7 +269,8 @@ private: ...@@ -269,7 +269,8 @@ private:
/* Open Dialog */ /* Open Dialog */
WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel); WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
class OpenDialog: public wxFrame //class OpenDialog: public wxFrame
class OpenDialog: public wxDialog
{ {
public: public:
/* Constructor */ /* Constructor */
...@@ -334,6 +335,8 @@ private: ...@@ -334,6 +335,8 @@ private:
int i_method; /* Normal or for the stream dialog ? */ int i_method; /* Normal or for the stream dialog ? */
int i_open_arg; int i_open_arg;
vlc_bool_t b_modal;
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
wxNotebook *notebook; wxNotebook *notebook;
......
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