WebBrowser/WebBrowserView.py

changeset 5532
3a7c5deab9b7
parent 5530
93f95c4b3153
child 5587
ea526b78ee6c
child 5633
1a767ca5bbf3
equal deleted inserted replaced
5530:93f95c4b3153 5532:3a7c5deab9b7
515 boldFont.setBold(True) 515 boldFont.setBold(True)
516 516
517 for suggestion in contextMenuData.spellCheckerSuggestions(): 517 for suggestion in contextMenuData.spellCheckerSuggestions():
518 act = menu.addAction( 518 act = menu.addAction(
519 suggestion, 519 suggestion,
520 lambda: self.page().replaceMisspelledWord(suggestion)) 520 self.__replaceMisspelledWord)
521 act.setFont(boldFont) 521 act.setFont(boldFont)
522 522
523 if bool(menu.actions()): 523 if bool(menu.actions()):
524 menu.addAction(self.tr("No suggestions")).setEnabled(False) 524 menu.addAction(self.tr("No suggestions")).setEnabled(False)
525 525
927 return url.isValid() and \ 927 return url.isValid() and \
928 bool(url.host()) and \ 928 bool(url.host()) and \
929 bool(url.scheme()) and \ 929 bool(url.scheme()) and \
930 "." in url.host() 930 "." in url.host()
931 931
932 def __replaceMisspelledWord(self):
933 """
934 Private slot to replace a misspelled word under the context menu.
935 """
936 act = self.sender()
937 suggestion = act.text()
938 self.page().replaceMisspelledWord(suggestion)
939
932 def __openLinkInNewTab(self): 940 def __openLinkInNewTab(self):
933 """ 941 """
934 Private method called by the context menu to open a link in a new 942 Private method called by the context menu to open a link in a new
935 tab. 943 tab.
936 """ 944 """

eric ide

mercurial