]> git.sesse.net Git - vlc/commitdiff
Qt: simplify and solve a leak and make a previous commit unecessary.
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Feb 2009 03:01:24 +0000 (04:01 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Feb 2009 03:01:24 +0000 (04:01 +0100)
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/components/controller_widget.hpp

index 46ecdbc4e4659aebcb4864339860a88a207fd48f..39aaec6d86077174e6ea4b6fbee02686d87adac8 100644 (file)
@@ -480,15 +480,14 @@ QFrame *AbstractController::telexFrame()
     /**
      * Telextext QFrame
      **/
-    TeletextController *telexFrame = new TeletextController( this );
+    QFrame *telexFrame = new QFrame;
     QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
     telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
     CONNECT( THEMIM->getIM(), teletextPossible( bool ),
              telexFrame, setVisible( bool ) );
 
     /* On/Off button */
-    QToolButton *telexOn = new QToolButton( this );
-    telexFrame->telexOn = telexOn;
+    QToolButton *telexOn = new QToolButton;
     setupButton( telexOn );
     BUTTON_SET_BAR2( telexOn, tv, qtr( "Teletext Activation" ) );
     telexLayout->addWidget( telexOn );
@@ -496,13 +495,10 @@ QFrame *AbstractController::telexFrame()
     /* Teletext Activation and set */
     CONNECT( telexOn, clicked( bool ),
              THEMIM->getIM(), activateTeletext( bool ) );
-    CONNECT( THEMIM->getIM(), teletextActivated( bool ),
-             telexFrame, enableTeletextButtons( bool ) );
 
 
     /* Transparency button */
-    QToolButton *telexTransparent = new QToolButton( this );
-    telexFrame->telexTransparent = telexTransparent;
+    QToolButton *telexTransparent = new QToolButton;
     setupButton( telexTransparent );
     BUTTON_SET_BAR2( telexTransparent, tvtelx,
                      qtr( "Toggle Transparency " ) );
@@ -518,8 +514,7 @@ QFrame *AbstractController::telexFrame()
 
 
     /* Page setting */
-    QSpinBox *telexPage = new QSpinBox( this );
-    telexFrame->telexPage = telexPage;
+    QSpinBox *telexPage = new QSpinBox( telexFrame );
     telexPage->setRange( 0, 999 );
     telexPage->setValue( 100 );
     telexPage->setAccelerated( true );
@@ -535,6 +530,9 @@ QFrame *AbstractController::telexFrame()
     CONNECT( THEMIM->getIM(), newTelexPageSet( int ),
             telexPage, setValue( int ) );
 
+    CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexPage, setEnabled( bool ) );
+    CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexTransparent, setEnabled( bool ) );
+    CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexOn, setChecked( bool ) );
     return telexFrame;
 }
 #undef CONNECT_MAP
index 31f0063284a853df8fa43bb79a2fc151c4f38596..4b957847b020767700f5efb036d350cd81b0811b 100644 (file)
@@ -188,13 +188,6 @@ void SoundWidget::updateVolume()
     }
 }
 
-void TeletextController::enableTeletextButtons( bool b_enabled )
-{
-    telexOn->setChecked( b_enabled );
-    telexTransparent->setEnabled( b_enabled );
-    telexPage->setEnabled( b_enabled );
-}
-
 void PlayButton::updateButton( bool b_playing )
 {
     setIcon( b_playing ? QIcon( ":/pause_b" ) : QIcon( ":/play_b" ) );
index 3bb7e49609f58b5efffdddf3233204983191758d..4a7c768e11a64f14cafa0ab220ae370198d91b24 100644 (file)
@@ -66,22 +66,6 @@ private slots:
     void setIcons( bool, bool );
 };
 
-class TeletextController : public QFrame
-{
-    Q_OBJECT
-    friend class AbstractController;
-
-public:
-    TeletextController( QWidget *parent ) : QFrame( parent ) { }
-
-private:
-    QToolButton         *telexTransparent, *telexOn;
-    QSpinBox            *telexPage;
-
-private slots:
-    void enableTeletextButtons( bool );
-};
-
 #define VOLUME_MAX 200
 class VolumeClickHandler;