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
0cb02de2
Commit
0cb02de2
authored
Feb 19, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebView GUI window and core bridge connection established
parent
03fe344b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
5 deletions
+43
-5
SkyliveX.js
gui/SkyliveX.js
+6
-0
splash.html
gui/splash.html
+2
-1
skproto.cpp
plugins/skproto.cpp
+1
-1
mainwin.cpp
src/mainwin.cpp
+10
-0
mainwin.h
src/mainwin.h
+20
-0
skylivex.pro
src/skylivex.pro
+4
-3
No files found.
gui/SkyliveX.js
0 → 100644
View file @
0cb02de2
function
changeContent
(
id
,
content
)
{
document
.
getElementById
(
id
).
innerHTML
=
content
;
}
SkyliveX
.
changeContent
.
connect
(
changeContent
);
gui/splash.html
View file @
0cb02de2
<html>
<head>
<title>
SkyliveX
</title>
<script
type=
"text/javascript"
src=
"SkyliveX.js"
></script>
<style>
#loading
{
color
:
#ff0000
;
...
...
@@ -10,7 +11,7 @@
<body>
<div
id=
"loading"
>
<img
src=
"img/logo.png"
></img>
<h3>
Loading...
</h3>
<h3
id=
"loadstring"
>
Loading...
</h3>
</div>
</body>
</html>
plugins/skproto.cpp
View file @
0cb02de2
...
...
@@ -53,7 +53,7 @@ void SkyliveProtocol::readFromNetwork()
while
(
tcpSocket
->
bytesAvailable
())
{
tcpSocket
->
read
(
buffer
,
50
);
std
::
cout
<<
"Received From Skylive Server"
<<
buffer
<<
std
::
endl
;
std
::
cout
<<
"Received From Skylive Server
:
"
<<
buffer
<<
std
::
endl
;
}
}
...
...
src/mainwin.cpp
View file @
0cb02de2
...
...
@@ -34,6 +34,7 @@
*/
#include "mainwin.h"
#include <QWebView>
#include <QWebFrame>
#include <QFile>
#include <QDir>
#include <QString>
...
...
@@ -59,6 +60,8 @@ MainWin::MainWin(QFile &htmlfile)
setHtml
(
htmlFileName
,
baseUrl
);
resize
(
250
,
200
);
page
()
->
mainFrame
()
->
addToJavaScriptWindowObject
(
"SkyliveX"
,
&
jsbridge
);
registerHandler
((
QString
)
"coreStarted"
,
&
MainWin
::
handle_corestarted
);
}
...
...
@@ -95,4 +98,11 @@ void MainWin::handle_corestarted(SKMessage::SKMessage &msg)
{
msg
.
handle
=
"connectTelescopes"
;
sendMessage
(
msg
);
jsbridge
.
changePageContent
(
"loadstring"
,
"Connecting..."
);
}
void
JSBridge
::
changePageContent
(
QString
elementid
,
QString
content
)
{
emit
changeContent
(
elementid
,
content
);
}
src/mainwin.h
View file @
0cb02de2
...
...
@@ -48,6 +48,25 @@ class MainWin; // forward declaration for typedef
// This is for member pointers to map messages
typedef
void
(
MainWin
::*
SKHandlerFunction
)(
SKMessage
::
SKMessage
&
);
/*
* class JSBridge
* This class connect the javascript object SkyliveX
* to c++
*/
class
JSBridge
:
public
QObject
{
Q_OBJECT
public
:
void
changePageContent
(
QString
elementid
,
QString
content
);
signals
:
void
changeContent
(
QString
elementid
,
QString
content
);
};
/*
* class MainWin
* This is just a little webkit transparent window
...
...
@@ -61,6 +80,7 @@ class MainWin : public QWebView
QUrl
baseurl
;
QFile
htmlfile
;
QString
htmlFileName
;
JSBridge
jsbridge
;
private
:
QHash
<
QString
,
SKHandlerFunction
>
_handlers
;
...
...
src/skylivex.pro
View file @
0cb02de2
...
...
@@ -10,7 +10,8 @@ HEADERS = skylivex.h \
QT
+=
core
network
webkitwidgets
widgets
OTHER_FILES
+=
\
..
/
gui
/
splash
.
html
\
..
/
gui
/
img
/
logo
.
png
OTHER_FILES
+=
..
/
gui
/
\
..
/
gui
/*
.js \
../gui
/*
.html \
../gui/img
/*
DESTDIR = ../build/
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