]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wizard.cpp
wizard.cpp -- change checkboxes to use wxALIGN_CENTER_VERTICAL|wxALL instead of wxLEF...
[vlc] / modules / gui / wxwindows / wizard.cpp
index 886708d163f9c3608e260356011b91d99ee3a385..e602a8266d22b70aa1c4c1c3969d1dd0de9748d9 100644 (file)
@@ -239,7 +239,6 @@ class wizInputPage : public wxWizardPage
         OpenDialog *p_open_dialog;
         wxListView *listview;
         wxPanel *open_panel;
-        wxPanel *pl_panel;
         wxWizardPage *p_prev;
         wxWizardPage *p_streaming_page;
         wxWizardPage *p_transcode_page;
@@ -530,12 +529,14 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
     p_parent = (WizardDialog *)parent;
     b_chosen = false;
     p_open_dialog = NULL;
-    pl_panel = NULL;
+    listview = NULL;    
     mainSizer = new wxBoxSizer(wxVERTICAL);
 
     /* Create the texts */
     pageHeader( this, mainSizer, INPUT_TITLE, INPUT_TEXT );
 
+    mainSizer->Add( 0,20,0 );
+
     /* Create the radio buttons */
     input_radios[0] = new wxRadioButton( this, InputRadio0_Event ,
                                wxU( INPUT_OPEN ) );
@@ -568,10 +569,8 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
     {
         if( p_playlist->i_size > 0)
         {
-            pl_panel = new wxPanel(this, -1);
-            wxBoxSizer *plSizer = new wxBoxSizer( wxHORIZONTAL );
-            listview = new wxListView( pl_panel, ListView_Event,
-                                       wxDefaultPosition, wxSize(300,300),
+            listview = new wxListView( this, ListView_Event,
+                                       wxDefaultPosition, wxDefaultSize,
                                        wxLC_REPORT | wxSUNKEN_BORDER );
             listview->InsertColumn( 0, wxU(_("Name")) );
             listview->InsertColumn( 1, wxU(_("URI")) );
@@ -586,13 +585,10 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
                                                             input.psz_uri) );
             }
             listview->Select( p_playlist->i_index , TRUE);
-            plSizer->Add( listview, 1, wxALL | wxEXPAND , 5 );
-            pl_panel->SetSizer( plSizer );
-            plSizer->Layout();
-            mainSizer->Add( pl_panel, 1, wxALL|wxEXPAND, 5 );
+            mainSizer->Add( listview, 1, wxALL|wxEXPAND, 5 );
 
-            pl_panel->Hide();
-            mainSizer->Hide( pl_panel );
+            listview->Hide();
+            mainSizer->Hide( listview );
             mainSizer->Layout();
         }
         else
@@ -617,7 +613,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
     enable_checkbox = new wxCheckBox( this, PartialEnable_Event,
                                                 wxU(_("Enable") ) );
     enable_checkbox->SetToolTip(wxU(_(PARTIAL) ) ) ;
-    partial_sizer->Add( enable_checkbox, 0 , wxLEFT , 5 );
+    partial_sizer->Add( enable_checkbox, 0 , wxALIGN_CENTER_VERTICAL|wxALL, 5 ); //wxLEFT
 
     wxFlexGridSizer *partial_sizer2 = new wxFlexGridSizer( 4 , 1 , 20 );
     partial_sizer2->Add( new wxStaticText(this, -1, wxU(_( "From" ) ) ),
@@ -653,10 +649,10 @@ void wizInputPage::OnInputChange(wxEvent& event)
     i_input = event.GetId() - InputRadio0_Event;
     if( i_input == 0 )
     {
-        if( pl_panel )
+        if( listview )
         {
-            pl_panel->Hide();
-            mainSizer->Hide( pl_panel );
+            listview->Hide();
+            mainSizer->Hide( listview );
             open_panel->Show();
             mainSizer->Show( open_panel );
             mainSizer->Layout();
@@ -666,8 +662,8 @@ void wizInputPage::OnInputChange(wxEvent& event)
     {
         open_panel->Hide();
         mainSizer->Hide( open_panel );
-        pl_panel->Show();
-        mainSizer->Show( pl_panel );
+        listview->Show();
+        mainSizer->Show( listview );
         mainSizer->Layout();
     }
 }
@@ -682,7 +678,8 @@ void wizInputPage::OnEnablePartial(wxCommandEvent& event)
 void wizInputPage::OnChoose(wxCommandEvent& event)
 {
     p_open_dialog = new OpenDialog( p_intf, this, -1, -1, OPEN_STREAM );
-    if(  p_open_dialog->ShowModal() == wxID_OK )
+    if(  p_open_dialog->ShowModal() == wxID_OK &&
+         !p_open_dialog->mrl.IsEmpty() )
     {
         mrl_text->SetValue(p_open_dialog->mrl[0] );
     }
@@ -801,7 +798,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
     /* Line 1 : only the checkbox */
     wxFlexGridSizer *video_sizer1 = new wxFlexGridSizer( 2,3,20 );
     video_sizer1->Add( new wxCheckBox( this, VideoEnable_Event,
-                       wxU(_("Transcode video") ) ), 0 , 0 , 5 );
+                       wxU(_("Transcode video") ) ), 0 , wxALIGN_CENTER_VERTICAL|wxALL , 5 );
     video_sizer1->Add( 0,0,1);
     /* Line 2 : codec */
     video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5);
