Fixed bug in the old web browser.

Mon, 03 Oct 2016 20:18:21 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 03 Oct 2016 20:18:21 +0200
changeset 5196
e7490a5e7549
parent 5195
a282431c01fc
child 5198
302a54ccc9b2

Fixed bug in the old web browser.

Helpviewer/HelpBrowserWV.py file | annotate | diff | comparison | revisions
Helpviewer/HelpWindow.py file | annotate | diff | comparison | revisions
diff -r a282431c01fc -r e7490a5e7549 Helpviewer/HelpBrowserWV.py
--- a/Helpviewer/HelpBrowserWV.py	Mon Oct 03 19:12:03 2016 +0200
+++ b/Helpviewer/HelpBrowserWV.py	Mon Oct 03 20:18:21 2016 +0200
@@ -14,6 +14,8 @@
 except NameError:
     pass
 
+import os
+
 from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObject, QT_TRANSLATE_NOOP, \
     QUrl, QBuffer, QIODevice, QFileInfo, Qt, QTimer, QEvent, \
     QRect, QFile, QPoint, QByteArray, qVersion
@@ -38,6 +40,7 @@
 import Preferences
 import UI.PixmapCache
 import Globals
+import Utilities
 
 try:
     from PyQt5.QtNetwork import QSslCertificate
@@ -901,7 +904,14 @@
             return
         
         if not name.scheme():
-            name.setUrl(Preferences.getHelp("DefaultScheme") + name.toString())
+            if not os.path.exists(name.toString()):
+                name.setScheme(Preferences.getWebBrowser("DefaultScheme"))
+            else:
+                if Utilities.isWindowsPlatform():
+                    name.setUrl("file:///" + Utilities.fromNativeSeparators(
+                        name.toString()))
+                else:
+                    name.setUrl("file://" + name.toString())
         
         if len(name.scheme()) == 1 or \
            name.scheme() == "file":
diff -r a282431c01fc -r e7490a5e7549 Helpviewer/HelpWindow.py
--- a/Helpviewer/HelpWindow.py	Mon Oct 03 19:12:03 2016 +0200
+++ b/Helpviewer/HelpWindow.py	Mon Oct 03 20:18:21 2016 +0200
@@ -119,6 +119,7 @@
 
         self.mHistory = []
         self.__lastConfigurationPageName = ""
+        self.__lastActiveWindow = None
         
         self.__eventMouseButtons = Qt.NoButton
         self.__eventKeyboardModifiers = Qt.NoModifier
@@ -298,7 +299,6 @@
                 if self.__searchWord is not None:
                     QTimer.singleShot(0, self.__searchForWord)
             
-            self.__lastActiveWindow = None
             e5App().focusChanged.connect(self.__appFocusChanged)
             
             QTimer.singleShot(0, syncMgr.loadSettings)

eric ide

mercurial