src/eric7/UI/UserInterface.py

branch
eric7-maintenance
changeset 11019
27cd57e98461
parent 10941
07cad049002c
parent 11006
a671918232f3
child 11063
bb05d1db9286
equal deleted inserted replaced
10947:c8df46dd566d 11019:27cd57e98461
575 ) 575 )
576 self.__ericServerInterface.connectionStateChanged.connect( 576 self.__ericServerInterface.connectionStateChanged.connect(
577 self.shell.remoteConnectionChanged 577 self.shell.remoteConnectionChanged
578 ) 578 )
579 579
580 self.__ericServerInterface.aboutToDisconnect.connect(self.project.closeProject) 580 self.__ericServerInterface.aboutToDisconnect.connect(
581 self.project.remoteConnectionAboutToDisconnect
582 )
581 self.__ericServerInterface.aboutToDisconnect.connect( 583 self.__ericServerInterface.aboutToDisconnect.connect(
582 self.viewmanager.closeRemoteEditors 584 self.viewmanager.closeRemoteEditors
583 ) 585 )
584 586
585 # create the toolbar manager object 587 # create the toolbar manager object
4603 except AttributeError: 4605 except AttributeError:
4604 sip_version_str = "sip version not available" 4606 sip_version_str = "sip version not available"
4605 4607
4606 sizeStr = "64-Bit" if sys.maxsize > 2**32 else "32-Bit" 4608 sizeStr = "64-Bit" if sys.maxsize > 2**32 else "32-Bit"
4607 4609
4608 versionText = self.tr("""<h2>Version Numbers</h2><table>""") 4610 versionInfo = [self.tr("""<h2>Version Numbers</h2><table>""")]
4611
4612 # eric7 version
4613 versionInfo.extend(
4614 [
4615 "<tr><td></td><td></td></tr>",
4616 f"<tr><td><b>{Program}</b></td><td>{Version}</td></tr>",
4617 "<tr><td></td><td></td></tr>",
4618 ]
4619 )
4609 4620
4610 # Python version 4621 # Python version
4611 versionText += ("""<tr><td><b>Python</b></td><td>{0}, {1}</td></tr>""").format( 4622 versionInfo.append(
4612 sys.version.split()[0], sizeStr 4623 f"<tr><td><b>Python</b></td><td>{sys.version.split()[0]},"
4624 f" {sizeStr}</td></tr>"
4613 ) 4625 )
4614 4626
4615 # Qt version 4627 # Qt version
4616 versionText += ("""<tr><td><b>Qt</b></td><td>{0}</td></tr>""").format( 4628 versionInfo.append(f"<tr><td><b>Qt</b></td><td>{qVersion()}</td></tr>")
4617 qVersion()
4618 )
4619 4629
4620 # PyQt versions 4630 # PyQt versions
4621 versionText += ("""<tr><td><b>PyQt6</b></td><td>{0}</td></tr>""").format( 4631 versionInfo.append(f"<tr><td><b>PyQt6</b></td><td>{PYQT_VERSION_STR}</td></tr>")
4622 PYQT_VERSION_STR
4623 )
4624 with contextlib.suppress(ImportError, AttributeError): 4632 with contextlib.suppress(ImportError, AttributeError):
4625 from PyQt6 import QtCharts # __IGNORE_WARNING_I10__ 4633 from PyQt6 import QtCharts # __IGNORE_WARNING_I10__
4626 4634
4627 versionText += ( 4635 versionInfo.append(
4628 """<tr><td><b>PyQt6-Charts</b></td><td>{0}</td></tr>""" 4636 "<tr><td><b>PyQt6-Charts</b></td>"
4629 ).format(QtCharts.PYQT_CHART_VERSION_STR) 4637 f"<td>{QtCharts.PYQT_CHART_VERSION_STR}</td></tr>"
4638 )
4630 with contextlib.suppress(ImportError, AttributeError): 4639 with contextlib.suppress(ImportError, AttributeError):
4631 from PyQt6 import QtWebEngineCore # __IGNORE_WARNING_I10__ 4640 from PyQt6 import QtWebEngineCore # __IGNORE_WARNING_I10__
4632 4641
4633 versionText += ( 4642 versionInfo.append(
4634 """<tr><td><b>PyQt6-WebEngine</b></td><td>{0}</td></tr>""" 4643 "<tr><td><b>PyQt6-WebEngine</b></td>"
4635 ).format(QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR) 4644 f"<td>{QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR}</td></tr>"
4636 versionText += ( 4645 )
4637 """<tr><td><b>PyQt6-QScintilla</b></td><td>{0}</td></tr>""" 4646 versionInfo.extend(
4638 ).format(QSCINTILLA_VERSION_STR) 4647 [
4639 versionText += ("""<tr><td><b>sip</b></td><td>{0}</td></tr>""").format( 4648 "<tr><td><b>PyQt6-QScintilla</b></td>"
4640 sip_version_str 4649 f"<td>{QSCINTILLA_VERSION_STR}</td></tr>",
4650 f"<tr><td><b>sip</b></td><td>{sip_version_str}</td></tr>",
4651 ]
4641 ) 4652 )
4642 4653
4643 # webengine (chromium) version 4654 # webengine (chromium) version
4644 with contextlib.suppress(ImportError): 4655 with contextlib.suppress(ImportError):
4645 from eric7.WebBrowser.Tools import ( # __IGNORE_WARNING_I101__ 4656 from eric7.WebBrowser.Tools import ( # __IGNORE_WARNING_I101__
4648 4659
4649 ( 4660 (
4650 chromiumVersion, 4661 chromiumVersion,
4651 chromiumSecurityVersion, 4662 chromiumSecurityVersion,
4652 ) = WebBrowserTools.getWebEngineVersions()[0:2] 4663 ) = WebBrowserTools.getWebEngineVersions()[0:2]
4653 versionText += """<tr><td><b>WebEngine</b></td><td>{0}</td></tr>""".format( 4664 versionInfo.append(
4654 chromiumVersion 4665 f"<tr><td><b>WebEngine</b></td><td>{chromiumVersion}</td></tr>"
4655 ) 4666 )
4656 if chromiumSecurityVersion: 4667 if chromiumSecurityVersion:
4657 versionText += self.tr( 4668 versionInfo.append(
4658 """<tr><td><b>WebEngine (Security)</b></td>""" 4669 "<tr><td><b>WebEngine (Security)</b></td>"
4659 """<td>{0}</td></tr>""" 4670 f"<td>{chromiumSecurityVersion}</td></tr>"
4660 ).format(chromiumSecurityVersion) 4671 )
4661
4662 # eric7 version
4663 versionText += ("""<tr><td><b>{0}</b></td><td>{1}</td></tr>""").format(
4664 Program, Version
4665 )
4666 4672
4667 # desktop and session type 4673 # desktop and session type
4668 desktop = DesktopUtilities.desktopName() 4674 desktop = DesktopUtilities.desktopName()
4669 session = DesktopUtilities.sessionType() 4675 session = DesktopUtilities.sessionType()
4670 if desktop or session: 4676 if desktop or session:
4671 versionText += "<tr><td></td><td></td></tr>" 4677 versionInfo.append("<tr><td></td><td></td></tr>")
4672 if desktop: 4678 if desktop:
4673 versionText += ("<tr><td><b>{0}</b></td><td>{1}</td></tr>").format( 4679 versionInfo.append(
4674 self.tr("Desktop"), desktop 4680 f"<tr><td><b>{self.tr('Desktop')}</b></td><td>{desktop}</td></tr>"
4675 ) 4681 )
4676 if session: 4682 if session:
4677 versionText += ("<tr><td><b>{0}</b></td><td>{1}</td></tr>").format( 4683 versionInfo.append(
4678 self.tr("Session Type"), session 4684 f"<tr><td><b>{self.tr('Session Type')}</b></td>"
4685 f"<td>{session}</td></tr>"
4679 ) 4686 )
4680 4687
4681 versionText += self.tr("""</table>""") 4688 versionInfo.append("</table>")
4682 4689
4683 VersionsDialog(self, Program, versionText) 4690 VersionsDialog(parent=self, title=Program, text="".join(versionInfo))
4684 4691
4685 def __copyVersions(self): 4692 def __copyVersions(self):
4686 """ 4693 """
4687 Private method to generated version information and copy that to the clipboard. 4694 Private method to generated version information and copy that to the clipboard.
4688 """ 4695 """
4786 from .ErrorLogDialog import ErrorLogDialog 4793 from .ErrorLogDialog import ErrorLogDialog
4787 4794
4788 if Preferences.getUI("CheckErrorLog"): 4795 if Preferences.getUI("CheckErrorLog"):
4789 logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName) 4796 logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName)
4790 if os.path.exists(logFile): 4797 if os.path.exists(logFile):
4791 dlg = ErrorLogDialog(logFile, False, self) 4798 dlg = ErrorLogDialog(logFile, False, parent=self)
4792 dlg.exec() 4799 dlg.exec()
4793 4800
4794 def __hasErrorLog(self): 4801 def __hasErrorLog(self):
4795 """ 4802 """
4796 Private method to check, if an error log file exists. 4803 Private method to check, if an error log file exists.
4817 Private slot to show a dialog containing information about the 4824 Private slot to show a dialog containing information about the
4818 installation process. 4825 installation process.
4819 """ 4826 """
4820 from .InstallInfoDialog import InstallInfoDialog 4827 from .InstallInfoDialog import InstallInfoDialog
4821 4828
4822 dlg = InstallInfoDialog(self) 4829 dlg = InstallInfoDialog(parent=self)
4823 if dlg.wasLoaded(): 4830 if dlg.wasLoaded():
4824 dlg.exec() 4831 dlg.exec()
4825 4832
4826 def __compareFiles(self): 4833 def __compareFiles(self):
4827 """ 4834 """
5131 return False 5138 return False
5132 5139
5133 @pyqtSlot() 5140 @pyqtSlot()
5134 def upgradeEricPyQt(self): 5141 def upgradeEricPyQt(self):
5135 """ 5142 """
5136 Public slot to upgrade the eric-ide and Pyqt packages of the eric7 5143 Public slot to upgrade the eric-ide and PyQt packages of the eric7
5137 environment. 5144 environment.
5138 5145
5139 @return flag indicating a successful upgrade 5146 @return flag indicating a successful upgrade
5140 @rtype bool 5147 @rtype bool
5141 """ 5148 """
5142 yes = EricMessageBox.yesNo( 5149 yes = EricMessageBox.yesNo(
5143 None, 5150 None,
5144 self.tr("Upgrade Eric"), 5151 self.tr("Upgrade Eric and PyQt6"),
5145 self.tr( 5152 self.tr(
5146 """eric needs to be closed in order to upgrade eric and""" 5153 """eric needs to be closed in order to upgrade eric and"""
5147 """ PyQt. It will be restarted once the upgrade process""" 5154 """ PyQt. It will be restarted once the upgrade process"""
5148 """ has finished. This may take some time.\n\n Shall""" 5155 """ has finished. This may take some time.\n\n Shall"""
5149 """ the upgrade be done now?""" 5156 """ the upgrade be done now?"""
6039 """ 6046 """
6040 Private slot to handle the tools configuration menu entry. 6047 Private slot to handle the tools configuration menu entry.
6041 """ 6048 """
6042 from eric7.Preferences.ToolConfigurationDialog import ToolConfigurationDialog 6049 from eric7.Preferences.ToolConfigurationDialog import ToolConfigurationDialog
6043 6050
6044 dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self) 6051 dlg = ToolConfigurationDialog(
6052 self.toolGroups[self.currentToolGroup][1], parent=self
6053 )
6045 if dlg.exec() == QDialog.DialogCode.Accepted: 6054 if dlg.exec() == QDialog.DialogCode.Accepted:
6046 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() 6055 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist()
6047 self.__updateExternalToolsActions() 6056 self.__updateExternalToolsActions()
6048 6057
6049 def __toolGroupsConfiguration(self): 6058 def __toolGroupsConfiguration(self):
6052 """ 6061 """
6053 from eric7.Preferences.ToolGroupConfigurationDialog import ( 6062 from eric7.Preferences.ToolGroupConfigurationDialog import (
6054 ToolGroupConfigurationDialog, 6063 ToolGroupConfigurationDialog,
6055 ) 6064 )
6056 6065
6057 dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self) 6066 dlg = ToolGroupConfigurationDialog(
6067 self.toolGroups, self.currentToolGroup, parent=self
6068 )
6058 if dlg.exec() == QDialog.DialogCode.Accepted: 6069 if dlg.exec() == QDialog.DialogCode.Accepted:
6059 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() 6070 self.toolGroups, self.currentToolGroup = dlg.getToolGroups()
6060 6071
6061 def __createTestingDialog(self): 6072 def __createTestingDialog(self):
6062 """ 6073 """
7316 from eric7.Preferences.ConfigurationDialog import ConfigurationDialog 7327 from eric7.Preferences.ConfigurationDialog import ConfigurationDialog
7317 7328
7318 if self.__configurationDialog is None: 7329 if self.__configurationDialog is None:
7319 # only one invocation at a time is allowed 7330 # only one invocation at a time is allowed
7320 self.__configurationDialog = ConfigurationDialog( 7331 self.__configurationDialog = ConfigurationDialog(
7321 self, 7332 parent=self,
7322 "Configuration", 7333 name="Configuration",
7323 expandedEntries=self.__expandedConfigurationEntries, 7334 expandedEntries=self.__expandedConfigurationEntries,
7324 ) 7335 )
7325 self.__configurationDialog.preferencesChanged.connect( 7336 self.__configurationDialog.preferencesChanged.connect(
7326 self.__preferencesChanged 7337 self.__preferencesChanged
7327 ) 7338 )
7521 Private slot to configure the various view profiles. 7532 Private slot to configure the various view profiles.
7522 """ 7533 """
7523 from eric7.Preferences.ViewProfileDialog import ViewProfileDialog 7534 from eric7.Preferences.ViewProfileDialog import ViewProfileDialog
7524 7535
7525 dlg = ViewProfileDialog( 7536 dlg = ViewProfileDialog(
7526 self.__layoutType, self.profiles["edit"][1], self.profiles["debug"][1] 7537 self.__layoutType,
7538 self.profiles["edit"][1],
7539 self.profiles["debug"][1],
7540 parent=self,
7527 ) 7541 )
7528 if dlg.exec() == QDialog.DialogCode.Accepted: 7542 if dlg.exec() == QDialog.DialogCode.Accepted:
7529 edit, debug = dlg.getVisibilities() 7543 edit, debug = dlg.getVisibilities()
7530 self.profiles["edit"][1] = edit 7544 self.profiles["edit"][1] = edit
7531 self.profiles["debug"][1] = debug 7545 self.profiles["debug"][1] = debug
7539 """ 7553 """
7540 Private slot to configure the various toolbars. 7554 Private slot to configure the various toolbars.
7541 """ 7555 """
7542 from eric7.EricWidgets.EricToolBarDialog import EricToolBarDialog 7556 from eric7.EricWidgets.EricToolBarDialog import EricToolBarDialog
7543 7557
7544 dlg = EricToolBarDialog(self.toolbarManager) 7558 dlg = EricToolBarDialog(self.toolbarManager, parent=self)
7545 if dlg.exec() == QDialog.DialogCode.Accepted: 7559 if dlg.exec() == QDialog.DialogCode.Accepted:
7546 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) 7560 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState())
7547 7561
7548 def __configShortcuts(self): 7562 def __configShortcuts(self):
7549 """ 7563 """
7623 """ 7637 """
7624 Private slot to clear the private data lists. 7638 Private slot to clear the private data lists.
7625 """ 7639 """
7626 from .ClearPrivateDataDialog import ClearPrivateDataDialog 7640 from .ClearPrivateDataDialog import ClearPrivateDataDialog
7627 7641
7628 dlg = ClearPrivateDataDialog(self) 7642 dlg = ClearPrivateDataDialog(parent=self)
7629 if dlg.exec() == QDialog.DialogCode.Accepted: 7643 if dlg.exec() == QDialog.DialogCode.Accepted:
7630 # recent files, recent projects, recent multi projects, 7644 # recent files, recent projects, recent multi projects,
7631 # debug histories, shell histories 7645 # debug histories, shell histories
7632 ( 7646 (
7633 files, 7647 files,
8286 """ 8300 """
8287 Private slot to show a dialog to uninstall a plugin. 8301 Private slot to show a dialog to uninstall a plugin.
8288 """ 8302 """
8289 from eric7.PluginManager.PluginUninstallDialog import PluginUninstallDialog 8303 from eric7.PluginManager.PluginUninstallDialog import PluginUninstallDialog
8290 8304
8291 dlg = PluginUninstallDialog(self.pluginManager, self) 8305 dlg = PluginUninstallDialog(self.pluginManager, parent=self)
8292 dlg.exec() 8306 dlg.exec()
8293 8307
8294 if self.__findFileWidget: 8308 if self.__findFileWidget:
8295 self.__findFileWidget.populateFileCategories() 8309 self.__findFileWidget.populateFileCategories()
8296 if self.__findFileDialog: 8310 if self.__findFileDialog:
8301 """ 8315 """
8302 Private slot to show the plugins available for download. 8316 Private slot to show the plugins available for download.
8303 """ 8317 """
8304 from eric7.PluginManager.PluginRepositoryDialog import PluginRepositoryDialog 8318 from eric7.PluginManager.PluginRepositoryDialog import PluginRepositoryDialog
8305 8319
8306 dlg = PluginRepositoryDialog(self.pluginManager, self) 8320 dlg = PluginRepositoryDialog(self.pluginManager, parent=self)
8307 res = dlg.exec() 8321 res = dlg.exec()
8308 if res == (QDialog.DialogCode.Accepted + 1): 8322 if res == (QDialog.DialogCode.Accepted + 1):
8309 self.__installPlugins(dlg.getDownloadedPlugins()) 8323 self.__installPlugins(dlg.getDownloadedPlugins())
8310 8324
8311 def __pluginsConfigure(self): 8325 def __pluginsConfigure(self):

eric ide

mercurial