--- a/src/eric7/UI/UserInterface.py Wed Apr 24 10:14:44 2024 +0200 +++ b/src/eric7/UI/UserInterface.py Sun Jun 02 09:51:20 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, @@ -54,6 +60,7 @@ ) from eric7 import Globals, Preferences, Testing, Utilities +from eric7.__version__ import Version, VersionOnly from eric7.CondaInterface.Conda import Conda from eric7.Debugger.DebugServer import DebugServer from eric7.Debugger.DebugUI import DebugUI @@ -93,7 +100,7 @@ from eric7.Utilities.BackgroundService import BackgroundService from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager -from .Info import BugAddress, FeatureAddress, Program, Version, VersionOnly +from .Info import BugAddress, FeatureAddress, Program from .NotificationWidget import NotificationTypes try: @@ -2732,6 +2739,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 +4095,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 +4623,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. @@ -8489,7 +8529,10 @@ @type QShowEvent """ if self.__startup: - if Preferences.getGeometry("MainMaximized"): + if ( + Preferences.getGeometry("MainMaximized") + and not DesktopUtilities.isWaylandSession() + ): self.setWindowState(Qt.WindowState.WindowMaximized) self.__startup = False