Commit 2b00e2dd authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Sout/Convert, display the input MRL.

parent 91273f89
......@@ -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 );
}
......@@ -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;
};
......
......@@ -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
......
......@@ -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;}
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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() );
}
......
......@@ -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">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment