]> git.sesse.net Git - vlc/commitdiff
QT4: Connect INPUT_EVENT_ITEM_EPG to update epg-widget via inputmanager
authorIlkka Ollakka <ileoo@videolan.org>
Thu, 3 Jun 2010 15:59:51 +0000 (18:59 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Thu, 3 Jun 2010 16:00:48 +0000 (19:00 +0300)
Now epg-content should update automaticly when user changes channel etc.

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

index 40980c7d383bf5a6ab34ca99f4c89f846f57a839..d54da54c0d1ae2ac29024dd0505a42301e531a4c 100644 (file)
@@ -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 );
index c8b70874e08d0489253005e1fa5bf8a20b55b295..7717cd2185c03c7b20fe50a5e92f9c1844bfc43f 100644 (file)
@@ -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() )
index a85d2940f1f8f0202bda4a64fd727e1f30808804..36549844f0ba8097fba12e23062f4aec0e9adda9 100644 (file)
@@ -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