Commit cc4cb782 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: EPG gui self update

parent 8d17c211
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <QPushButton> #include <QPushButton>
#include <QTextEdit> #include <QTextEdit>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QTimer>
#include "qt4.hpp" #include "qt4.hpp"
#include "input_manager.hpp" #include "input_manager.hpp"
...@@ -88,6 +89,11 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -88,6 +89,11 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
boxLayout->addWidget( buttonsBox ); boxLayout->addWidget( buttonsBox );
CONNECT( buttonsBox, rejected(), this, close() ); CONNECT( buttonsBox, rejected(), this, close() );
timer = new QTimer( this );
timer->setSingleShot( true );
timer->setInterval( 1000 * 60 );
CONNECT( timer, timeout(), this, updateInfos() );
updateInfos(); updateInfos();
readSettings( "EPGDialog", QSize( 650, 450 ) ); readSettings( "EPGDialog", QSize( 650, 450 ) );
} }
...@@ -122,10 +128,11 @@ void EpgDialog::showEvent( EPGEvent *event ) ...@@ -122,10 +128,11 @@ void EpgDialog::showEvent( EPGEvent *event )
void EpgDialog::updateInfos() void EpgDialog::updateInfos()
{ {
if( !THEMIM->getInput() ) return; if( !THEMIM->getInput() ) return;
timer->stop();
int i_nbitems = input_GetItem( THEMIM->getInput())->i_epg; int i_nbitems = input_GetItem( THEMIM->getInput())->i_epg;
if ( i_nbitems > 0 ) msg_Dbg( p_intf, "Found %i EPG items", i_nbitems ); if ( i_nbitems > 0 ) msg_Dbg( p_intf, "Found %i EPG items", i_nbitems );
epg->updateEPG( input_GetItem( THEMIM->getInput())->pp_epg, epg->updateEPG( input_GetItem( THEMIM->getInput())->pp_epg,
input_GetItem( THEMIM->getInput())->i_epg, input_GetItem( THEMIM->getInput())->i_epg,
input_GetItem( THEMIM->getInput())->i_type); input_GetItem( THEMIM->getInput())->i_type);
if ( isVisible() ) timer->start();
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
class QLabel; class QLabel;
class QTextEdit; class QTextEdit;
class QTimer;
class EPGEvent; class EPGEvent;
class EPGWidget; class EPGWidget;
...@@ -42,6 +43,7 @@ private: ...@@ -42,6 +43,7 @@ private:
EPGWidget *epg; EPGWidget *epg;
QTextEdit *description; QTextEdit *description;
QLabel *title; QLabel *title;
QTimer *timer;
friend class Singleton<EpgDialog>; friend class Singleton<EpgDialog>;
......
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