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 @@ ...@@ -38,15 +38,17 @@
#include <assert.h> #include <assert.h>
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL ) 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" ) ); setWindowTitle( qtr( "Stream Output" ) );
setWindowRole( "vlc-stream-output" ); setWindowRole( "vlc-stream-output" );
/* UI stuff */ /* UI stuff */
ui.setupUi( this ); ui.setupUi( this );
ui.inputBox->setMRL( inputMRL ); 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, " "convert your media for use locally, on your private network, "
"or on the Internet.\n" "or on the Internet.\n"
"You should start by checking that source matches what you want " "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& ...@@ -61,6 +63,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#if 0 #if 0
/* This needs Qt4.5 to be cool */ /* This needs Qt4.5 to be cool */
ui.destTab->setTabsClosable( true ); ui.destTab->setTabsClosable( true );
CONNECT( ui.destTab, tabCloseRequested( int ), this, closeTab( int ) );
#else #else
closeTabButton = new QToolButton( this ); closeTabButton = new QToolButton( this );
ui.destTab->setCornerWidget( closeTabButton ); ui.destTab->setCornerWidget( closeTabButton );
...@@ -95,20 +98,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& ...@@ -95,20 +98,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
CB( localOutput ); CB( transcodeBox ); CB( localOutput ); CB( transcodeBox );
CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() ); CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() );
okButton = new QPushButton( qtr( "&Stream" ) ); setButtonText( QWizard::FinishButton, "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() );
#undef CC #undef CC
#undef CS #undef CS
...@@ -116,16 +106,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& ...@@ -116,16 +106,6 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#undef CB #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 ) void SoutDialog::tabChanged( int i )
{ {
closeTabButton->setVisible( (i != 0) ); closeTabButton->setVisible( (i != 0) );
......
...@@ -109,7 +109,7 @@ private: ...@@ -109,7 +109,7 @@ private:
}; };
class SoutDialog : public QVLCDialog class SoutDialog : public QWizard
{ {
Q_OBJECT Q_OBJECT
public: public:
...@@ -125,14 +125,14 @@ private: ...@@ -125,14 +125,14 @@ private:
QPushButton *okButton; QPushButton *okButton;
QToolButton *closeTabButton; QToolButton *closeTabButton;
intf_thread_t* p_intf;
public slots: public slots:
void updateMRL(); void updateMRL();
private slots: private slots:
void ok(); void ok();
void cancel(); void cancel();
void next();
void prev();
void closeTab(); void closeTab();
void tabChanged( int ); void tabChanged( int );
void addDest(); 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