[vlc-devel] commit: Qt: Sout/Convert, display the input MRL. (Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Mar 5 21:20:05 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Mar  5 20:17:42 2009 +0100| [2b00e2dd5bc9470ba14579409fc04b927a7e05a0] | committer: Jean-Baptiste Kempf 

Qt: Sout/Convert, display the input MRL.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b00e2dd5bc9470ba14579409fc04b927a7e05a0
---

 modules/gui/qt4/components/sout/sout_widgets.cpp |   21 ++++++++++++++++++---
 modules/gui/qt4/components/sout/sout_widgets.hpp |   10 ++++++++--
 modules/gui/qt4/dialogs/convert.cpp              |    7 +++++--
 modules/gui/qt4/dialogs/convert.hpp              |    2 +-
 modules/gui/qt4/dialogs/sout.cpp                 |    3 ++-
 modules/gui/qt4/dialogs/sout.hpp                 |    7 ++++---
 modules/gui/qt4/dialogs_provider.cpp             |    4 ++--
 modules/gui/qt4/ui/sout.ui                       |   12 ++++++------
 8 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index 17e1997..b63e60a 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -28,7 +28,7 @@
 #include <QLabel>
 #include <QLineEdit>
 
-SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent )
+SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent )
 {
     /**
      * Source Block
@@ -39,14 +39,15 @@ SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent )
     QLabel *sourceLabel = new QLabel( qtr( "Source:" ) );
     sourceLayout->addWidget( sourceLabel, 0, 0 );
 
-    QLineEdit *sourceLine = new QLineEdit;
+    sourceLine = new QLineEdit;
     sourceLine->setReadOnly( true );
+    sourceLine->setText( mrl );
     sourceLabel->setBuddy( sourceLine );
     sourceLayout->addWidget( sourceLine, 0, 1 );
 
     QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) );
     sourceLayout->addWidget( sourceTypeLabel, 1, 0 );
-    QLabel *sourceValueLabel = new QLabel;
+    sourceValueLabel = new QLabel;
     sourceLayout->addWidget( sourceValueLabel, 1, 1 );
 
     /* Line */
@@ -55,3 +56,17 @@ SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent )
     sourceLayout->addWidget( line, 2, 0, 1, -1 );
 }
 
+void SoutInputBox::setMRL( QString mrl )
+{
+    sourceLine->setText( mrl );
+    QString type;
+    int i = mrl.indexOf( "://" );
+    if( i != -1 )
+    {
+        printf( "%i\n", i );
+        type = mrl.left( i );
+    }
+    else
+        type = qtr( "File/Directory" );
+    sourceValueLabel->setText( type );
+}
diff --git a/modules/gui/qt4/components/sout/sout_widgets.hpp b/modules/gui/qt4/components/sout/sout_widgets.hpp
index ccc023a..f10cf2f 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.hpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.hpp
@@ -28,12 +28,18 @@
 
 #include <QGroupBox>
 
-#include "util/qvlcframe.hpp"
+class QLineEdit;
+class QLabel;
 
 class SoutInputBox : public QGroupBox
 {
     public:
-        SoutInputBox( QWidget *);
+        SoutInputBox( QWidget *_parent = NULL, QString mrl = "" );
+
+        void setMRL( QString );
+    private:
+        QLineEdit *sourceLine;
+        QLabel *sourceValueLabel;
 
 };
 
diff --git a/modules/gui/qt4/dialogs/convert.cpp b/modules/gui/qt4/dialogs/convert.cpp
index b9680ab..5b64b48 100644
--- a/modules/gui/qt4/dialogs/convert.cpp
+++ b/modules/gui/qt4/dialogs/convert.cpp
@@ -37,13 +37,16 @@
 #include <QFileDialog>
 #include <QCheckBox>
 
-ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf)
+ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
+                              QString inputMRL )
               : QVLCDialog( parent, _p_intf )
 {
     setWindowTitle( qtr( "Convert" ) );
 
     QGridLayout *mainLayout = new QGridLayout( this );
-    mainLayout->addWidget( new SoutInputBox( this ), 0, 0, 1, -1  );
+    SoutInputBox *inputBox = new SoutInputBox( this );
+    inputBox->setMRL( inputMRL );
+    mainLayout->addWidget( inputBox, 0, 0, 1, -1  );
 
     /**
      * Destination
diff --git a/modules/gui/qt4/dialogs/convert.hpp b/modules/gui/qt4/dialogs/convert.hpp
index a400e0c..a0ba1dc 100644
--- a/modules/gui/qt4/dialogs/convert.hpp
+++ b/modules/gui/qt4/dialogs/convert.hpp
@@ -34,7 +34,7 @@ class ConvertDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    ConvertDialog( QWidget *, intf_thread_t * );
+    ConvertDialog( QWidget *, intf_thread_t *, QString );
     virtual ~ConvertDialog(){}
 
     QString getMrl() {return mrl;}
diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index 97d33c0..545ab02 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -89,13 +89,14 @@ struct sout_gui_descr_t
 
 SoutDialog* SoutDialog::instance = NULL;
 
-SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf )
+SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, QString inputMRL )
            : QVLCDialog( parent,  _p_intf )
 {
     setWindowTitle( qtr( "Stream Output" ) );
 
     /* UI stuff */
     ui.setupUi( this );
+    ui.inputBox->setMRL( inputMRL );
 
     changeUDPandRTPmess( false );
 
diff --git a/modules/gui/qt4/dialogs/sout.hpp b/modules/gui/qt4/dialogs/sout.hpp
index 2c435ef..9cc9255 100644
--- a/modules/gui/qt4/dialogs/sout.hpp
+++ b/modules/gui/qt4/dialogs/sout.hpp
@@ -112,10 +112,11 @@ class SoutDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf )
+    static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf,
+                                    QString mrl = "" )
     {
         if( !instance )
-            instance = new SoutDialog( parent, p_intf );
+            instance = new SoutDialog( parent, p_intf, mrl );
         else
         {
             /* Recenter the dialog on the parent */
@@ -131,7 +132,7 @@ public:
 private:
     Ui::Sout ui;
     static SoutDialog *instance;
-    SoutDialog( QWidget* parent, intf_thread_t * );
+    SoutDialog( QWidget* parent, intf_thread_t *, QString mrl );
     QPushButton *okButton;
     QString mrl;
 
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 99da2f3..bf0246d 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -575,11 +575,11 @@ void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
     const char *psz_option;
     if( !b_transcode_only )
     {
-        SoutDialog *s = SoutDialog::getInstance( parent, p_intf );
+        SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl );
         if( s->exec() == QDialog::Accepted )
             psz_option = qtu( s->getMrl() );
     }else {
-        ConvertDialog *s = new ConvertDialog( parent, p_intf );
+        ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl );
         if( s->exec() == QDialog::Accepted )
             psz_option = qtu( s->getMrl() );
     }
diff --git a/modules/gui/qt4/ui/sout.ui b/modules/gui/qt4/ui/sout.ui
index 0b82423..fadac44 100644
--- a/modules/gui/qt4/ui/sout.ui
+++ b/modules/gui/qt4/ui/sout.ui
@@ -26,7 +26,7 @@
         <x>0</x>
         <y>0</y>
         <width>697</width>
-        <height>389</height>
+        <height>381</height>
        </rect>
       </property>
       <attribute name="label">
@@ -67,7 +67,7 @@
         </widget>
        </item>
        <item row="0" column="0" colspan="2">
-        <widget class="SoutInputBox" name="groupBox">
+        <widget class="SoutInputBox" name="inputBox">
          <property name="title">
           <string>GroupBox</string>
          </property>
@@ -80,8 +80,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>697</width>
-        <height>389</height>
+        <width>653</width>
+        <height>367</height>
        </rect>
       </property>
       <attribute name="label">
@@ -512,8 +512,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>697</width>
-        <height>389</height>
+        <width>604</width>
+        <height>310</height>
        </rect>
       </property>
       <attribute name="label">




More information about the vlc-devel mailing list