From 360fe5b28ee233104d47b954ea50d44bf822227d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Wed, 27 Jan 2010 02:25:24 +0100 Subject: [PATCH] Qt EPG: design and functionnalities improvements --- modules/gui/qt4/components/epg/EPGWidget.cpp | 4 --- modules/gui/qt4/components/epg/EPGWidget.hpp | 5 ++-- modules/gui/qt4/dialogs/epg.cpp | 28 ++++++++++++++++++-- modules/gui/qt4/dialogs/epg.hpp | 4 ++- modules/gui/qt4/menus.cpp | 3 +++ 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/modules/gui/qt4/components/epg/EPGWidget.cpp b/modules/gui/qt4/components/epg/EPGWidget.cpp index df062620da..dfa81b1bc0 100644 --- a/modules/gui/qt4/components/epg/EPGWidget.cpp +++ b/modules/gui/qt4/components/epg/EPGWidget.cpp @@ -41,11 +41,8 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent ) m_rulerWidget = new EPGRuler( this ); m_channelsWidget = new ChannelsWidget( this ); m_epgView = new EPGView( this ); - m_description = new QLabel( "Hello world
blablabla" ); m_channelsWidget->setMinimumWidth( 40 ); - m_description->setAlignment( Qt::AlignTop | Qt::AlignLeft ); - m_description->setMinimumHeight( 70 ); m_epgView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); setZoom( 1 ); @@ -53,7 +50,6 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent ) layout->addWidget( m_rulerWidget, 0, 1 ); layout->addWidget( m_channelsWidget, 1, 0 ); layout->addWidget( m_epgView, 1, 1 ); - layout->addWidget( m_description, 2, 1 ); layout->setSpacing( 0 ); setLayout( layout ); diff --git a/modules/gui/qt4/components/epg/EPGWidget.hpp b/modules/gui/qt4/components/epg/EPGWidget.hpp index 358c856247..84e88d183f 100644 --- a/modules/gui/qt4/components/epg/EPGWidget.hpp +++ b/modules/gui/qt4/components/epg/EPGWidget.hpp @@ -35,7 +35,6 @@ #include class QDateTime; -class QLabel; class ChannelsWidget : public QWidget { @@ -58,9 +57,11 @@ private: ChannelsWidget* m_channelsWidget; EPGRuler* m_rulerWidget; EPGView* m_epgView; - QLabel* m_description; QMultiMap m_events; + +signals: + void descriptionChanged( const QString& ); }; #endif // EPGWIDGET_H diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp index b5213c3280..e30ad52075 100644 --- a/modules/gui/qt4/dialogs/epg.cpp +++ b/modules/gui/qt4/dialogs/epg.cpp @@ -29,15 +29,39 @@ #include "components/epg/EPGWidget.hpp" #include +#include +#include +#include EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) { - setTitle( "Program Guide" ); + setWindowTitle( "Program Guide" ); QHBoxLayout *layout = new QHBoxLayout( this ); + QSplitter *splitter = new QSplitter( this ); EPGWidget *epg = new EPGWidget( this ); + splitter->addWidget( epg ); + splitter->setOrientation(Qt::Vertical); - layout->addWidget( epg ); + QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this ); + + QHBoxLayout *boxLayout = new QHBoxLayout( descBox ); + + description = new QLabel( this ); + description->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel ); + description->setAutoFillBackground( true ); + + QPalette palette; + palette.setBrush(QPalette::Active, QPalette::Window, palette.brush( QPalette::Base ) ); + description->setPalette( palette ); + + boxLayout->addWidget( description ); + + splitter->addWidget( epg ); + splitter->addWidget( descBox ); + layout->addWidget( splitter ); + + CONNECT( epg, descriptionChanged( const QString & ), description, setText( const QString & ) ); } EpgDialog::~EpgDialog() diff --git a/modules/gui/qt4/dialogs/epg.hpp b/modules/gui/qt4/dialogs/epg.hpp index 1d6bedf8cb..1f4658aee6 100644 --- a/modules/gui/qt4/dialogs/epg.hpp +++ b/modules/gui/qt4/dialogs/epg.hpp @@ -27,7 +27,7 @@ #include "util/singleton.hpp" - +class QLabel; class EpgDialog : public QVLCFrame, public Singleton { Q_OBJECT; @@ -35,6 +35,8 @@ private: EpgDialog( intf_thread_t * ); virtual ~EpgDialog(); + QLabel *description; + friend class Singleton; }; diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index bb07f9c969..d7d9146406 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -375,6 +375,9 @@ QMenu *QVLCMenu::ToolsMenu( QMenu *menu ) "Ctrl+W" ); #endif + addDPStaticEntry( menu, qtr( "Program Guide" ), "", SLOT( epgDialog() ), + "" ); + addDPStaticEntry( menu, qtr( I_MENU_MSG ), ":/menu/messages", SLOT( messagesDialog() ), "Ctrl+M" ); -- 2.39.2