WebBrowser/WebBrowserTabWidget.py

changeset 5780
79d06c98c5c9
parent 5777
2c4441d65ee3
child 5782
60874802161b
--- a/WebBrowser/WebBrowserTabWidget.py	Fri Jun 30 19:58:09 2017 +0200
+++ b/WebBrowser/WebBrowserTabWidget.py	Sat Jul 01 19:14:01 2017 +0200
@@ -378,15 +378,21 @@
         """
         self.newBrowser()
     
-    def newBrowser(self, link=None, position=-1, background=False):
+    def newBrowser(self, link=None, position=-1, background=False,
+                   restoreSession=False):
         """
         Public method to create a new web browser tab.
         
-        @param link link to be shown (string or QUrl)
+        @param link link to be shown
+        @type str or QUrl
         @keyparam position position to create the new tab at or -1 to add it
-            to the end (integer)
+            to the end
+        @type int
         @keyparam background flag indicating to open the tab in the
-            background (bool)
+            background
+        @type bool
+        @keyparam restoreSession flag indicating a restore session action
+        @type bool
         @return reference to the new browser
         @rtype WebBrowserView
         """
@@ -449,7 +455,7 @@
         self.__closeButton.setEnabled(True)
         self.__navigationButton.setEnabled(True)
         
-        if not linkName:
+        if not linkName and not restoreSession:
             if Preferences.getWebBrowser("StartupBehavior") == 0:
                 linkName = Preferences.getWebBrowser("HomePage")
             elif Preferences.getWebBrowser("StartupBehavior") == 1:
@@ -1222,7 +1228,7 @@
         # 1. load tab data
         if "Tabs" in sessionData:
             for data in sessionData["Tabs"]:
-                browser = self.newBrowser()
+                browser = self.newBrowser(restoreSession=True)
                 browser.page().loadFromSessionData(data)
         
         # 2. set tab index

eric ide

mercurial