From a087c55c728d8a7231feff80bf6a7c45758394ec Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Thu, 11 Oct 2007 19:26:21 +0000 Subject: [PATCH] Qt4 - VLM improvements in the layout and in the function used. --- modules/gui/qt4/dialogs/vlm.cpp | 250 +++++++++++++++++--------------- modules/gui/qt4/dialogs/vlm.hpp | 11 +- modules/gui/qt4/ui/vlm.ui | 197 +++++++++++++------------ 3 files changed, 244 insertions(+), 214 deletions(-) diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp index 1e130d4aa9..a3848a0d5c 100644 --- a/modules/gui/qt4/dialogs/vlm.cpp +++ b/modules/gui/qt4/dialogs/vlm.cpp @@ -1,5 +1,5 @@ /***************************************************************************** - * sout.cpp : Stream output dialog ( old-style ) + * sout.cpp : stream output dialog ( old-style ) **************************************************************************** * Copyright ( C ) 2006 the VideoLAN team * $Id: sout.cpp 21875 2007-09-08 16:01:33Z jb $ @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * 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" @@ -41,148 +41,166 @@ #include #include #include +#include +#include +#include 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 ); - 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"); - ADDMEDIATYPES("Video On Demand (VOD)"); - ADDMEDIATYPES("Schedule"); +#define ADDMEDIATYPES( type ) mediatype->addItem( qtr( type ) ); + + ADDMEDIATYPES( "Broadcast" ); + ADDMEDIATYPES( "Video On Demand ( VOD )" ); + ADDMEDIATYPES( "Schedule" ); makeBcastPage(); makeVODPage(); makeSchedulePage(); - slayout = new QStackedWidget(ui.groupBox); - slayout->addWidget(pBcast); - slayout->addWidget(pVod); - slayout->addWidget(pSchedule); + /* Create a Stacked Widget to old the different phases */ + slayout = new QStackedWidget( ui.groupBox ); + slayout->addWidget( pBcast ); + 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(){} -void VLMDialog::close() -{ - close(); -} - void VLMDialog::makeBcastPage() { - pBcast = new QWidget(ui.groupBox); - bcastlayout = new QGridLayout(pBcast); - bcastname = new QLabel(tr("Name :"),pBcast); - bcastnameledit = new QLineEdit(pBcast); - bcastenable = new QCheckBox(tr("Enable"),pBcast); - bcastinput = new QLabel(tr("Input :"),pBcast); - bcastinputledit = new QLineEdit(pBcast); - bcastinputtbutton = new QToolButton(pBcast); - bcastoutput = new QLabel(tr("Output :"),pBcast); - bcastoutputledit = new QLineEdit(pBcast); - bcastoutputtbutton = new QToolButton(pBcast); - bcastcontrol = new QGroupBox(tr("Controls"),pBcast); - bcastgbox = new QHBoxLayout(bcastcontrol); - bcastplay = new QPushButton(tr("Play"),bcastcontrol); - bcastpause = new QPushButton(tr("Pause"),bcastcontrol); - bcaststop = new QPushButton(tr("Stop"),bcastcontrol); - bcastadd = new QPushButton(tr("Add"),pBcast); - bcastremove = new QPushButton(tr("Remove"),pBcast); - -// Adding all widgets in the QGridLayout - bcastgbox->addWidget(bcastplay); - bcastgbox->addWidget(bcastpause); - bcastgbox->addWidget(bcaststop); - bcastlayout->addWidget(bcastname,0,0); - bcastlayout->addWidget(bcastnameledit,0,1); - bcastlayout->addWidget(bcastenable,0,2); - bcastlayout->addWidget(bcastinput,1,0); - bcastlayout->addWidget(bcastinputledit,1,1); - bcastlayout->addWidget(bcastinputtbutton,1,2); - bcastlayout->addWidget(bcastoutput,2,0); - bcastlayout->addWidget(bcastoutputledit,2,1); - bcastlayout->addWidget(bcastoutputtbutton,2,2); - bcastlayout->addWidget(bcastcontrol,3,0,1,3); - bcastlayout->addWidget(bcastadd,4,1); - bcastlayout->addWidget(bcastremove,4,2); + pBcast = new QWidget( ui.groupBox ); + bcastlayout = new QGridLayout( pBcast ); + bcastname = new QLabel( qtr( "Name :" ),pBcast ); + bcastnameledit = new QLineEdit( pBcast ); + bcastenable = new QCheckBox( qtr( "Enable" ),pBcast ); + bcastinput = new QLabel( qtr( "Input :" ),pBcast ); + bcastinputledit = new QLineEdit( pBcast ); + bcastinputtbutton = new QToolButton( pBcast ); + bcastoutput = new QLabel( qtr( "Output :" ),pBcast ); + bcastoutputledit = new QLineEdit( pBcast ); + bcastoutputtbutton = new QToolButton( pBcast ); + bcastcontrol = new QGroupBox( qtr( "Controls" ),pBcast ); + bcastgbox = new QHBoxLayout( bcastcontrol ); + bcastplay = new QPushButton( qtr( "Play" ),bcastcontrol ); + bcastpause = new QPushButton( qtr( "Pause" ),bcastcontrol ); + bcaststop = new QPushButton( qtr( "Stop" ),bcastcontrol ); + bcastadd = new QPushButton( qtr( "Add" ),pBcast ); + bcastremove = new QPushButton( qtr( "Remove" ),pBcast ); + +// Adding all widgets in the QGridLayout + bcastgbox->addWidget( bcastplay ); + bcastgbox->addWidget( bcastpause ); + bcastgbox->addWidget( bcaststop ); + bcastlayout->addWidget( bcastname,0,0 ); + bcastlayout->addWidget( bcastnameledit,0,1 ); + bcastlayout->addWidget( bcastenable,0,2 ); + bcastlayout->addWidget( bcastinput,1,0 ); + bcastlayout->addWidget( bcastinputledit,1,1 ); + bcastlayout->addWidget( bcastinputtbutton,1,2 ); + bcastlayout->addWidget( bcastoutput,2,0 ); + bcastlayout->addWidget( bcastoutputledit,2,1 ); + bcastlayout->addWidget( bcastoutputtbutton,2,2 ); + bcastlayout->addWidget( bcastcontrol,3,0,1,3 ); + bcastlayout->addWidget( bcastadd,4,1 ); + bcastlayout->addWidget( bcastremove,4,2 ); } void VLMDialog::makeVODPage() { - pVod = new QWidget(ui.groupBox); - vodlayout = new QGridLayout(pVod); - vodname = new QLabel(tr("Name :"),pVod); - vodnameledit = new QLineEdit(pVod); - vodenable = new QCheckBox(tr("Enable"),pVod); - vodinput = new QLabel(tr("Input :"),pVod); - vodinputledit = new QLineEdit(pVod); - vodinputtbutton = new QToolButton(pVod); - vodoutput = new QLabel(tr("Output :"),pVod); - vodoutputledit = new QLineEdit(pVod); - vodoutputtbutton = new QToolButton(pVod); - vodadd = new QPushButton(tr("Add"),pVod); - vodremove = new QPushButton(tr("Remove"),pVod); - -// Adding all widgets in the QGridLayout - vodlayout->addWidget(vodname,0,0); - vodlayout->addWidget(vodnameledit,0,1); - vodlayout->addWidget(vodenable,0,2); - vodlayout->addWidget(vodinput,1,0); - vodlayout->addWidget(vodinputledit,1,1); - vodlayout->addWidget(vodinputtbutton,1,2); - vodlayout->addWidget(vodoutput,2,0); - vodlayout->addWidget(vodoutputledit,2,1); - vodlayout->addWidget(vodoutputtbutton,2,2); - vodlayout->addWidget(vodadd,3,1); - vodlayout->addWidget(vodremove,3,2); + pVod = new QWidget( ui.groupBox ); + vodlayout = new QGridLayout( pVod ); + vodname = new QLabel( qtr( "Name :" ),pVod ); + vodnameledit = new QLineEdit( pVod ); + vodenable = new QCheckBox( qtr( "Enable" ),pVod ); + vodinput = new QLabel( qtr( "Input :" ),pVod ); + vodinputledit = new QLineEdit( pVod ); + vodinputtbutton = new QToolButton( pVod ); + vodoutput = new QLabel( qtr( "Output :" ),pVod ); + vodoutputledit = new QLineEdit( pVod ); + vodoutputtbutton = new QToolButton( pVod ); + vodadd = new QPushButton( qtr( "Add" ),pVod ); + vodremove = new QPushButton( qtr( "Remove" ),pVod ); + +// Adding all widgets in the QGridLayout + vodlayout->addWidget( vodname,0,0 ); + vodlayout->addWidget( vodnameledit,0,1 ); + vodlayout->addWidget( vodenable,0,2 ); + vodlayout->addWidget( vodinput,1,0 ); + vodlayout->addWidget( vodinputledit,1,1 ); + vodlayout->addWidget( vodinputtbutton,1,2 ); + vodlayout->addWidget( vodoutput,2,0 ); + vodlayout->addWidget( vodoutputledit,2,1 ); + vodlayout->addWidget( vodoutputtbutton,2,2 ); + vodlayout->addWidget( vodadd,3,1 ); + vodlayout->addWidget( vodremove,3,2 ); } void VLMDialog::makeSchedulePage() { - pSchedule = new QWidget(ui.groupBox); - schelayout = new QGridLayout(pSchedule); - schename = new QLabel(tr("Name :"),pSchedule); - schenameledit = new QLineEdit(pSchedule); - scheenable = new QCheckBox(tr("Enable"),pSchedule); - scheinput = new QLabel(tr("Input :"),pSchedule); - scheinputledit = new QLineEdit(pSchedule); - scheinputtbutton = new QToolButton(pSchedule); - scheoutput = new QLabel(tr("Output :"),pSchedule); - scheoutputledit = new QLineEdit(pSchedule); - scheoutputtbutton = new QToolButton(pSchedule); - schecontrol = new QGroupBox(tr("Time Control"),pSchedule); - scheadd = new QPushButton(tr("Add"),pSchedule); - scheremove = new QPushButton(tr("Remove"),pSchedule); - - //scheadd->setMaximumWidth(30); - -// Adding all widgets in the QGridLayout - schelayout->addWidget(schename,0,0); - schelayout->addWidget(schenameledit,0,1); - schelayout->addWidget(scheenable,0,2); - schelayout->addWidget(scheinput,1,0); - schelayout->addWidget(scheinputledit,1,1); - 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); + pSchedule = new QWidget( ui.groupBox ); + schelayout = new QGridLayout( pSchedule ); + schename = new QLabel( qtr( "Name :" ),pSchedule ); + schenameledit = new QLineEdit( pSchedule ); + scheenable = new QCheckBox( qtr( "Enable" ),pSchedule ); + scheinput = new QLabel( qtr( "Input :" ),pSchedule ); + scheinputledit = new QLineEdit( pSchedule ); + scheinputtbutton = new QToolButton( pSchedule ); + scheoutput = new QLabel( qtr( "Output :" ),pSchedule ); + scheoutputledit = new QLineEdit( pSchedule ); + scheoutputtbutton = new QToolButton( pSchedule ); + schecontrol = new QGroupBox( qtr( "Time Control" ),pSchedule ); + scheadd = new QPushButton( qtr( "Add" ),pSchedule ); + scheremove = new QPushButton( qtr( "Remove" ),pSchedule ); + schetimelayout = new QGridLayout( schecontrol ); + 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 + schetimelayout->addWidget( schetimelabel,0,0 ); + schetimelayout->addWidget( time,0,1 ); + schetimelayout->addWidget( schedatelabel,1,0 ); + schetimelayout->addWidget( date,1,1 ); + schetimelayout->addWidget( schetimerepeat,2,0 ); + schetimelayout->addWidget( scherepeatnumber,2,1 ); + schelayout->addWidget( schename,0,0 ); + schelayout->addWidget( schenameledit,0,1 ); + schelayout->addWidget( scheenable,0,2 ); + schelayout->addWidget( scheinput,1,0 ); + schelayout->addWidget( scheinputledit,1,1 ); + 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 ); } - + diff --git a/modules/gui/qt4/dialogs/vlm.hpp b/modules/gui/qt4/dialogs/vlm.hpp index 70134d51a4..736975b756 100644 --- a/modules/gui/qt4/dialogs/vlm.hpp +++ b/modules/gui/qt4/dialogs/vlm.hpp @@ -42,6 +42,9 @@ class QToolButton; class QGroupBox; class QPushButton; class QHBoxLayout; +class QDateEdit; +class QTimeEdit; +class QSpinBox; class VLMDialog : public QVLCFrame { @@ -66,10 +69,10 @@ private: QComboBox *mediatype; QVBoxLayout *layout; - QHBoxLayout *bcastgbox; + QHBoxLayout *bcastgbox, ; QStackedWidget *slayout; QWidget *pBcast, *pVod, *pSchedule; - QGridLayout *bcastlayout, *vodlayout, *schelayout; + QGridLayout *bcastlayout, *vodlayout, *schelayout, *schetimelayout; QLabel *bcastname, *vodname, *schename,*bcastinput, *vodinput, *scheinput; QLabel *bcastoutput, *vodoutput, *scheoutput; QCheckBox *bcastenable, *vodenable, *scheenable; @@ -80,6 +83,10 @@ private: QGroupBox *bcastcontrol, *schecontrol; QPushButton *bcastplay, *bcastpause, *bcaststop; QPushButton *bcastadd, *vodadd, *scheadd, *bcastremove, *vodremove, *scheremove; + QTimeEdit *time; + QDateEdit *date; + QLabel *schetimelabel, *schedatelabel, *schetimerepeat; + QSpinBox *scherepeatnumber; private slots: void close(); diff --git a/modules/gui/qt4/ui/vlm.ui b/modules/gui/qt4/ui/vlm.ui index dbf80c107f..98419b9e6b 100644 --- a/modules/gui/qt4/ui/vlm.ui +++ b/modules/gui/qt4/ui/vlm.ui @@ -8,111 +8,116 @@ 0 0 - 632 - 602 + 640 + 640 - - 5 - 5 + 0 0 - Form + _("VLM configurator") - - - - 10 - 10 - 611 - 351 - - - - Media configuration - - - - - Qt::NonModal - - - true - - - - 10 - 370 - 611 - 221 - - - - - 0 - 7 - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - false - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::MultiSelection - - - true - - - true - - - - - Type - - - - - Media Name - - - - - Input - - - - - Output - - - - - State - - - + + + + + + 0 + 300 + + + + Media configuration + + + + + + + Qt::NonModal + + + true + + + + 0 + 0 + + + + + 0 + 220 + + + + + 0 + 0 + + + + + 0 + 0 + + + + false + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::MultiSelection + + + true + + + true + + + + + Type + + + + + Media Name + + + + + Input + + + + + Output + + + + + State + + + + + + + + QDialogButtonBox::NoButton + + + + -- 2.20.1