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