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();
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<author>Jean-Baptiste Kempf</author> <author>Edward Wang</author>
<class>Sout</class> <class>Sout</class>
<widget class="QWidget" name="Sout"> <widget class="QWizard" name="Sout">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>708</width> <width>725</width>
<height>587</height> <height>445</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>400</width>
<height>359</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Stream Output</string> <string>Stream Output</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <property name="wizardStyle">
<item> <enum>QWizard::ClassicStyle</enum>
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>0</number>
</property> </property>
<widget class="QWidget" name="sourcePage"> <widget class="QWizardPage" name="sourceWizardPage">
<property name="geometry"> <property name="title">
<rect>
<x>0</x>
<y>0</y>
<width>690</width>
<height>472</height>
</rect>
</property>
<attribute name="label">
<string>Source</string> <string>Source</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<widget class="QTextEdit" name="helpEdit">
<property name="enabled">
<bool>true</bool>
</property> </property>
<property name="maximumSize"> <property name="subTitle">
<size> <string>Set up media sources to stream</string>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>220</red>
<green>220</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>220</red>
<green>220</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPlainTextEdit" name="helpEdit">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item>
<widget class="SoutInputBox" name="inputBox"/> <widget class="SoutInputBox" name="inputBox">
</item> <property name="title">
<item row="2" column="0" colspan="2"> <string/>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>581</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="flat">
<size> <bool>true</bool>
<width>581</width>
<height>26</height>
</size>
</property> </property>
</spacer> <property name="checkable">
</item> <bool>false</bool>
<item row="3" column="1">
<widget class="QPushButton" name="nextButton">
<property name="text">
<string>Next</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
<widget class="QWidget" name="destPage"> <widget class="QWizardPage" name="destinationWizardPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>690</width>
<height>319</height>
</rect>
</property>
<attribute name="label">
<string>Destination Setup</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Destinations</string> <string>Destination Setup</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_7"> <property name="subTitle">
<item row="0" column="0"> <string>Select destinations to stream to</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTabWidget" name="destTab"> <widget class="QTabWidget" name="destTab">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
...@@ -155,9 +74,22 @@ ...@@ -155,9 +74,22 @@
<attribute name="title"> <attribute name="title">
<string/> <string/>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_10"> <layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Add destinations following the streaming methods you need. Be sure to check with transcoding that the format is compatible with the method used.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>New destination</string> <string>New destination</string>
</property> </property>
...@@ -179,19 +111,6 @@ ...@@ -179,19 +111,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Add destinations following the streaming methods you need. Be sure to check with transcoding that the format is compatible with the method used.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="localOutput"> <widget class="QCheckBox" name="localOutput">
<property name="text"> <property name="text">
...@@ -205,17 +124,15 @@ ...@@ -205,17 +124,15 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item> <widget class="QWizardPage" name="wizardPage">
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Transcoding options</string> <string>Transcoding Options</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <property name="subTitle">
<item row="1" column="0"> <string>Select and choose transcoding options</string>
<widget class="VLCProfileSelector" name="profileSelect" native="true"/> </property>
</item> <layout class="QVBoxLayout" name="verticalLayout_3">
<item row="0" column="0"> <item>
<widget class="QCheckBox" name="transcodeBox"> <widget class="QCheckBox" name="transcodeBox">
<property name="text"> <property name="text">
<string>Activate Transcoding</string> <string>Activate Transcoding</string>
...@@ -225,105 +142,60 @@ ...@@ -225,105 +142,60 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item>
</widget> <widget class="VLCProfileSelector" name="profileSelect" native="true"/>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="prevButton">
<property name="text">
<string>Previous</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>382</width>
<height>26</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="nextButton2">
<property name="text">
<string>Next</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="miscPage"> <widget class="QWizardPage" name="optionsWizardPage">
<property name="geometry"> <property name="title">
<rect>
<x>0</x>
<y>0</y>
<width>690</width>
<height>469</height>
</rect>
</property>
<attribute name="label">
<string>Option Setup</string> <string>Option Setup</string>
</attribute> </property>
<layout class="QGridLayout" name="gridLayout_2"> <property name="subTitle">
<item row="0" column="0" colspan="2"> <string>Set up any additional options for streaming</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<property name="title"> <property name="title">
<string>Miscellaneous Options</string> <string>Miscellaneous Options</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="5"> <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="soutAll"> <widget class="QCheckBox" name="soutAll">
<property name="text"> <property name="text">
<string>Stream all elementary streams</string> <string>Stream all elementary streams</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" rowspan="2"> <item row="1" column="0">
<widget class="QCheckBox" name="sap"> <widget class="QCheckBox" name="sap">
<property name="text"> <property name="text">
<string>SAP announce</string> <string>SAP announce</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" rowspan="2" colspan="2"> <item row="1" column="1">
<widget class="QLineEdit" name="sapName"/> <widget class="QLineEdit" name="sapName"/>
</item> </item>
<item row="2" column="3"> <item row="1" column="2">
<widget class="QLabel" name="sapGroupLabel"> <widget class="QLabel" name="sapGroupLabel">
<property name="text"> <property name="text">
<string>Group name</string> <string>Group name</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="4"> <item row="1" column="3">
<widget class="QLineEdit" name="sapGroup"/> <widget class="QLineEdit" name="sapGroup"/>
</item> </item>
<item row="3" column="0" colspan="2"> <item row="2" column="0">
<widget class="QLabel" name="ttlLabel"> <widget class="QLabel" name="ttlLabel">
<property name="text"> <property name="text">
<string>Time-To-Live (TTL)</string> <string>Time-To-Live (TTL)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="2" column="1">
<widget class="QSpinBox" name="ttl"> <widget class="QSpinBox" name="ttl">
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
...@@ -339,12 +211,12 @@ ...@@ -339,12 +211,12 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item>
<widget class="QGroupBox" name="groupBox_4"> <widget class="QGroupBox" name="groupBox_4">
<property name="title"> <property name="title">
<string>Generated stream output string</string> <string>Generated stream output string</string>
</property> </property>
<layout class="QHBoxLayout" name="_4"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QTextEdit" name="mrlEdit"> <widget class="QTextEdit" name="mrlEdit">
<property name="acceptRichText"> <property name="acceptRichText">
...@@ -355,39 +227,9 @@ ...@@ -355,39 +227,9 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QPushButton" name="prevButton2">
<property name="text">
<string>Previous</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>507</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item>
<item>
<widget class="QDialogButtonBox" name="acceptButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>VLCProfileSelector</class> <class>VLCProfileSelector</class>
......
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