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

Qt: connect the EPG to the core item on request

This is ugly, but I don't know how to do it the correct way.
The UI is not top-quality yet, but it works. Feel free to improve.
parent 2e1f2e3d
......@@ -34,6 +34,9 @@
#include <QGroupBox>
#include <QPushButton>
#include "qt4.hpp"
#include "input_manager.hpp"
EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
{
setWindowTitle( "Program Guide" );
......@@ -41,7 +44,7 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setMargin( 0 );
QSplitter *splitter = new QSplitter( this );
EPGWidget *epg = new EPGWidget( this );
epg = new EPGWidget( this );
splitter->addWidget( epg );
splitter->setOrientation(Qt::Vertical);
......@@ -68,10 +71,15 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
CONNECT( epg, itemSelectionChanged( EPGEvent *), this, showEvent( EPGEvent *) );
QPushButton *update = new QPushButton( "Update" ); //Temporary to test
layout->addWidget( update, 0, Qt::AlignRight );
BUTTONACT( update, update() );
QPushButton *close = new QPushButton( qtr( "&Close" ) );
layout->addWidget( close, 0, Qt::AlignRight );
BUTTONACT( close, close() );
resize( 650, 400 );
}
......@@ -87,3 +95,11 @@ void EpgDialog::showEvent( EPGEvent *event )
description->setText( event->description );
}
void EpgDialog::update()
{
if( !THEMIM->getInput() ) return;
msg_Dbg( p_intf, "Found %i EPG items", input_GetItem( THEMIM->getInput())->i_epg);
epg->updateEPG( input_GetItem( THEMIM->getInput())->pp_epg, input_GetItem( THEMIM->getInput())->i_epg );
}
......@@ -29,6 +29,7 @@
class QLabel;
class EPGEvent;
class EPGWidget;
class EpgDialog : public QVLCFrame, public Singleton<EpgDialog>
{
Q_OBJECT;
......@@ -36,6 +37,7 @@ private:
EpgDialog( intf_thread_t * );
virtual ~EpgDialog();
EPGWidget *epg;
QLabel *description;
QLabel *title;
......@@ -43,6 +45,7 @@ private:
private slots:
void showEvent( EPGEvent * );
void update();
};
#endif
......
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