Commit d2c02161 authored by Anton Gladky's avatar Anton Gladky
Browse files

Partly fix webpage help show. LP:1598174

parent e68407dd
...@@ -13,6 +13,7 @@ from PyQt5 import QtCore ...@@ -13,6 +13,7 @@ from PyQt5 import QtCore
from PyQt5 import QtGui from PyQt5 import QtGui
from PyQt5.QtCore import * from PyQt5.QtCore import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
from PyQt5 import QtWebKit, QtWebKitWidgets
from yade.qt.ui_controller import Ui_Controller from yade.qt.ui_controller import Ui_Controller
...@@ -28,7 +29,6 @@ webWindows=[] ...@@ -28,7 +29,6 @@ webWindows=[]
sphinxOnlineDocPath='https://www.yade-dem.org/doc/' sphinxOnlineDocPath='https://www.yade-dem.org/doc/'
"Base URL for the documentation. Packaged versions should change to the local installation directory." "Base URL for the documentation. Packaged versions should change to the local installation directory."
import os.path import os.path
# find if we have docs installed locally from package # find if we have docs installed locally from package
sphinxLocalDocPath=yade.config.prefix+'/share/doc/yade'+yade.config.suffix+'-doc/html/' sphinxLocalDocPath=yade.config.prefix+'/share/doc/yade'+yade.config.suffix+'-doc/html/'
...@@ -42,11 +42,7 @@ else: sphinxPrefix=sphinxOnlineDocPath ...@@ -42,11 +42,7 @@ else: sphinxPrefix=sphinxOnlineDocPath
sphinxDocWrapperPage=sphinxPrefix+'/yade.wrapper.html' sphinxDocWrapperPage=sphinxPrefix+'/yade.wrapper.html'
def openUrl(url): def openUrl(url):
from PyQt5 import QtWebKit
global maxWebWindows,webWindows global maxWebWindows,webWindows
reuseLast=False reuseLast=False
# use the last window if the class is the same and only the attribute differs # use the last window if the class is the same and only the attribute differs
...@@ -55,12 +51,14 @@ def openUrl(url): ...@@ -55,12 +51,14 @@ def openUrl(url):
#print str(webWindows[-1].url()).split('#')[-1].split('.')[2],url.split('#')[-1].split('.')[2] #print str(webWindows[-1].url()).split('#')[-1].split('.')[2],url.split('#')[-1].split('.')[2]
except: pass except: pass
if not reuseLast: if not reuseLast:
if len(webWindows)<maxWebWindows: webWindows.append(QtWebKit.QWebView()) if len(webWindows)<maxWebWindows: webWindows.append(QtWebKitWidgets.QWebView())
else: webWindows=webWindows[1:]+[webWindows[0]] else: webWindows=webWindows[1:]+[webWindows[0]]
web=webWindows[-1] web=webWindows[-1]
web.load(QUrl(url)); web.setWindowTitle(url); connect(web.page().networkAccessManager(),SIGNAL("sslErrors (QNetworkReply *, const QList<QSslError> &)"),sslErrorHandler)
web.show(); web.raise_() web.load(QUrl(url))
web.setWindowTitle(url)
web.setFocus()
web.show()
controller=None controller=None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment