]> git.sesse.net Git - vlc/commitdiff
Qt: connect the EPG to the core item on request
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 28 Jan 2010 00:33:37 +0000 (01:33 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 28 Jan 2010 00:38:52 +0000 (01:38 +0100)
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.

modules/gui/qt4/dialogs/epg.cpp
modules/gui/qt4/dialogs/epg.hpp

index 85222fbad02b7c30f22981740b2ed03e05ee16c7..44221768f9a148557271cb69b4ffc1930ed75f65 100644 (file)
@@ -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 );
+
+}
index 80ebb952ac864f9c65ab3d493714f5c882045eea..fb2993f16990f169707c18d6c7fccdc695ec4fdf 100644 (file)
@@ -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