Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
16bf241c
Commit
16bf241c
authored
Jun 24, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix network panel behaviour (comboBox and adress generation especially )
parent
d79d5b33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
21 deletions
+45
-21
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.cpp
+32
-21
modules/gui/qt4/components/open_panels.hpp
modules/gui/qt4/components/open_panels.hpp
+13
-0
No files found.
modules/gui/qt4/components/open_panels.cpp
View file @
16bf241c
...
@@ -410,13 +410,14 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
...
@@ -410,13 +410,14 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
/* CONNECTs */
/* CONNECTs */
CONNECT
(
ui
.
protocolCombo
,
currentIndexChang
ed
(
int
),
CONNECT
(
ui
.
protocolCombo
,
activat
ed
(
int
),
this
,
updateProtocol
(
int
)
);
this
,
updateProtocol
(
int
)
);
CONNECT
(
ui
.
portSpin
,
valueChanged
(
int
),
this
,
updateMRL
()
);
CONNECT
(
ui
.
portSpin
,
valueChanged
(
int
),
this
,
updateMRL
()
);
CONNECT
(
ui
.
addressText
,
textChanged
(
QString
),
this
,
updateMRL
());
CONNECT
(
ui
.
addressText
,
textChanged
(
QString
),
this
,
updateMRL
());
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
(
""
);
ui
.
protocolCombo
->
addItem
(
"HTTP"
,
QVariant
(
"http"
));
ui
.
protocolCombo
->
addItem
(
"HTTP"
,
QVariant
(
"http"
));
ui
.
protocolCombo
->
addItem
(
"HTTPS"
,
QVariant
(
"https"
));
ui
.
protocolCombo
->
addItem
(
"HTTPS"
,
QVariant
(
"https"
));
ui
.
protocolCombo
->
addItem
(
"FTP"
,
QVariant
(
"ftp"
));
ui
.
protocolCombo
->
addItem
(
"FTP"
,
QVariant
(
"ftp"
));
...
@@ -433,19 +434,24 @@ void NetOpenPanel::clear()
...
@@ -433,19 +434,24 @@ void NetOpenPanel::clear()
{}
{}
/* update the widgets according the type of protocol */
/* update the widgets according the type of protocol */
void
NetOpenPanel
::
updateProtocol
(
int
idx
)
{
void
NetOpenPanel
::
updateProtocol
(
int
idx
_proto
)
{
QString
addr
=
ui
.
addressText
->
text
();
QString
addr
=
ui
.
addressText
->
text
();
QString
proto
=
ui
.
protocolCombo
->
itemData
(
idx
).
toString
();
QString
proto
=
ui
.
protocolCombo
->
itemData
(
idx
_proto
).
toString
();
ui
.
timeShift
->
setEnabled
(
idx
>=
5
);
ui
.
timeShift
->
setEnabled
(
idx_proto
>=
UDP_PROTO
);
ui
.
ipv6
->
setEnabled
(
idx
==
5
);
ui
.
ipv6
->
setEnabled
(
idx_proto
==
UDP_PROTO
);
ui
.
addressText
->
setEnabled
(
idx
!=
5
);
ui
.
addressText
->
setEnabled
(
idx_proto
!=
UDP_PROTO
);
ui
.
portSpin
->
setEnabled
(
idx
>=
5
);
ui
.
portSpin
->
setEnabled
(
idx_proto
>=
UDP_PROTO
);
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 */
if
(
addr
.
contains
(
"://"
))
{
if
(
addr
.
contains
(
"://"
))
msg_Err
(
p_intf
,
"replace"
);
{
addr
.
replace
(
QRegExp
(
"^.*://"
),
proto
+
"://"
);
if
(
idx_proto
!=
UDPM_PROTO
)
addr
.
replace
(
QRegExp
(
"^.*://@*"
),
proto
+
"://"
);
else
addr
.
replace
(
QRegExp
(
"^.*://"
),
proto
+
"://@"
);
ui
.
addressText
->
setText
(
addr
);
ui
.
addressText
->
setText
(
addr
);
}
}
updateMRL
();
updateMRL
();
...
@@ -455,36 +461,41 @@ void NetOpenPanel::updateMRL() {
...
@@ -455,36 +461,41 @@ void NetOpenPanel::updateMRL() {
QString
mrl
=
""
;
QString
mrl
=
""
;
QString
addr
=
ui
.
addressText
->
text
();
QString
addr
=
ui
.
addressText
->
text
();
addr
=
QUrl
::
toPercentEncoding
(
addr
,
":/?#@!$&'()*+,;="
);
addr
=
QUrl
::
toPercentEncoding
(
addr
,
":/?#@!$&'()*+,;="
);
int
proto
=
ui
.
protocolCombo
->
currentIndex
();
int
idx_
proto
=
ui
.
protocolCombo
->
currentIndex
();
if
(
addr
.
contains
(
"://"
)
&&
(
proto
!=
5
||
proto
!=
6
)
)
if
(
addr
.
contains
(
"://"
))
{
{
/* Match the correct item in the comboBox */
ui
.
protocolCombo
->
setCurrentIndex
(
ui
.
protocolCombo
->
findData
(
addr
.
section
(
':'
,
0
,
0
)
)
);
if
(
idx_proto
!=
UDP_PROTO
||
idx_proto
!=
UDPM_PROTO
)
mrl
=
addr
;
mrl
=
addr
;
}
}
else
else
{
{
switch
(
proto
)
{
switch
(
idx_
proto
)
{
case
0
:
case
HTTP_PROTO
:
mrl
=
"http://"
+
addr
;
mrl
=
"http://"
+
addr
;
emit
methodChanged
(
"http-caching"
);
emit
methodChanged
(
"http-caching"
);
break
;
break
;
case
1
:
case
HTTPS_PROTO
:
mrl
=
"https://"
+
addr
;
mrl
=
"https://"
+
addr
;
emit
methodChanged
(
"http-caching"
);
emit
methodChanged
(
"http-caching"
);
break
;
break
;
case
3
:
case
MMS_PROTO
:
mrl
=
"mms://"
+
addr
;
mrl
=
"mms://"
+
addr
;
emit
methodChanged
(
"mms-caching"
);
emit
methodChanged
(
"mms-caching"
);
break
;
break
;
case
2
:
case
FTP_PROTO
:
mrl
=
"ftp://"
+
addr
;
mrl
=
"ftp://"
+
addr
;
emit
methodChanged
(
"ftp-caching"
);
emit
methodChanged
(
"ftp-caching"
);
break
;
break
;
case
4
:
/* RTSP */
case
RTSP_PROTO
:
mrl
=
"rtsp://"
+
addr
;
mrl
=
"rtsp://"
+
addr
;
emit
methodChanged
(
"rtsp-caching"
);
emit
methodChanged
(
"rtsp-caching"
);
break
;
break
;
case
5
:
case
UDP_PROTO
:
mrl
=
"udp://@"
;
mrl
=
"udp://@"
;
if
(
ui
.
ipv6
->
isEnabled
()
&&
ui
.
ipv6
->
isChecked
()
)
if
(
ui
.
ipv6
->
isEnabled
()
&&
ui
.
ipv6
->
isChecked
()
)
{
{
...
@@ -493,7 +504,7 @@ void NetOpenPanel::updateMRL() {
...
@@ -493,7 +504,7 @@ void NetOpenPanel::updateMRL() {
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
emit
methodChanged
(
"udp-caching"
);
emit
methodChanged
(
"udp-caching"
);
break
;
break
;
case
6
:
/* UDP multicast */
case
UDPM_PROTO
:
/* UDP multicast */
mrl
=
"udp://@"
;
mrl
=
"udp://@"
;
/* Add [] to IPv6 */
/* Add [] to IPv6 */
if
(
addr
.
contains
(
':'
)
&&
!
addr
.
contains
(
'['
)
)
if
(
addr
.
contains
(
':'
)
&&
!
addr
.
contains
(
'['
)
)
...
...
modules/gui/qt4/components/open_panels.hpp
View file @
16bf241c
...
@@ -48,6 +48,19 @@
...
@@ -48,6 +48,19 @@
#define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
#define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
spinbox->setAccelerated( true ); }
spinbox->setAccelerated( true ); }
enum
{
NO_PROTO
,
HTTP_PROTO
,
HTTPS_PROTO
,
MMS_PROTO
,
FTP_PROTO
,
RTSP_PROTO
,
UDP_PROTO
,
UDPM_PROTO
};
enum
enum
{
{
V4L_DEVICE
,
V4L_DEVICE
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment