Esempio n. 1
0
 def loadSettings(self):
     self.homepageEntry.setText(
         str(settings.settings.value("general/Homepage")))
     self.closeWindowToggle.setChecked(
         settings.setting_to_bool("general/CloseWindowWithLastTab"))
     self.reopenableTabCount.setValue(
         settings.setting_to_int("general/ReopenableTabCount"))
     self.reopenableWindowCount.setValue(
         settings.setting_to_int("general/ReopenableWindowCount"))
     self.pinnedTabCount.setValue(
         settings.setting_to_int("general/PinnedTabCount"))
     self.tabHotkeysToggle.setChecked(
         settings.setting_to_bool("general/TabHotkeysVisible"))
     self.retainHistoryToggle.setChecked(
         settings.setting_to_bool("general/NewTabsRetainHistory"))
     self.duplicateTabsToggle.setChecked(
         settings.setting_to_bool("general/DuplicateTabs"))
     self.navBarVisibleToggle.setChecked(
         settings.setting_to_bool("general/NavigationToolBarVisible"))
     self.statusBarVisibleToggle.setChecked(
         settings.setting_to_bool("general/StatusBarVisible"))
     self.homeButtonVisibleToggle.setChecked(
         settings.setting_to_bool("general/HomeButtonVisible"))
     self.upButtonVisibleToggle.setChecked(
         settings.setting_to_bool("general/UpButtonVisible"))
     self.feedButtonVisibleToggle.setChecked(
         settings.setting_to_bool("general/FeedButtonVisible"))
Esempio n. 2
0
 def loadSettings(self):
     self.homepageEntry.setText(str(settings.settings.value("general/Homepage")))
     self.closeWindowToggle.setChecked(settings.setting_to_bool("general/CloseWindowWithLastTab"))
     self.reopenableTabCount.setValue(settings.setting_to_int("general/ReopenableTabCount"))
     self.reopenableWindowCount.setValue(settings.setting_to_int("general/ReopenableWindowCount"))
     self.pinnedTabCount.setValue(settings.setting_to_int("general/PinnedTabCount"))
     self.tabHotkeysToggle.setChecked(settings.setting_to_bool("general/TabHotkeysVisible"))
     self.retainHistoryToggle.setChecked(settings.setting_to_bool("general/NewTabsRetainHistory"))
     self.duplicateTabsToggle.setChecked(settings.setting_to_bool("general/DuplicateTabs"))
     self.navBarVisibleToggle.setChecked(settings.setting_to_bool("general/NavigationToolBarVisible"))
     self.statusBarVisibleToggle.setChecked(settings.setting_to_bool("general/StatusBarVisible"))
     self.homeButtonVisibleToggle.setChecked(settings.setting_to_bool("general/HomeButtonVisible"))
     self.upButtonVisibleToggle.setChecked(settings.setting_to_bool("general/UpButtonVisible"))
     self.feedButtonVisibleToggle.setChecked(settings.setting_to_bool("general/FeedButtonVisible"))
Esempio n. 3
0
 def loadSettings(self):
     self.maximumURLLength.setValue(settings.setting_to_int("data/MaximumURLLength"))
     #self.maximumCacheSize.setValue(settings.setting_to_int("data/MaximumCacheSize"))
     self.rememberHistoryToggle.setChecked(settings.setting_to_bool("data/RememberHistory"))
     self.geolocationToggle.setChecked(settings.setting_to_bool("network/GeolocationEnabled"))
     self.geolocationWhitelist.clear()
     for url in data.geolocation_whitelist:
         self.geolocationWhitelist.addItem(url)
     self.geolocationBlacklist.clear()
     for url in data.geolocation_blacklist:
         self.geolocationBlacklist.addItem(url)
Esempio n. 4
0
def loadSession(session_file=settings.session_file):
    try:
        if os.path.exists(session_file):
            f = open(session_file, "rb")
            session_full = pickle.load(f)
            f.close()
            if type(session_full) is dict:
                session = session_full["session"]
                browser.closedWindows = session_full["closed_windows"]
            else:
                session = session_full
            for window in session:
                if type(window) is dict:
                    try:
                        closed_tabs = window["closed_tabs"]
                        appMode = window["app_mode"]
                        current_tab = window["current_tab"]
                        window = window["tabs"]
                    except:
                        window = []
                if len(window) == 0:
                    continue
                win = MainWindow(appMode=appMode)
                try:
                    win.closedTabs = closed_tabs
                except:
                    pass
                for tab in range(len(window)):
                    try:
                        incognito = bool(window[tab][2])
                    except:
                        pass
                        incognito = False
                    win.addTab(index=tab, incognito=incognito)
                    if type(window[tab]) is tuple:
                        if tab < settings.setting_to_int(
                                "general/PinnedTabCount"):
                            win.tabWidget().widget(tab).page().loadHistory(
                                window[tab][0])
                        else:
                            win.tabWidget().widget(tab).loadHistory(
                                window[tab][0], window[tab][1])
                    else:
                        win.tabWidget().widget(tab).loadHistory(window[tab])
                try:
                    win.tabWidget().setCurrentIndex(current_tab)
                except:
                    pass
                win.show()
    except:
        pass
