]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wizard.cpp
* string review
[vlc] / modules / gui / wxwindows / wizard.cpp
index 10f36a1b0ba43bf8a675954bcd8fb2b51b49010b..bfcc6a364bd67b8271a1224b8240f5f8625335f0 100644 (file)
@@ -217,6 +217,9 @@ class wizInputPage : public wxWizardPage
         void SetTranscodePage( wxWizardPage *page);
         void SetAction( int i_action );
         void SetPintf( intf_thread_t *p_intf );
+        void SetUri( char *psz_uri );
+        void SetPartial( int i_from, int i_to );
+
     protected:
         bool b_chosen;
         intf_thread_t *p_intf;
@@ -240,10 +243,11 @@ class wizInputPage : public wxWizardPage
         wxWizardPage *p_prev;
         wxWizardPage *p_streaming_page;
         wxWizardPage *p_transcode_page;
+
         DECLARE_EVENT_TABLE()
 };
 
-BEGIN_EVENT_TABLE(wizInputPage, wxWizardPageSimple)
+BEGIN_EVENT_TABLE(wizInputPage, wxWizardPage)
     EVT_RADIOBUTTON( InputRadio0_Event, wizInputPage::OnInputChange)
     EVT_RADIOBUTTON( InputRadio1_Event, wizInputPage::OnInputChange)
     EVT_BUTTON( Choose_Event, wizInputPage::OnChoose)
@@ -289,7 +293,7 @@ protected:
     DECLARE_EVENT_TABLE()
 };
 
-BEGIN_EVENT_TABLE(wizTranscodeCodecPage, wxWizardPageSimple)
+BEGIN_EVENT_TABLE(wizTranscodeCodecPage, wxWizardPage)
    EVT_CHECKBOX( VideoEnable_Event, wizTranscodeCodecPage::OnEnableVideo)
    EVT_CHECKBOX( AudioEnable_Event, wizTranscodeCodecPage::OnEnableAudio)
    EVT_COMBOBOX( VideoCodec_Event, wizTranscodeCodecPage::OnVideoCodecChange)
@@ -319,7 +323,7 @@ protected:
     wxWizardPage *p_next;
 };
 
-BEGIN_EVENT_TABLE(wizStreamingMethodPage, wxWizardPageSimple)
+BEGIN_EVENT_TABLE(wizStreamingMethodPage, wxWizardPage)
     EVT_RADIOBUTTON( MethodRadio0_Event, wizStreamingMethodPage::OnMethodChange)
     EVT_RADIOBUTTON( MethodRadio1_Event, wizStreamingMethodPage::OnMethodChange)
     EVT_RADIOBUTTON( MethodRadio2_Event, wizStreamingMethodPage::OnMethodChange)
@@ -354,7 +358,7 @@ protected:
     wxWizardPage *p_transcode_page;
 };
 
-BEGIN_EVENT_TABLE(wizEncapPage, wxWizardPageSimple)
+BEGIN_EVENT_TABLE(wizEncapPage, wxWizardPage)
     EVT_WIZARD_PAGE_CHANGING(-1, wizEncapPage::OnWizardPageChanging)
     EVT_RADIOBUTTON( EncapRadio0_Event, wizEncapPage::OnEncapChange)
     EVT_RADIOBUTTON( EncapRadio1_Event, wizEncapPage::OnEncapChange)
@@ -755,6 +759,23 @@ void wizInputPage::SetPintf( intf_thread_t *p_intf )
     this->p_intf = p_intf;
 }
 
+void wizInputPage::SetUri( char *psz_uri )
+{
+    mrl_text->SetValue( wxU( psz_uri ) );
+}
+
+void wizInputPage::SetPartial( int i_from, int i_to )
+{
+   wxString msg;
+   msg.Printf( wxString( wxT( "%i") ), i_from );
+   from_text->Enable( TRUE );
+   from_text->SetValue( msg );
+   msg.Printf( wxString( wxT( "%i") ), i_to );
+   to_text->Enable( TRUE );
+   to_text->SetValue( msg );
+   enable_checkbox->SetValue( TRUE );
+}
+
 /***************************************************
  * First transcode page: choose codecs             *
  ***************************************************/
@@ -1280,7 +1301,7 @@ wizStreamingExtraPage::wizStreamingExtraPage( wxWizard *parent,
     /* TTL */
     sizer->Add( new wxStaticText( this, -1, wxU(_("Time-To-Live (TTL)"))),
                     0, wxALL,  5 );
-    ttl_spin = new wxSpinCtrl( this, -1, "", wxDefaultPosition, wxDefaultSize,
+    ttl_spin = new wxSpinCtrl( this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
                     0, 1, 255, 1 );
     ttl_spin->SetToolTip(wxU(_(TTL) ) ) ;
     sizer->Add( ttl_spin, 0, wxALL , 5 );
@@ -1344,7 +1365,8 @@ wizTranscodeExtraPage *tr_page2 ;
 wizStreamingExtraPage *st_page2;
 wizEncapPage *encap_page;
 
-WizardDialog::WizardDialog(intf_thread_t *_p_intf, wxWindow *_p_parent ) :
+WizardDialog::WizardDialog(intf_thread_t *_p_intf, wxWindow *_p_parent,
+                           char *psz_uri, int _i_from, int _i_to  ) :
 wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, wxDefaultPosition)
 {
     /* Initializations */
@@ -1353,8 +1375,8 @@ wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, w
 
     /* Initialize structure */
     i_action = 0;
-    i_from = 0;
-    i_to = 0;
+    i_from = _i_from;
+    i_to = _i_to;
     i_ttl = 1;
     vb = 0;
     ab = 0;
@@ -1363,6 +1385,16 @@ wxWizard( _p_parent, -1, wxU(_("Streaming/Transcoding Wizard")), wxNullBitmap, w
 
     page1 = new wizHelloPage(this);
     page2 = new wizInputPage(this, page1, p_intf);
+
+    if( psz_uri )
+    {
+        page2->SetUri( psz_uri );
+    }
+    if( i_from != 0 || i_to != 0 )
+    {
+        page2->SetPartial( i_from, i_to );
+    }
+
     encap_page = new wizEncapPage(this );
     tr_page1 = new wizTranscodeCodecPage(this, encap_page );
     st_page1 = new wizStreamingMethodPage(this, encap_page);
@@ -1474,6 +1506,7 @@ int WizardDialog::GetAction()
 
 void WizardDialog::Run()
 {
+    fprintf(stderr, "p_intf %p %p", p_intf, this->p_intf);
     msg_Dbg( p_intf,"starting wizard");
     if( RunWizard(page1) )
     {