src/eric7/UI/UserInterface.py

branch
server
changeset 10711
2ef631169541
parent 10704
27d21e5163b8
parent 10710
0e06a55c9f2d
child 10718
c9252721680b
--- a/src/eric7/UI/UserInterface.py	Wed May 15 11:01:48 2024 +0200
+++ b/src/eric7/UI/UserInterface.py	Thu May 16 11:56:31 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,
@@ -2753,6 +2759,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..."),
@@ -4101,6 +4127,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()
@@ -4631,6 +4658,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.

eric ide

mercurial