Commit 000f1e1f authored by Laurent Aimar's avatar Laurent Aimar

Fixed open network panel.

parent a15af1b9
...@@ -417,15 +417,21 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -417,15 +417,21 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
CONNECT( ui.timeShift, clicked(), this, updateMRL()); CONNECT( ui.timeShift, clicked(), this, updateMRL());
CONNECT( ui.ipv6, clicked(), this, updateMRL()); CONNECT( ui.ipv6, clicked(), this, updateMRL());
ui.protocolCombo->addItem( "" ); typedef QPair<QString,QString> QPairString;
ui.protocolCombo->addItem("HTTP", QVariant("http")); QMap<int, QPairString> protocols;
ui.protocolCombo->addItem("HTTPS", QVariant("https")); #define P(value,name,dsc) do { protocols[value] = QPairString( QString(dsc), QString(name) );} while(0)
ui.protocolCombo->addItem("FTP", QVariant("ftp")); P( NO_PROTO, "", "" );
ui.protocolCombo->addItem("MMS", QVariant("mms")); P( UDPM_PROTO, "udp", "UDP/RTP (multicast)" );
ui.protocolCombo->addItem("RTSP", QVariant("rtsp")); P( HTTP_PROTO, "http", "HTTP" );
ui.protocolCombo->addItem("UDP/RTP (unicast)", QVariant("udp")); P( HTTPS_PROTO, "https", "HTTPS" );
ui.protocolCombo->addItem("UDP/RTP (multicast)", QVariant("udp")); P( MMS_PROTO, "mms", "MMS" );
ui.protocolCombo->addItem("RTMP", QVariant("rtmp")); P( FTP_PROTO, "ftp", "FTP" );
P( RTSP_PROTO, "rtsp", "RTSP" );
P( UDP_PROTO, "udp", "UDP/RTP (unicast)" );
P( RTMP_PROTO, "rtmp", "RTMP" );
#undef P
foreach( QPairString e, protocols ) /* Sorted by key, exactly what we need */
ui.protocolCombo->addItem( e.first, QVariant(e.second.isEmpty() ) );
} }
NetOpenPanel::~NetOpenPanel() NetOpenPanel::~NetOpenPanel()
...@@ -517,6 +523,7 @@ void NetOpenPanel::updateMRL() { ...@@ -517,6 +523,7 @@ void NetOpenPanel::updateMRL() {
else mrl += addr; else mrl += addr;
mrl += QString(":%1").arg( ui.portSpin->value() ); mrl += QString(":%1").arg( ui.portSpin->value() );
emit methodChanged("udp-caching"); emit methodChanged("udp-caching");
break;
case RTMP_PROTO: case RTMP_PROTO:
mrl = "rtmp://" + addr; mrl = "rtmp://" + addr;
emit methodChanged("rtmp-caching"); emit methodChanged("rtmp-caching");
......
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