802 menu.addAction(self.trUtf8("Save Lin&k"), self.__downloadLink) |
803 menu.addAction(self.trUtf8("Save Lin&k"), self.__downloadLink) |
803 act = menu.addAction(self.trUtf8("Bookmark this Link"), self.__bookmarkLink) |
804 act = menu.addAction(self.trUtf8("Bookmark this Link"), self.__bookmarkLink) |
804 act.setData(hit.linkUrl()) |
805 act.setData(hit.linkUrl()) |
805 menu.addSeparator() |
806 menu.addSeparator() |
806 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 \ |
|
809 Preferences.getHelp("VirusTotalServiceKey") != "": |
|
810 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"), |
|
811 self.trUtf8("Scan Link with VirusTotal"), self.__virusTotal) |
|
812 act.setData(hit.linkUrl()) |
807 |
813 |
808 if not hit.imageUrl().isEmpty(): |
814 if not hit.imageUrl().isEmpty(): |
809 if not menu.isEmpty(): |
815 if not menu.isEmpty(): |
810 menu.addSeparator() |
816 menu.addSeparator() |
811 act = menu.addAction(self.trUtf8("Open Image in New Tab"), |
817 act = menu.addAction(self.trUtf8("Open Image in New Tab"), |
818 self.__copyImageLocation) |
824 self.__copyImageLocation) |
819 act.setData(hit.imageUrl().toString()) |
825 act.setData(hit.imageUrl().toString()) |
820 menu.addSeparator() |
826 menu.addSeparator() |
821 act = menu.addAction(self.trUtf8("Block Image"), self.__blockImage) |
827 act = menu.addAction(self.trUtf8("Block Image"), self.__blockImage) |
822 act.setData(hit.imageUrl().toString()) |
828 act.setData(hit.imageUrl().toString()) |
|
829 if Preferences.getHelp("VirusTotalEnabled") and \ |
|
830 Preferences.getHelp("VirusTotalServiceKey") != "": |
|
831 act = menu.addAction(UI.PixmapCache.getIcon("virustotal.png"), |
|
832 self.trUtf8("Scan Image with VirusTotal"), self.__virusTotal) |
|
833 act.setData(hit.imageUrl()) |
823 |
834 |
824 if not menu.isEmpty(): |
835 if not menu.isEmpty(): |
825 menu.addSeparator() |
836 menu.addSeparator() |
826 menu.addAction(self.mw.newTabAct) |
837 menu.addAction(self.mw.newTabAct) |
827 menu.addAction(self.mw.newAct) |
838 menu.addAction(self.mw.newAct) |
933 act = self.sender() |
944 act = self.sender() |
934 url = act.data() |
945 url = act.data() |
935 dlg = Helpviewer.HelpWindow.HelpWindow.adblockManager().showDialog() |
946 dlg = Helpviewer.HelpWindow.HelpWindow.adblockManager().showDialog() |
936 dlg.addCustomRule(url) |
947 dlg.addCustomRule(url) |
937 |
948 |
|
949 def __virusTotal(self): |
|
950 """ |
|
951 Private slot to scan the selected URL with VirusTotal. |
|
952 """ |
|
953 act = self.sender() |
|
954 url = act.data() |
|
955 self.mw.requestVirusTotalScan(url) |
|
956 |
938 def __searchRequested(self, act): |
957 def __searchRequested(self, act): |
939 """ |
958 """ |
940 Private slot to search for some text with a selected search engine. |
959 Private slot to search for some text with a selected search engine. |
941 |
960 |
942 @param act reference to the action that triggered this slot (QAction) |
961 @param act reference to the action that triggered this slot (QAction) |
1283 """ |
1302 """ |
1284 url = self.url() |
1303 url = self.url() |
1285 if url.isEmpty(): |
1304 if url.isEmpty(): |
1286 return |
1305 return |
1287 |
1306 |
1288 self.mw.downloadManager().download(url, True) |
1307 self.mw.downloadManager().download(url, True, mainWindow=self.mw) |
1289 |
1308 |
1290 def __unsupportedContent(self, reply, requestFilename=None, download=False): |
1309 def __unsupportedContent(self, reply, requestFilename=None, download=False): |
1291 """ |
1310 """ |
1292 Private slot to handle the unsupportedContent signal. |
1311 Private slot to handle the unsupportedContent signal. |
1293 |
1312 |
1306 return |
1325 return |
1307 |
1326 |
1308 if reply.error() == QNetworkReply.NoError: |
1327 if reply.error() == QNetworkReply.NoError: |
1309 if reply.header(QNetworkRequest.ContentTypeHeader): |
1328 if reply.header(QNetworkRequest.ContentTypeHeader): |
1310 self.mw.downloadManager().handleUnsupportedContent( |
1329 self.mw.downloadManager().handleUnsupportedContent( |
1311 reply, webPage=self.page()) |
1330 reply, webPage=self.page(), mainWindow=self.mw) |
1312 return |
1331 return |
1313 |
1332 |
1314 replyUrl = reply.url() |
1333 replyUrl = reply.url() |
1315 if replyUrl.isEmpty(): |
1334 if replyUrl.isEmpty(): |
1316 return |
1335 return |
1358 """ |
1377 """ |
1359 Private slot to handle a download request. |
1378 Private slot to handle a download request. |
1360 |
1379 |
1361 @param request reference to the request object (QNetworkRequest) |
1380 @param request reference to the request object (QNetworkRequest) |
1362 """ |
1381 """ |
1363 self.mw.downloadManager().download(request) |
1382 self.mw.downloadManager().download(request, mainWindow=self.mw) |
1364 |
1383 |
1365 def __databaseQuotaExceeded(self, frame, databaseName): |
1384 def __databaseQuotaExceeded(self, frame, databaseName): |
1366 """ |
1385 """ |
1367 Private slot to handle the case, where the database quota is exceeded. |
1386 Private slot to handle the case, where the database quota is exceeded. |
1368 |
1387 |