Commit 94038d2f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Code factorization

parent 2912aadf
...@@ -140,55 +140,41 @@ void SoutDialog::closeTab() ...@@ -140,55 +140,41 @@ void SoutDialog::closeTab()
void SoutDialog::addDest( ) void SoutDialog::addDest( )
{ {
int index; VirtualDestBox *db;
QString caption;
switch( ui.destBox->currentIndex() ) switch( ui.destBox->currentIndex() )
{ {
case 0: case 0:
{ db = new FileDestBox( this );
FileDestBox *fdb = new FileDestBox( this ); caption = qtr( "File" );
index = ui.destTab->addTab( fdb, qtr( "File" ) );
CONNECT( fdb, mrlUpdated(), this, updateMRL() );
}
break; break;
case 1: case 1:
{ db = new HTTPDestBox( this );
HTTPDestBox *hdb = new HTTPDestBox( this ); caption = qfu( "HTTP" );
index = ui.destTab->addTab( hdb, "HTTP" );
CONNECT( hdb, mrlUpdated(), this, updateMRL() );
}
break; break;
case 2: case 2:
{ db = new MMSHDestBox( this );
MMSHDestBox *mdb = new MMSHDestBox( this ); caption = qfu( "WMSP" );
index = ui.destTab->addTab( mdb, "WMSP" );
CONNECT( mdb, mrlUpdated(), this, updateMRL() );
}
break; break;
case 3: case 3:
{ db = new RTPDestBox( this );
RTPDestBox *rdb = new RTPDestBox( this ); caption = "RTP/TS";
index = ui.destTab->addTab( rdb, "RTP/TS" );
CONNECT( rdb, mrlUpdated(), this, updateMRL() );
}
break; break;
case 4: case 4:
{ db = new UDPDestBox( this );
UDPDestBox *udb = new UDPDestBox( this ); caption = "UDP";
index = ui.destTab->addTab( udb, "UDP" );
CONNECT( udb, mrlUpdated(), this, updateMRL() );
}
break; break;
case 5: case 5:
{ db = new ICEDestBox( this );
ICEDestBox *idb = new ICEDestBox( this ); caption = "Icecast";
index = ui.destTab->addTab( idb, "Icecast" );
CONNECT( idb, mrlUpdated(), this, updateMRL() );
}
break; break;
default: default:
assert(0); assert(0);
} }
int index = ui.destTab->addTab( db, caption );
CONNECT( db, mrlUpdated(), this, updateMRL() );
ui.destTab->setCurrentIndex( index ); ui.destTab->setCurrentIndex( index );
updateMRL(); updateMRL();
} }
......
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