Commit a5dcd1ee authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: EPG: dialog: add no epg warning

parent 19e198c5
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "EPGWidget.hpp" #include "EPGWidget.hpp"
#include <QStackedWidget>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QScrollBar> #include <QScrollBar>
#include <QLabel> #include <QLabel>
...@@ -45,11 +46,24 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent ) ...@@ -45,11 +46,24 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent )
m_epgView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_epgView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
setZoom( 1 ); setZoom( 1 );
rootWidget = new QStackedWidget( this );
QWidget *containerWidget = new QWidget( this );
QGridLayout* layout = new QGridLayout( this ); QGridLayout* layout = new QGridLayout( this );
layout->addWidget( m_rulerWidget, 0, 1 ); layout->addWidget( m_rulerWidget, 0, 1 );
layout->addWidget( m_channelsWidget, 1, 0 ); layout->addWidget( m_channelsWidget, 1, 0 );
layout->addWidget( m_epgView, 1, 1 ); layout->addWidget( m_epgView, 1, 1 );
layout->setSpacing( 0 ); layout->setSpacing( 0 );
containerWidget->setLayout( layout );
rootWidget->addWidget( containerWidget ); /* index 0 */
QLabel *noepgLabel = new QLabel( tr("No EPG Data Available"), this );
noepgLabel->setAlignment( Qt::AlignCenter );
rootWidget->addWidget( noepgLabel ); /* index 1 */
rootWidget->setCurrentIndex( 1 );
layout = new QGridLayout( this );
layout->addWidget( rootWidget );
setLayout( layout ); setLayout( layout );
CONNECT( m_epgView, startTimeChanged(QDateTime), CONNECT( m_epgView, startTimeChanged(QDateTime),
...@@ -88,6 +102,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type ) ...@@ -88,6 +102,7 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
b_input_type_known = true; b_input_type_known = true;
m_epgView->cleanup(); /* expire items and flags */ m_epgView->cleanup(); /* expire items and flags */
rootWidget->setCurrentIndex( ( i_epg > 0 ) ? 0 : 1 );
for ( int i = 0; i < i_epg; ++i ) for ( int i = 0; i < i_epg; ++i )
{ {
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_epg.h> #include <vlc_epg.h>
#include <QWidget> #include <QWidget>
#include <QStackedWidget>
class QDateTime; class QDateTime;
...@@ -51,6 +52,7 @@ private: ...@@ -51,6 +52,7 @@ private:
EPGRuler* m_rulerWidget; EPGRuler* m_rulerWidget;
EPGView* m_epgView; EPGView* m_epgView;
EPGChannels *m_channelsWidget; EPGChannels *m_channelsWidget;
QStackedWidget *rootWidget;
uint8_t i_event_source_type; uint8_t i_event_source_type;
bool b_input_type_known; bool b_input_type_known;
......
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