Commit a087c55c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - VLM improvements in the layout and in the function used.

parent 948158b1
/***************************************************************************** /*****************************************************************************
* sout.cpp : Stream output dialog ( old-style ) * sout.cpp : stream output dialog ( old-style )
**************************************************************************** ****************************************************************************
* Copyright ( C ) 2006 the VideoLAN team * Copyright ( C ) 2006 the VideoLAN team
* $Id: sout.cpp 21875 2007-09-08 16:01:33Z jb $ * $Id: sout.cpp 21875 2007-09-08 16:01:33Z jb $
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "dialogs/vlm.hpp" #include "dialogs/vlm.hpp"
...@@ -41,148 +41,166 @@ ...@@ -41,148 +41,166 @@
#include <QGroupBox> #include <QGroupBox>
#include <QPushButton> #include <QPushButton>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QTimeEdit>
#include <QDateEdit>
#include <QSpinBox>
VLMDialog *VLMDialog::instance = NULL; VLMDialog *VLMDialog::instance = NULL;
VLMDialog::VLMDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
setWindowTitle( qtr( "VLM front-end" ) );
// UI stuff // UI stuff
ui.setupUi( this ); ui.setupUi( this );
mediatype = new QComboBox(ui.groupBox);
layout = new QVBoxLayout(ui.groupBox);
layout->addWidget(mediatype);
#define ADDMEDIATYPES(type) mediatype->addItem(type); /* Layout in the main groupBox */
layout = new QVBoxLayout( ui.groupBox );
mediatype = new QComboBox( ui.groupBox );
layout->addWidget( mediatype );
ADDMEDIATYPES("Broadcast"); #define ADDMEDIATYPES( type ) mediatype->addItem( qtr( type ) );
ADDMEDIATYPES("Video On Demand (VOD)");
ADDMEDIATYPES("Schedule"); ADDMEDIATYPES( "Broadcast" );
ADDMEDIATYPES( "Video On Demand ( VOD )" );
ADDMEDIATYPES( "Schedule" );
makeBcastPage(); makeBcastPage();
makeVODPage(); makeVODPage();
makeSchedulePage(); makeSchedulePage();
slayout = new QStackedWidget(ui.groupBox); /* Create a Stacked Widget to old the different phases */
slayout->addWidget(pBcast); slayout = new QStackedWidget( ui.groupBox );
slayout->addWidget(pVod); slayout->addWidget( pBcast );
slayout->addWidget(pSchedule); slayout->addWidget( pVod );
slayout->addWidget( pSchedule );
layout->addWidget( slayout );
layout->addWidget(slayout); QPushButton *closeButton = new QPushButton( qtr("Close") );
QPushButton *cancelButton = new QPushButton( qtr("Cancel") );
ui.buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
ui.buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
connect(mediatype,SIGNAL(currentIndexChanged(int)),slayout,SLOT(setCurrentIndex(int))); connect( mediatype, SIGNAL( currentIndexChanged( int ) ), slayout, SLOT( setCurrentIndex( int ) ) );
} }
VLMDialog::~VLMDialog(){} VLMDialog::~VLMDialog(){}
void VLMDialog::close()
{
close();
}
void VLMDialog::makeBcastPage() void VLMDialog::makeBcastPage()
{ {
pBcast = new QWidget(ui.groupBox); pBcast = new QWidget( ui.groupBox );
bcastlayout = new QGridLayout(pBcast); bcastlayout = new QGridLayout( pBcast );
bcastname = new QLabel(tr("Name :"),pBcast); bcastname = new QLabel( qtr( "Name :" ),pBcast );
bcastnameledit = new QLineEdit(pBcast); bcastnameledit = new QLineEdit( pBcast );
bcastenable = new QCheckBox(tr("Enable"),pBcast); bcastenable = new QCheckBox( qtr( "Enable" ),pBcast );
bcastinput = new QLabel(tr("Input :"),pBcast); bcastinput = new QLabel( qtr( "Input :" ),pBcast );
bcastinputledit = new QLineEdit(pBcast); bcastinputledit = new QLineEdit( pBcast );
bcastinputtbutton = new QToolButton(pBcast); bcastinputtbutton = new QToolButton( pBcast );
bcastoutput = new QLabel(tr("Output :"),pBcast); bcastoutput = new QLabel( qtr( "Output :" ),pBcast );
bcastoutputledit = new QLineEdit(pBcast); bcastoutputledit = new QLineEdit( pBcast );
bcastoutputtbutton = new QToolButton(pBcast); bcastoutputtbutton = new QToolButton( pBcast );
bcastcontrol = new QGroupBox(tr("Controls"),pBcast); bcastcontrol = new QGroupBox( qtr( "Controls" ),pBcast );
bcastgbox = new QHBoxLayout(bcastcontrol); bcastgbox = new QHBoxLayout( bcastcontrol );
bcastplay = new QPushButton(tr("Play"),bcastcontrol); bcastplay = new QPushButton( qtr( "Play" ),bcastcontrol );
bcastpause = new QPushButton(tr("Pause"),bcastcontrol); bcastpause = new QPushButton( qtr( "Pause" ),bcastcontrol );
bcaststop = new QPushButton(tr("Stop"),bcastcontrol); bcaststop = new QPushButton( qtr( "Stop" ),bcastcontrol );
bcastadd = new QPushButton(tr("Add"),pBcast); bcastadd = new QPushButton( qtr( "Add" ),pBcast );
bcastremove = new QPushButton(tr("Remove"),pBcast); bcastremove = new QPushButton( qtr( "Remove" ),pBcast );
// Adding all widgets in the QGridLayout // Adding all widgets in the QGridLayout
bcastgbox->addWidget(bcastplay); bcastgbox->addWidget( bcastplay );
bcastgbox->addWidget(bcastpause); bcastgbox->addWidget( bcastpause );
bcastgbox->addWidget(bcaststop); bcastgbox->addWidget( bcaststop );
bcastlayout->addWidget(bcastname,0,0); bcastlayout->addWidget( bcastname,0,0 );
bcastlayout->addWidget(bcastnameledit,0,1); bcastlayout->addWidget( bcastnameledit,0,1 );
bcastlayout->addWidget(bcastenable,0,2); bcastlayout->addWidget( bcastenable,0,2 );
bcastlayout->addWidget(bcastinput,1,0); bcastlayout->addWidget( bcastinput,1,0 );
bcastlayout->addWidget(bcastinputledit,1,1); bcastlayout->addWidget( bcastinputledit,1,1 );
bcastlayout->addWidget(bcastinputtbutton,1,2); bcastlayout->addWidget( bcastinputtbutton,1,2 );
bcastlayout->addWidget(bcastoutput,2,0); bcastlayout->addWidget( bcastoutput,2,0 );
bcastlayout->addWidget(bcastoutputledit,2,1); bcastlayout->addWidget( bcastoutputledit,2,1 );
bcastlayout->addWidget(bcastoutputtbutton,2,2); bcastlayout->addWidget( bcastoutputtbutton,2,2 );
bcastlayout->addWidget(bcastcontrol,3,0,1,3); bcastlayout->addWidget( bcastcontrol,3,0,1,3 );
bcastlayout->addWidget(bcastadd,4,1); bcastlayout->addWidget( bcastadd,4,1 );
bcastlayout->addWidget(bcastremove,4,2); bcastlayout->addWidget( bcastremove,4,2 );
} }
void VLMDialog::makeVODPage() void VLMDialog::makeVODPage()
{ {
pVod = new QWidget(ui.groupBox); pVod = new QWidget( ui.groupBox );
vodlayout = new QGridLayout(pVod); vodlayout = new QGridLayout( pVod );
vodname = new QLabel(tr("Name :"),pVod); vodname = new QLabel( qtr( "Name :" ),pVod );
vodnameledit = new QLineEdit(pVod); vodnameledit = new QLineEdit( pVod );
vodenable = new QCheckBox(tr("Enable"),pVod); vodenable = new QCheckBox( qtr( "Enable" ),pVod );
vodinput = new QLabel(tr("Input :"),pVod); vodinput = new QLabel( qtr( "Input :" ),pVod );
vodinputledit = new QLineEdit(pVod); vodinputledit = new QLineEdit( pVod );
vodinputtbutton = new QToolButton(pVod); vodinputtbutton = new QToolButton( pVod );
vodoutput = new QLabel(tr("Output :"),pVod); vodoutput = new QLabel( qtr( "Output :" ),pVod );
vodoutputledit = new QLineEdit(pVod); vodoutputledit = new QLineEdit( pVod );
vodoutputtbutton = new QToolButton(pVod); vodoutputtbutton = new QToolButton( pVod );
vodadd = new QPushButton(tr("Add"),pVod); vodadd = new QPushButton( qtr( "Add" ),pVod );
vodremove = new QPushButton(tr("Remove"),pVod); vodremove = new QPushButton( qtr( "Remove" ),pVod );
// Adding all widgets in the QGridLayout // Adding all widgets in the QGridLayout
vodlayout->addWidget(vodname,0,0); vodlayout->addWidget( vodname,0,0 );
vodlayout->addWidget(vodnameledit,0,1); vodlayout->addWidget( vodnameledit,0,1 );
vodlayout->addWidget(vodenable,0,2); vodlayout->addWidget( vodenable,0,2 );
vodlayout->addWidget(vodinput,1,0); vodlayout->addWidget( vodinput,1,0 );
vodlayout->addWidget(vodinputledit,1,1); vodlayout->addWidget( vodinputledit,1,1 );
vodlayout->addWidget(vodinputtbutton,1,2); vodlayout->addWidget( vodinputtbutton,1,2 );
vodlayout->addWidget(vodoutput,2,0); vodlayout->addWidget( vodoutput,2,0 );
vodlayout->addWidget(vodoutputledit,2,1); vodlayout->addWidget( vodoutputledit,2,1 );
vodlayout->addWidget(vodoutputtbutton,2,2); vodlayout->addWidget( vodoutputtbutton,2,2 );
vodlayout->addWidget(vodadd,3,1); vodlayout->addWidget( vodadd,3,1 );
vodlayout->addWidget(vodremove,3,2); vodlayout->addWidget( vodremove,3,2 );
} }
void VLMDialog::makeSchedulePage() void VLMDialog::makeSchedulePage()
{ {
pSchedule = new QWidget(ui.groupBox); pSchedule = new QWidget( ui.groupBox );
schelayout = new QGridLayout(pSchedule); schelayout = new QGridLayout( pSchedule );
schename = new QLabel(tr("Name :"),pSchedule); schename = new QLabel( qtr( "Name :" ),pSchedule );
schenameledit = new QLineEdit(pSchedule); schenameledit = new QLineEdit( pSchedule );
scheenable = new QCheckBox(tr("Enable"),pSchedule); scheenable = new QCheckBox( qtr( "Enable" ),pSchedule );
scheinput = new QLabel(tr("Input :"),pSchedule); scheinput = new QLabel( qtr( "Input :" ),pSchedule );
scheinputledit = new QLineEdit(pSchedule); scheinputledit = new QLineEdit( pSchedule );
scheinputtbutton = new QToolButton(pSchedule); scheinputtbutton = new QToolButton( pSchedule );
scheoutput = new QLabel(tr("Output :"),pSchedule); scheoutput = new QLabel( qtr( "Output :" ),pSchedule );
scheoutputledit = new QLineEdit(pSchedule); scheoutputledit = new QLineEdit( pSchedule );
scheoutputtbutton = new QToolButton(pSchedule); scheoutputtbutton = new QToolButton( pSchedule );
schecontrol = new QGroupBox(tr("Time Control"),pSchedule); schecontrol = new QGroupBox( qtr( "Time Control" ),pSchedule );
scheadd = new QPushButton(tr("Add"),pSchedule); scheadd = new QPushButton( qtr( "Add" ),pSchedule );
scheremove = new QPushButton(tr("Remove"),pSchedule); scheremove = new QPushButton( qtr( "Remove" ),pSchedule );
schetimelayout = new QGridLayout( schecontrol );
//scheadd->setMaximumWidth(30); schetimelabel = new QLabel( qtr( "Hours/Minutes/Seconds :" ), schecontrol );
schedatelabel = new QLabel( qtr( "Day/Month/Year :" ), schecontrol );
schetimerepeat = new QLabel( qtr( "Repeat :" ), schecontrol );
time = new QTimeEdit( schecontrol );
date = new QDateEdit( schecontrol );
scherepeatnumber = new QSpinBox( schecontrol );
//scheadd->setMaximumWidth( 30 );
// Adding all widgets in the QGridLayout // Adding all widgets in the QGridLayout
schelayout->addWidget(schename,0,0); schetimelayout->addWidget( schetimelabel,0,0 );
schelayout->addWidget(schenameledit,0,1); schetimelayout->addWidget( time,0,1 );
schelayout->addWidget(scheenable,0,2); schetimelayout->addWidget( schedatelabel,1,0 );
schelayout->addWidget(scheinput,1,0); schetimelayout->addWidget( date,1,1 );
schelayout->addWidget(scheinputledit,1,1); schetimelayout->addWidget( schetimerepeat,2,0 );
schelayout->addWidget(scheinputtbutton,1,2); schetimelayout->addWidget( scherepeatnumber,2,1 );
schelayout->addWidget(scheoutput,2,0); schelayout->addWidget( schename,0,0 );
schelayout->addWidget(scheoutputledit,2,1); schelayout->addWidget( schenameledit,0,1 );
schelayout->addWidget(scheoutputtbutton,2,2); schelayout->addWidget( scheenable,0,2 );
schelayout->addWidget(schecontrol,3,0,1,3); schelayout->addWidget( scheinput,1,0 );
schelayout->addWidget(scheadd,4,1); schelayout->addWidget( scheinputledit,1,1 );
schelayout->addWidget(scheremove,4,2); schelayout->addWidget( scheinputtbutton,1,2 );
schelayout->addWidget( scheoutput,2,0 );
schelayout->addWidget( scheoutputledit,2,1 );
schelayout->addWidget( scheoutputtbutton,2,2 );
schelayout->addWidget( schecontrol,3,0,1,3 );
schelayout->addWidget( scheadd,4,1 );
schelayout->addWidget( scheremove,4,2 );
} }
...@@ -42,6 +42,9 @@ class QToolButton; ...@@ -42,6 +42,9 @@ class QToolButton;
class QGroupBox; class QGroupBox;
class QPushButton; class QPushButton;
class QHBoxLayout; class QHBoxLayout;
class QDateEdit;
class QTimeEdit;
class QSpinBox;
class VLMDialog : public QVLCFrame class VLMDialog : public QVLCFrame
{ {
...@@ -66,10 +69,10 @@ private: ...@@ -66,10 +69,10 @@ private:
QComboBox *mediatype; QComboBox *mediatype;
QVBoxLayout *layout; QVBoxLayout *layout;
QHBoxLayout *bcastgbox; QHBoxLayout *bcastgbox, ;
QStackedWidget *slayout; QStackedWidget *slayout;
QWidget *pBcast, *pVod, *pSchedule; QWidget *pBcast, *pVod, *pSchedule;
QGridLayout *bcastlayout, *vodlayout, *schelayout; QGridLayout *bcastlayout, *vodlayout, *schelayout, *schetimelayout;
QLabel *bcastname, *vodname, *schename,*bcastinput, *vodinput, *scheinput; QLabel *bcastname, *vodname, *schename,*bcastinput, *vodinput, *scheinput;
QLabel *bcastoutput, *vodoutput, *scheoutput; QLabel *bcastoutput, *vodoutput, *scheoutput;
QCheckBox *bcastenable, *vodenable, *scheenable; QCheckBox *bcastenable, *vodenable, *scheenable;
...@@ -80,6 +83,10 @@ private: ...@@ -80,6 +83,10 @@ private:
QGroupBox *bcastcontrol, *schecontrol; QGroupBox *bcastcontrol, *schecontrol;
QPushButton *bcastplay, *bcastpause, *bcaststop; QPushButton *bcastplay, *bcastpause, *bcaststop;
QPushButton *bcastadd, *vodadd, *scheadd, *bcastremove, *vodremove, *scheremove; QPushButton *bcastadd, *vodadd, *scheadd, *bcastremove, *vodremove, *scheremove;
QTimeEdit *time;
QDateEdit *date;
QLabel *schetimelabel, *schedatelabel, *schetimerepeat;
QSpinBox *scherepeatnumber;
private slots: private slots:
void close(); void close();
......
...@@ -8,34 +8,34 @@ ...@@ -8,34 +8,34 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>632</width> <width>640</width>
<height>602</height> <height>640</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Form</string> <string>_("VLM configurator")</string>
</property> </property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="geometry" > <property name="minimumSize" >
<rect> <size>
<x>10</x> <width>0</width>
<y>10</y> <height>300</height>
<width>611</width> </size>
<height>351</height>
</rect>
</property> </property>
<property name="title" > <property name="title" >
<string>Media configuration</string> <string>Media configuration</string>
</property> </property>
</widget> </widget>
</item>
<item row="1" column="0" >
<widget class="QTableWidget" name="mediasDB" > <widget class="QTableWidget" name="mediasDB" >
<property name="windowModality" > <property name="windowModality" >
<enum>Qt::NonModal</enum> <enum>Qt::NonModal</enum>
...@@ -43,22 +43,18 @@ ...@@ -43,22 +43,18 @@
<property name="enabled" > <property name="enabled" >
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="geometry" >
<rect>
<x>10</x>
<y>370</y>
<width>611</width>
<height>221</height>
</rect>
</property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<hsizetype>0</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>220</height>
</size>
</property>
<property name="sizeIncrement" > <property name="sizeIncrement" >
<size> <size>
<width>0</width> <width>0</width>
...@@ -113,6 +109,15 @@ ...@@ -113,6 +109,15 @@
</property> </property>
</column> </column>
</widget> </widget>
</item>
<item row="2" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="standardButtons" >
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
......
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