Qt: Sout/Convert, display the input MRL.

This commit is contained in:
Jean-Baptiste Kempf 2009-03-05 20:17:42 +01:00
parent 91273f8962
commit 2b00e2dd5b
8 changed files with 46 additions and 20 deletions

View File

@ -28,7 +28,7 @@
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent ) SoutInputBox::SoutInputBox( QWidget *_parent, QString mrl ) : QGroupBox( _parent )
{ {
/** /**
* Source Block * Source Block
@ -39,14 +39,15 @@ SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent )
QLabel *sourceLabel = new QLabel( qtr( "Source:" ) ); QLabel *sourceLabel = new QLabel( qtr( "Source:" ) );
sourceLayout->addWidget( sourceLabel, 0, 0 ); sourceLayout->addWidget( sourceLabel, 0, 0 );
QLineEdit *sourceLine = new QLineEdit; sourceLine = new QLineEdit;
sourceLine->setReadOnly( true ); sourceLine->setReadOnly( true );
sourceLine->setText( mrl );
sourceLabel->setBuddy( sourceLine ); sourceLabel->setBuddy( sourceLine );
sourceLayout->addWidget( sourceLine, 0, 1 ); sourceLayout->addWidget( sourceLine, 0, 1 );
QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) ); QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) );
sourceLayout->addWidget( sourceTypeLabel, 1, 0 ); sourceLayout->addWidget( sourceTypeLabel, 1, 0 );
QLabel *sourceValueLabel = new QLabel; sourceValueLabel = new QLabel;
sourceLayout->addWidget( sourceValueLabel, 1, 1 ); sourceLayout->addWidget( sourceValueLabel, 1, 1 );
/* Line */ /* Line */
@ -55,3 +56,17 @@ SoutInputBox::SoutInputBox( QWidget *_parent ) : QGroupBox( _parent )
sourceLayout->addWidget( line, 2, 0, 1, -1 ); 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 );
}

View File

@ -28,12 +28,18 @@
#include <QGroupBox> #include <QGroupBox>
#include "util/qvlcframe.hpp" class QLineEdit;
class QLabel;
class SoutInputBox : public QGroupBox class SoutInputBox : public QGroupBox
{ {
public: public:
SoutInputBox( QWidget *); SoutInputBox( QWidget *_parent = NULL, QString mrl = "" );
void setMRL( QString );
private:
QLineEdit *sourceLine;
QLabel *sourceValueLabel;
}; };

View File

@ -37,13 +37,16 @@
#include <QFileDialog> #include <QFileDialog>
#include <QCheckBox> #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 ) : QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "Convert" ) ); setWindowTitle( qtr( "Convert" ) );
QGridLayout *mainLayout = new QGridLayout( this ); 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 * Destination

View File

@ -34,7 +34,7 @@ class ConvertDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
ConvertDialog( QWidget *, intf_thread_t * ); ConvertDialog( QWidget *, intf_thread_t *, QString );
virtual ~ConvertDialog(){} virtual ~ConvertDialog(){}
QString getMrl() {return mrl;} QString getMrl() {return mrl;}

View File

@ -89,13 +89,14 @@ struct sout_gui_descr_t
SoutDialog* SoutDialog::instance = NULL; 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 ) : QVLCDialog( parent, _p_intf )
{ {
setWindowTitle( qtr( "Stream Output" ) ); setWindowTitle( qtr( "Stream Output" ) );
/* UI stuff */ /* UI stuff */
ui.setupUi( this ); ui.setupUi( this );
ui.inputBox->setMRL( inputMRL );
changeUDPandRTPmess( false ); changeUDPandRTPmess( false );

View File

@ -112,10 +112,11 @@ class SoutDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: 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 ) if( !instance )
instance = new SoutDialog( parent, p_intf ); instance = new SoutDialog( parent, p_intf, mrl );
else else
{ {
/* Recenter the dialog on the parent */ /* Recenter the dialog on the parent */
@ -131,7 +132,7 @@ public:
private: private:
Ui::Sout ui; Ui::Sout ui;
static SoutDialog *instance; static SoutDialog *instance;
SoutDialog( QWidget* parent, intf_thread_t * ); SoutDialog( QWidget* parent, intf_thread_t *, QString mrl );
QPushButton *okButton; QPushButton *okButton;
QString mrl; QString mrl;

View File

@ -575,11 +575,11 @@ void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
const char *psz_option; const char *psz_option;
if( !b_transcode_only ) if( !b_transcode_only )
{ {
SoutDialog *s = SoutDialog::getInstance( parent, p_intf ); SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl );
if( s->exec() == QDialog::Accepted ) if( s->exec() == QDialog::Accepted )
psz_option = qtu( s->getMrl() ); psz_option = qtu( s->getMrl() );
}else { }else {
ConvertDialog *s = new ConvertDialog( parent, p_intf ); ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl );
if( s->exec() == QDialog::Accepted ) if( s->exec() == QDialog::Accepted )
psz_option = qtu( s->getMrl() ); psz_option = qtu( s->getMrl() );
} }

View File

@ -26,7 +26,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>697</width> <width>697</width>
<height>389</height> <height>381</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@ -67,7 +67,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="SoutInputBox" name="groupBox"> <widget class="SoutInputBox" name="inputBox">
<property name="title"> <property name="title">
<string>GroupBox</string> <string>GroupBox</string>
</property> </property>
@ -80,8 +80,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>697</width> <width>653</width>
<height>389</height> <height>367</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@ -512,8 +512,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>697</width> <width>604</width>
<height>389</height> <height>310</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">