[vlc-devel] commit: Qt: connect the EPG to the core item on request ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Thu Jan 28 01:38:48 CET 2010
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jan 28 01:33:37 2010 +0100| [b471a8b1aeac35b27b3cb2cb8c102689f7b33dfd] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b471a8b1aeac35b27b3cb2cb8c102689f7b33dfd
---
modules/gui/qt4/dialogs/epg.cpp | 18 +++++++++++++++++-
modules/gui/qt4/dialogs/epg.hpp | 3 +++
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 85222fb..4422176 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -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 );
+
+}
diff --git a/modules/gui/qt4/dialogs/epg.hpp b/modules/gui/qt4/dialogs/epg.hpp
index 80ebb95..fb2993f 100644
--- a/modules/gui/qt4/dialogs/epg.hpp
+++ b/modules/gui/qt4/dialogs/epg.hpp
@@ -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
More information about the vlc-devel
mailing list