]> git.sesse.net Git - vlc/commitdiff
Qt: Sout/Convert, display the input MRL.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Mar 2009 19:17:42 +0000 (20:17 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Mar 2009 20:05:51 +0000 (21:05 +0100)
modules/gui/qt4/components/sout/sout_widgets.cpp
modules/gui/qt4/components/sout/sout_widgets.hpp
modules/gui/qt4/dialogs/convert.cpp
modules/gui/qt4/dialogs/convert.hpp
modules/gui/qt4/dialogs/sout.cpp
modules/gui/qt4/dialogs/sout.hpp
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/ui/sout.ui

index 17e1997236acedaa5c6343fcd80716bcb00dcd28..b63e60a5895d3b600a127dbcc57f40f91c17a843 100644 (file)
@@ -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 );
+}
index ccc023adb437058c6181483a1c2a7ff538abf8d3..f10cf2fd17ec78ff8f7777c1e9e960b9e5658b73 100644 (file)
 
 #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;
 
 };
 
index b9680ab98b531369606aa3da0096d54565353101..5b64b4895f810c66e33a68027985bad7976c8b23 100644 (file)
 #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
index a400e0c7b1cd4b2ff45950de42d1846afb1e9791..a0ba1dc232d61bfbbb42a5674e22a750db8d4305 100644 (file)
@@ -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;}
index 97d33c015a12f1356ead4cdf12dce95291c307f7..545ab024e60f6acc79a998c1486c0a6dc3efaa05 100644 (file)
@@ -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 );
 
index 2c435ef09e5a3b66ae559cb985ededf0e1adffcd..9cc9255be7d365c4ad2652ba325ef9a0cf395c23 100644 (file)
@@ -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;
 
index 99da2f3b72e2a0bf1a92959d18b879c03e785486..bf0246d4707dc6744616c219c7ab67526e0934dc 100644 (file)
@@ -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() );
     }
index 0b82423fb7ebeeca45d49dbf1efa5d4f4391ff8e..fadac44a15c46cbe1907eba7db88fffcc35b5dd5 100644 (file)
@@ -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">
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>697</width>
-        <height>389</height>
+        <width>604</width>
+        <height>310</height>
        </rect>
       </property>
       <attribute name="label">