--- a/WebBrowser/SiteInfo/SiteInfoDialog.py Wed Feb 07 18:57:46 2018 +0100 +++ b/WebBrowser/SiteInfo/SiteInfoDialog.py Wed Feb 07 20:14:09 2018 +0100 @@ -236,30 +236,34 @@ return menu = QMenu() - menu.addAction( - self.tr("Copy Image Location to Clipboard"), - self.__copyAction).setData(itm.text(1)) - menu.addAction( - self.tr("Copy Image Name to Clipboard"), - self.__copyAction).setData(itm.text(0)) + act = menu.addAction(self.tr("Copy Image Location to Clipboard")) + act.setData(itm.text(1)) + act.triggered.connect(lambda: self.__copyAction(act)) + act = menu.addAction(self.tr("Copy Image Name to Clipboard")) + act.setData(itm.text(0)) + act.triggered.connect(lambda: self.__copyAction(act)) menu.addSeparator() - menu.addAction( - self.tr("Save Image"), - self.__saveImage).setData(self.imagesTree.indexOfTopLevelItem(itm)) + act = menu.addAction(self.tr("Save Image")) + act.setData(self.imagesTree.indexOfTopLevelItem(itm)) + act.triggered.connect(lambda: self.__saveImage(act)) menu.exec_(self.imagesTree.viewport().mapToGlobal(pos)) - def __copyAction(self): + def __copyAction(self, act): """ Private slot to copy the image URL or the image name to the clipboard. + + @param act reference to the action that triggered + @type QAction """ - act = self.sender() QApplication.clipboard().setText(act.data()) - def __saveImage(self): + def __saveImage(self, act): """ Private slot to save the selected image to disk. + + @param act reference to the action that triggered + @type QAction """ - act = self.sender() index = act.data() itm = self.imagesTree.topLevelItem(index) if itm is None: