Fixed bug in the old web browser. 6_1_x

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 03 Oct 2016 20:18:21 +0200
branch
6_1_x
changeset 5197
468264f9de9a
parent 5188
48af75c98cfe
child 5210
44f5411f0edb

Fixed bug in the old web browser.
(grafted from e7490a5e7549a6c79e759e0f9d7277b88df17d6c)

Helpviewer/HelpBrowserWV.py file | annotate | diff | comparison | revisions
Helpviewer/HelpWindow.py file | annotate | diff | comparison | revisions
diff -r 48af75c98cfe -r 468264f9de9a Helpviewer/HelpBrowserWV.py
--- a/Helpviewer/HelpBrowserWV.py	Fri Sep 30 19:42:02 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
@@ -900,7 +903,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 48af75c98cfe -r 468264f9de9a Helpviewer/HelpWindow.py
--- a/Helpviewer/HelpWindow.py	Fri Sep 30 19:42:02 2016 +0200
+++ b/Helpviewer/HelpWindow.py	Mon Oct 03 20:18:21 2016 +0200
@@ -118,6 +118,7 @@
 
         self.mHistory = []
         self.__lastConfigurationPageName = ""
+        self.__lastActiveWindow = None
         
         self.__eventMouseButtons = Qt.NoButton
         self.__eventKeyboardModifiers = Qt.NoModifier
@@ -296,7 +297,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