Commit ad55dcbc authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: simplify and solve a leak and make a previous commit unecessary.

parent 2a94c4bb
...@@ -480,15 +480,14 @@ QFrame *AbstractController::telexFrame() ...@@ -480,15 +480,14 @@ QFrame *AbstractController::telexFrame()
/** /**
* Telextext QFrame * Telextext QFrame
**/ **/
TeletextController *telexFrame = new TeletextController( this ); QFrame *telexFrame = new QFrame;
QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame ); QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 ); telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
CONNECT( THEMIM->getIM(), teletextPossible( bool ), CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexFrame, setVisible( bool ) ); telexFrame, setVisible( bool ) );
/* On/Off button */ /* On/Off button */
QToolButton *telexOn = new QToolButton( this ); QToolButton *telexOn = new QToolButton;
telexFrame->telexOn = telexOn;
setupButton( telexOn ); setupButton( telexOn );
BUTTON_SET_BAR2( telexOn, tv, qtr( "Teletext Activation" ) ); BUTTON_SET_BAR2( telexOn, tv, qtr( "Teletext Activation" ) );
telexLayout->addWidget( telexOn ); telexLayout->addWidget( telexOn );
...@@ -496,13 +495,10 @@ QFrame *AbstractController::telexFrame() ...@@ -496,13 +495,10 @@ QFrame *AbstractController::telexFrame()
/* Teletext Activation and set */ /* Teletext Activation and set */
CONNECT( telexOn, clicked( bool ), CONNECT( telexOn, clicked( bool ),
THEMIM->getIM(), activateTeletext( bool ) ); THEMIM->getIM(), activateTeletext( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ),
telexFrame, enableTeletextButtons( bool ) );
/* Transparency button */ /* Transparency button */
QToolButton *telexTransparent = new QToolButton( this ); QToolButton *telexTransparent = new QToolButton;
telexFrame->telexTransparent = telexTransparent;
setupButton( telexTransparent ); setupButton( telexTransparent );
BUTTON_SET_BAR2( telexTransparent, tvtelx, BUTTON_SET_BAR2( telexTransparent, tvtelx,
qtr( "Toggle Transparency " ) ); qtr( "Toggle Transparency " ) );
...@@ -518,8 +514,7 @@ QFrame *AbstractController::telexFrame() ...@@ -518,8 +514,7 @@ QFrame *AbstractController::telexFrame()
/* Page setting */ /* Page setting */
QSpinBox *telexPage = new QSpinBox( this ); QSpinBox *telexPage = new QSpinBox( telexFrame );
telexFrame->telexPage = telexPage;
telexPage->setRange( 0, 999 ); telexPage->setRange( 0, 999 );
telexPage->setValue( 100 ); telexPage->setValue( 100 );
telexPage->setAccelerated( true ); telexPage->setAccelerated( true );
...@@ -535,6 +530,9 @@ QFrame *AbstractController::telexFrame() ...@@ -535,6 +530,9 @@ QFrame *AbstractController::telexFrame()
CONNECT( THEMIM->getIM(), newTelexPageSet( int ), CONNECT( THEMIM->getIM(), newTelexPageSet( int ),
telexPage, setValue( 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; return telexFrame;
} }
#undef CONNECT_MAP #undef CONNECT_MAP
......
...@@ -188,13 +188,6 @@ void SoundWidget::updateVolume() ...@@ -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 ) void PlayButton::updateButton( bool b_playing )
{ {
setIcon( b_playing ? QIcon( ":/pause_b" ) : QIcon( ":/play_b" ) ); setIcon( b_playing ? QIcon( ":/pause_b" ) : QIcon( ":/play_b" ) );
......
...@@ -66,22 +66,6 @@ private slots: ...@@ -66,22 +66,6 @@ private slots:
void setIcons( bool, bool ); 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 #define VOLUME_MAX 200
class VolumeClickHandler; class VolumeClickHandler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment