Helpviewer/HelpTabWidget.py

changeset 953
7c42d54ba205
parent 945
8cd4d08fa9f6
child 978
11f8adbcac97
equal deleted inserted replaced
952:cc3e2e5558e9 953:7c42d54ba205
663 def __lineEditReturnPressed(self): 663 def __lineEditReturnPressed(self):
664 """ 664 """
665 Private slot to handle the entering of an URL. 665 Private slot to handle the entering of an URL.
666 """ 666 """
667 edit = self.sender() 667 edit = self.sender()
668 url = self.__guessUrlFromPath(edit.text())
668 if e5App().keyboardModifiers() == Qt.AltModifier: 669 if e5App().keyboardModifiers() == Qt.AltModifier:
669 self.newBrowser(edit.text()) 670 self.newBrowser(url)
670 else: 671 else:
671 self.currentBrowser().setSource(QUrl(edit.text())) 672 self.currentBrowser().setSource(url)
672 self.currentBrowser().setFocus() 673 self.currentBrowser().setFocus()
673 674
674 def __pathSelected(self, path): 675 def __pathSelected(self, path):
675 """ 676 """
676 Private slot called when a URL is selected from the completer. 677 Private slot called when a URL is selected from the completer.
692 url = manager.convertKeywordSearchToUrl(path) 693 url = manager.convertKeywordSearchToUrl(path)
693 if url.isValid(): 694 if url.isValid():
694 return url 695 return url
695 696
696 try: 697 try:
697 return QUrl.fromUserInput(path) 698 url = QUrl.fromUserInput(path)
698 except AttributeError: 699 except AttributeError:
699 return QUrl(path) 700 url = QUrl(path)
701
702 if url.scheme() == "about" and \
703 url.path() == "home":
704 url = QUrl("pyrc:home")
705
706 if url.scheme() in ["s", "search"]:
707 url = manager.currentEngine().searchUrl(url.path().strip())
708
709 if url.scheme() != "" and \
710 (url.host() != "" or url.path() != ""):
711 return url
712
713 urlString = Preferences.getHelp("DefaultScheme") + path.strip()
714 url = QUrl.fromEncoded(urlString.encode(), QUrl.TolerantMode)
715
716 return url
700 717
701 def __currentChanged(self, index): 718 def __currentChanged(self, index):
702 """ 719 """
703 Private slot to handle an index change. 720 Private slot to handle an index change.
704 721

eric ide

mercurial