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 """ |