]> git.sesse.net Git - vlc/commitdiff
Qt4 - teletext Panel. Not any function behind it. Not my job anymore :)
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 16 Dec 2007 06:04:53 +0000 (06:04 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 16 Dec 2007 06:04:53 +0000 (06:04 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp

index f78e9fda278171600e4b39ceefeb8edca6c16466..80eb9f11d1a27a3c57a8ff8cc65a8379e047dbfb 100644 (file)
@@ -37,6 +37,7 @@
 #include <QSpacerItem>
 #include <QCursor>
 #include <QPushButton>
+#include <QToolButton>
 #include <QHBoxLayout>
 #include <QMenu>
 #include <QPalette>
@@ -419,7 +420,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     if( !b_advancedVisible ) advControls->hide();
 
     /** Disc and Menus handling */
-    discFrame = new QFrame( this );
+    discFrame = new QWidget( this );
 
     QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
     discLayout->setSpacing( 0 );
@@ -455,11 +456,41 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
              sectionNext() );
     CONNECT( menuButton, clicked(), THEMIM->getIM(),
              sectionMenu() );
-
     /** TODO
      * Telextext QFrame
      * Merge with upper menu in a StackLayout
      **/
+    telexFrame = new QWidget( this );
+    QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
+    telexLayout->setSpacing( 0 );
+    telexLayout->setMargin( 0 );
+
+    QToolButton *telexOn = new QToolButton;
+    telexOn->setText( qtr( "On" ) );
+    setupSmallButton( telexOn );
+    telexLayout->addWidget( telexOn );
+
+    QToolButton *telexTransparent = new QToolButton;
+    telexTransparent->setText( qtr( "Transparent" ) );
+    setupSmallButton( telexTransparent );
+    telexLayout->addWidget( telexTransparent );
+
+    QSpinBox *telexPage = new QSpinBox;
+    telexPage->setRange( 0, 999 );
+    telexPage->setAlignment( Qt::AlignRight );
+    telexLayout->addWidget( telexPage );
+
+    controlLayout->addWidget( telexFrame, 1, 10, 2, 3, Qt::AlignBottom );
+    telexFrame->hide();
+
+    CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(),
+             telexGotoPage( int ) );
+    CONNECT( telexOn, clicked( bool ), THEMIM->getIM(),
+             telexToggle( bool ) );
+    CONNECT( telexTransparent, clicked( bool ),
+             THEMIM->getIM(), telexSetTransparency( bool ) );
+    CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
+             telexFrame, setVisible( bool ) );
 
     /** Play Buttons **/
     QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
index 3bfd51301c0081a2afa3d66fa909a0b908ca4960..3a079c63bd2c2b4ecebba914ecd22bbbdf21ea2a 100644 (file)
@@ -163,7 +163,8 @@ protected:
     friend class VolumeClickHandler;
 private:
     intf_thread_t       *p_intf;
-    QFrame              *discFrame;
+    QWidget             *discFrame;
+    QWidget             *telexFrame;
     QGridLayout         *controlLayout;
     InputSlider         *slider;
     QPushButton         *prevSectionButton, *nextSectionButton, *menuButton;
index 1c5d51f84f4c3ac5fda69ede7477b34340ed09ed..8e22a93a7e77743ed34bdfe3fbd488470650db8f 100644 (file)
@@ -138,6 +138,11 @@ void InputManager::update()
         emit navigationChanged( 0 );
     }
 
+    /* Update teletext status*/
+
+    /* emit teletextEnabled( true|false ) */
+
+
     /* Update text */
     QString text;
     char *psz_name = input_item_GetTitle( input_GetItem( p_input ) );
@@ -231,6 +236,21 @@ void InputManager::sectionMenu()
         var_SetInteger( p_input, "title 0", 2 );
 }
 
+void InputManager::telexGotoPage( int page )
+{
+    //TODO
+}
+
+void InputManager::telexToggle( bool b_enabled )
+{
+    //TODO
+}
+
+void InputManager::telexSetTransparency( bool b_transp )
+{
+    //TODO
+}
+
 void InputManager::slower()
 {
     if( hasInput() )
index cfe16cb3468c1172f5718a3a3ef130ce4962a508..f5c84415dd4c58d89dbfcbf287054bb0dccaf040 100644 (file)
@@ -59,6 +59,9 @@ public slots:
     void sectionNext();
     void sectionPrev();
     void sectionMenu();
+    void telexGotoPage( int );
+    void telexToggle( bool );
+    void telexSetTransparency( bool );
 signals:
     /// Send new position, new time and new length
     void positionUpdated( float , int, int );
@@ -66,6 +69,7 @@ signals:
     void nameChanged( QString );
     /// Used to signal whether we should show navigation buttons
     void navigationChanged( int );
+    void teletextEnabled( bool );
     /// Play/pause status
     void statusChanged( int );
 };