diff -r c8df46dd566d -r 27cd57e98461 src/eric7/UI/UserInterface.py --- a/src/eric7/UI/UserInterface.py Thu Oct 03 17:06:51 2024 +0200 +++ b/src/eric7/UI/UserInterface.py Thu Oct 31 10:54:33 2024 +0100 @@ -577,7 +577,9 @@ self.shell.remoteConnectionChanged ) - self.__ericServerInterface.aboutToDisconnect.connect(self.project.closeProject) + self.__ericServerInterface.aboutToDisconnect.connect( + self.project.remoteConnectionAboutToDisconnect + ) self.__ericServerInterface.aboutToDisconnect.connect( self.viewmanager.closeRemoteEditors ) @@ -4605,39 +4607,48 @@ sizeStr = "64-Bit" if sys.maxsize > 2**32 else "32-Bit" - versionText = self.tr("""<h2>Version Numbers</h2><table>""") + versionInfo = [self.tr("""<h2>Version Numbers</h2><table>""")] + + # eric7 version + versionInfo.extend( + [ + "<tr><td></td><td></td></tr>", + f"<tr><td><b>{Program}</b></td><td>{Version}</td></tr>", + "<tr><td></td><td></td></tr>", + ] + ) # Python version - versionText += ("""<tr><td><b>Python</b></td><td>{0}, {1}</td></tr>""").format( - sys.version.split()[0], sizeStr + versionInfo.append( + f"<tr><td><b>Python</b></td><td>{sys.version.split()[0]}," + f" {sizeStr}</td></tr>" ) # Qt version - versionText += ("""<tr><td><b>Qt</b></td><td>{0}</td></tr>""").format( - qVersion() - ) + versionInfo.append(f"<tr><td><b>Qt</b></td><td>{qVersion()}</td></tr>") # PyQt versions - versionText += ("""<tr><td><b>PyQt6</b></td><td>{0}</td></tr>""").format( - PYQT_VERSION_STR - ) + versionInfo.append(f"<tr><td><b>PyQt6</b></td><td>{PYQT_VERSION_STR}</td></tr>") with contextlib.suppress(ImportError, AttributeError): from PyQt6 import QtCharts # __IGNORE_WARNING_I10__ - versionText += ( - """<tr><td><b>PyQt6-Charts</b></td><td>{0}</td></tr>""" - ).format(QtCharts.PYQT_CHART_VERSION_STR) + versionInfo.append( + "<tr><td><b>PyQt6-Charts</b></td>" + f"<td>{QtCharts.PYQT_CHART_VERSION_STR}</td></tr>" + ) with contextlib.suppress(ImportError, AttributeError): from PyQt6 import QtWebEngineCore # __IGNORE_WARNING_I10__ - versionText += ( - """<tr><td><b>PyQt6-WebEngine</b></td><td>{0}</td></tr>""" - ).format(QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR) - versionText += ( - """<tr><td><b>PyQt6-QScintilla</b></td><td>{0}</td></tr>""" - ).format(QSCINTILLA_VERSION_STR) - versionText += ("""<tr><td><b>sip</b></td><td>{0}</td></tr>""").format( - sip_version_str + versionInfo.append( + "<tr><td><b>PyQt6-WebEngine</b></td>" + f"<td>{QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR}</td></tr>" + ) + versionInfo.extend( + [ + "<tr><td><b>PyQt6-QScintilla</b></td>" + f"<td>{QSCINTILLA_VERSION_STR}</td></tr>", + f"<tr><td><b>sip</b></td><td>{sip_version_str}</td></tr>", + ] ) # webengine (chromium) version @@ -4650,37 +4661,33 @@ chromiumVersion, chromiumSecurityVersion, ) = WebBrowserTools.getWebEngineVersions()[0:2] - versionText += """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>""".format( - chromiumVersion + versionInfo.append( + f"<tr><td><b>WebEngine</b></td><td>{chromiumVersion}</td></tr>" ) if chromiumSecurityVersion: - versionText += self.tr( - """<tr><td><b>WebEngine (Security)</b></td>""" - """<td>{0}</td></tr>""" - ).format(chromiumSecurityVersion) - - # eric7 version - versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>""").format( - Program, Version - ) + versionInfo.append( + "<tr><td><b>WebEngine (Security)</b></td>" + f"<td>{chromiumSecurityVersion}</td></tr>" + ) # desktop and session type desktop = DesktopUtilities.desktopName() session = DesktopUtilities.sessionType() if desktop or session: - versionText += "<tr><td></td><td></td></tr>" + versionInfo.append("<tr><td></td><td></td></tr>") if desktop: - versionText += ("<tr><td><b>{0}</b></td><td>{1}</td></tr>").format( - self.tr("Desktop"), desktop + versionInfo.append( + f"<tr><td><b>{self.tr('Desktop')}</b></td><td>{desktop}</td></tr>" ) if session: - versionText += ("<tr><td><b>{0}</b></td><td>{1}</td></tr>").format( - self.tr("Session Type"), session + versionInfo.append( + f"<tr><td><b>{self.tr('Session Type')}</b></td>" + f"<td>{session}</td></tr>" ) - versionText += self.tr("""</table>""") - - VersionsDialog(self, Program, versionText) + versionInfo.append("</table>") + + VersionsDialog(parent=self, title=Program, text="".join(versionInfo)) def __copyVersions(self): """ @@ -4788,7 +4795,7 @@ if Preferences.getUI("CheckErrorLog"): logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName) if os.path.exists(logFile): - dlg = ErrorLogDialog(logFile, False, self) + dlg = ErrorLogDialog(logFile, False, parent=self) dlg.exec() def __hasErrorLog(self): @@ -4819,7 +4826,7 @@ """ from .InstallInfoDialog import InstallInfoDialog - dlg = InstallInfoDialog(self) + dlg = InstallInfoDialog(parent=self) if dlg.wasLoaded(): dlg.exec() @@ -5133,7 +5140,7 @@ @pyqtSlot() def upgradeEricPyQt(self): """ - Public slot to upgrade the eric-ide and Pyqt packages of the eric7 + Public slot to upgrade the eric-ide and PyQt packages of the eric7 environment. @return flag indicating a successful upgrade @@ -5141,7 +5148,7 @@ """ yes = EricMessageBox.yesNo( None, - self.tr("Upgrade Eric"), + self.tr("Upgrade Eric and PyQt6"), self.tr( """eric needs to be closed in order to upgrade eric and""" """ PyQt. It will be restarted once the upgrade process""" @@ -6041,7 +6048,9 @@ """ from eric7.Preferences.ToolConfigurationDialog import ToolConfigurationDialog - dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self) + dlg = ToolConfigurationDialog( + self.toolGroups[self.currentToolGroup][1], parent=self + ) if dlg.exec() == QDialog.DialogCode.Accepted: self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() self.__updateExternalToolsActions() @@ -6054,7 +6063,9 @@ ToolGroupConfigurationDialog, ) - dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self) + dlg = ToolGroupConfigurationDialog( + self.toolGroups, self.currentToolGroup, parent=self + ) if dlg.exec() == QDialog.DialogCode.Accepted: self.toolGroups, self.currentToolGroup = dlg.getToolGroups() @@ -7318,8 +7329,8 @@ if self.__configurationDialog is None: # only one invocation at a time is allowed self.__configurationDialog = ConfigurationDialog( - self, - "Configuration", + parent=self, + name="Configuration", expandedEntries=self.__expandedConfigurationEntries, ) self.__configurationDialog.preferencesChanged.connect( @@ -7523,7 +7534,10 @@ from eric7.Preferences.ViewProfileDialog import ViewProfileDialog dlg = ViewProfileDialog( - self.__layoutType, self.profiles["edit"][1], self.profiles["debug"][1] + self.__layoutType, + self.profiles["edit"][1], + self.profiles["debug"][1], + parent=self, ) if dlg.exec() == QDialog.DialogCode.Accepted: edit, debug = dlg.getVisibilities() @@ -7541,7 +7555,7 @@ """ from eric7.EricWidgets.EricToolBarDialog import EricToolBarDialog - dlg = EricToolBarDialog(self.toolbarManager) + dlg = EricToolBarDialog(self.toolbarManager, parent=self) if dlg.exec() == QDialog.DialogCode.Accepted: Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) @@ -7625,7 +7639,7 @@ """ from .ClearPrivateDataDialog import ClearPrivateDataDialog - dlg = ClearPrivateDataDialog(self) + dlg = ClearPrivateDataDialog(parent=self) if dlg.exec() == QDialog.DialogCode.Accepted: # recent files, recent projects, recent multi projects, # debug histories, shell histories @@ -8288,7 +8302,7 @@ """ from eric7.PluginManager.PluginUninstallDialog import PluginUninstallDialog - dlg = PluginUninstallDialog(self.pluginManager, self) + dlg = PluginUninstallDialog(self.pluginManager, parent=self) dlg.exec() if self.__findFileWidget: @@ -8303,7 +8317,7 @@ """ from eric7.PluginManager.PluginRepositoryDialog import PluginRepositoryDialog - dlg = PluginRepositoryDialog(self.pluginManager, self) + dlg = PluginRepositoryDialog(self.pluginManager, parent=self) res = dlg.exec() if res == (QDialog.DialogCode.Accepted + 1): self.__installPlugins(dlg.getDownloadedPlugins())