Commit 3509a974 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Qt: use QWizard for Sout

Close #5651
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e75a889e
......@@ -38,15 +38,17 @@
#include <assert.h>
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL )
: QVLCDialog( parent, _p_intf )
: QWizard( parent )
{
p_intf = _p_intf;
setWindowTitle( qtr( "Stream Output" ) );
setWindowRole( "vlc-stream-output" );
/* UI stuff */
ui.setupUi( this );
ui.inputBox->setMRL( inputMRL );
ui.helpEdit->setPlainText( qtr("This dialog will allow you to stream or "
ui.helpEdit->setPlainText( qtr("This wizard will allow you to stream or "
"convert your media for use locally, on your private network, "
"or on the Internet.\n"
"You should start by checking that source matches what you want "
......@@ -61,6 +63,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#if 0
/* This needs Qt4.5 to be cool */
ui.destTab->setTabsClosable( true );
CONNECT( ui.destTab, tabCloseRequested( int ), this, closeTab( int ) );
#else
closeTabButton = new QToolButton( this );
ui.destTab->setCornerWidget( closeTabButton );
......@@ -95,20 +98,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
CB( localOutput ); CB( transcodeBox );
CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() );
okButton = new QPushButton( qtr( "&Stream" ) );
QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
okButton->setDefault( true );
ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole );
ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
BUTTONACT( okButton, ok() );
BUTTONACT( cancelButton, cancel() );
BUTTONACT( ui.nextButton, next() );
BUTTONACT( ui.nextButton2, next() );
BUTTONACT( ui.prevButton, prev() );
BUTTONACT( ui.prevButton2, prev() );
setButtonText( QWizard::FinishButton, "Stream" );
#undef CC
#undef CS
......@@ -116,16 +106,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#undef CB
}
void SoutDialog::next()
{
ui.toolBox->setCurrentIndex( ui.toolBox->currentIndex() + 1 );
}
void SoutDialog::prev()
{
ui.toolBox->setCurrentIndex( ui.toolBox->currentIndex() - 1 );
}
void SoutDialog::tabChanged( int i )
{
closeTabButton->setVisible( (i != 0) );
......
......@@ -109,7 +109,7 @@ private:
};
class SoutDialog : public QVLCDialog
class SoutDialog : public QWizard
{
Q_OBJECT
public:
......@@ -125,14 +125,14 @@ private:
QPushButton *okButton;
QToolButton *closeTabButton;
intf_thread_t* p_intf;
public slots:
void updateMRL();
private slots:
void ok();
void cancel();
void next();
void prev();
void closeTab();
void tabChanged( int );
void addDest();
......
This diff is collapsed.
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