[vlc-commits] Qt: EPG gui self update
Francois Cartegnie
git at videolan.org
Sat Mar 5 16:25:49 CET 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Mar 5 15:53:23 2011 +0100| [cc4cb782deebdd1c39f71a2d63d7c7c1be3f3422] | committer: Francois Cartegnie
Qt: EPG gui self update
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc4cb782deebdd1c39f71a2d63d7c7c1be3f3422
---
modules/gui/qt4/dialogs/epg.cpp | 9 ++++++++-
modules/gui/qt4/dialogs/epg.hpp | 2 ++
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 55113b6..9d4b95e 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -35,6 +35,7 @@
#include <QPushButton>
#include <QTextEdit>
#include <QDialogButtonBox>
+#include <QTimer>
#include "qt4.hpp"
#include "input_manager.hpp"
@@ -88,6 +89,11 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
boxLayout->addWidget( buttonsBox );
CONNECT( buttonsBox, rejected(), this, close() );
+ timer = new QTimer( this );
+ timer->setSingleShot( true );
+ timer->setInterval( 1000 * 60 );
+ CONNECT( timer, timeout(), this, updateInfos() );
+
updateInfos();
readSettings( "EPGDialog", QSize( 650, 450 ) );
}
@@ -122,10 +128,11 @@ void EpgDialog::showEvent( EPGEvent *event )
void EpgDialog::updateInfos()
{
if( !THEMIM->getInput() ) return;
+ timer->stop();
int i_nbitems = input_GetItem( THEMIM->getInput())->i_epg;
if ( i_nbitems > 0 ) msg_Dbg( p_intf, "Found %i EPG items", i_nbitems );
epg->updateEPG( input_GetItem( THEMIM->getInput())->pp_epg,
input_GetItem( THEMIM->getInput())->i_epg,
input_GetItem( THEMIM->getInput())->i_type);
-
+ if ( isVisible() ) timer->start();
}
diff --git a/modules/gui/qt4/dialogs/epg.hpp b/modules/gui/qt4/dialogs/epg.hpp
index f81e39d..ccb05e5 100644
--- a/modules/gui/qt4/dialogs/epg.hpp
+++ b/modules/gui/qt4/dialogs/epg.hpp
@@ -29,6 +29,7 @@
class QLabel;
class QTextEdit;
+class QTimer;
class EPGEvent;
class EPGWidget;
@@ -42,6 +43,7 @@ private:
EPGWidget *epg;
QTextEdit *description;
QLabel *title;
+ QTimer *timer;
friend class Singleton<EpgDialog>;
More information about the vlc-commits
mailing list