diff -r 4c60a21ce6dd -r d3d64f3128b3 Helpviewer/SiteInfo/SiteInfoDialog.py --- a/Helpviewer/SiteInfo/SiteInfoDialog.py Wed Feb 07 18:57:46 2018 +0100 +++ b/Helpviewer/SiteInfo/SiteInfoDialog.py Wed Feb 07 20:14:09 2018 +0100 @@ -225,31 +225,34 @@ return menu = QMenu() - act = menu.addAction( - self.tr("Copy Image Location to Clipboard"), - self.__copyAction) + act = menu.addAction(self.tr("Copy Image Location to Clipboard")) act.setData(itm.text(1)) - act = menu.addAction( - self.tr("Copy Image Name to Clipboard"), - self.__copyAction) + 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() - act = menu.addAction(self.tr("Save Image"), self.__saveImage) + act = menu.addAction(self.tr("Save Image")) act.setData(self.imagesTree.indexOfTopLevelItem(itm)) + act.triggered.connect(lambda: self.__saveImage(act)) menu.exec_(QCursor.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: