[vlc-commits] commit: QT4: Connect INPUT_EVENT_ITEM_EPG to update epg-widget via inputmanager ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Thu Jun 3 18:00:56 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Jun  3 18:59:51 2010 +0300| [f53ff18f969ce5d3cc5f9e844d390ad7898dd05d] | committer: Ilkka Ollakka 

QT4: Connect INPUT_EVENT_ITEM_EPG to update epg-widget via inputmanager

Now epg-content should update automaticly when user changes channel etc.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f53ff18f969ce5d3cc5f9e844d390ad7898dd05d
---

 modules/gui/qt4/dialogs/epg.cpp   |    1 +
 modules/gui/qt4/input_manager.cpp |   16 ++++++++++++++++
 modules/gui/qt4/input_manager.hpp |    3 +++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 40980c7..d54da54 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -72,6 +72,7 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     layout->addWidget( splitter );
 
     CONNECT( epg, itemSelectionChanged( EPGEvent *), this, showEvent( EPGEvent *) );
+    CONNECT( THEMIM->getIM(), epgChanged(), this, updateInfos() );
 
     QPushButton *update = new QPushButton( qtr( "Update" ) ); //Temporary to test
     layout->addWidget( update, 0, Qt::AlignRight );
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index c8b7087..7717cd2 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -257,6 +257,9 @@ void InputManager::customEvent( QEvent *event )
     case ProgramChanged_Type:
         UpdateProgramEvent();
         break;
+    case EPGEvent_Type:
+        UpdateEPG();
+        break;
     default:
         msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
         assert(0);
@@ -361,6 +364,11 @@ static int InputEvent( vlc_object_t *p_this, const char *,
         event = new IMEvent( ProgramChanged_Type );
         break;
 
+    case INPUT_EVENT_ITEM_EPG:
+        /* EPG data changed */
+        event = new IMEvent( EPGEvent_Type );
+        break;
+
     case INPUT_EVENT_SIGNAL:
         /* This is for capture-card signals */
         /* event = new IMEvent( SignalChanged_Type );
@@ -547,6 +555,14 @@ void InputManager::UpdateTeletext()
     }
 }
 
+void InputManager::UpdateEPG()
+{
+    if( hasInput() )
+    {
+       emit epgChanged();
+    }
+}
+
 void InputManager::UpdateVout()
 {
     if( hasInput() )
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index a85d294..3654984 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -62,6 +62,7 @@ enum {
     LoopChanged_Type,
     RepeatChanged_Type,
     LeafToParent_Type,
+    EPGEvent_Type,
 /*    SignalChanged_Type, */
 
     FullscreenControlToggle_Type = QEvent::User + IMEventType + 20,
@@ -170,6 +171,7 @@ private:
     void UpdateCaching();
     void UpdateRecord();
     void UpdateProgramEvent();
+    void UpdateEPG();
 
 public slots:
     void setInput( input_thread_t * ); ///< Our controlled input changed
@@ -234,6 +236,7 @@ signals:
     void cachingChanged( float );
     /// Program Event changes
     void encryptionChanged( bool );
+    void epgChanged();
 };
 
 class MainInputManager : public QObject



More information about the vlc-commits mailing list