Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
3d27a5e1
Commit
3d27a5e1
authored
12 years ago
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added open url
parent
a595120e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
skproto.cpp
plugins/skproto.cpp
+17
-0
mainwin.cpp
src/mainwin.cpp
+22
-0
mainwin.h
src/mainwin.h
+1
-0
webwin.cpp
src/webwin.cpp
+0
-1
No files found.
plugins/skproto.cpp
View file @
3d27a5e1
...
...
@@ -206,6 +206,23 @@ void SkyliveProtocol::processPackets()
}
}
}
else
if
(
pkt
.
cmd
==
"OPENYOUTUBE"
)
{
QList
<
QString
>
paramlist
=
pkt
.
params
.
split
(
PARAM_SEPARATOR
);
if
(
paramlist
.
size
()
==
3
)
{
//SKMessage mmsg("youtubevideo");
//QString yt("http://youtube.googleapis.com/v/");
SKMessage
mmsg
(
"openurl"
);
QString
yt
(
"http://www.youtube.com/embed/"
);
yt
.
append
(
paramlist
[
0
]);
yt
.
append
(
"?html5=1&autoplay=1&start="
);
yt
.
append
(
paramlist
[
1
]);
mmsg
.
parameters
.
insert
(
"url"
,
yt
);
//mmsg.parameters.insert("volume", paramlist[2]);
sendMessage
(
mmsg
);
}
}
else
{
std
::
cout
<<
"Unknown command from server"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/mainwin.cpp
View file @
3d27a5e1
...
...
@@ -57,6 +57,7 @@ MainWin::MainWin(QString &htmlfile)
registerHandler
((
QString
)
"loginok"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
registerHandler
((
QString
)
"loginfailed"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
registerHandler
((
QString
)
"openurl"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_openurl
);
msgsender
=
SENDER
;
...
...
@@ -106,3 +107,24 @@ void MainWin::handle_loginres(SKMessage &msg)
}
}
void
MainWin
::
handle_openurl
(
SKMessage
&
msg
)
{
if
(
msg
.
handle
==
"openurl"
)
{
if
(
msg
.
parameters
.
contains
(
"url"
))
{
std
::
cout
<<
"OPEN URL "
<<
msg
.
parameters
[
"url"
].
toStdString
()
<<
std
::
endl
;
//if(msg.parameters.contains("width")
//if(msg.parameters.contains("height);
WebWin
*
wv
=
new
WebWin
;
QWebPage
*
newWeb
=
new
QWebPage
(
wv
);
wv
->
setPage
(
newWeb
);
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
wv
->
setUrl
(
QUrl
(
msg
.
parameters
[
"url"
]));
wv
->
show
();
}
}
}
This diff is collapsed.
Click to expand it.
src/mainwin.h
View file @
3d27a5e1
...
...
@@ -62,6 +62,7 @@ class MainWin : public SkylivexWin
void
handle_connected
(
SKMessage
&
msg
);
void
handle_asklogin
(
SKMessage
&
msg
);
void
handle_loginres
(
SKMessage
&
msg
);
void
handle_openurl
(
SKMessage
&
msg
);
};
...
...
This diff is collapsed.
Click to expand it.
src/webwin.cpp
View file @
3d27a5e1
...
...
@@ -241,7 +241,6 @@ SkylivexWin::SkylivexWin()
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
}
SkylivexWin
*
SkylivexWin
::
createSkyliveWindow
(
QString
url
,
QWebPage
::
WebWindowType
type
)
...
...
This diff is collapsed.
Click to expand it.
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