Commit 3eb4455a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: remove dead code in sout to simplify.

parent a81446ff
......@@ -88,13 +88,11 @@ struct sout_gui_descr_t
SoutDialog* SoutDialog::instance = NULL;
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
bool _transcode_only ) : QVLCDialog( parent, _p_intf )
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf )
: QVLCDialog( parent, _p_intf )
{
setWindowTitle( qtr( "Stream Output" ) );
b_transcode_only = _transcode_only;
/* UI stuff */
ui.setupUi( this );
......@@ -152,7 +150,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );
CONNECT( ui.RTPOutput, clicked(bool), this, RTPtoggled( bool ) );
if( b_transcode_only ) toggleSout();
}
void SoutDialog::fileBrowse()
......@@ -223,35 +220,6 @@ void SoutDialog::setOptions()
updateMRL();
}
void SoutDialog::toggleSout()
{
//Toggle all the streaming options.
#define HIDEORSHOW(x) if( b_transcode_only ) x->hide(); else x->show();
HIDEORSHOW( ui.HTTPOutput ) ; HIDEORSHOW( ui.RTPOutput ) ; HIDEORSHOW( ui.MMSHOutput ) ; HIDEORSHOW( ui.UDPOutput ) ;
HIDEORSHOW( ui.HTTPEdit ) ; HIDEORSHOW( ui.RTPEdit ) ; HIDEORSHOW( ui.MMSHEdit ) ; HIDEORSHOW( ui.UDPEdit ) ;
HIDEORSHOW( ui.HTTPLabel ) ; HIDEORSHOW( ui.RTPLabel ) ; HIDEORSHOW( ui.MMSHLabel ) ; HIDEORSHOW( ui.UDPLabel ) ;
HIDEORSHOW( ui.HTTPPortLabel ) ; HIDEORSHOW( ui.RTPPortLabel ) ; HIDEORSHOW( ui.MMSHPortLabel ) ; HIDEORSHOW( ui.UDPPortLabel )
HIDEORSHOW( ui.HTTPPort ) ; HIDEORSHOW( ui.RTPPort ) ; HIDEORSHOW( ui.MMSHPort ) ; HIDEORSHOW( ui.UDPPort ) ; HIDEORSHOW( ui.RTPPortLabel2 ); HIDEORSHOW( ui.RTPPort2 ); HIDEORSHOW( ui.UDPRTPLabel )
HIDEORSHOW( ui.sap ); HIDEORSHOW( ui.sapName );
HIDEORSHOW( ui.sapGroup ); HIDEORSHOW( ui.sapGroupLabel );
HIDEORSHOW( ui.ttlLabel ); HIDEORSHOW( ui.ttl );
HIDEORSHOW( ui.soutKeep );
HIDEORSHOW( ui.IcecastOutput ); HIDEORSHOW( ui.IcecastEdit );
HIDEORSHOW( ui.IcecastNamePassEdit ); HIDEORSHOW( ui.IcecastMountpointEdit );
HIDEORSHOW( ui.IcecastPort ); HIDEORSHOW( ui.IcecastLabel );
HIDEORSHOW( ui.IcecastPortLabel );
HIDEORSHOW( ui.IcecastMountpointLabel ); HIDEORSHOW( ui.IcecastNameLabel );
#undef HIDEORSHOW
if( b_transcode_only ) okButton->setText( "&Save" );
else okButton->setText( "&Stream" );
setMinimumHeight( 500 );
resize( width(), sizeHint().height() );
}
void SoutDialog::changeUDPandRTPmess( bool b_udp )
{
ui.RTPEdit->setVisible( !b_udp );
......
......@@ -112,17 +112,14 @@ class SoutDialog : public QVLCDialog
{
Q_OBJECT;
public:
static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf,
bool transcode_only )
static SoutDialog* getInstance( QWidget *parent, intf_thread_t *p_intf )
{
if( !instance )
instance = new SoutDialog( parent, p_intf, transcode_only );
instance = new SoutDialog( parent, p_intf );
else
{
/* Recenter the dialog on the parent */
instance->setParent( parent, Qt::Dialog );
instance->b_transcode_only = transcode_only;
instance->toggleSout();
}
return instance;
}
......@@ -134,11 +131,9 @@ public:
private:
Ui::Sout ui;
static SoutDialog *instance;
SoutDialog( QWidget* parent, intf_thread_t *,
bool _transcode_only = false );
SoutDialog( QWidget* parent, intf_thread_t * );
QPushButton *okButton;
QString mrl;
bool b_transcode_only;
public slots:
void updateMRL();
......@@ -146,7 +141,6 @@ public slots:
private slots:
void ok();
void cancel();
void toggleSout();
void setOptions();
void fileBrowse();
void setRawOptions( bool );
......
......@@ -399,7 +399,7 @@ void VLMDialog::selectInput()
void VLMDialog::selectOutput()
{
SoutDialog *s = SoutDialog::getInstance( this, p_intf, false );
SoutDialog *s = SoutDialog::getInstance( this, p_intf );
if( s->exec() == QDialog::Accepted )
ui.outputLedit->setText( s->getMrl() );
}
......
......@@ -570,7 +570,7 @@ void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
const char *psz_option;
if( !b_transcode_only )
{
SoutDialog *s = SoutDialog::getInstance( parent, p_intf, b_transcode_only );
SoutDialog *s = SoutDialog::getInstance( parent, p_intf );
if( s->exec() == QDialog::Accepted )
psz_option = qtu( s->getMrl() );
}else {
......
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