Esempio n. 5
0
 def loadSettings(self):
     self.maximumURLLength.setValue(
         settings.setting_to_int("data/MaximumURLLength"))
     #self.maximumCacheSize.setValue(settings.setting_to_int("data/MaximumCacheSize"))
     self.rememberHistoryToggle.setChecked(
         settings.setting_to_bool("data/RememberHistory"))
     self.geolocationToggle.setChecked(
         settings.setting_to_bool("network/GeolocationEnabled"))
     self.geolocationWhitelist.clear()
     for url in data.geolocation_whitelist:
         self.geolocationWhitelist.addItem(url)
     self.geolocationBlacklist.clear()
     for url in data.geolocation_blacklist:
         self.geolocationBlacklist.addItem(url)
Esempio n. 6
0
 def loadSettings(self):
     self.hostNameEntry.setText(str(settings.settings.value("proxy/Hostname")))
     self.userEntry.setText(str(settings.settings.value("proxy/User")))
     self.passwordEntry.setText(str(settings.settings.value("proxy/Password")))
     self.xssAuditingToggle.setChecked(settings.setting_to_bool("network/XSSAuditingEnabled"))
     self.dnsPrefetchingToggle.setChecked(settings.setting_to_bool("network/DnsPrefetchingEnabled"))
     port = settings.setting_to_int("proxy/Port")
     if port == "None":
         port = str(settings.default_port)
     self.portEntry.setValue(port)
     for index in range(0, self.proxySelect.count()):
         if self.proxySelect.itemText(index) == settings.settings.value("proxy/Type"):
             self.proxySelect.setCurrentIndex(index)
             break
Esempio n. 7
0
def loadSession(session_file=settings.session_file):
    try:
        if os.path.exists(session_file):
            f = open(session_file, "rb")
            session_full = pickle.load(f)
            f.close()
            if type(session_full) is dict:
                session = session_full["session"]
                browser.closedWindows = session_full["closed_windows"]
            else:
                session = session_full
            for window in session:
                if type(window) is dict:
                    try:
                        closed_tabs = window["closed_tabs"]
                        appMode = window["app_mode"]
                        current_tab = window["current_tab"]
                        window = window["tabs"]
                    except:
                        window = []
                if len(window) == 0:
                    continue
                win = MainWindow(appMode=appMode)
                try: win.closedTabs = closed_tabs
                except: pass
                for tab in range(len(window)):
                    try:
                        incognito = bool(window[tab][2])
                    except:
                        pass
                        incognito = False
                    win.addTab(index=tab, incognito=incognito)
                    if type(window[tab]) is tuple:
                        if tab < settings.setting_to_int("general/PinnedTabCount"):
                            win.tabWidget().widget(tab).page().loadHistory(window[tab][0])
                        else:    
                            win.tabWidget().widget(tab).loadHistory(window[tab][0], window[tab][1])
                    else:
                        win.tabWidget().widget(tab).loadHistory(window[tab])
                try:
                    win.tabWidget().setCurrentIndex(current_tab)
                except:
                    pass
                win.show()
    except:
        pass
Esempio n. 8
0
 def loadSettings(self):
     self.hostNameEntry.setText(
         str(settings.settings.value("proxy/Hostname")))
     self.userEntry.setText(str(settings.settings.value("proxy/User")))
     self.passwordEntry.setText(
         str(settings.settings.value("proxy/Password")))
     self.xssAuditingToggle.setChecked(
         settings.setting_to_bool("network/XSSAuditingEnabled"))
     self.dnsPrefetchingToggle.setChecked(
         settings.setting_to_bool("network/DnsPrefetchingEnabled"))
     port = settings.setting_to_int("proxy/Port")
     if port == "None":
         port = str(settings.default_port)
     self.portEntry.setValue(port)
     for index in range(0, self.proxySelect.count()):
         if self.proxySelect.itemText(index) == settings.settings.value(
                 "proxy/Type"):
             self.proxySelect.setCurrentIndex(index)
             break