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

Qt4 - Define a TOGGLEV to toggleVisible on QWidgets, and use it instead of...

Qt4 - Define a TOGGLEV to toggleVisible on QWidgets, and use it instead of rewriting the code n times.
parent 1072961e
......@@ -280,7 +280,7 @@ void OpenDialog::finish( bool b_enqueue = false )
void OpenDialog::toggleAdvancedPanel()
{
//FIXME does not work under Windows
if (ui.advancedFrame->isVisible()) {
if( ui.advancedFrame->isVisible() ) {
ui.advancedFrame->hide();
#ifndef WIN32
setMinimumHeight(1);
......
......@@ -225,20 +225,15 @@ void SoutDialog::setOptions()
void SoutDialog::toggleSout()
{
//Toggle all the streaming options.
#define TGV( x ) { \
if( ( x->isHidden() ) ) \
x->show(); \
else x->hide();\
}
TGV( ui.HTTPOutput ) ; TGV( ui.UDPOutput ) ; TGV( ui.MMSHOutput ) ;
TGV( ui.HTTPEdit ) ; TGV( ui.UDPEdit ) ; TGV( ui.MMSHEdit ) ;
TGV( ui.HTTPLabel ) ; TGV( ui.UDPLabel ) ; TGV( ui.MMSHLabel ) ;
TGV( ui.HTTPPortLabel ) ; TGV( ui.UDPPortLabel ) ; TGV( ui.MMSHPortLabel ) ;
TGV( ui.HTTPPort ) ; TGV( ui.UDPPort ) ; TGV( ui.MMSHPort ) ;
TGV( ui.sap ); TGV( ui.sapName );
TGV( ui.sapGroup ); TGV( ui.sapGroupLabel );
TGV( ui.ttlLabel ); TGV( ui.ttl );
TOGGLEV( ui.HTTPOutput ) ; TOGGLEV( ui.UDPOutput ) ; TOGGLEV( ui.MMSHOutput ) ;
TOGGLEV( ui.HTTPEdit ) ; TOGGLEV( ui.UDPEdit ) ; TOGGLEV( ui.MMSHEdit ) ;
TOGGLEV( ui.HTTPLabel ) ; TOGGLEV( ui.UDPLabel ) ; TOGGLEV( ui.MMSHLabel ) ;
TOGGLEV( ui.HTTPPortLabel ) ; TOGGLEV( ui.UDPPortLabel ) ; TOGGLEV( ui.MMSHPortLabel ) ;
TOGGLEV( ui.HTTPPort ) ; TOGGLEV( ui.UDPPort ) ; TOGGLEV( ui.MMSHPort ) ;
TOGGLEV( ui.sap ); TOGGLEV( ui.sapName );
TOGGLEV( ui.sapGroup ); TOGGLEV( ui.sapGroupLabel );
TOGGLEV( ui.ttlLabel ); TOGGLEV( ui.ttl );
if( b_transcode_only ) okButton->setText( "&Save" );
else okButton->setText( "&Stream" );
......
......@@ -625,10 +625,8 @@ void MainInterface::visual()
void MainInterface::toggleMenus()
{
msg_Dbg( p_intf, "I HAS HERE, HIDING YOUR MENUZ: \\_o<~~ coin coin" );
if( controls->isVisible() ) controls->hide();
else controls->show();
if( statusBar()->isVisible() ) statusBar()->hide();
else statusBar()->show();
TOGGLEV( controls );
TOGGLEV( statusBar() );
updateGeometry();
}
......
......@@ -90,6 +90,9 @@ struct intf_sys_t
#define VISIBLE(i) (i && i->isVisible())
#define TOGGLEV( x ) { if( x->isVisible() ) x->hide(); \
else x->show(); }
static int DialogEvent_Type = QEvent::User + 1;
static int PLUndockEvent_Type = QEvent::User + 2;
static int PLDockEvent_Type = QEvent::User + 3;
......
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