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
d1b20502
Commit
d1b20502
authored
Feb 27, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally, multiple window message are working
parent
620e5057
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
9 deletions
+40
-9
skylivex.pro.user
skylivex.pro.user
+1
-1
ipcmsg.cpp
src/ipcmsg.cpp
+9
-0
ipcmsg.h
src/ipcmsg.h
+6
-0
main.cpp
src/main.cpp
+2
-2
skylivex.cpp
src/skylivex.cpp
+10
-4
skylivex.h
src/skylivex.h
+2
-2
webwin.cpp
src/webwin.cpp
+10
-0
No files found.
skylivex.pro.user
View file @
d1b20502
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.6.1, 2013-02-2
4T21:44:10
. -->
<!-- Written by Qt Creator 2.6.1, 2013-02-2
7T02:00:05
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
ProjectExplorer.Project.ActiveTarget
</variable>
<variable>
ProjectExplorer.Project.ActiveTarget
</variable>
...
...
src/ipcmsg.cpp
View file @
d1b20502
...
@@ -91,3 +91,12 @@ SKMessage::SKMessage(const SKMessage &other)
...
@@ -91,3 +91,12 @@ SKMessage::SKMessage(const SKMessage &other)
time
=
other
.
time
;
time
=
other
.
time
;
}
}
SKMessage
::
SKMessage
(
QString
h
,
SkylivexWin
*
win
)
{
sender
=
QString
(
"unknown"
);
handle
=
h
;
webwin
=
win
;
time
=
QTime
::
currentTime
();
}
src/ipcmsg.h
View file @
d1b20502
...
@@ -40,6 +40,10 @@
...
@@ -40,6 +40,10 @@
#include <QHash>
#include <QHash>
#include <QString>
#include <QString>
// Forward declarations
class
SkylivexWin
;
/*
/*
* SKMessage
* SKMessage
* An object representing an IPC message
* An object representing an IPC message
...
@@ -56,12 +60,14 @@ class SKMessage
...
@@ -56,12 +60,14 @@ class SKMessage
QTime
time
;
QTime
time
;
QString
sender
;
QString
sender
;
QString
handle
;
QString
handle
;
SkylivexWin
*
webwin
;
QHash
<
QString
,
QString
>
parameters
;
QHash
<
QString
,
QString
>
parameters
;
SKMessage
(
QString
s
,
QString
h
,
QHash
<
QString
,
QString
>
p
);
SKMessage
(
QString
s
,
QString
h
,
QHash
<
QString
,
QString
>
p
);
SKMessage
(
QString
h
,
QHash
<
QString
,
QString
>
p
);
SKMessage
(
QString
h
,
QHash
<
QString
,
QString
>
p
);
SKMessage
(
QString
s
,
QString
h
);
SKMessage
(
QString
s
,
QString
h
);
SKMessage
(
QString
h
);
SKMessage
(
QString
h
);
SKMessage
(
QString
h
,
SkylivexWin
*
win
);
};
};
...
...
src/main.cpp
View file @
d1b20502
...
@@ -73,8 +73,8 @@ int main(int argc, char *argv[])
...
@@ -73,8 +73,8 @@ int main(int argc, char *argv[])
QTimer
::
singleShot
(
0
,
skx
,
SLOT
(
initialize
()));
QTimer
::
singleShot
(
0
,
skx
,
SLOT
(
initialize
()));
// connect core with the mainwin
// connect core with the mainwin
QObject
::
connect
(
skx
,
SIGNAL
(
msgFor
MainWin
(
SKMessage
&
)),
&
mainw
,
SLOT
(
msgFromCore
(
SKMessage
&
)));
QObject
::
connect
(
skx
,
SIGNAL
(
msgFor
Gui
(
SKMessage
&
)),
&
mainw
,
SLOT
(
msgFromCore
(
SKMessage
&
)));
QObject
::
connect
(
&
mainw
,
SIGNAL
(
putMessage
(
SKMessage
&
)),
skx
,
SLOT
(
receiveFrom
MainWin
(
SKMessage
&
)));
QObject
::
connect
(
&
mainw
,
SIGNAL
(
putMessage
(
SKMessage
&
)),
skx
,
SLOT
(
receiveFrom
Gui
(
SKMessage
&
)));
// and then.. go!
// and then.. go!
return
skylivexapp
.
exec
();
return
skylivexapp
.
exec
();
...
...
src/skylivex.cpp
View file @
d1b20502
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include "skylivex.h"
#include "skylivex.h"
#include "pluginsinterfaces.h"
#include "pluginsinterfaces.h"
#include <iostream>
#include <iostream>
#include "webwin.h"
#include "ipcmsg.h"
#include "ipcmsg.h"
Q_DECLARE_METATYPE
(
SKMessage
)
Q_DECLARE_METATYPE
(
SKMessage
)
...
@@ -120,15 +121,20 @@ void SkyliveX::initializePlugin(QObject *plugin, QString filename)
...
@@ -120,15 +121,20 @@ void SkyliveX::initializePlugin(QObject *plugin, QString filename)
void
SkyliveX
::
sendMessage
(
SKMessage
&
msg
)
void
SkyliveX
::
sendMessage
(
SKMessage
&
msg
)
{
{
//std::cout << "Send To MainWin: " << msg << std::endl;
emit
msgForGui
(
msg
);
emit
msgForMainWin
(
msg
);
emit
msgForPlugins
(
msg
);
emit
msgForPlugins
(
msg
);
}
}
void
SkyliveX
::
receiveFrom
MainWin
(
SKMessage
&
msg
)
void
SkyliveX
::
receiveFrom
Gui
(
SKMessage
&
msg
)
{
{
std
::
cout
<<
"received from MainWin "
<<
msg
.
handle
.
toStdString
()
<<
std
::
endl
;
std
::
cout
<<
"received from Gui "
<<
msg
.
handle
.
toStdString
()
<<
std
::
endl
;
if
(
msg
.
handle
==
"newwindow"
)
{
std
::
cout
<<
"Connecting new window signals/slots"
<<
std
::
endl
;
connect
(
msg
.
webwin
,
SIGNAL
(
putMessage
(
SKMessage
&
)),
this
,
SLOT
(
receiveFromGui
(
SKMessage
&
)));
connect
(
this
,
SIGNAL
(
msgForGui
(
SKMessage
&
)),
msg
.
webwin
,
SLOT
(
msgFromCore
(
SKMessage
&
)));
}
emit
msgForPlugins
(
msg
);
emit
msgForPlugins
(
msg
);
}
}
...
...
src/skylivex.h
View file @
d1b20502
...
@@ -66,13 +66,13 @@ class SkyliveX : public QObject
...
@@ -66,13 +66,13 @@ class SkyliveX : public QObject
public
slots
:
public
slots
:
void
initialize
();
void
initialize
();
void
receiveFrom
MainWin
(
SKMessage
&
msg
);
void
receiveFrom
Gui
(
SKMessage
&
msg
);
void
receiveFromPlugins
(
SKMessage
msg
);
void
receiveFromPlugins
(
SKMessage
msg
);
signals
:
signals
:
void
finished
();
void
finished
();
void
kickPlugins
();
void
kickPlugins
();
void
msgFor
MainWin
(
SKMessage
&
msg
);
void
msgFor
Gui
(
SKMessage
&
msg
);
void
msgForPlugins
(
SKMessage
msg
);
void
msgForPlugins
(
SKMessage
msg
);
};
};
...
...
src/webwin.cpp
View file @
d1b20502
...
@@ -97,6 +97,11 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
...
@@ -97,6 +97,11 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
if
(
type
==
QWebPage
::
WebModalDialog
)
if
(
type
==
QWebPage
::
WebModalDialog
)
wv
->
setWindowModality
(
Qt
::
ApplicationModal
);
wv
->
setWindowModality
(
Qt
::
ApplicationModal
);
SKMessage
msg
(
"newwindow"
,
qobject_cast
<
SkylivexWin
*>
(
wv
));
sendMessage
(
msg
);
wv
->
show
();
wv
->
show
();
return
wv
;
return
wv
;
}
}
...
@@ -261,7 +266,12 @@ SkylivexWin* SkylivexWin::createSkyliveWindow(QString url, QWebPage::WebWindowTy
...
@@ -261,7 +266,12 @@ SkylivexWin* SkylivexWin::createSkyliveWindow(QString url, QWebPage::WebWindowTy
std
::
cout
<<
"transform uri in local file "
<<
url
.
toStdString
()
<<
std
::
endl
;
std
::
cout
<<
"transform uri in local file "
<<
url
.
toStdString
()
<<
std
::
endl
;
}
}
wv
->
setUrl
(
QUrl
(
url
));
wv
->
setUrl
(
QUrl
(
url
));
SKMessage
msg
(
"newwindow"
,
qobject_cast
<
SkylivexWin
*>
(
wv
));
sendMessage
(
msg
);
wv
->
show
();
wv
->
show
();
return
wv
;
return
wv
;
}
}
...
...
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