← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3913: Partly fix webpage help show. LP:1598174

 

------------------------------------------------------------
revno: 3913
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2016-07-01 22:21:18 +0200
message:
  Partly fix webpage help show. LP:1598174
modified:
  gui/qt5/__init__.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt5/__init__.py'
--- gui/qt5/__init__.py	2015-12-03 17:42:44 +0000
+++ gui/qt5/__init__.py	2016-07-01 20:21:18 +0000
@@ -13,6 +13,7 @@
 from PyQt5 import QtGui
 from PyQt5.QtCore import *
 from PyQt5.QtWidgets import *
+from PyQt5 import QtWebKit, QtWebKitWidgets
 
 from yade.qt.ui_controller import Ui_Controller
 
@@ -28,7 +29,6 @@
 sphinxOnlineDocPath='https://www.yade-dem.org/doc/'
 "Base URL for the documentation. Packaged versions should change to the local installation directory."
 
-
 import os.path
 # find if we have docs installed locally from package
 sphinxLocalDocPath=yade.config.prefix+'/share/doc/yade'+yade.config.suffix+'-doc/html/'
@@ -42,11 +42,7 @@
 
 sphinxDocWrapperPage=sphinxPrefix+'/yade.wrapper.html'
 
-
-
-
 def openUrl(url):
-	from PyQt5 import QtWebKit
 	global maxWebWindows,webWindows
 	reuseLast=False
 	# use the last window if the class is the same and only the attribute differs
@@ -55,12 +51,14 @@
 		#print str(webWindows[-1].url()).split('#')[-1].split('.')[2],url.split('#')[-1].split('.')[2]
 	except: pass
 	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]]
 	web=webWindows[-1]
-	web.load(QUrl(url)); web.setWindowTitle(url);
-	web.show();	web.raise_()
-
+	connect(web.page().networkAccessManager(),SIGNAL("sslErrors (QNetworkReply *, const QList<QSslError> &)"),sslErrorHandler)
+	web.load(QUrl(url))
+	web.setWindowTitle(url)
+	web.setFocus()
+	web.show()
 
 controller=None