]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/epg.cpp
Qt EPG: design and functionnalities improvements
[vlc] / modules / gui / qt4 / dialogs / epg.cpp
1 /*****************************************************************************
2  * Epg.cpp : Epg Viewer dialog
3  ****************************************************************************
4  * Copyright © 2010 VideoLAN and AUTHORS
5  *
6  * Authors:    Jean-Baptiste Kempf <jb@videolan.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22
23 #ifdef HAVE_CONFIG_H
24 # include "config.h"
25 #endif
26
27 #include "dialogs/epg.hpp"
28
29 #include "components/epg/EPGWidget.hpp"
30
31 #include <QHBoxLayout>
32 #include <QSplitter>
33 #include <QLabel>
34 #include <QGroupBox>
35
36 EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
37 {
38     setWindowTitle( "Program Guide" );
39
40     QHBoxLayout *layout = new QHBoxLayout( this );
41     QSplitter *splitter = new QSplitter( this );
42     EPGWidget *epg = new EPGWidget( this );
43     splitter->addWidget( epg );
44     splitter->setOrientation(Qt::Vertical);
45
46     QGroupBox *descBox = new QGroupBox( qtr( "Description" ), this );
47
48     QHBoxLayout *boxLayout = new QHBoxLayout( descBox );
49
50     description = new QLabel( this );
51     description->setFrameStyle( QFrame::Sunken | QFrame::StyledPanel );
52     description->setAutoFillBackground( true );
53
54     QPalette palette;
55     palette.setBrush(QPalette::Active, QPalette::Window, palette.brush( QPalette::Base ) );
56     description->setPalette( palette );
57
58     boxLayout->addWidget( description );
59
60     splitter->addWidget( epg );
61     splitter->addWidget( descBox );
62     layout->addWidget( splitter );
63
64     CONNECT( epg, descriptionChanged( const QString & ), description, setText( const QString & ) );
65 }
66
67 EpgDialog::~EpgDialog()
68 {
69 }
70