Commit 43925afd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt: remove port from open network tab

parent 4e357385
...@@ -494,7 +494,6 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -494,7 +494,6 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* CONNECTs */ /* CONNECTs */
CONNECT( ui.protocolCombo, activated( int ), CONNECT( ui.protocolCombo, activated( int ),
this, updateProtocol( int ) ); this, updateProtocol( int ) );
CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
CONNECT( ui.addressText, textChanged( const QString& ), this, updateMRL()); CONNECT( ui.addressText, textChanged( const QString& ), this, updateMRL());
ui.protocolCombo->addItem( "" ); ui.protocolCombo->addItem( "" );
...@@ -542,9 +541,6 @@ void NetOpenPanel::updateProtocol( int idx_proto ) { ...@@ -542,9 +541,6 @@ void NetOpenPanel::updateProtocol( int idx_proto ) {
QString addr = ui.addressText->text(); QString addr = ui.addressText->text();
QString proto = ui.protocolCombo->itemData( idx_proto ).toString(); QString proto = ui.protocolCombo->itemData( idx_proto ).toString();
ui.portSpin->setEnabled( idx_proto == UDP_PROTO ||
idx_proto == RTP_PROTO );
if( idx_proto == NO_PROTO ) return; if( idx_proto == NO_PROTO ) return;
/* If we already have a protocol in the address, replace it */ /* If we already have a protocol in the address, replace it */
...@@ -602,35 +598,7 @@ void NetOpenPanel::updateMRL() { ...@@ -602,35 +598,7 @@ void NetOpenPanel::updateMRL() {
case UDP_PROTO: case UDP_PROTO:
mrl = qfu(((idx_proto == RTP_PROTO) ? "rtp" : "udp")); mrl = qfu(((idx_proto == RTP_PROTO) ? "rtp" : "udp"));
mrl += qfu( "://" ); mrl += qfu( "://" );
if( addr[0] == ':' ) /* Port number without address */
mrl += addr;
else
{
if( !addr.contains( "@" ) )
mrl += qfu( "@" );
switch( addr.count( ":" ) )
{
case 0: /* DNS or IPv4 literal, no port number */
mrl += addr;
mrl += QString(":%1").arg( ui.portSpin->value() );
break;
case 1: /* DNS or IPv4 literal plus port number */
mrl += addr;
break;
default: /* IPv6 literal */
if( !addr.contains( "]:" ) )
{
if( addr[0] != '[' ) /* Missing brackets */
mrl += qfu( "[" ) + addr + qfu( "]" );
else
mrl += addr;
mrl += QString(":%1").arg( ui.portSpin->value() );
}
else /* Brackets present, port present */
mrl += addr; mrl += addr;
break;
}
}
emit methodChanged(idx_proto == RTP_PROTO emit methodChanged(idx_proto == RTP_PROTO
? "rtp-caching" : "udp-caching"); ? "rtp-caching" : "udp-caching");
break; break;
......
...@@ -37,22 +37,6 @@ ...@@ -37,22 +37,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2" >
<widget class="QSpinBox" name="portSpin" >
<property name="toolTip" >
<string>Select the port used</string>
</property>
<property name="accelerated" >
<bool>true</bool>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>1234</number>
</property>
</widget>
</item>
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2" >
<property name="sizePolicy" > <property name="sizePolicy" >
...@@ -69,16 +53,6 @@ ...@@ -69,16 +53,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Port</string>
</property>
<property name="buddy" >
<cstring>portSpin</cstring>
</property>
</widget>
</item>
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QLineEdit" name="addressText" > <widget class="QLineEdit" name="addressText" >
<property name="toolTip" > <property name="toolTip" >
...@@ -110,7 +84,6 @@ ...@@ -110,7 +84,6 @@
<tabstops> <tabstops>
<tabstop>protocolCombo</tabstop> <tabstop>protocolCombo</tabstop>
<tabstop>addressText</tabstop> <tabstop>addressText</tabstop>
<tabstop>portSpin</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>
......
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