--- a/src/eric7/UI/UserInterface.py Thu May 16 11:45:40 2024 +0200 +++ b/src/eric7/UI/UserInterface.py Thu May 16 11:51:49 2024 +0200 @@ -37,7 +37,13 @@ pyqtSlot, qVersion, ) -from PyQt6.QtGui import QAction, QDesktopServices, QKeySequence, QSessionManager +from PyQt6.QtGui import ( + QAction, + QDesktopServices, + QGuiApplication, + QKeySequence, + QSessionManager, +) from PyQt6.QtNetwork import QNetworkAccessManager, QNetworkProxyFactory from PyQt6.QtWidgets import ( QApplication, @@ -2732,6 +2738,26 @@ self.versionAct.triggered.connect(self.__showVersions) self.actions.append(self.versionAct) + self.copyVersionAct = EricAction( + self.tr("Copy Versions"), + self.tr("&Copy Versions"), + 0, + 0, + self, + "copy_versions", + ) + self.copyVersionAct.setStatusTip( + self.tr("Copy version information to the clipboard") + ) + self.copyVersionAct.setWhatsThis( + self.tr( + "<b>Copy Versions</b><p>This generates version information and copies" + " it to the clipboard.</p>" + ) + ) + self.copyVersionAct.triggered.connect(self.__copyVersions) + self.actions.append(self.copyVersionAct) + self.showErrorLogAct = EricAction( self.tr("Show Error Log"), self.tr("Show Error &Log..."), @@ -4068,6 +4094,7 @@ self.__menus["help"].addAction(self.pyside6DocAct) self.__menus["help"].addSeparator() self.__menus["help"].addAction(self.versionAct) + self.__menus["help"].addAction(self.copyVersionAct) self.__menus["help"].addSeparator() self.__menus["help"].addAction(self.showInstallInfoAct) self.__menus["help"].addSeparator() @@ -4595,6 +4622,18 @@ VersionsDialog(self, Program, versionText) + def __copyVersions(self): + """ + Private method to generated version information and copy that to the clipboard. + """ + QGuiApplication.clipboard().setText( + "\n----\n\n{0}\n\n----\n\n{1}\n\n----\n\n{2}".format( + Utilities.generateVersionInfo("\n"), + Utilities.generatePluginsVersionInfo("\n"), + Utilities.generateDistroInfo("\n"), + ) + ) + def __reportBug(self): """ Private slot to handle the Report Bug dialog.