Helpviewer/HelpBrowserWV.py

changeset 992
566e87428fc8
parent 978
11f8adbcac97
child 1112
8a7d1b9d18db
equal deleted inserted replaced
991:5ec5e707dfa5 992:566e87428fc8
805 act.setData(hit.linkUrl()) 805 act.setData(hit.linkUrl())
806 menu.addSeparator() 806 menu.addSeparator()
807 menu.addAction(self.trUtf8("Copy Link to Clipboard"), self.__copyLink) 807 menu.addAction(self.trUtf8("Copy Link to Clipboard"), self.__copyLink)
808 if Preferences.getHelp("VirusTotalEnabled") and \ 808 if Preferences.getHelp("VirusTotalEnabled") and \
809 Preferences.getHelp("VirusTotalServiceKey") != "": 809 Preferences.getHelp("VirusTotalServiceKey") != "":
810 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"), 810 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"),
811 self.trUtf8("Scan Link with VirusTotal"), self.__virusTotal) 811 self.trUtf8("Scan Link with VirusTotal"), self.__virusTotal)
812 act.setData(hit.linkUrl()) 812 act.setData(hit.linkUrl())
813 813
814 if not hit.imageUrl().isEmpty(): 814 if not hit.imageUrl().isEmpty():
815 if not menu.isEmpty(): 815 if not menu.isEmpty():
826 menu.addSeparator() 826 menu.addSeparator()
827 act = menu.addAction(self.trUtf8("Block Image"), self.__blockImage) 827 act = menu.addAction(self.trUtf8("Block Image"), self.__blockImage)
828 act.setData(hit.imageUrl().toString()) 828 act.setData(hit.imageUrl().toString())
829 if Preferences.getHelp("VirusTotalEnabled") and \ 829 if Preferences.getHelp("VirusTotalEnabled") and \
830 Preferences.getHelp("VirusTotalServiceKey") != "": 830 Preferences.getHelp("VirusTotalServiceKey") != "":
831 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"), 831 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"),
832 self.trUtf8("Scan Image with VirusTotal"), self.__virusTotal) 832 self.trUtf8("Scan Image with VirusTotal"), self.__virusTotal)
833 act.setData(hit.imageUrl()) 833 act.setData(hit.imageUrl())
834 834
835 if not menu.isEmpty(): 835 if not menu.isEmpty():
836 menu.addSeparator() 836 menu.addSeparator()
1476 p -= frame.scrollPosition() 1476 p -= frame.scrollPosition()
1477 frame = frame.parentFrame() 1477 frame = frame.parentFrame()
1478 while frame and frame != self.page().mainFrame(): 1478 while frame and frame != self.page().mainFrame():
1479 p -= frame.scrollPosition() 1479 p -= frame.scrollPosition()
1480 frame = frame.parentFrame() 1480 frame = frame.parentFrame()
1481 pevent = QMouseEvent(QEvent.MouseButtonPress, p, Qt.LeftButton, 1481 pevent = QMouseEvent(QEvent.MouseButtonPress, p, Qt.LeftButton,
1482 Qt.MouseButtons(Qt.NoButton), Qt.KeyboardModifiers(Qt.NoModifier)) 1482 Qt.MouseButtons(Qt.NoButton), Qt.KeyboardModifiers(Qt.NoModifier))
1483 qApp.sendEvent(self, pevent) 1483 qApp.sendEvent(self, pevent)
1484 revent = QMouseEvent(QEvent.MouseButtonRelease, p, Qt.LeftButton, 1484 revent = QMouseEvent(QEvent.MouseButtonRelease, p, Qt.LeftButton,
1485 Qt.MouseButtons(Qt.NoButton), Qt.KeyboardModifiers(Qt.NoModifier)) 1485 Qt.MouseButtons(Qt.NoButton), Qt.KeyboardModifiers(Qt.NoModifier))
1486 qApp.sendEvent(self, revent) 1486 qApp.sendEvent(self, revent)
1487 handled = True 1487 handled = True
1488 1488
1489 return handled 1489 return handled
1503 def __showAccessKeys(self): 1503 def __showAccessKeys(self):
1504 """ 1504 """
1505 Private method to show the access key labels. 1505 Private method to show the access key labels.
1506 """ 1506 """
1507 supportedElements = [ 1507 supportedElements = [
1508 "input", "a", "area", "button", "label", "legend", "textarea", 1508 "input", "a", "area", "button", "label", "legend", "textarea",
1509 ] 1509 ]
1510 unusedKeys = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" \ 1510 unusedKeys = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" \
1511 " 0 1 2 3 4 5 6 7 8 9".split() 1511 " 0 1 2 3 4 5 6 7 8 9".split()
1512 1512
1513 viewport = QRect(self.__page.mainFrame().scrollPosition(), 1513 viewport = QRect(self.__page.mainFrame().scrollPosition(),
1514 self.__page.viewportSize()) 1514 self.__page.viewportSize())
1515 # Priority first goes to elements with accesskey attributes 1515 # Priority first goes to elements with accesskey attributes
1516 alreadyLabeled = [] 1516 alreadyLabeled = []
1517 for elementType in supportedElements: 1517 for elementType in supportedElements:
1518 result = self.page().mainFrame().findAllElements(elementType).toList() 1518 result = self.page().mainFrame().findAllElements(elementType).toList()

eric ide

mercurial