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();
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Jean-Baptiste Kempf</author>
<author>Edward Wang</author>
<class>Sout</class>
<widget class="QWidget" name="Sout">
<widget class="QWizard" name="Sout">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>708</width>
<height>587</height>
<width>725</width>
<height>445</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>359</height>
</size>
</property>
<property name="windowTitle">
<string>Stream Output</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="sourcePage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>690</width>
<height>472</height>
</rect>
<property name="wizardStyle">
<enum>QWizard::ClassicStyle</enum>
</property>
<widget class="QWizardPage" name="sourceWizardPage">
<property name="title">
<string>Source</string>
</property>
<property name="subTitle">
<string>Set up media sources to stream</string>
</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">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="SoutInputBox" name="inputBox">
<property name="title">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="destinationWizardPage">
<property name="title">
<string>Destination Setup</string>
</property>
<property name="subTitle">
<string>Select destinations to stream to</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTabWidget" name="destTab">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string/>
</attribute>
<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">
<widget class="QLabel" name="label_3">
<property name="text">
<string>New destination</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="destBox"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="addButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="localOutput">
<property name="text">
<string>Display locally</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizardPage">
<property name="title">
<string>Transcoding Options</string>
</property>
<property name="subTitle">
<string>Select and choose transcoding options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="transcodeBox">
<property name="text">
<string>Activate Transcoding</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="VLCProfileSelector" name="profileSelect" native="true"/>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="optionsWizardPage">
<property name="title">
<string>Option Setup</string>
</property>
<property name="subTitle">
<string>Set up any additional options for streaming</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Miscellaneous Options</string>
</property>
<attribute name="label">
<string>Source</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QTextEdit" name="helpEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximumSize">
<size>
<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 name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="SoutInputBox" name="inputBox"/>
</item>
<item row="2" column="0" colspan="2">
<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 name="sizeHint" stdset="0">
<size>
<width>581</width>
<height>26</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="nextButton">
<widget class="QCheckBox" name="soutAll">
<property name="text">
<string>Next</string>
<string>Stream all elementary streams</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="destPage">
<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">
<string>Destinations</string>
<item row="1" column="0">
<widget class="QCheckBox" name="sap">
<property name="text">
<string>SAP announce</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QTabWidget" name="destTab">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string/>
</attribute>
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>New destination</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="destBox"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="addButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</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">
<widget class="QCheckBox" name="localOutput">
<property name="text">
<string>Display locally</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Transcoding options</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="0">
<widget class="VLCProfileSelector" name="profileSelect" native="true"/>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="transcodeBox">
<property name="text">
<string>Activate Transcoding</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<item row="1" column="1">
<widget class="QLineEdit" name="sapName"/>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="prevButton">
<item row="1" column="2">
<widget class="QLabel" name="sapGroupLabel">
<property name="text">
<string>Previous</string>
<string>Group name</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 row="1" column="3">
<widget class="QLineEdit" name="sapGroup"/>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="nextButton2">
<item row="2" column="0">
<widget class="QLabel" name="ttlLabel">
<property name="text">
<string>Next</string>
<string>Time-To-Live (TTL)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QSpinBox" name="ttl">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="maximum">
<number>255</number>
</property>
</spacer>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="miscPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>690</width>
<height>469</height>
</rect>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Generated stream output string</string>
</property>
<attribute name="label">
<string>Option Setup</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Miscellaneous Options</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="5">
<widget class="QCheckBox" name="soutAll">
<property name="text">
<string>Stream all elementary streams</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QCheckBox" name="sap">
<property name="text">
<string>SAP announce</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2" colspan="2">
<widget class="QLineEdit" name="sapName"/>
</item>
<item row="2" column="3">
<widget class="QLabel" name="sapGroupLabel">
<property name="text">
<string>Group name</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLineEdit" name="sapGroup"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="ttlLabel">
<property name="text">
<string>Time-To-Live (TTL)</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QSpinBox" name="ttl">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Generated stream output string</string>
</property>
<layout class="QHBoxLayout" name="_4">
<item>
<widget class="QTextEdit" name="mrlEdit">
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="prevButton2">
<property name="text">
<string>Previous</string>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTextEdit" name="mrlEdit">
<property name="acceptRichText">
<bool>false</bool>
</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>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="acceptButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
......
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