549 |
549 |
550 hitTest = self.page().hitTestContent(evt.pos()) |
550 hitTest = self.page().hitTestContent(evt.pos()) |
551 |
551 |
552 self.__createContextMenu(self.__menu, hitTest) |
552 self.__createContextMenu(self.__menu, hitTest) |
553 |
553 |
554 # TODO: AdBlock |
554 if not hitTest.isContentEditable() and not hitTest.isContentSelected(): |
555 ## if not hitTest.isContentEditable() and not hitTest.isContentSelected(): |
555 self.__menu.addAction(self.__mw.adBlockIcon().menuAction()) |
556 ## self.__menu.addAction(self.__mw.adBlockIcon().menuAction()) |
|
557 |
556 |
558 if Preferences.getWebBrowser("WebInspectorEnabled"): |
557 if Preferences.getWebBrowser("WebInspectorEnabled"): |
559 self.__menu.addSeparator() |
558 self.__menu.addSeparator() |
560 self.__menu.addAction( |
559 self.__menu.addAction( |
561 UI.PixmapCache.getIcon("webInspector.png"), |
560 UI.PixmapCache.getIcon("webInspector.png"), |
686 self.__copyLink).setData(hitTest.imageUrl()) |
685 self.__copyLink).setData(hitTest.imageUrl()) |
687 menu.addAction( |
686 menu.addAction( |
688 UI.PixmapCache.getIcon("mailSend.png"), |
687 UI.PixmapCache.getIcon("mailSend.png"), |
689 self.tr("Send Image Link"), |
688 self.tr("Send Image Link"), |
690 self.__sendLink).setData(hitTest.imageUrl()) |
689 self.__sendLink).setData(hitTest.imageUrl()) |
691 # TODO: AdBlock |
690 menu.addSeparator() |
692 ## menu.addSeparator() |
691 menu.addAction( |
693 ## menu.addAction( |
692 UI.PixmapCache.getIcon("adBlockPlus.png"), |
694 ## UI.PixmapCache.getIcon("adBlockPlus.png"), |
693 self.tr("Block Image"), self.__blockImage)\ |
695 ## self.tr("Block Image"), self.__blockImage)\ |
694 .setData(hitTest.imageUrl().toString()) |
696 ## .setData(hitTest.imageUrl().toString()) |
|
697 if Preferences.getWebBrowser("VirusTotalEnabled") and \ |
695 if Preferences.getWebBrowser("VirusTotalEnabled") and \ |
698 Preferences.getWebBrowser("VirusTotalServiceKey") != "": |
696 Preferences.getWebBrowser("VirusTotalServiceKey") != "": |
699 menu.addAction( |
697 menu.addAction( |
700 UI.PixmapCache.getIcon("virustotal.png"), |
698 UI.PixmapCache.getIcon("virustotal.png"), |
701 self.tr("Scan Image with VirusTotal"), |
699 self.tr("Scan Image with VirusTotal"), |
1036 ## """ |
1034 ## """ |
1037 ## Private slot to copy an image to the clipboard. |
1035 ## Private slot to copy an image to the clipboard. |
1038 ## """ |
1036 ## """ |
1039 ## self.triggerPageAction(QWebEnginePage.CopyImageToClipboard) |
1037 ## self.triggerPageAction(QWebEnginePage.CopyImageToClipboard) |
1040 |
1038 |
1041 # TODO: AdBlock |
1039 def __blockImage(self): |
1042 ## def __blockImage(self): |
1040 """ |
1043 ## """ |
1041 Private slot to add a block rule for an image URL. |
1044 ## Private slot to add a block rule for an image URL. |
1042 """ |
1045 ## """ |
1043 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
1046 ## import WebBrowser.WebBrowserWindow |
1044 act = self.sender() |
1047 ## act = self.sender() |
1045 url = act.data() |
1048 ## url = act.data() |
1046 dlg = WebBrowserWindow.adBlockManager().showDialog() |
1049 ## dlg = WebBrowser.WebBrowserWindow.WebBrowserWindow.adBlockManager().showDialog() |
1047 dlg.addCustomRule(url) |
1050 ## dlg.addCustomRule(url) |
|
1051 |
1048 |
1052 # TODO: Qt 5.6 |
1049 # TODO: Qt 5.6 |
1053 ## def __downloadMedia(self): |
1050 ## def __downloadMedia(self): |
1054 ## """ |
1051 ## """ |
1055 ## Private slot to download a media and save it to disk. |
1052 ## Private slot to download a media and save it to disk. |
1533 zoomValue = ZoomManager.instance().zoomValue(self.url()) |
1530 zoomValue = ZoomManager.instance().zoomValue(self.url()) |
1534 self.setZoomValue(zoomValue) |
1531 self.setZoomValue(zoomValue) |
1535 |
1532 |
1536 if ok: |
1533 if ok: |
1537 self.__mw.historyManager().addHistoryEntry(self) |
1534 self.__mw.historyManager().addHistoryEntry(self) |
1538 # TODO: AdBlock |
1535 self.__mw.adBlockManager().page().hideBlockedPageEntries( |
1539 ## self.__mw.adBlockManager().page().hideBlockedPageEntries(self.page()) |
1536 self.page()) |
1540 self.__mw.passwordManager().completePage(self.page()) |
1537 self.__mw.passwordManager().completePage(self.page()) |
1541 |
1538 |
1542 def isLoading(self): |
1539 def isLoading(self): |
1543 """ |
1540 """ |
1544 Public method to get the loading state. |
1541 Public method to get the loading state. |