@@ -812,13 +809,16 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
         video_combo->Append( wxU( vcodecs_array[i].psz_display ) ,
                             (void *)&vcodecs_array[i] );
     }
+    i_video_codec = 0;
+    video_combo->SetSelection(0);
+
     video_sizer1->Add( video_combo, 0 , wxALIGN_LEFT , 0 );
 
     video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Bitrate (kb/s)"))),0,
                        wxLEFT ,5);
     vb_combo = new wxComboBox( this, VideoBitrate_Event, wxT("1024"),
                                wxDefaultPosition, wxDefaultSize,
-                               WXSIZEOF(vbitrates_array), vbitrates_array );
+                               WXSIZEOF(vbitrates_array), vbitrates_array, wxCB_READONLY );
     video_sizer1->Add( vb_combo, 0, wxALIGN_LEFT , 0 );
 
     /* Line 3 : text */
@@ -836,7 +836,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
     /* Line1: enabler */
     wxFlexGridSizer *audio_sizer1 = new wxFlexGridSizer( 2,3,20);
     audio_sizer1->Add( new wxCheckBox( this, AudioEnable_Event,
-                            wxU(_("Transcode audio") ) ), 0 , wxLEFT, 5 );
+                            wxU(_("Transcode audio") ) ), 0 , wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     audio_sizer1->Add( 0, 0, 1 );
 
     /* Line 2 : codec */
@@ -848,13 +848,15 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
         audio_combo->Append( wxU( acodecs_array[i].psz_display ) ,
                             (void *)&acodecs_array[i] );
     }
+    i_audio_codec = 0;
+    audio_combo->SetSelection(0);
     audio_sizer1->Add( audio_combo, 0 , wxALIGN_LEFT, 0 );
 
     audio_sizer1->Add( new wxStaticText(this, -1, wxU(_("Bitrate (kb/s)"))),0,
                        wxLEFT ,5);
     ab_combo = new wxComboBox( this, AudioBitrate_Event, wxT("192"),
                                wxDefaultPosition, wxDefaultSize,
-                               WXSIZEOF(abitrates_array), abitrates_array );
+                               WXSIZEOF(abitrates_array), abitrates_array, wxCB_READONLY );
     audio_sizer1->Add( ab_combo, 0, wxALIGN_LEFT, 0 );
 
     /* Line 3 : text */
@@ -998,7 +1000,7 @@ wizStreamingMethodPage::wizStreamingMethodPage( wxWizard *parent,
     /* Create the texts */
     pageHeader( this, mainSizer,  STREAMING1_TITLE, STREAMING1_TEXT );
 
-    mainSizer->Add( 0,0,1 );
+    mainSizer->Add( 0,50,0 );
 
     i_method = 0;
 
@@ -1101,6 +1103,8 @@ void wizStreamingMethodPage::OnMethodChange(wxEvent& event)
     i_method = event.GetId() - MethodRadio0_Event;
     address_text->SetLabel( wxU(
      vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false)));
+    address_sizer->Layout();
+    mainSizer->Layout();
 }
 
 /***************************************************
@@ -1273,7 +1277,7 @@ void wizTranscodeExtraPage::OnWizardPageChanging( wxWizardEvent& event )
     }
     if( event.GetDirection() )
     {
-       p_parent->SetTranscodeOut( (char *)file_text->GetValue().mb_str());
+       p_parent->SetTranscodeOut( file_text->GetValue().mb_str());
     }
 }
 
@@ -1485,7 +1489,7 @@ void WizardDialog::SetStream( char *method, char *address )
     this->address = strdup( address );
 }
 
-void WizardDialog::SetTranscodeOut( char *address )
+void WizardDialog::SetTranscodeOut( const char *address )
 {
     this->address = strdup( address );
 }