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
7ae6290e
Commit
7ae6290e
authored
Feb 28, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fucking stupid osx...
parent
17e1d439
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
39 deletions
+46
-39
mainwin.cpp
src/mainwin.cpp
+0
-20
mainwin.h
src/mainwin.h
+0
-19
webwin.cpp
src/webwin.cpp
+29
-0
webwin.h
src/webwin.h
+17
-0
No files found.
src/mainwin.cpp
View file @
7ae6290e
...
...
@@ -48,26 +48,6 @@
#define SENDER "maingui"
#if defined(Q_OS_MAC)
#include <QWebPage>
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
QWebPageForMac
::
QWebPageForMac
(
WebWin
*
&
win
)
:
QWebPage
(
win
)
{
}
QString
QWebPageForMac
::
userAgentForUrl
(
const
QUrl
&
url
)
const
{
return
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) skylivex Safari/537.21"
;
}
#endif
MainWin
::
MainWin
(
QString
&
htmlfile
)
:
SkylivexWin
(
htmlfile
)
{
...
...
src/mainwin.h
View file @
7ae6290e
...
...
@@ -44,25 +44,6 @@
#include "webwin.h"
#include "jsbridge.h"
#if defined(Q_OS_MAC)
#include <QWebPage>
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
class
QWebPageForMac
:
public
QWebPage
{
Q_OBJECT
public
:
QWebPageForMac
(
WebWin
*
&
win
);
QString
userAgentForUrl
(
const
QUrl
&
url
)
const
;
};
#endif
/*
* class MainWin
* This is just a little webkit transparent window
...
...
src/webwin.cpp
View file @
7ae6290e
...
...
@@ -50,6 +50,26 @@
#define SENDER "webwin"
#if defined(Q_OS_MAC)
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
QWebPageForMac
::
QWebPageForMac
(
WebWin
*
&
win
)
:
QWebPage
(
win
)
{
}
QString
QWebPageForMac
::
userAgentForUrl
(
const
QUrl
&
url
)
const
{
return
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) skylivex Safari/537.21"
;
}
#endif
WebWin
::
WebWin
(
QString
&
htmlfile
)
:
QWebView
(
0
)
{
...
...
@@ -100,7 +120,12 @@ void WebWin::closeEvent(QCloseEvent *event)
QWebView
*
WebWin
::
createWindow
(
QWebPage
::
WebWindowType
type
)
{
WebWin
*
wv
=
new
WebWin
;
#if defined(Q_OS_MAC)
QWebPageForMac
*
newWeb
=
new
QWebPageForMac
(
wv
);
#else
QWebPage
*
newWeb
=
new
QWebPage
(
wv
);
#endif
wv
->
setPage
(
newWeb
);
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
if
(
type
==
QWebPage
::
WebModalDialog
)
...
...
@@ -254,7 +279,11 @@ SkylivexWin::SkylivexWin()
SkylivexWin
*
SkylivexWin
::
createSkyliveWindow
(
QString
url
,
QWebPage
::
WebWindowType
type
)
{
SkylivexWin
*
wv
=
new
SkylivexWin
;
//#if defined(Q_OS_MAC)
//QWebPageForMac *newWeb = new QWebPageForMac(wv);
//#else
QWebPage
*
newWeb
=
new
QWebPage
(
wv
);
//#endif
wv
->
jsbridge
=
new
JSBridge
();
wv
->
jsbridge
->
wwin
=
qobject_cast
<
SkylivexWin
*>
(
wv
);
newWeb
->
mainFrame
()
->
addToJavaScriptWindowObject
(
"SkyliveX"
,
wv
->
jsbridge
);
...
...
src/webwin.h
View file @
7ae6290e
...
...
@@ -52,6 +52,23 @@ typedef void (WebWin::*SKHandlerFunction)(SKMessage&);
//typedef int (WebWin::*SKHandlerFunction)(SKMessage&);
#if defined(Q_OS_MAC)
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
class
QWebPageForMac
:
public
QWebPage
{
Q_OBJECT
public
:
QWebPageForMac
(
WebWin
*
&
win
);
QString
userAgentForUrl
(
const
QUrl
&
url
)
const
;
};
#endif
/*
* class WebWin
* This is just a little webkit transparent window
...
...
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