src/eric7/UI/UserInterface.py

branch
eric7
changeset 9413
80c06d472826
parent 9377
b9c8dc3b7da1
child 9421
989ee2535d59
equal deleted inserted replaced
9412:45e7bb09c120 9413:80c06d472826
55 55
56 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress 56 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress
57 from . import Config 57 from . import Config
58 from .NotificationWidget import NotificationTypes 58 from .NotificationWidget import NotificationTypes
59 59
60 from EricWidgets.EricSingleApplication import EricSingleApplicationServer 60 from eric7.EricWidgets.EricSingleApplication import EricSingleApplicationServer
61 from EricGui.EricAction import EricAction, createActionGroup 61 from eric7.EricGui.EricAction import EricAction, createActionGroup
62 from EricWidgets.EricToolBarManager import EricToolBarManager 62 from eric7.EricWidgets.EricToolBarManager import EricToolBarManager
63 from EricWidgets import EricMessageBox, EricFileDialog, EricErrorMessage 63 from eric7.EricWidgets import EricMessageBox, EricFileDialog, EricErrorMessage
64 from EricWidgets.EricApplication import ericApp 64 from eric7.EricWidgets.EricApplication import ericApp
65 from EricWidgets.EricMainWindow import EricMainWindow 65 from eric7.EricWidgets.EricMainWindow import EricMainWindow
66 from EricWidgets.EricZoomWidget import EricZoomWidget 66 from eric7.EricWidgets.EricZoomWidget import EricZoomWidget
67 from EricWidgets.EricClickableLabel import EricClickableLabel 67 from eric7.EricWidgets.EricClickableLabel import EricClickableLabel
68 68
69 import Preferences 69 from eric7 import Globals, Preferences, Utilities
70 import Utilities 70
71 import Globals 71 from eric7.EricGui import EricPixmapCache
72 72
73 import UI.PixmapCache 73 from eric7.Sessions.SessionFile import SessionFile
74 74
75 from Sessions.SessionFile import SessionFile 75 from eric7.Tasks.TasksFile import TasksFile
76 76
77 from Tasks.TasksFile import TasksFile 77 from eric7.EricNetwork.EricNetworkIcon import EricNetworkIcon
78 78 from eric7.EricNetwork.EricNetworkProxyFactory import (
79 from EricNetwork.EricNetworkIcon import EricNetworkIcon
80 from EricNetwork.EricNetworkProxyFactory import (
81 EricNetworkProxyFactory, 79 EricNetworkProxyFactory,
82 proxyAuthenticationRequired, 80 proxyAuthenticationRequired,
83 ) 81 )
84 82
85 try: 83 try:
86 from EricNetwork.EricSslErrorHandler import EricSslErrorHandler, EricSslErrorState 84 from eric7.EricNetwork.EricSslErrorHandler import (
85 EricSslErrorHandler,
86 EricSslErrorState,
87 )
87 88
88 SSL_AVAILABLE = True 89 SSL_AVAILABLE = True
89 except ImportError: 90 except ImportError:
90 SSL_AVAILABLE = False 91 SSL_AVAILABLE = False
91 92
273 274
274 self.capProject = "" 275 self.capProject = ""
275 self.capEditor = "" 276 self.capEditor = ""
276 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") 277 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename")
277 278
278 QApplication.setWindowIcon(UI.PixmapCache.getIcon("eric")) 279 QApplication.setWindowIcon(EricPixmapCache.getIcon("eric"))
279 self.setWindowIcon(UI.PixmapCache.getIcon("eric")) 280 self.setWindowIcon(EricPixmapCache.getIcon("eric"))
280 self.__setWindowCaption() 281 self.__setWindowCaption()
281 282
282 # load the view profiles 283 # load the view profiles
283 self.profiles = Preferences.getUI("ViewProfiles") 284 self.profiles = Preferences.getUI("ViewProfiles")
284 285
285 splash.showMessage(self.tr("Initializing Basic Services...")) 286 splash.showMessage(self.tr("Initializing Basic Services..."))
286 287
287 # Generate the conda interface 288 # Generate the conda interface
288 logging.debug("Creating Conda Interface...") 289 logging.debug("Creating Conda Interface...")
289 from CondaInterface.Conda import Conda 290 from eric7.CondaInterface.Conda import Conda
290 291
291 self.condaInterface = Conda(self) 292 self.condaInterface = Conda(self)
292 ericApp().registerObject("Conda", self.condaInterface) 293 ericApp().registerObject("Conda", self.condaInterface)
293 294
294 # Generate the pip interface 295 # Generate the pip interface
295 logging.debug("Creating Pip Interface...") 296 logging.debug("Creating Pip Interface...")
296 from PipInterface.Pip import Pip 297 from eric7.PipInterface.Pip import Pip
297 298
298 self.pipInterface = Pip(self) 299 self.pipInterface = Pip(self)
299 ericApp().registerObject("Pip", self.pipInterface) 300 ericApp().registerObject("Pip", self.pipInterface)
300 301
301 # Generate the virtual environment manager 302 # Generate the virtual environment manager
302 logging.debug("Creating Virtual Environments Manager...") 303 logging.debug("Creating Virtual Environments Manager...")
303 from VirtualEnv.VirtualenvManager import VirtualenvManager 304 from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager
304 305
305 self.virtualenvManager = VirtualenvManager(self) 306 self.virtualenvManager = VirtualenvManager(self)
306 # register it early because it is needed very soon 307 # register it early because it is needed very soon
307 ericApp().registerObject("VirtualEnvManager", self.virtualenvManager) 308 ericApp().registerObject("VirtualEnvManager", self.virtualenvManager)
308 309
309 # Generate an empty project object and multi project object 310 # Generate an empty project object and multi project object
310 logging.debug("Creating Project Manager...") 311 logging.debug("Creating Project Manager...")
311 from Project.Project import Project 312 from eric7.Project.Project import Project
312 313
313 self.project = Project(self) 314 self.project = Project(self)
314 ericApp().registerObject("Project", self.project) 315 ericApp().registerObject("Project", self.project)
315 316
316 from MultiProject.MultiProject import MultiProject 317 from eric7.MultiProject.MultiProject import MultiProject
317 318
318 logging.debug("Creating Multi-Project Manager...") 319 logging.debug("Creating Multi-Project Manager...")
319 self.multiProject = MultiProject(self.project, self) 320 self.multiProject = MultiProject(self.project, self)
320 321
321 # Generate the debug server object 322 # Generate the debug server object
322 logging.debug("Creating Debug Server...") 323 logging.debug("Creating Debug Server...")
323 from Debugger.DebugServer import DebugServer 324 from eric7.Debugger.DebugServer import DebugServer
324 325
325 self.__debugServer = DebugServer( 326 self.__debugServer = DebugServer(
326 self.__originalPathString, project=self.project, parent=self 327 self.__originalPathString, project=self.project, parent=self
327 ) 328 )
328 329
329 # Create the background service object 330 # Create the background service object
330 from Utilities.BackgroundService import BackgroundService 331 from eric7.Utilities.BackgroundService import BackgroundService
331 332
332 self.backgroundService = BackgroundService(self) 333 self.backgroundService = BackgroundService(self)
333 334
334 splash.showMessage(self.tr("Initializing Plugin Manager...")) 335 splash.showMessage(self.tr("Initializing Plugin Manager..."))
335 336
336 # Initialize the Plugin Manager (Plugins are initialized later 337 # Initialize the Plugin Manager (Plugins are initialized later
337 from PluginManager.PluginManager import PluginManager 338 from eric7.PluginManager.PluginManager import PluginManager
338 339
339 self.pluginManager = PluginManager( 340 self.pluginManager = PluginManager(
340 self, self.__disabledPlugins, develPlugin=plugin 341 self, self.__disabledPlugins, develPlugin=plugin
341 ) 342 )
342 343
345 self.__webBrowserProcess = None 346 self.__webBrowserProcess = None
346 self.__webBrowserClient = None 347 self.__webBrowserClient = None
347 self.__webBrowserSAName = QUuid.createUuid().toString()[1:-1] 348 self.__webBrowserSAName = QUuid.createUuid().toString()[1:-1]
348 349
349 # set spellchecker defaults 350 # set spellchecker defaults
350 from QScintilla.SpellChecker import SpellChecker 351 from eric7.QScintilla.SpellChecker import SpellChecker
351 352
352 SpellChecker.setDefaultLanguage( 353 SpellChecker.setDefaultLanguage(
353 Preferences.getEditor("SpellCheckingDefaultLanguage") 354 Preferences.getEditor("SpellCheckingDefaultLanguage")
354 ) 355 )
355 356
356 with contextlib.suppress(ImportError, AttributeError): 357 with contextlib.suppress(ImportError, AttributeError):
357 from EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin 358 from eric7.EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin
358 359
359 pwl = SpellChecker.getUserDictionaryPath(isException=False) 360 pwl = SpellChecker.getUserDictionaryPath(isException=False)
360 pel = SpellChecker.getUserDictionaryPath(isException=True) 361 pel = SpellChecker.getUserDictionaryPath(isException=True)
361 SpellCheckMixin.setDefaultLanguage( 362 SpellCheckMixin.setDefaultLanguage(
362 Preferences.getEditor("SpellCheckingDefaultLanguage"), pwl, pel 363 Preferences.getEditor("SpellCheckingDefaultLanguage"), pwl, pel
371 self.__currentRightWidget = None 372 self.__currentRightWidget = None
372 self.__currentBottomWidget = None 373 self.__currentBottomWidget = None
373 374
374 # Generate the debugger part of the ui 375 # Generate the debugger part of the ui
375 logging.debug("Creating Debugger UI...") 376 logging.debug("Creating Debugger UI...")
376 from Debugger.DebugUI import DebugUI 377 from eric7.Debugger.DebugUI import DebugUI
377 378
378 self.debuggerUI = DebugUI( 379 self.debuggerUI = DebugUI(
379 self, self.viewmanager, self.__debugServer, self.debugViewer, self.project 380 self, self.viewmanager, self.__debugServer, self.debugViewer, self.project
380 ) 381 )
381 self.debugViewer.setDebugger(self.debuggerUI) 382 self.debugViewer.setDebugger(self.debuggerUI)
749 self.pluginManager.activatePlugins() 750 self.pluginManager.activatePlugins()
750 splash.showMessage(self.tr("Generating Plugins Toolbars...")) 751 splash.showMessage(self.tr("Generating Plugins Toolbars..."))
751 self.pluginManager.initPluginToolbars(self.toolbarManager) 752 self.pluginManager.initPluginToolbars(self.toolbarManager)
752 if Preferences.getPluginManager("StartupCleanup"): 753 if Preferences.getPluginManager("StartupCleanup"):
753 splash.showMessage(self.tr("Cleaning Plugins Download Area...")) 754 splash.showMessage(self.tr("Cleaning Plugins Download Area..."))
754 from PluginManager.PluginRepositoryDialog import ( 755 from eric7.PluginManager.PluginRepositoryDialog import (
755 PluginRepositoryDownloadCleanup, 756 PluginRepositoryDownloadCleanup,
756 ) 757 )
757 758
758 PluginRepositoryDownloadCleanup(quiet=True) 759 PluginRepositoryDownloadCleanup(quiet=True)
759 760
760 # now read the keyboard shortcuts for all the actions 761 # now read the keyboard shortcuts for all the actions
761 from Preferences import Shortcuts 762 from eric7.Preferences import Shortcuts
762 763
763 Shortcuts.readShortcuts() 764 Shortcuts.readShortcuts()
764 765
765 # restore toolbar manager state 766 # restore toolbar manager state
766 splash.showMessage(self.tr("Restoring Toolbarmanager...")) 767 splash.showMessage(self.tr("Restoring Toolbarmanager..."))
840 """ 841 """
841 Private method to create the various application objects. 842 Private method to create the various application objects.
842 """ 843 """
843 # Create the view manager depending on the configuration setting 844 # Create the view manager depending on the configuration setting
844 logging.debug("Creating Viewmanager...") 845 logging.debug("Creating Viewmanager...")
845 import ViewManager 846 from eric7 import ViewManager
846 847
847 self.viewmanager = ViewManager.factory( 848 self.viewmanager = ViewManager.factory(
848 self, self, self.__debugServer, self.pluginManager 849 self, self, self.__debugServer, self.pluginManager
849 ) 850 )
850 851
866 867
867 self.__disViewer = PythonDisViewer(self.viewmanager) 868 self.__disViewer = PythonDisViewer(self.viewmanager)
868 869
869 # Create the project browser 870 # Create the project browser
870 logging.debug("Creating Project Browser...") 871 logging.debug("Creating Project Browser...")
871 from Project.ProjectBrowser import ProjectBrowser 872 from eric7.Project.ProjectBrowser import ProjectBrowser
872 873
873 self.projectBrowser = ProjectBrowser(self.project) 874 self.projectBrowser = ProjectBrowser(self.project)
874 875
875 # Create the multi project browser 876 # Create the multi project browser
876 logging.debug("Creating Multiproject Browser...") 877 logging.debug("Creating Multiproject Browser...")
877 from MultiProject.MultiProjectBrowser import MultiProjectBrowser 878 from eric7.MultiProject.MultiProjectBrowser import MultiProjectBrowser
878 879
879 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject, self.project) 880 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject, self.project)
880 881
881 # Create the task viewer part of the user interface 882 # Create the task viewer part of the user interface
882 logging.debug("Creating Task Viewer...") 883 logging.debug("Creating Task Viewer...")
883 from Tasks.TaskViewer import TaskViewer 884 from eric7.Tasks.TaskViewer import TaskViewer
884 885
885 self.taskViewer = TaskViewer(None, self.project) 886 self.taskViewer = TaskViewer(None, self.project)
886 887
887 # Create the log viewer part of the user interface 888 # Create the log viewer part of the user interface
888 logging.debug("Creating Log Viewer...") 889 logging.debug("Creating Log Viewer...")
890 891
891 self.logViewer = LogViewer(self) 892 self.logViewer = LogViewer(self)
892 893
893 # Create the debug viewer 894 # Create the debug viewer
894 logging.debug("Creating Debug Viewer...") 895 logging.debug("Creating Debug Viewer...")
895 from Debugger.DebugViewer import DebugViewer 896 from eric7.Debugger.DebugViewer import DebugViewer
896 897
897 self.debugViewer = DebugViewer(self.__debugServer) 898 self.debugViewer = DebugViewer(self.__debugServer)
898 899
899 # Create the shell 900 # Create the shell
900 logging.debug("Creating Shell...") 901 logging.debug("Creating Shell...")
901 from QScintilla.Shell import ShellAssembly 902 from eric7.QScintilla.Shell import ShellAssembly
902 903
903 self.shellAssembly = ShellAssembly( 904 self.shellAssembly = ShellAssembly(
904 self.__debugServer, self.viewmanager, self.project, True 905 self.__debugServer, self.viewmanager, self.project, True
905 ) 906 )
906 self.shell = self.shellAssembly.shell() 907 self.shell = self.shellAssembly.shell()
907 908
908 if Preferences.getUI("ShowTemplateViewer"): 909 if Preferences.getUI("ShowTemplateViewer"):
909 # Create the template viewer part of the user interface 910 # Create the template viewer part of the user interface
910 logging.debug("Creating Template Viewer...") 911 logging.debug("Creating Template Viewer...")
911 from Templates.TemplateViewer import TemplateViewer 912 from eric7.Templates.TemplateViewer import TemplateViewer
912 913
913 self.templateViewer = TemplateViewer(None, self.viewmanager) 914 self.templateViewer = TemplateViewer(None, self.viewmanager)
914 else: 915 else:
915 logging.debug("Template Viewer disabled") 916 logging.debug("Template Viewer disabled")
916 self.templateViewer = None 917 self.templateViewer = None
946 self.codeDocumentationViewer = None 947 self.codeDocumentationViewer = None
947 948
948 if Preferences.getUI("ShowPyPIPackageManager"): 949 if Preferences.getUI("ShowPyPIPackageManager"):
949 # Create the PyPI package manager 950 # Create the PyPI package manager
950 logging.debug("Creating PyPI Package Manager...") 951 logging.debug("Creating PyPI Package Manager...")
951 from PipInterface.PipPackagesWidget import PipPackagesWidget 952 from eric7.PipInterface.PipPackagesWidget import PipPackagesWidget
952 953
953 self.pipWidget = PipPackagesWidget(self.pipInterface) 954 self.pipWidget = PipPackagesWidget(self.pipInterface)
954 else: 955 else:
955 logging.debug("PyPI Package Manager disabled") 956 logging.debug("PyPI Package Manager disabled")
956 self.pipWidget = None 957 self.pipWidget = None
957 958
958 if Preferences.getUI("ShowCondaPackageManager"): 959 if Preferences.getUI("ShowCondaPackageManager"):
959 # Create the conda package manager 960 # Create the conda package manager
960 logging.debug("Creating Conda Package Manager...") 961 logging.debug("Creating Conda Package Manager...")
961 from CondaInterface.CondaPackagesWidget import CondaPackagesWidget 962 from eric7.CondaInterface.CondaPackagesWidget import CondaPackagesWidget
962 963
963 self.condaWidget = CondaPackagesWidget(self.condaInterface) 964 self.condaWidget = CondaPackagesWidget(self.condaInterface)
964 else: 965 else:
965 logging.debug("Conda Package Manager disabled") 966 logging.debug("Conda Package Manager disabled")
966 self.condaWidget = None 967 self.condaWidget = None
967 968
968 if Preferences.getUI("ShowCooperation"): 969 if Preferences.getUI("ShowCooperation"):
969 # Create the chat part of the user interface 970 # Create the chat part of the user interface
970 logging.debug("Creating Chat Widget...") 971 logging.debug("Creating Chat Widget...")
971 from Cooperation.ChatWidget import ChatWidget 972 from eric7.Cooperation.ChatWidget import ChatWidget
972 973
973 self.cooperation = ChatWidget(self) 974 self.cooperation = ChatWidget(self)
974 else: 975 else:
975 logging.debug("Chat Widget disabled") 976 logging.debug("Chat Widget disabled")
976 self.cooperation = None 977 self.cooperation = None
977 978
978 if Preferences.getUI("ShowIrc"): 979 if Preferences.getUI("ShowIrc"):
979 # Create the IRC part of the user interface 980 # Create the IRC part of the user interface
980 logging.debug("Creating IRC Widget...") 981 logging.debug("Creating IRC Widget...")
981 from Network.IRC.IrcWidget import IrcWidget 982 from eric7.Network.IRC.IrcWidget import IrcWidget
982 983
983 self.irc = IrcWidget(self) 984 self.irc = IrcWidget(self)
984 else: 985 else:
985 logging.debug("IRC Widget disabled") 986 logging.debug("IRC Widget disabled")
986 self.irc = None 987 self.irc = None
987 988
988 if Preferences.getUI("ShowMicroPython"): 989 if Preferences.getUI("ShowMicroPython"):
989 # Create the MicroPython part of the user interface 990 # Create the MicroPython part of the user interface
990 logging.debug("Creating MicroPython Widget...") 991 logging.debug("Creating MicroPython Widget...")
991 from MicroPython.MicroPythonWidget import MicroPythonWidget 992 from eric7.MicroPython.MicroPythonWidget import MicroPythonWidget
992 993
993 self.microPythonWidget = MicroPythonWidget(self) 994 self.microPythonWidget = MicroPythonWidget(self)
994 else: 995 else:
995 logging.debug("MicroPython Widget disabled") 996 logging.debug("MicroPython Widget disabled")
996 self.microPythonWidget = None 997 self.microPythonWidget = None
1005 logging.debug("Numbers Viewer disabled") 1006 logging.debug("Numbers Viewer disabled")
1006 self.numbersViewer = None 1007 self.numbersViewer = None
1007 1008
1008 # Create the Jedi Assistant 1009 # Create the Jedi Assistant
1009 logging.debug("Creating Jedi Assistant...") 1010 logging.debug("Creating Jedi Assistant...")
1010 from JediInterface.AssistantJedi import AssistantJedi 1011 from eric7.JediInterface.AssistantJedi import AssistantJedi
1011 1012
1012 self.jediAssistant = AssistantJedi(self, self.viewmanager, self.project) 1013 self.jediAssistant = AssistantJedi(self, self.viewmanager, self.project)
1013 1014
1014 # Create the plug-ins repository viewer 1015 # Create the plug-ins repository viewer
1015 from PluginManager.PluginRepositoryDialog import PluginRepositoryWidget 1016 from eric7.PluginManager.PluginRepositoryDialog import PluginRepositoryWidget
1016 1017
1017 self.pluginRepositoryViewer = PluginRepositoryWidget( 1018 self.pluginRepositoryViewer = PluginRepositoryWidget(
1018 self.pluginManager, integrated=True, parent=self 1019 self.pluginManager, integrated=True, parent=self
1019 ) 1020 )
1020 self.pluginRepositoryViewer.closeAndInstall.connect( 1021 self.pluginRepositoryViewer.closeAndInstall.connect(
1021 self.__installDownloadedPlugins 1022 self.__installDownloadedPlugins
1022 ) 1023 )
1023 1024
1024 # Create the virtual environments management widget 1025 # Create the virtual environments management widget
1025 from VirtualEnv.VirtualenvManagerWidgets import VirtualenvManagerWidget 1026 from eric7.VirtualEnv.VirtualenvManagerWidgets import VirtualenvManagerWidget
1026 1027
1027 self.__virtualenvManagerWidget = VirtualenvManagerWidget( 1028 self.__virtualenvManagerWidget = VirtualenvManagerWidget(
1028 self.virtualenvManager, self 1029 self.virtualenvManager, self
1029 ) 1030 )
1030 1031
1062 self.__findLocationWidget.umlFile.connect(self.__showUml) 1063 self.__findLocationWidget.umlFile.connect(self.__showUml)
1063 else: 1064 else:
1064 self.__findLocationWidget = None 1065 self.__findLocationWidget = None
1065 1066
1066 # Create the VCS Status widget 1067 # Create the VCS Status widget
1067 from VCS.StatusWidget import StatusWidget 1068 from eric7.VCS.StatusWidget import StatusWidget
1068 1069
1069 self.__vcsStatusWidget = StatusWidget(self.project, self.viewmanager, self) 1070 self.__vcsStatusWidget = StatusWidget(self.project, self.viewmanager, self)
1070 1071
1071 if ( 1072 if (
1072 Preferences.getUI("ShowInternalHelpViewer") 1073 Preferences.getUI("ShowInternalHelpViewer")
1073 or Preferences.getHelp("HelpViewerType") == 0 1074 or Preferences.getHelp("HelpViewerType") == 0
1074 ): 1075 ):
1075 # Create the embedded help viewer 1076 # Create the embedded help viewer
1076 logging.debug("Creating Internal Help Viewer...") 1077 logging.debug("Creating Internal Help Viewer...")
1077 from HelpViewer.HelpViewerWidget import HelpViewerWidget 1078 from eric7.HelpViewer.HelpViewerWidget import HelpViewerWidget
1078 1079
1079 self.__helpViewerWidget = HelpViewerWidget(self) 1080 self.__helpViewerWidget = HelpViewerWidget(self)
1080 else: 1081 else:
1081 logging.debug("Internal Help Viewer disabled...") 1082 logging.debug("Internal Help Viewer disabled...")
1082 self.__helpViewerWidget = None 1083 self.__helpViewerWidget = None
1136 1137
1137 def __createToolboxesLayout(self): 1138 def __createToolboxesLayout(self):
1138 """ 1139 """
1139 Private method to create the Toolboxes layout. 1140 Private method to create the Toolboxes layout.
1140 """ 1141 """
1141 from EricWidgets.EricToolBox import EricVerticalToolBox, EricHorizontalToolBox 1142 from eric7.EricWidgets.EricToolBox import (
1143 EricVerticalToolBox,
1144 EricHorizontalToolBox,
1145 )
1142 1146
1143 logging.debug("Creating Toolboxes Layout...") 1147 logging.debug("Creating Toolboxes Layout...")
1144 1148
1145 # Create the left toolbox 1149 # Create the left toolbox
1146 self.lToolboxDock = self.__createDockWindow("lToolboxDock") 1150 self.lToolboxDock = self.__createDockWindow("lToolboxDock")
1176 ## Populate the left toolbox 1180 ## Populate the left toolbox
1177 #################################################### 1181 ####################################################
1178 1182
1179 self.lToolbox.addItem( 1183 self.lToolbox.addItem(
1180 self.multiProjectBrowser, 1184 self.multiProjectBrowser,
1181 UI.PixmapCache.getIcon("multiProjectViewer"), 1185 EricPixmapCache.getIcon("multiProjectViewer"),
1182 self.tr("Multiproject-Viewer"), 1186 self.tr("Multiproject-Viewer"),
1183 ) 1187 )
1184 1188
1185 self.lToolbox.addItem( 1189 self.lToolbox.addItem(
1186 self.projectBrowser, 1190 self.projectBrowser,
1187 UI.PixmapCache.getIcon("projectViewer"), 1191 EricPixmapCache.getIcon("projectViewer"),
1188 self.tr("Project-Viewer"), 1192 self.tr("Project-Viewer"),
1189 ) 1193 )
1190 1194
1191 if self.__findFileWidget: 1195 if self.__findFileWidget:
1192 self.lToolbox.addItem( 1196 self.lToolbox.addItem(
1193 self.__findFileWidget, 1197 self.__findFileWidget,
1194 UI.PixmapCache.getIcon("find"), 1198 EricPixmapCache.getIcon("find"),
1195 self.tr("Find/Replace In Files"), 1199 self.tr("Find/Replace In Files"),
1196 ) 1200 )
1197 1201
1198 if self.__findLocationWidget: 1202 if self.__findLocationWidget:
1199 self.lToolbox.addItem( 1203 self.lToolbox.addItem(
1200 self.__findLocationWidget, 1204 self.__findLocationWidget,
1201 UI.PixmapCache.getIcon("findLocation"), 1205 EricPixmapCache.getIcon("findLocation"),
1202 self.tr("Find File"), 1206 self.tr("Find File"),
1203 ) 1207 )
1204 1208
1205 self.lToolbox.addItem( 1209 self.lToolbox.addItem(
1206 self.__vcsStatusWidget, 1210 self.__vcsStatusWidget,
1207 UI.PixmapCache.getIcon("tbVcsStatus"), 1211 EricPixmapCache.getIcon("tbVcsStatus"),
1208 self.tr("VCS Status"), 1212 self.tr("VCS Status"),
1209 ) 1213 )
1210 1214
1211 if self.templateViewer: 1215 if self.templateViewer:
1212 self.lToolbox.addItem( 1216 self.lToolbox.addItem(
1213 self.templateViewer, 1217 self.templateViewer,
1214 UI.PixmapCache.getIcon("templateViewer"), 1218 EricPixmapCache.getIcon("templateViewer"),
1215 self.tr("Template-Viewer"), 1219 self.tr("Template-Viewer"),
1216 ) 1220 )
1217 1221
1218 if self.browser: 1222 if self.browser:
1219 self.lToolbox.addItem( 1223 self.lToolbox.addItem(
1220 self.browser, UI.PixmapCache.getIcon("browser"), self.tr("File-Browser") 1224 self.browser,
1225 EricPixmapCache.getIcon("browser"),
1226 self.tr("File-Browser"),
1221 ) 1227 )
1222 1228
1223 if self.symbolsViewer: 1229 if self.symbolsViewer:
1224 self.lToolbox.addItem( 1230 self.lToolbox.addItem(
1225 self.symbolsViewer, 1231 self.symbolsViewer,
1226 UI.PixmapCache.getIcon("symbols"), 1232 EricPixmapCache.getIcon("symbols"),
1227 self.tr("Symbols"), 1233 self.tr("Symbols"),
1228 ) 1234 )
1229 1235
1230 #################################################### 1236 ####################################################
1231 ## Populate the right toolbox 1237 ## Populate the right toolbox
1232 #################################################### 1238 ####################################################
1233 1239
1234 self.rToolbox.addItem( 1240 self.rToolbox.addItem(
1235 self.debugViewer, 1241 self.debugViewer,
1236 UI.PixmapCache.getIcon("debugViewer"), 1242 EricPixmapCache.getIcon("debugViewer"),
1237 self.tr("Debug-Viewer"), 1243 self.tr("Debug-Viewer"),
1238 ) 1244 )
1239 1245
1240 if self.codeDocumentationViewer: 1246 if self.codeDocumentationViewer:
1241 self.rToolbox.addItem( 1247 self.rToolbox.addItem(
1242 self.codeDocumentationViewer, 1248 self.codeDocumentationViewer,
1243 UI.PixmapCache.getIcon("codeDocuViewer"), 1249 EricPixmapCache.getIcon("codeDocuViewer"),
1244 self.tr("Code Documentation Viewer"), 1250 self.tr("Code Documentation Viewer"),
1245 ) 1251 )
1246 1252
1247 if self.__helpViewerWidget: 1253 if self.__helpViewerWidget:
1248 self.rToolbox.addItem( 1254 self.rToolbox.addItem(
1249 self.__helpViewerWidget, 1255 self.__helpViewerWidget,
1250 UI.PixmapCache.getIcon("help"), 1256 EricPixmapCache.getIcon("help"),
1251 self.tr("Help Viewer"), 1257 self.tr("Help Viewer"),
1252 ) 1258 )
1253 1259
1254 self.rToolbox.addItem( 1260 self.rToolbox.addItem(
1255 self.pluginRepositoryViewer, 1261 self.pluginRepositoryViewer,
1256 UI.PixmapCache.getIcon("pluginRepository"), 1262 EricPixmapCache.getIcon("pluginRepository"),
1257 self.tr("Plugin Repository"), 1263 self.tr("Plugin Repository"),
1258 ) 1264 )
1259 1265
1260 self.rToolbox.addItem( 1266 self.rToolbox.addItem(
1261 self.__virtualenvManagerWidget, 1267 self.__virtualenvManagerWidget,
1262 UI.PixmapCache.getIcon("virtualenv"), 1268 EricPixmapCache.getIcon("virtualenv"),
1263 self.tr("Virtual Environments"), 1269 self.tr("Virtual Environments"),
1264 ) 1270 )
1265 1271
1266 if self.pipWidget: 1272 if self.pipWidget:
1267 self.rToolbox.addItem( 1273 self.rToolbox.addItem(
1268 self.pipWidget, UI.PixmapCache.getIcon("pypi"), self.tr("PyPI") 1274 self.pipWidget, EricPixmapCache.getIcon("pypi"), self.tr("PyPI")
1269 ) 1275 )
1270 1276
1271 if self.condaWidget: 1277 if self.condaWidget:
1272 self.rToolbox.addItem( 1278 self.rToolbox.addItem(
1273 self.condaWidget, UI.PixmapCache.getIcon("miniconda"), self.tr("Conda") 1279 self.condaWidget, EricPixmapCache.getIcon("miniconda"), self.tr("Conda")
1274 ) 1280 )
1275 1281
1276 if self.cooperation: 1282 if self.cooperation:
1277 self.rToolbox.addItem( 1283 self.rToolbox.addItem(
1278 self.cooperation, 1284 self.cooperation,
1279 UI.PixmapCache.getIcon("cooperation"), 1285 EricPixmapCache.getIcon("cooperation"),
1280 self.tr("Cooperation"), 1286 self.tr("Cooperation"),
1281 ) 1287 )
1282 1288
1283 if self.irc: 1289 if self.irc:
1284 self.rToolbox.addItem( 1290 self.rToolbox.addItem(
1285 self.irc, UI.PixmapCache.getIcon("irc"), self.tr("IRC") 1291 self.irc, EricPixmapCache.getIcon("irc"), self.tr("IRC")
1286 ) 1292 )
1287 1293
1288 if self.microPythonWidget: 1294 if self.microPythonWidget:
1289 self.rToolbox.addItem( 1295 self.rToolbox.addItem(
1290 self.microPythonWidget, 1296 self.microPythonWidget,
1291 UI.PixmapCache.getIcon("micropython"), 1297 EricPixmapCache.getIcon("micropython"),
1292 self.tr("MicroPython"), 1298 self.tr("MicroPython"),
1293 ) 1299 )
1294 1300
1295 #################################################### 1301 ####################################################
1296 ## Populate the bottom toolbox 1302 ## Populate the bottom toolbox
1297 #################################################### 1303 ####################################################
1298 1304
1299 self.hToolbox.addItem( 1305 self.hToolbox.addItem(
1300 self.shellAssembly, UI.PixmapCache.getIcon("shell"), self.tr("Shell") 1306 self.shellAssembly, EricPixmapCache.getIcon("shell"), self.tr("Shell")
1301 ) 1307 )
1302 1308
1303 self.hToolbox.addItem( 1309 self.hToolbox.addItem(
1304 self.taskViewer, UI.PixmapCache.getIcon("task"), self.tr("Task-Viewer") 1310 self.taskViewer, EricPixmapCache.getIcon("task"), self.tr("Task-Viewer")
1305 ) 1311 )
1306 1312
1307 self.hToolbox.addItem( 1313 self.hToolbox.addItem(
1308 self.logViewer, UI.PixmapCache.getIcon("logViewer"), self.tr("Log-Viewer") 1314 self.logViewer, EricPixmapCache.getIcon("logViewer"), self.tr("Log-Viewer")
1309 ) 1315 )
1310 1316
1311 if self.numbersViewer: 1317 if self.numbersViewer:
1312 self.hToolbox.addItem( 1318 self.hToolbox.addItem(
1313 self.numbersViewer, 1319 self.numbersViewer,
1314 UI.PixmapCache.getIcon("numbers"), 1320 EricPixmapCache.getIcon("numbers"),
1315 self.tr("Numbers"), 1321 self.tr("Numbers"),
1316 ) 1322 )
1317 1323
1318 #################################################### 1324 ####################################################
1319 ## Set the start index of each toolbox 1325 ## Set the start index of each toolbox
1325 1331
1326 def __createSidebarsLayout(self): 1332 def __createSidebarsLayout(self):
1327 """ 1333 """
1328 Private method to create the Sidebars layout. 1334 Private method to create the Sidebars layout.
1329 """ 1335 """
1330 from EricWidgets.EricSideBar import EricSideBar, EricSideBarSide 1336 from eric7.EricWidgets.EricSideBar import EricSideBar, EricSideBarSide
1331 1337
1332 logging.debug("Creating Sidebars Layout...") 1338 logging.debug("Creating Sidebars Layout...")
1333 1339
1334 # Create the left sidebar 1340 # Create the left sidebar
1335 self.leftSidebar = EricSideBar( 1341 self.leftSidebar = EricSideBar(
1357 ## Populate the left side bar 1363 ## Populate the left side bar
1358 #################################################### 1364 ####################################################
1359 1365
1360 self.leftSidebar.addTab( 1366 self.leftSidebar.addTab(
1361 self.multiProjectBrowser, 1367 self.multiProjectBrowser,
1362 UI.PixmapCache.getIcon("sbMultiProjectViewer96"), 1368 EricPixmapCache.getIcon("sbMultiProjectViewer96"),
1363 self.tr("Multiproject-Viewer"), 1369 self.tr("Multiproject-Viewer"),
1364 ) 1370 )
1365 1371
1366 self.leftSidebar.addTab( 1372 self.leftSidebar.addTab(
1367 self.projectBrowser, 1373 self.projectBrowser,
1368 UI.PixmapCache.getIcon("sbProjectViewer96"), 1374 EricPixmapCache.getIcon("sbProjectViewer96"),
1369 self.tr("Project-Viewer"), 1375 self.tr("Project-Viewer"),
1370 ) 1376 )
1371 1377
1372 if self.__findFileWidget: 1378 if self.__findFileWidget:
1373 self.leftSidebar.addTab( 1379 self.leftSidebar.addTab(
1374 self.__findFileWidget, 1380 self.__findFileWidget,
1375 UI.PixmapCache.getIcon("sbFind96"), 1381 EricPixmapCache.getIcon("sbFind96"),
1376 self.tr("Find/Replace In Files"), 1382 self.tr("Find/Replace In Files"),
1377 ) 1383 )
1378 1384
1379 if self.__findLocationWidget: 1385 if self.__findLocationWidget:
1380 self.leftSidebar.addTab( 1386 self.leftSidebar.addTab(
1381 self.__findLocationWidget, 1387 self.__findLocationWidget,
1382 UI.PixmapCache.getIcon("sbFindLocation96"), 1388 EricPixmapCache.getIcon("sbFindLocation96"),
1383 self.tr("Find File"), 1389 self.tr("Find File"),
1384 ) 1390 )
1385 1391
1386 self.leftSidebar.addTab( 1392 self.leftSidebar.addTab(
1387 self.__vcsStatusWidget, 1393 self.__vcsStatusWidget,
1388 UI.PixmapCache.getIcon("sbVcsStatus96"), 1394 EricPixmapCache.getIcon("sbVcsStatus96"),
1389 self.tr("VCS Status"), 1395 self.tr("VCS Status"),
1390 ) 1396 )
1391 1397
1392 if self.templateViewer: 1398 if self.templateViewer:
1393 self.leftSidebar.addTab( 1399 self.leftSidebar.addTab(
1394 self.templateViewer, 1400 self.templateViewer,
1395 UI.PixmapCache.getIcon("sbTemplateViewer96"), 1401 EricPixmapCache.getIcon("sbTemplateViewer96"),
1396 self.tr("Template-Viewer"), 1402 self.tr("Template-Viewer"),
1397 ) 1403 )
1398 1404
1399 if self.browser: 1405 if self.browser:
1400 self.leftSidebar.addTab( 1406 self.leftSidebar.addTab(
1401 self.browser, 1407 self.browser,
1402 UI.PixmapCache.getIcon("sbFileBrowser96"), 1408 EricPixmapCache.getIcon("sbFileBrowser96"),
1403 self.tr("File-Browser"), 1409 self.tr("File-Browser"),
1404 ) 1410 )
1405 1411
1406 if self.symbolsViewer: 1412 if self.symbolsViewer:
1407 self.leftSidebar.addTab( 1413 self.leftSidebar.addTab(
1408 self.symbolsViewer, 1414 self.symbolsViewer,
1409 UI.PixmapCache.getIcon("sbSymbolsViewer96"), 1415 EricPixmapCache.getIcon("sbSymbolsViewer96"),
1410 self.tr("Symbols"), 1416 self.tr("Symbols"),
1411 ) 1417 )
1412 1418
1413 ############################################################## 1419 ##############################################################
1414 ## Populate the right side bar or combined left sidebar 1420 ## Populate the right side bar or combined left sidebar
1420 # place debug viewer after 'VCS Status' widget 1426 # place debug viewer after 'VCS Status' widget
1421 index = self.leftSidebar.indexOf(self.__vcsStatusWidget) + 1 1427 index = self.leftSidebar.indexOf(self.__vcsStatusWidget) + 1
1422 sidebar.insertTab( 1428 sidebar.insertTab(
1423 index, 1429 index,
1424 self.debugViewer, 1430 self.debugViewer,
1425 UI.PixmapCache.getIcon("sbDebugViewer96"), 1431 EricPixmapCache.getIcon("sbDebugViewer96"),
1426 self.tr("Debug-Viewer"), 1432 self.tr("Debug-Viewer"),
1427 ) 1433 )
1428 else: 1434 else:
1429 sidebar.addTab( 1435 sidebar.addTab(
1430 self.debugViewer, 1436 self.debugViewer,
1431 UI.PixmapCache.getIcon("sbDebugViewer96"), 1437 EricPixmapCache.getIcon("sbDebugViewer96"),
1432 self.tr("Debug-Viewer"), 1438 self.tr("Debug-Viewer"),
1433 ) 1439 )
1434 1440
1435 if self.codeDocumentationViewer: 1441 if self.codeDocumentationViewer:
1436 sidebar.addTab( 1442 sidebar.addTab(
1437 self.codeDocumentationViewer, 1443 self.codeDocumentationViewer,
1438 UI.PixmapCache.getIcon("sbCodeDocuViewer96"), 1444 EricPixmapCache.getIcon("sbCodeDocuViewer96"),
1439 self.tr("Code Documentation Viewer"), 1445 self.tr("Code Documentation Viewer"),
1440 ) 1446 )
1441 1447
1442 if self.__helpViewerWidget: 1448 if self.__helpViewerWidget:
1443 sidebar.addTab( 1449 sidebar.addTab(
1444 self.__helpViewerWidget, 1450 self.__helpViewerWidget,
1445 UI.PixmapCache.getIcon("sbHelpViewer96"), 1451 EricPixmapCache.getIcon("sbHelpViewer96"),
1446 self.tr("Help Viewer"), 1452 self.tr("Help Viewer"),
1447 ) 1453 )
1448 1454
1449 sidebar.addTab( 1455 sidebar.addTab(
1450 self.pluginRepositoryViewer, 1456 self.pluginRepositoryViewer,
1451 UI.PixmapCache.getIcon("sbPluginRepository96"), 1457 EricPixmapCache.getIcon("sbPluginRepository96"),
1452 self.tr("Plugin Repository"), 1458 self.tr("Plugin Repository"),
1453 ) 1459 )
1454 1460
1455 sidebar.addTab( 1461 sidebar.addTab(
1456 self.__virtualenvManagerWidget, 1462 self.__virtualenvManagerWidget,
1457 UI.PixmapCache.getIcon("sbVirtenvManager96"), 1463 EricPixmapCache.getIcon("sbVirtenvManager96"),
1458 self.tr("Virtual Environments"), 1464 self.tr("Virtual Environments"),
1459 ) 1465 )
1460 1466
1461 if self.pipWidget: 1467 if self.pipWidget:
1462 sidebar.addTab( 1468 sidebar.addTab(
1463 self.pipWidget, UI.PixmapCache.getIcon("sbPyPI96"), self.tr("PyPI") 1469 self.pipWidget, EricPixmapCache.getIcon("sbPyPI96"), self.tr("PyPI")
1464 ) 1470 )
1465 1471
1466 if self.condaWidget: 1472 if self.condaWidget:
1467 sidebar.addTab( 1473 sidebar.addTab(
1468 self.condaWidget, 1474 self.condaWidget,
1469 UI.PixmapCache.getIcon("sbMiniconda96"), 1475 EricPixmapCache.getIcon("sbMiniconda96"),
1470 self.tr("Conda"), 1476 self.tr("Conda"),
1471 ) 1477 )
1472 1478
1473 if self.cooperation: 1479 if self.cooperation:
1474 sidebar.addTab( 1480 sidebar.addTab(
1475 self.cooperation, 1481 self.cooperation,
1476 UI.PixmapCache.getIcon("sbCooperation96"), 1482 EricPixmapCache.getIcon("sbCooperation96"),
1477 self.tr("Cooperation"), 1483 self.tr("Cooperation"),
1478 ) 1484 )
1479 1485
1480 if self.irc: 1486 if self.irc:
1481 sidebar.addTab(self.irc, UI.PixmapCache.getIcon("sbIrc96"), self.tr("IRC")) 1487 sidebar.addTab(self.irc, EricPixmapCache.getIcon("sbIrc96"), self.tr("IRC"))
1482 1488
1483 if self.microPythonWidget: 1489 if self.microPythonWidget:
1484 sidebar.addTab( 1490 sidebar.addTab(
1485 self.microPythonWidget, 1491 self.microPythonWidget,
1486 UI.PixmapCache.getIcon("sbMicroPython96"), 1492 EricPixmapCache.getIcon("sbMicroPython96"),
1487 self.tr("MicroPython"), 1493 self.tr("MicroPython"),
1488 ) 1494 )
1489 1495
1490 #################################################### 1496 ####################################################
1491 ## Populate the bottom side bar 1497 ## Populate the bottom side bar
1492 #################################################### 1498 ####################################################
1493 1499
1494 self.bottomSidebar.addTab( 1500 self.bottomSidebar.addTab(
1495 self.shellAssembly, UI.PixmapCache.getIcon("sbShell96"), self.tr("Shell") 1501 self.shellAssembly, EricPixmapCache.getIcon("sbShell96"), self.tr("Shell")
1496 ) 1502 )
1497 1503
1498 self.bottomSidebar.addTab( 1504 self.bottomSidebar.addTab(
1499 self.taskViewer, 1505 self.taskViewer,
1500 UI.PixmapCache.getIcon("sbTasksViewer96"), 1506 EricPixmapCache.getIcon("sbTasksViewer96"),
1501 self.tr("Task-Viewer"), 1507 self.tr("Task-Viewer"),
1502 ) 1508 )
1503 1509
1504 self.bottomSidebar.addTab( 1510 self.bottomSidebar.addTab(
1505 self.logViewer, 1511 self.logViewer,
1506 UI.PixmapCache.getIcon("sbLogViewer96"), 1512 EricPixmapCache.getIcon("sbLogViewer96"),
1507 self.tr("Log-Viewer"), 1513 self.tr("Log-Viewer"),
1508 ) 1514 )
1509 1515
1510 if self.numbersViewer: 1516 if self.numbersViewer:
1511 self.bottomSidebar.addTab( 1517 self.bottomSidebar.addTab(
1512 self.numbersViewer, 1518 self.numbersViewer,
1513 UI.PixmapCache.getIcon("sbNumbers96"), 1519 EricPixmapCache.getIcon("sbNumbers96"),
1514 self.tr("Numbers"), 1520 self.tr("Numbers"),
1515 ) 1521 )
1516 1522
1517 #################################################### 1523 ####################################################
1518 ## Set the start index of each side bar 1524 ## Set the start index of each side bar
1764 1770
1765 def processInstallInfoFile(self): 1771 def processInstallInfoFile(self):
1766 """ 1772 """
1767 Public method to process the file containing installation information. 1773 Public method to process the file containing installation information.
1768 """ 1774 """
1769 import Globals 1775 from eric7 import Globals
1770 1776
1771 installInfoFile = Globals.getInstallInfoFilePath() 1777 installInfoFile = Globals.getInstallInfoFilePath()
1772 if not os.path.exists(installInfoFile): 1778 if not os.path.exists(installInfoFile):
1773 filename = os.path.join(getConfig("ericDir"), "eric7install.json") 1779 filename = os.path.join(getConfig("ericDir"), "eric7install.json")
1774 if os.path.exists(filename): 1780 if os.path.exists(filename):
1931 self.actions = [] 1937 self.actions = []
1932 self.wizardsActions = [] 1938 self.wizardsActions = []
1933 1939
1934 self.exitAct = EricAction( 1940 self.exitAct = EricAction(
1935 self.tr("Quit"), 1941 self.tr("Quit"),
1936 UI.PixmapCache.getIcon("exit"), 1942 EricPixmapCache.getIcon("exit"),
1937 self.tr("&Quit"), 1943 self.tr("&Quit"),
1938 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), 1944 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
1939 0, 1945 0,
1940 self, 1946 self,
1941 "quit", 1947 "quit",
1953 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole) 1959 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole)
1954 self.actions.append(self.exitAct) 1960 self.actions.append(self.exitAct)
1955 1961
1956 self.restartAct = EricAction( 1962 self.restartAct = EricAction(
1957 self.tr("Restart"), 1963 self.tr("Restart"),
1958 UI.PixmapCache.getIcon("restart"), 1964 EricPixmapCache.getIcon("restart"),
1959 self.tr("Restart"), 1965 self.tr("Restart"),
1960 QKeySequence(self.tr("Ctrl+Shift+Q", "File|Quit")), 1966 QKeySequence(self.tr("Ctrl+Shift+Q", "File|Quit")),
1961 0, 1967 0,
1962 self, 1968 self,
1963 "restart_eric", 1969 "restart_eric",
2012 self.loadSessionAct.triggered.connect(self.__loadSessionFromFile) 2018 self.loadSessionAct.triggered.connect(self.__loadSessionFromFile)
2013 self.actions.append(self.loadSessionAct) 2019 self.actions.append(self.loadSessionAct)
2014 2020
2015 self.newWindowAct = EricAction( 2021 self.newWindowAct = EricAction(
2016 self.tr("New Window"), 2022 self.tr("New Window"),
2017 UI.PixmapCache.getIcon("newWindow"), 2023 EricPixmapCache.getIcon("newWindow"),
2018 self.tr("New &Window"), 2024 self.tr("New &Window"),
2019 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 2025 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
2020 0, 2026 0,
2021 self, 2027 self,
2022 "new_window", 2028 "new_window",
2034 2040
2035 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) 2041 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True)
2036 2042
2037 self.setEditProfileAct = EricAction( 2043 self.setEditProfileAct = EricAction(
2038 self.tr("Edit Profile"), 2044 self.tr("Edit Profile"),
2039 UI.PixmapCache.getIcon("viewProfileEdit"), 2045 EricPixmapCache.getIcon("viewProfileEdit"),
2040 self.tr("Edit Profile"), 2046 self.tr("Edit Profile"),
2041 0, 2047 0,
2042 0, 2048 0,
2043 self.viewProfileActGrp, 2049 self.viewProfileActGrp,
2044 "edit_profile", 2050 "edit_profile",
2056 self.setEditProfileAct.triggered.connect(self.__setEditProfile) 2062 self.setEditProfileAct.triggered.connect(self.__setEditProfile)
2057 self.actions.append(self.setEditProfileAct) 2063 self.actions.append(self.setEditProfileAct)
2058 2064
2059 self.setDebugProfileAct = EricAction( 2065 self.setDebugProfileAct = EricAction(
2060 self.tr("Debug Profile"), 2066 self.tr("Debug Profile"),
2061 UI.PixmapCache.getIcon("viewProfileDebug"), 2067 EricPixmapCache.getIcon("viewProfileDebug"),
2062 self.tr("Debug Profile"), 2068 self.tr("Debug Profile"),
2063 0, 2069 0,
2064 0, 2070 0,
2065 self.viewProfileActGrp, 2071 self.viewProfileActGrp,
2066 "debug_profile", 2072 "debug_profile",
2732 self.actions.append(self.helpViewerActivateAct) 2738 self.actions.append(self.helpViewerActivateAct)
2733 self.addAction(self.helpViewerActivateAct) 2739 self.addAction(self.helpViewerActivateAct)
2734 2740
2735 self.whatsThisAct = EricAction( 2741 self.whatsThisAct = EricAction(
2736 self.tr("What's This?"), 2742 self.tr("What's This?"),
2737 UI.PixmapCache.getIcon("whatsThis"), 2743 EricPixmapCache.getIcon("whatsThis"),
2738 self.tr("&What's This?"), 2744 self.tr("&What's This?"),
2739 QKeySequence(self.tr("Shift+F1")), 2745 QKeySequence(self.tr("Shift+F1")),
2740 0, 2746 0,
2741 self, 2747 self,
2742 "whatsThis", 2748 "whatsThis",
2755 self.whatsThisAct.triggered.connect(self.__whatsThis) 2761 self.whatsThisAct.triggered.connect(self.__whatsThis)
2756 self.actions.append(self.whatsThisAct) 2762 self.actions.append(self.whatsThisAct)
2757 2763
2758 self.helpviewerAct = EricAction( 2764 self.helpviewerAct = EricAction(
2759 self.tr("Helpviewer"), 2765 self.tr("Helpviewer"),
2760 UI.PixmapCache.getIcon("help"), 2766 EricPixmapCache.getIcon("help"),
2761 self.tr("&Helpviewer..."), 2767 self.tr("&Helpviewer..."),
2762 QKeySequence(self.tr("F1")), 2768 QKeySequence(self.tr("F1")),
2763 0, 2769 0,
2764 self, 2770 self,
2765 "helpviewer", 2771 "helpviewer",
2871 2877
2872 self.testingActGrp = createActionGroup(self) 2878 self.testingActGrp = createActionGroup(self)
2873 2879
2874 self.testingDialogAct = EricAction( 2880 self.testingDialogAct = EricAction(
2875 self.tr("Testing"), 2881 self.tr("Testing"),
2876 UI.PixmapCache.getIcon("unittest"), 2882 EricPixmapCache.getIcon("unittest"),
2877 self.tr("&Testing..."), 2883 self.tr("&Testing..."),
2878 0, 2884 0,
2879 0, 2885 0,
2880 self.testingActGrp, 2886 self.testingActGrp,
2881 "unittest", 2887 "unittest",
2892 self.testingDialogAct.triggered.connect(self.__startTesting) 2898 self.testingDialogAct.triggered.connect(self.__startTesting)
2893 self.actions.append(self.testingDialogAct) 2899 self.actions.append(self.testingDialogAct)
2894 2900
2895 self.restartTestAct = EricAction( 2901 self.restartTestAct = EricAction(
2896 self.tr("Restart Last Test"), 2902 self.tr("Restart Last Test"),
2897 UI.PixmapCache.getIcon("unittestRestart"), 2903 EricPixmapCache.getIcon("unittestRestart"),
2898 self.tr("&Restart Last Test..."), 2904 self.tr("&Restart Last Test..."),
2899 0, 2905 0,
2900 0, 2906 0,
2901 self.testingActGrp, 2907 self.testingActGrp,
2902 "unittest_restart", 2908 "unittest_restart",
2912 self.restartTestAct.setEnabled(False) 2918 self.restartTestAct.setEnabled(False)
2913 self.actions.append(self.restartTestAct) 2919 self.actions.append(self.restartTestAct)
2914 2920
2915 self.rerunFailedTestsAct = EricAction( 2921 self.rerunFailedTestsAct = EricAction(
2916 self.tr("Rerun Failed Tests"), 2922 self.tr("Rerun Failed Tests"),
2917 UI.PixmapCache.getIcon("unittestRerunFailed"), 2923 EricPixmapCache.getIcon("unittestRerunFailed"),
2918 self.tr("Rerun Failed Tests..."), 2924 self.tr("Rerun Failed Tests..."),
2919 0, 2925 0,
2920 0, 2926 0,
2921 self.testingActGrp, 2927 self.testingActGrp,
2922 "unittest_rerun_failed", 2928 "unittest_rerun_failed",
2934 self.rerunFailedTestsAct.setEnabled(False) 2940 self.rerunFailedTestsAct.setEnabled(False)
2935 self.actions.append(self.rerunFailedTestsAct) 2941 self.actions.append(self.rerunFailedTestsAct)
2936 2942
2937 self.testScriptAct = EricAction( 2943 self.testScriptAct = EricAction(
2938 self.tr("Test Script"), 2944 self.tr("Test Script"),
2939 UI.PixmapCache.getIcon("unittestScript"), 2945 EricPixmapCache.getIcon("unittestScript"),
2940 self.tr("Test &Script..."), 2946 self.tr("Test &Script..."),
2941 0, 2947 0,
2942 0, 2948 0,
2943 self.testingActGrp, 2949 self.testingActGrp,
2944 "unittest_script", 2950 "unittest_script",
2953 self.testScriptAct.setEnabled(False) 2959 self.testScriptAct.setEnabled(False)
2954 self.actions.append(self.testScriptAct) 2960 self.actions.append(self.testScriptAct)
2955 2961
2956 self.testProjectAct = EricAction( 2962 self.testProjectAct = EricAction(
2957 self.tr("Test Project"), 2963 self.tr("Test Project"),
2958 UI.PixmapCache.getIcon("unittestProject"), 2964 EricPixmapCache.getIcon("unittestProject"),
2959 self.tr("Test &Project..."), 2965 self.tr("Test &Project..."),
2960 0, 2966 0,
2961 0, 2967 0,
2962 self.testingActGrp, 2968 self.testingActGrp,
2963 "unittest_project", 2969 "unittest_project",
2985 Utilities.getQtBinariesPath(), Utilities.generateQtToolName("designer") 2991 Utilities.getQtBinariesPath(), Utilities.generateQtToolName("designer")
2986 ) 2992 )
2987 if os.path.exists(designerExe): 2993 if os.path.exists(designerExe):
2988 self.designer4Act = EricAction( 2994 self.designer4Act = EricAction(
2989 self.tr("Qt-Designer"), 2995 self.tr("Qt-Designer"),
2990 UI.PixmapCache.getIcon("designer4"), 2996 EricPixmapCache.getIcon("designer4"),
2991 self.tr("Qt-&Designer..."), 2997 self.tr("Qt-&Designer..."),
2992 0, 2998 0,
2993 0, 2999 0,
2994 self, 3000 self,
2995 "qt_designer4", 3001 "qt_designer4",
3015 Utilities.getQtBinariesPath(), Utilities.generateQtToolName("linguist") 3021 Utilities.getQtBinariesPath(), Utilities.generateQtToolName("linguist")
3016 ) 3022 )
3017 if os.path.exists(linguistExe): 3023 if os.path.exists(linguistExe):
3018 self.linguist4Act = EricAction( 3024 self.linguist4Act = EricAction(
3019 self.tr("Qt-Linguist"), 3025 self.tr("Qt-Linguist"),
3020 UI.PixmapCache.getIcon("linguist4"), 3026 EricPixmapCache.getIcon("linguist4"),
3021 self.tr("Qt-&Linguist..."), 3027 self.tr("Qt-&Linguist..."),
3022 0, 3028 0,
3023 0, 3029 0,
3024 self, 3030 self,
3025 "qt_linguist4", 3031 "qt_linguist4",
3033 else: 3039 else:
3034 self.linguist4Act = None 3040 self.linguist4Act = None
3035 3041
3036 self.uipreviewerAct = EricAction( 3042 self.uipreviewerAct = EricAction(
3037 self.tr("UI Previewer"), 3043 self.tr("UI Previewer"),
3038 UI.PixmapCache.getIcon("uiPreviewer"), 3044 EricPixmapCache.getIcon("uiPreviewer"),
3039 self.tr("&UI Previewer..."), 3045 self.tr("&UI Previewer..."),
3040 0, 3046 0,
3041 0, 3047 0,
3042 self, 3048 self,
3043 "ui_previewer", 3049 "ui_previewer",
3049 self.uipreviewerAct.triggered.connect(self.__UIPreviewer) 3055 self.uipreviewerAct.triggered.connect(self.__UIPreviewer)
3050 self.actions.append(self.uipreviewerAct) 3056 self.actions.append(self.uipreviewerAct)
3051 3057
3052 self.trpreviewerAct = EricAction( 3058 self.trpreviewerAct = EricAction(
3053 self.tr("Translations Previewer"), 3059 self.tr("Translations Previewer"),
3054 UI.PixmapCache.getIcon("trPreviewer"), 3060 EricPixmapCache.getIcon("trPreviewer"),
3055 self.tr("&Translations Previewer..."), 3061 self.tr("&Translations Previewer..."),
3056 0, 3062 0,
3057 0, 3063 0,
3058 self, 3064 self,
3059 "tr_previewer", 3065 "tr_previewer",
3068 self.trpreviewerAct.triggered.connect(self.__TRPreviewer) 3074 self.trpreviewerAct.triggered.connect(self.__TRPreviewer)
3069 self.actions.append(self.trpreviewerAct) 3075 self.actions.append(self.trpreviewerAct)
3070 3076
3071 self.diffAct = EricAction( 3077 self.diffAct = EricAction(
3072 self.tr("Compare Files"), 3078 self.tr("Compare Files"),
3073 UI.PixmapCache.getIcon("diffFiles"), 3079 EricPixmapCache.getIcon("diffFiles"),
3074 self.tr("&Compare Files..."), 3080 self.tr("&Compare Files..."),
3075 0, 3081 0,
3076 0, 3082 0,
3077 self, 3083 self,
3078 "diff_files", 3084 "diff_files",
3087 self.diffAct.triggered.connect(self.__compareFiles) 3093 self.diffAct.triggered.connect(self.__compareFiles)
3088 self.actions.append(self.diffAct) 3094 self.actions.append(self.diffAct)
3089 3095
3090 self.compareAct = EricAction( 3096 self.compareAct = EricAction(
3091 self.tr("Compare Files side by side"), 3097 self.tr("Compare Files side by side"),
3092 UI.PixmapCache.getIcon("compareFiles"), 3098 EricPixmapCache.getIcon("compareFiles"),
3093 self.tr("Compare &Files side by side..."), 3099 self.tr("Compare &Files side by side..."),
3094 0, 3100 0,
3095 0, 3101 0,
3096 self, 3102 self,
3097 "compare_files", 3103 "compare_files",
3107 self.compareAct.triggered.connect(self.__compareFilesSbs) 3113 self.compareAct.triggered.connect(self.__compareFilesSbs)
3108 self.actions.append(self.compareAct) 3114 self.actions.append(self.compareAct)
3109 3115
3110 self.sqlBrowserAct = EricAction( 3116 self.sqlBrowserAct = EricAction(
3111 self.tr("SQL Browser"), 3117 self.tr("SQL Browser"),
3112 UI.PixmapCache.getIcon("sqlBrowser"), 3118 EricPixmapCache.getIcon("sqlBrowser"),
3113 self.tr("SQL &Browser..."), 3119 self.tr("SQL &Browser..."),
3114 0, 3120 0,
3115 0, 3121 0,
3116 self, 3122 self,
3117 "sql_browser", 3123 "sql_browser",
3123 self.sqlBrowserAct.triggered.connect(self.__sqlBrowser) 3129 self.sqlBrowserAct.triggered.connect(self.__sqlBrowser)
3124 self.actions.append(self.sqlBrowserAct) 3130 self.actions.append(self.sqlBrowserAct)
3125 3131
3126 self.miniEditorAct = EricAction( 3132 self.miniEditorAct = EricAction(
3127 self.tr("Mini Editor"), 3133 self.tr("Mini Editor"),
3128 UI.PixmapCache.getIcon("editor"), 3134 EricPixmapCache.getIcon("editor"),
3129 self.tr("Mini &Editor..."), 3135 self.tr("Mini &Editor..."),
3130 0, 3136 0,
3131 0, 3137 0,
3132 self, 3138 self,
3133 "mini_editor", 3139 "mini_editor",
3142 self.miniEditorAct.triggered.connect(self.__openMiniEditor) 3148 self.miniEditorAct.triggered.connect(self.__openMiniEditor)
3143 self.actions.append(self.miniEditorAct) 3149 self.actions.append(self.miniEditorAct)
3144 3150
3145 self.hexEditorAct = EricAction( 3151 self.hexEditorAct = EricAction(
3146 self.tr("Hex Editor"), 3152 self.tr("Hex Editor"),
3147 UI.PixmapCache.getIcon("hexEditor"), 3153 EricPixmapCache.getIcon("hexEditor"),
3148 self.tr("&Hex Editor..."), 3154 self.tr("&Hex Editor..."),
3149 0, 3155 0,
3150 0, 3156 0,
3151 self, 3157 self,
3152 "hex_editor", 3158 "hex_editor",
3162 self.hexEditorAct.triggered.connect(self.__openHexEditor) 3168 self.hexEditorAct.triggered.connect(self.__openHexEditor)
3163 self.actions.append(self.hexEditorAct) 3169 self.actions.append(self.hexEditorAct)
3164 3170
3165 self.webBrowserAct = EricAction( 3171 self.webBrowserAct = EricAction(
3166 self.tr("eric Web Browser"), 3172 self.tr("eric Web Browser"),
3167 UI.PixmapCache.getIcon("ericWeb"), 3173 EricPixmapCache.getIcon("ericWeb"),
3168 self.tr("eric &Web Browser..."), 3174 self.tr("eric &Web Browser..."),
3169 0, 3175 0,
3170 0, 3176 0,
3171 self, 3177 self,
3172 "web_browser", 3178 "web_browser",
3181 self.webBrowserAct.triggered.connect(self.__startWebBrowser) 3187 self.webBrowserAct.triggered.connect(self.__startWebBrowser)
3182 self.actions.append(self.webBrowserAct) 3188 self.actions.append(self.webBrowserAct)
3183 3189
3184 self.iconEditorAct = EricAction( 3190 self.iconEditorAct = EricAction(
3185 self.tr("Icon Editor"), 3191 self.tr("Icon Editor"),
3186 UI.PixmapCache.getIcon("iconEditor"), 3192 EricPixmapCache.getIcon("iconEditor"),
3187 self.tr("&Icon Editor..."), 3193 self.tr("&Icon Editor..."),
3188 0, 3194 0,
3189 0, 3195 0,
3190 self, 3196 self,
3191 "icon_editor", 3197 "icon_editor",
3200 self.iconEditorAct.triggered.connect(self.__editPixmap) 3206 self.iconEditorAct.triggered.connect(self.__editPixmap)
3201 self.actions.append(self.iconEditorAct) 3207 self.actions.append(self.iconEditorAct)
3202 3208
3203 self.snapshotAct = EricAction( 3209 self.snapshotAct = EricAction(
3204 self.tr("Snapshot"), 3210 self.tr("Snapshot"),
3205 UI.PixmapCache.getIcon("ericSnap"), 3211 EricPixmapCache.getIcon("ericSnap"),
3206 self.tr("&Snapshot..."), 3212 self.tr("&Snapshot..."),
3207 0, 3213 0,
3208 0, 3214 0,
3209 self, 3215 self,
3210 "snapshot", 3216 "snapshot",
3220 self.snapshotAct.triggered.connect(self.__snapshot) 3226 self.snapshotAct.triggered.connect(self.__snapshot)
3221 self.actions.append(self.snapshotAct) 3227 self.actions.append(self.snapshotAct)
3222 3228
3223 self.prefAct = EricAction( 3229 self.prefAct = EricAction(
3224 self.tr("Preferences"), 3230 self.tr("Preferences"),
3225 UI.PixmapCache.getIcon("configure"), 3231 EricPixmapCache.getIcon("configure"),
3226 self.tr("&Preferences..."), 3232 self.tr("&Preferences..."),
3227 0, 3233 0,
3228 0, 3234 0,
3229 self, 3235 self,
3230 "preferences", 3236 "preferences",
3241 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole) 3247 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole)
3242 self.actions.append(self.prefAct) 3248 self.actions.append(self.prefAct)
3243 3249
3244 self.prefExportAct = EricAction( 3250 self.prefExportAct = EricAction(
3245 self.tr("Export Preferences"), 3251 self.tr("Export Preferences"),
3246 UI.PixmapCache.getIcon("configureExport"), 3252 EricPixmapCache.getIcon("configureExport"),
3247 self.tr("E&xport Preferences..."), 3253 self.tr("E&xport Preferences..."),
3248 0, 3254 0,
3249 0, 3255 0,
3250 self, 3256 self,
3251 "export_preferences", 3257 "export_preferences",
3259 ) 3265 )
3260 self.prefExportAct.triggered.connect(self.__exportPreferences) 3266 self.prefExportAct.triggered.connect(self.__exportPreferences)
3261 self.actions.append(self.prefExportAct) 3267 self.actions.append(self.prefExportAct)
3262 3268
3263 self.prefImportAct = EricAction( 3269 self.prefImportAct = EricAction(
3264 self.tr("Import Preferences"), 3270 self.tr("from eric7 import Preferences"),
3265 UI.PixmapCache.getIcon("configureImport"), 3271 EricPixmapCache.getIcon("configureImport"),
3266 self.tr("I&mport Preferences..."), 3272 self.tr("I&mport Preferences..."),
3267 0, 3273 0,
3268 0, 3274 0,
3269 self, 3275 self,
3270 "import_preferences", 3276 "import_preferences",
3272 self.prefImportAct.setStatusTip( 3278 self.prefImportAct.setStatusTip(
3273 self.tr("Import a previously exported configuration") 3279 self.tr("Import a previously exported configuration")
3274 ) 3280 )
3275 self.prefImportAct.setWhatsThis( 3281 self.prefImportAct.setWhatsThis(
3276 self.tr( 3282 self.tr(
3277 """<b>Import Preferences</b>""" 3283 """<b>from eric7 import Preferences</b>"""
3278 """<p>Import a previously exported configuration.</p>""" 3284 """<p>Import a previously exported configuration.</p>"""
3279 ) 3285 )
3280 ) 3286 )
3281 self.prefImportAct.triggered.connect(self.__importPreferences) 3287 self.prefImportAct.triggered.connect(self.__importPreferences)
3282 self.actions.append(self.prefImportAct) 3288 self.actions.append(self.prefImportAct)
3283 3289
3284 self.themeExportAct = EricAction( 3290 self.themeExportAct = EricAction(
3285 self.tr("Export Theme"), 3291 self.tr("Export Theme"),
3286 UI.PixmapCache.getIcon("themeExport"), 3292 EricPixmapCache.getIcon("themeExport"),
3287 self.tr("Export Theme..."), 3293 self.tr("Export Theme..."),
3288 0, 3294 0,
3289 0, 3295 0,
3290 self, 3296 self,
3291 "export_theme", 3297 "export_theme",
3300 self.themeExportAct.triggered.connect(self.__exportTheme) 3306 self.themeExportAct.triggered.connect(self.__exportTheme)
3301 self.actions.append(self.themeExportAct) 3307 self.actions.append(self.themeExportAct)
3302 3308
3303 self.themeImportAct = EricAction( 3309 self.themeImportAct = EricAction(
3304 self.tr("Import Theme"), 3310 self.tr("Import Theme"),
3305 UI.PixmapCache.getIcon("themeImport"), 3311 EricPixmapCache.getIcon("themeImport"),
3306 self.tr("Import Theme..."), 3312 self.tr("Import Theme..."),
3307 0, 3313 0,
3308 0, 3314 0,
3309 self, 3315 self,
3310 "import_theme", 3316 "import_theme",
3329 self.reloadAPIsAct.triggered.connect(self.__reloadAPIs) 3335 self.reloadAPIsAct.triggered.connect(self.__reloadAPIs)
3330 self.actions.append(self.reloadAPIsAct) 3336 self.actions.append(self.reloadAPIsAct)
3331 3337
3332 self.showExternalToolsAct = EricAction( 3338 self.showExternalToolsAct = EricAction(
3333 self.tr("Show external tools"), 3339 self.tr("Show external tools"),
3334 UI.PixmapCache.getIcon("showPrograms"), 3340 EricPixmapCache.getIcon("showPrograms"),
3335 self.tr("Show external &tools"), 3341 self.tr("Show external &tools"),
3336 0, 3342 0,
3337 0, 3343 0,
3338 self, 3344 self,
3339 "show_external_tools", 3345 "show_external_tools",
3349 self.showExternalToolsAct.triggered.connect(self.__showExternalTools) 3355 self.showExternalToolsAct.triggered.connect(self.__showExternalTools)
3350 self.actions.append(self.showExternalToolsAct) 3356 self.actions.append(self.showExternalToolsAct)
3351 3357
3352 self.configViewProfilesAct = EricAction( 3358 self.configViewProfilesAct = EricAction(
3353 self.tr("View Profiles"), 3359 self.tr("View Profiles"),
3354 UI.PixmapCache.getIcon("configureViewProfiles"), 3360 EricPixmapCache.getIcon("configureViewProfiles"),
3355 self.tr("&View Profiles..."), 3361 self.tr("&View Profiles..."),
3356 0, 3362 0,
3357 0, 3363 0,
3358 self, 3364 self,
3359 "view_profiles", 3365 "view_profiles",
3370 self.configViewProfilesAct.triggered.connect(self.__configViewProfiles) 3376 self.configViewProfilesAct.triggered.connect(self.__configViewProfiles)
3371 self.actions.append(self.configViewProfilesAct) 3377 self.actions.append(self.configViewProfilesAct)
3372 3378
3373 self.configToolBarsAct = EricAction( 3379 self.configToolBarsAct = EricAction(
3374 self.tr("Toolbars"), 3380 self.tr("Toolbars"),
3375 UI.PixmapCache.getIcon("toolbarsConfigure"), 3381 EricPixmapCache.getIcon("toolbarsConfigure"),
3376 self.tr("Tool&bars..."), 3382 self.tr("Tool&bars..."),
3377 0, 3383 0,
3378 0, 3384 0,
3379 self, 3385 self,
3380 "configure_toolbars", 3386 "configure_toolbars",
3391 self.configToolBarsAct.triggered.connect(self.__configToolBars) 3397 self.configToolBarsAct.triggered.connect(self.__configToolBars)
3392 self.actions.append(self.configToolBarsAct) 3398 self.actions.append(self.configToolBarsAct)
3393 3399
3394 self.shortcutsAct = EricAction( 3400 self.shortcutsAct = EricAction(
3395 self.tr("Keyboard Shortcuts"), 3401 self.tr("Keyboard Shortcuts"),
3396 UI.PixmapCache.getIcon("configureShortcuts"), 3402 EricPixmapCache.getIcon("configureShortcuts"),
3397 self.tr("Keyboard &Shortcuts..."), 3403 self.tr("Keyboard &Shortcuts..."),
3398 0, 3404 0,
3399 0, 3405 0,
3400 self, 3406 self,
3401 "keyboard_shortcuts", 3407 "keyboard_shortcuts",
3411 self.shortcutsAct.triggered.connect(self.__configShortcuts) 3417 self.shortcutsAct.triggered.connect(self.__configShortcuts)
3412 self.actions.append(self.shortcutsAct) 3418 self.actions.append(self.shortcutsAct)
3413 3419
3414 self.exportShortcutsAct = EricAction( 3420 self.exportShortcutsAct = EricAction(
3415 self.tr("Export Keyboard Shortcuts"), 3421 self.tr("Export Keyboard Shortcuts"),
3416 UI.PixmapCache.getIcon("exportShortcuts"), 3422 EricPixmapCache.getIcon("exportShortcuts"),
3417 self.tr("&Export Keyboard Shortcuts..."), 3423 self.tr("&Export Keyboard Shortcuts..."),
3418 0, 3424 0,
3419 0, 3425 0,
3420 self, 3426 self,
3421 "export_keyboard_shortcuts", 3427 "export_keyboard_shortcuts",
3430 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts) 3436 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts)
3431 self.actions.append(self.exportShortcutsAct) 3437 self.actions.append(self.exportShortcutsAct)
3432 3438
3433 self.importShortcutsAct = EricAction( 3439 self.importShortcutsAct = EricAction(
3434 self.tr("Import Keyboard Shortcuts"), 3440 self.tr("Import Keyboard Shortcuts"),
3435 UI.PixmapCache.getIcon("importShortcuts"), 3441 EricPixmapCache.getIcon("importShortcuts"),
3436 self.tr("&Import Keyboard Shortcuts..."), 3442 self.tr("&Import Keyboard Shortcuts..."),
3437 0, 3443 0,
3438 0, 3444 0,
3439 self, 3445 self,
3440 "import_keyboard_shortcuts", 3446 "import_keyboard_shortcuts",
3450 self.actions.append(self.importShortcutsAct) 3456 self.actions.append(self.importShortcutsAct)
3451 3457
3452 if SSL_AVAILABLE: 3458 if SSL_AVAILABLE:
3453 self.certificatesAct = EricAction( 3459 self.certificatesAct = EricAction(
3454 self.tr("Manage SSL Certificates"), 3460 self.tr("Manage SSL Certificates"),
3455 UI.PixmapCache.getIcon("certificates"), 3461 EricPixmapCache.getIcon("certificates"),
3456 self.tr("Manage SSL Certificates..."), 3462 self.tr("Manage SSL Certificates..."),
3457 0, 3463 0,
3458 0, 3464 0,
3459 self, 3465 self,
3460 "manage_ssl_certificates", 3466 "manage_ssl_certificates",
3472 self.certificatesAct.triggered.connect(self.__showCertificatesDialog) 3478 self.certificatesAct.triggered.connect(self.__showCertificatesDialog)
3473 self.actions.append(self.certificatesAct) 3479 self.actions.append(self.certificatesAct)
3474 3480
3475 self.editMessageFilterAct = EricAction( 3481 self.editMessageFilterAct = EricAction(
3476 self.tr("Edit Message Filters"), 3482 self.tr("Edit Message Filters"),
3477 UI.PixmapCache.getIcon("warning"), 3483 EricPixmapCache.getIcon("warning"),
3478 self.tr("Edit Message Filters..."), 3484 self.tr("Edit Message Filters..."),
3479 0, 3485 0,
3480 0, 3486 0,
3481 self, 3487 self,
3482 "manage_message_filters", 3488 "manage_message_filters",
3495 self.editMessageFilterAct.triggered.connect(EricErrorMessage.editMessageFilters) 3501 self.editMessageFilterAct.triggered.connect(EricErrorMessage.editMessageFilters)
3496 self.actions.append(self.editMessageFilterAct) 3502 self.actions.append(self.editMessageFilterAct)
3497 3503
3498 self.clearPrivateDataAct = EricAction( 3504 self.clearPrivateDataAct = EricAction(
3499 self.tr("Clear private data"), 3505 self.tr("Clear private data"),
3500 UI.PixmapCache.getIcon("clearPrivateData"), 3506 EricPixmapCache.getIcon("clearPrivateData"),
3501 self.tr("Clear private data"), 3507 self.tr("Clear private data"),
3502 0, 3508 0,
3503 0, 3509 0,
3504 self, 3510 self,
3505 "clear_private_data", 3511 "clear_private_data",
3563 self.actions.append(self.switchTabAct) 3569 self.actions.append(self.switchTabAct)
3564 self.addAction(self.switchTabAct) 3570 self.addAction(self.switchTabAct)
3565 3571
3566 self.pluginInfoAct = EricAction( 3572 self.pluginInfoAct = EricAction(
3567 self.tr("Plugin Infos"), 3573 self.tr("Plugin Infos"),
3568 UI.PixmapCache.getIcon("plugin"), 3574 EricPixmapCache.getIcon("plugin"),
3569 self.tr("&Plugin Infos..."), 3575 self.tr("&Plugin Infos..."),
3570 0, 3576 0,
3571 0, 3577 0,
3572 self, 3578 self,
3573 "plugin_infos", 3579 "plugin_infos",
3583 self.pluginInfoAct.triggered.connect(self.__showPluginInfo) 3589 self.pluginInfoAct.triggered.connect(self.__showPluginInfo)
3584 self.actions.append(self.pluginInfoAct) 3590 self.actions.append(self.pluginInfoAct)
3585 3591
3586 self.pluginInstallAct = EricAction( 3592 self.pluginInstallAct = EricAction(
3587 self.tr("Install Plugins"), 3593 self.tr("Install Plugins"),
3588 UI.PixmapCache.getIcon("pluginInstall"), 3594 EricPixmapCache.getIcon("pluginInstall"),
3589 self.tr("&Install Plugins..."), 3595 self.tr("&Install Plugins..."),
3590 0, 3596 0,
3591 0, 3597 0,
3592 self, 3598 self,
3593 "plugin_install", 3599 "plugin_install",
3602 self.pluginInstallAct.triggered.connect(self.__installPlugins) 3608 self.pluginInstallAct.triggered.connect(self.__installPlugins)
3603 self.actions.append(self.pluginInstallAct) 3609 self.actions.append(self.pluginInstallAct)
3604 3610
3605 self.pluginDeinstallAct = EricAction( 3611 self.pluginDeinstallAct = EricAction(
3606 self.tr("Uninstall Plugin"), 3612 self.tr("Uninstall Plugin"),
3607 UI.PixmapCache.getIcon("pluginUninstall"), 3613 EricPixmapCache.getIcon("pluginUninstall"),
3608 self.tr("&Uninstall Plugin..."), 3614 self.tr("&Uninstall Plugin..."),
3609 0, 3615 0,
3610 0, 3616 0,
3611 self, 3617 self,
3612 "plugin_deinstall", 3618 "plugin_deinstall",
3621 self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin) 3627 self.pluginDeinstallAct.triggered.connect(self.__deinstallPlugin)
3622 self.actions.append(self.pluginDeinstallAct) 3628 self.actions.append(self.pluginDeinstallAct)
3623 3629
3624 self.pluginRepoAct = EricAction( 3630 self.pluginRepoAct = EricAction(
3625 self.tr("Plugin Repository"), 3631 self.tr("Plugin Repository"),
3626 UI.PixmapCache.getIcon("pluginRepository"), 3632 EricPixmapCache.getIcon("pluginRepository"),
3627 self.tr("Plugin &Repository..."), 3633 self.tr("Plugin &Repository..."),
3628 0, 3634 0,
3629 0, 3635 0,
3630 self, 3636 self,
3631 "plugin_repository", 3637 "plugin_repository",
3962 ############################################################## 3968 ##############################################################
3963 ## Extras/Plugins menu 3969 ## Extras/Plugins menu
3964 ############################################################## 3970 ##############################################################
3965 3971
3966 pluginsMenu = QMenu(self.tr("P&lugins"), self) 3972 pluginsMenu = QMenu(self.tr("P&lugins"), self)
3967 pluginsMenu.setIcon(UI.PixmapCache.getIcon("plugin")) 3973 pluginsMenu.setIcon(EricPixmapCache.getIcon("plugin"))
3968 pluginsMenu.setTearOffEnabled(True) 3974 pluginsMenu.setTearOffEnabled(True)
3969 pluginsMenu.addAction(self.pluginInfoAct) 3975 pluginsMenu.addAction(self.pluginInfoAct)
3970 pluginsMenu.addAction(self.pluginInstallAct) 3976 pluginsMenu.addAction(self.pluginInstallAct)
3971 pluginsMenu.addAction(self.pluginDeinstallAct) 3977 pluginsMenu.addAction(self.pluginDeinstallAct)
3972 pluginsMenu.addSeparator() 3978 pluginsMenu.addSeparator()
4415 """ of the current editor.</p>""" 4421 """ of the current editor.</p>"""
4416 ) 4422 )
4417 ) 4423 )
4418 4424
4419 self.sbZoom = EricZoomWidget( 4425 self.sbZoom = EricZoomWidget(
4420 UI.PixmapCache.getPixmap("zoomOut"), 4426 EricPixmapCache.getPixmap("zoomOut"),
4421 UI.PixmapCache.getPixmap("zoomIn"), 4427 EricPixmapCache.getPixmap("zoomIn"),
4422 UI.PixmapCache.getPixmap("zoomReset"), 4428 EricPixmapCache.getPixmap("zoomReset"),
4423 self.__statusBar, 4429 self.__statusBar,
4424 ) 4430 )
4425 self.__statusBar.addPermanentWidget(self.sbZoom) 4431 self.__statusBar.addPermanentWidget(self.sbZoom)
4426 self.sbZoom.setWhatsThis( 4432 self.sbZoom.setWhatsThis(
4427 self.tr( 4433 self.tr(
4438 self.sbLanguage, 4444 self.sbLanguage,
4439 self.sbEol, 4445 self.sbEol,
4440 self.sbZoom, 4446 self.sbZoom,
4441 ) 4447 )
4442 4448
4443 from VCS.StatusMonitorLed import StatusMonitorLedWidget 4449 from eric7.VCS.StatusMonitorLed import StatusMonitorLedWidget
4444 4450
4445 self.sbVcsMonitorLed = StatusMonitorLedWidget(self.project, self.__statusBar) 4451 self.sbVcsMonitorLed = StatusMonitorLedWidget(self.project, self.__statusBar)
4446 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed) 4452 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed)
4447 4453
4448 self.networkIcon = EricNetworkIcon(self.__statusBar) 4454 self.networkIcon = EricNetworkIcon(self.__statusBar)
4458 for toolGroup in self.toolGroups: 4464 for toolGroup in self.toolGroups:
4459 category = self.tr("External Tools/{0}").format(toolGroup[0]) 4465 category = self.tr("External Tools/{0}").format(toolGroup[0])
4460 for tool in toolGroup[1]: 4466 for tool in toolGroup[1]:
4461 if tool["menutext"] != "--": 4467 if tool["menutext"] != "--":
4462 act = QAction( 4468 act = QAction(
4463 UI.PixmapCache.getIcon(tool["icon"]), tool["menutext"], self 4469 EricPixmapCache.getIcon(tool["icon"]), tool["menutext"], self
4464 ) 4470 )
4465 act.setObjectName("{0}@@{1}".format(toolGroup[0], tool["menutext"])) 4471 act.setObjectName("{0}@@{1}".format(toolGroup[0], tool["menutext"]))
4466 act.triggered.connect( 4472 act.triggered.connect(
4467 functools.partial(self.__toolActionTriggered, act) 4473 functools.partial(self.__toolActionTriggered, act)
4468 ) 4474 )
4501 for tool in toolGroup[1]: 4507 for tool in toolGroup[1]:
4502 if tool["menutext"] != "--": 4508 if tool["menutext"] != "--":
4503 key = "{0}@@{1}".format(toolGroup[0], tool["menutext"]) 4509 key = "{0}@@{1}".format(toolGroup[0], tool["menutext"])
4504 if key not in groupActionKeys: 4510 if key not in groupActionKeys:
4505 act = QAction( 4511 act = QAction(
4506 UI.PixmapCache.getIcon(tool["icon"]), tool["menutext"], self 4512 EricPixmapCache.getIcon(tool["icon"]), tool["menutext"], self
4507 ) 4513 )
4508 act.setObjectName(key) 4514 act.setObjectName(key)
4509 act.triggered.connect( 4515 act.triggered.connect(
4510 functools.partial(self.__toolActionTriggered, act) 4516 functools.partial(self.__toolActionTriggered, act)
4511 ) 4517 )
4639 sip_version_str 4645 sip_version_str
4640 ) 4646 )
4641 4647
4642 # webengine (chromium) version 4648 # webengine (chromium) version
4643 with contextlib.suppress(ImportError): 4649 with contextlib.suppress(ImportError):
4644 from WebBrowser.Tools import WebBrowserTools 4650 from eric7.WebBrowser.Tools import WebBrowserTools
4645 4651
4646 ( 4652 (
4647 chromiumVersion, 4653 chromiumVersion,
4648 chromiumSecurityVersion, 4654 chromiumSecurityVersion,
4649 ) = WebBrowserTools.getWebEngineVersions()[0:2] 4655 ) = WebBrowserTools.getWebEngineVersions()[0:2]
4827 4833
4828 def __openMiniEditor(self): 4834 def __openMiniEditor(self):
4829 """ 4835 """
4830 Private slot to show a mini editor window. 4836 Private slot to show a mini editor window.
4831 """ 4837 """
4832 from QScintilla.MiniEditor import MiniEditor 4838 from eric7.QScintilla.MiniEditor import MiniEditor
4833 4839
4834 editor = MiniEditor(parent=self) 4840 editor = MiniEditor(parent=self)
4835 editor.show() 4841 editor.show()
4836 4842
4837 def addEricActions(self, actions, actionType): 4843 def addEricActions(self, actions, actionType):
5223 for idx, tool in enumerate(self.toolGroups[self.currentToolGroup][1]): 5229 for idx, tool in enumerate(self.toolGroups[self.currentToolGroup][1]):
5224 if tool["menutext"] == "--": 5230 if tool["menutext"] == "--":
5225 self.__menus["user_tools"].addSeparator() 5231 self.__menus["user_tools"].addSeparator()
5226 else: 5232 else:
5227 act = self.__menus["user_tools"].addAction( 5233 act = self.__menus["user_tools"].addAction(
5228 UI.PixmapCache.getIcon(tool["icon"]), tool["menutext"] 5234 EricPixmapCache.getIcon(tool["icon"]), tool["menutext"]
5229 ) 5235 )
5230 act.setData(idx) 5236 act.setData(idx)
5231 except IndexError: 5237 except IndexError:
5232 # the current tool group might have been deleted 5238 # the current tool group might have been deleted
5233 act = self.__menus["user_tools"].addAction( 5239 act = self.__menus["user_tools"].addAction(
5931 5937
5932 def __toolsConfiguration(self): 5938 def __toolsConfiguration(self):
5933 """ 5939 """
5934 Private slot to handle the tools configuration menu entry. 5940 Private slot to handle the tools configuration menu entry.
5935 """ 5941 """
5936 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog 5942 from eric7.Preferences.ToolConfigurationDialog import ToolConfigurationDialog
5937 5943
5938 dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self) 5944 dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self)
5939 if dlg.exec() == QDialog.DialogCode.Accepted: 5945 if dlg.exec() == QDialog.DialogCode.Accepted:
5940 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() 5946 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist()
5941 self.__updateExternalToolsActions() 5947 self.__updateExternalToolsActions()
5942 5948
5943 def __toolGroupsConfiguration(self): 5949 def __toolGroupsConfiguration(self):
5944 """ 5950 """
5945 Private slot to handle the tool groups configuration menu entry. 5951 Private slot to handle the tool groups configuration menu entry.
5946 """ 5952 """
5947 from Preferences.ToolGroupConfigurationDialog import ( 5953 from eric7.Preferences.ToolGroupConfigurationDialog import (
5948 ToolGroupConfigurationDialog, 5954 ToolGroupConfigurationDialog,
5949 ) 5955 )
5950 5956
5951 dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self) 5957 dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self)
5952 if dlg.exec() == QDialog.DialogCode.Accepted: 5958 if dlg.exec() == QDialog.DialogCode.Accepted:
5955 def __createTestingDialog(self): 5961 def __createTestingDialog(self):
5956 """ 5962 """
5957 Private slot to generate the testing dialog on demand. 5963 Private slot to generate the testing dialog on demand.
5958 """ 5964 """
5959 if self.__testingWidget is None: 5965 if self.__testingWidget is None:
5960 from Testing.TestingWidget import TestingWidget 5966 from eric7.Testing.TestingWidget import TestingWidget
5961 5967
5962 self.__testingWidget = TestingWidget() 5968 self.__testingWidget = TestingWidget()
5963 self.__testingWidget.testFile.connect(self.viewmanager.setFileLine) 5969 self.__testingWidget.testFile.connect(self.viewmanager.setFileLine)
5964 self.__testingWidget.testRunStopped.connect(self.__testingStopped) 5970 self.__testingWidget.testRunStopped.connect(self.__testingStopped)
5965 5971
6410 """ 6416 """
6411 Private slot to open the hex editor window. 6417 Private slot to open the hex editor window.
6412 6418
6413 @param fn filename of the file to show (string) 6419 @param fn filename of the file to show (string)
6414 """ 6420 """
6415 from HexEdit.HexEditMainWindow import HexEditMainWindow 6421 from eric7.HexEdit.HexEditMainWindow import HexEditMainWindow
6416 6422
6417 dlg = HexEditMainWindow(fn, self, fromEric=True, project=self.project) 6423 dlg = HexEditMainWindow(fn, self, fromEric=True, project=self.project)
6418 dlg.show() 6424 dlg.show()
6419 6425
6420 @pyqtSlot() 6426 @pyqtSlot()
6423 """ 6429 """
6424 Private slot to show a pixmap in a dialog. 6430 Private slot to show a pixmap in a dialog.
6425 6431
6426 @param fn filename of the file to show (string) 6432 @param fn filename of the file to show (string)
6427 """ 6433 """
6428 from IconEditor.IconEditorWindow import IconEditorWindow 6434 from eric7.IconEditor.IconEditorWindow import IconEditorWindow
6429 6435
6430 dlg = IconEditorWindow(fn, self, fromEric=True, project=self.project) 6436 dlg = IconEditorWindow(fn, self, fromEric=True, project=self.project)
6431 dlg.show() 6437 dlg.show()
6432 6438
6433 @pyqtSlot() 6439 @pyqtSlot()
6436 """ 6442 """
6437 Private slot to show a pixmap in a dialog. 6443 Private slot to show a pixmap in a dialog.
6438 6444
6439 @param fn filename of the file to show (string) 6445 @param fn filename of the file to show (string)
6440 """ 6446 """
6441 from Graphics.PixmapDiagram import PixmapDiagram 6447 from eric7.Graphics.PixmapDiagram import PixmapDiagram
6442 6448
6443 dlg = PixmapDiagram(fn, self) 6449 dlg = PixmapDiagram(fn, self)
6444 if dlg.getStatus(): 6450 if dlg.getStatus():
6445 dlg.show() 6451 dlg.show()
6446 6452
6450 """ 6456 """
6451 Private slot to show a SVG file in a dialog. 6457 Private slot to show a SVG file in a dialog.
6452 6458
6453 @param fn filename of the file to show (string) 6459 @param fn filename of the file to show (string)
6454 """ 6460 """
6455 from Graphics.SvgDiagram import SvgDiagram 6461 from eric7.Graphics.SvgDiagram import SvgDiagram
6456 6462
6457 dlg = SvgDiagram(fn, self) 6463 dlg = SvgDiagram(fn, self)
6458 dlg.show() 6464 dlg.show()
6459 6465
6460 @pyqtSlot(str) 6466 @pyqtSlot(str)
6463 Private slot to show an eric graphics file in a dialog. 6469 Private slot to show an eric graphics file in a dialog.
6464 6470
6465 @param fn name of the file to be shown 6471 @param fn name of the file to be shown
6466 @type str 6472 @type str
6467 """ 6473 """
6468 from Graphics.UMLDialog import UMLDialog, UMLDialogType 6474 from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType
6469 6475
6470 dlg = UMLDialog(UMLDialogType.NO_DIAGRAM, self.project, parent=self) 6476 dlg = UMLDialog(UMLDialogType.NO_DIAGRAM, self.project, parent=self)
6471 if dlg.load(fn): 6477 if dlg.load(fn):
6472 dlg.show(fromFile=True) 6478 dlg.show(fromFile=True)
6473 6479
7073 @type QProcess 7079 @type QProcess
7074 @return error indication (1 = connection not possible, 0 = ok, 7080 @return error indication (1 = connection not possible, 0 = ok,
7075 -1 = server exited with an error code) 7081 -1 = server exited with an error code)
7076 @rtype int 7082 @rtype int
7077 """ 7083 """
7078 from WebBrowser.WebBrowserSingleApplication import ( 7084 from eric7.WebBrowser.WebBrowserSingleApplication import (
7079 WebBrowserSingleApplicationClient, 7085 WebBrowserSingleApplicationClient,
7080 ) 7086 )
7081 7087
7082 webBrowserClient = WebBrowserSingleApplicationClient(self.__webBrowserSAName) 7088 webBrowserClient = WebBrowserSingleApplicationClient(self.__webBrowserSAName)
7083 connectCount = 30 7089 connectCount = 30
7153 7159
7154 @param pageName name of the configuration page to show (string) 7160 @param pageName name of the configuration page to show (string)
7155 """ 7161 """
7156 if self.__configurationDialog is None: 7162 if self.__configurationDialog is None:
7157 # only one invocation at a time is allowed 7163 # only one invocation at a time is allowed
7158 from Preferences.ConfigurationDialog import ConfigurationDialog 7164 from eric7.Preferences.ConfigurationDialog import ConfigurationDialog
7159 7165
7160 self.__configurationDialog = ConfigurationDialog( 7166 self.__configurationDialog = ConfigurationDialog(
7161 self, 7167 self,
7162 "Configuration", 7168 "Configuration",
7163 expandedEntries=self.__expandedConfigurationEntries, 7169 expandedEntries=self.__expandedConfigurationEntries,
7201 Preferences.exportPreferences() 7207 Preferences.exportPreferences()
7202 7208
7203 @pyqtSlot() 7209 @pyqtSlot()
7204 def __importPreferences(self): 7210 def __importPreferences(self):
7205 """ 7211 """
7206 Private slot to import preferences. 7212 Private slot to from eric7 import Preferences.
7207 """ 7213 """
7208 Preferences.importPreferences() 7214 Preferences.importPreferences()
7209 self.__preferencesChanged() 7215 self.__preferencesChanged()
7210 7216
7211 @pyqtSlot() 7217 @pyqtSlot()
7212 def __exportTheme(self): 7218 def __exportTheme(self):
7213 """ 7219 """
7214 Private slot to export the current theme to a file. 7220 Private slot to export the current theme to a file.
7215 """ 7221 """
7216 from Preferences.ThemeManager import ThemeManager 7222 from eric7.Preferences.ThemeManager import ThemeManager
7217 7223
7218 ThemeManager().exportTheme() 7224 ThemeManager().exportTheme()
7219 7225
7220 @pyqtSlot() 7226 @pyqtSlot()
7221 def __importTheme(self): 7227 def __importTheme(self):
7222 """ 7228 """
7223 Private slot to import a previously exported theme. 7229 Private slot to import a previously exported theme.
7224 """ 7230 """
7225 from Preferences.ThemeManager import ThemeManager 7231 from eric7.Preferences.ThemeManager import ThemeManager
7226 7232
7227 if ThemeManager().importTheme(): 7233 if ThemeManager().importTheme():
7228 self.__preferencesChanged() 7234 self.__preferencesChanged()
7229 7235
7230 @pyqtSlot() 7236 @pyqtSlot()
7266 else: 7272 else:
7267 self.__setWindowCaption(editor="") 7273 self.__setWindowCaption(editor="")
7268 7274
7269 self.performVersionCheck() 7275 self.performVersionCheck()
7270 7276
7271 from QScintilla.SpellChecker import SpellChecker 7277 from eric7.QScintilla.SpellChecker import SpellChecker
7272 7278
7273 SpellChecker.setDefaultLanguage( 7279 SpellChecker.setDefaultLanguage(
7274 Preferences.getEditor("SpellCheckingDefaultLanguage") 7280 Preferences.getEditor("SpellCheckingDefaultLanguage")
7275 ) 7281 )
7276 7282
7277 with contextlib.suppress(ImportError, AttributeError): 7283 with contextlib.suppress(ImportError, AttributeError):
7278 from EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin 7284 from eric7.EricWidgets.EricSpellCheckedTextEdit import SpellCheckMixin
7279 7285
7280 pwl = SpellChecker.getUserDictionaryPath(isException=False) 7286 pwl = SpellChecker.getUserDictionaryPath(isException=False)
7281 pel = SpellChecker.getUserDictionaryPath(isException=True) 7287 pel = SpellChecker.getUserDictionaryPath(isException=True)
7282 SpellCheckMixin.setDefaultLanguage( 7288 SpellCheckMixin.setDefaultLanguage(
7283 Preferences.getEditor("SpellCheckingDefaultLanguage"), pwl, pel 7289 Preferences.getEditor("SpellCheckingDefaultLanguage"), pwl, pel
7288 else: 7294 else:
7289 self.__proxyFactory = EricNetworkProxyFactory() 7295 self.__proxyFactory = EricNetworkProxyFactory()
7290 QNetworkProxyFactory.setApplicationProxyFactory(self.__proxyFactory) 7296 QNetworkProxyFactory.setApplicationProxyFactory(self.__proxyFactory)
7291 QNetworkProxyFactory.setUseSystemConfiguration(False) 7297 QNetworkProxyFactory.setUseSystemConfiguration(False)
7292 7298
7293 from HexEdit.HexEditMainWindow import HexEditMainWindow 7299 from eric7.HexEdit.HexEditMainWindow import HexEditMainWindow
7294 7300
7295 for hexEditor in HexEditMainWindow.windows: 7301 for hexEditor in HexEditMainWindow.windows:
7296 hexEditor.preferencesChanged() 7302 hexEditor.preferencesChanged()
7297 7303
7298 # set the keyboard input interval 7304 # set the keyboard input interval
7315 Private slot to handle the change of the master password. 7321 Private slot to handle the change of the master password.
7316 7322
7317 @param oldPassword current master password (string) 7323 @param oldPassword current master password (string)
7318 @param newPassword new master password (string) 7324 @param newPassword new master password (string)
7319 """ 7325 """
7320 import Globals 7326 from eric7 import Globals
7321 7327
7322 self.masterPasswordChanged.emit(oldPassword, newPassword) 7328 self.masterPasswordChanged.emit(oldPassword, newPassword)
7323 Preferences.convertPasswords(oldPassword, newPassword) 7329 Preferences.convertPasswords(oldPassword, newPassword)
7324 variant = Globals.getWebBrowserSupport() 7330 variant = Globals.getWebBrowserSupport()
7325 if variant == "QtWebEngine": 7331 if variant == "QtWebEngine":
7326 from WebBrowser.Passwords.PasswordManager import PasswordManager 7332 from eric7.WebBrowser.Passwords.PasswordManager import PasswordManager
7327 7333
7328 pwManager = PasswordManager() 7334 pwManager = PasswordManager()
7329 pwManager.masterPasswordChanged(oldPassword, newPassword) 7335 pwManager.masterPasswordChanged(oldPassword, newPassword)
7330 Utilities.crypto.changeRememberedMaster(newPassword) 7336 Utilities.crypto.changeRememberedMaster(newPassword)
7331 7337
7339 """ 7345 """
7340 Private slot to display a dialog show a list of external tools used 7346 Private slot to display a dialog show a list of external tools used
7341 by eric. 7347 by eric.
7342 """ 7348 """
7343 if self.programsDialog is None: 7349 if self.programsDialog is None:
7344 from Preferences.ProgramsDialog import ProgramsDialog 7350 from eric7.Preferences.ProgramsDialog import ProgramsDialog
7345 7351
7346 self.programsDialog = ProgramsDialog(self) 7352 self.programsDialog = ProgramsDialog(self)
7347 self.programsDialog.show() 7353 self.programsDialog.show()
7348 7354
7349 def __configViewProfiles(self): 7355 def __configViewProfiles(self):
7350 """ 7356 """
7351 Private slot to configure the various view profiles. 7357 Private slot to configure the various view profiles.
7352 """ 7358 """
7353 from Preferences.ViewProfileDialog import ViewProfileDialog 7359 from eric7.Preferences.ViewProfileDialog import ViewProfileDialog
7354 7360
7355 dlg = ViewProfileDialog( 7361 dlg = ViewProfileDialog(
7356 self.__layoutType, self.profiles["edit"][1], self.profiles["debug"][1] 7362 self.__layoutType, self.profiles["edit"][1], self.profiles["debug"][1]
7357 ) 7363 )
7358 if dlg.exec() == QDialog.DialogCode.Accepted: 7364 if dlg.exec() == QDialog.DialogCode.Accepted:
7367 7373
7368 def __configToolBars(self): 7374 def __configToolBars(self):
7369 """ 7375 """
7370 Private slot to configure the various toolbars. 7376 Private slot to configure the various toolbars.
7371 """ 7377 """
7372 from EricWidgets.EricToolBarDialog import EricToolBarDialog 7378 from eric7.EricWidgets.EricToolBarDialog import EricToolBarDialog
7373 7379
7374 dlg = EricToolBarDialog(self.toolbarManager) 7380 dlg = EricToolBarDialog(self.toolbarManager)
7375 if dlg.exec() == QDialog.DialogCode.Accepted: 7381 if dlg.exec() == QDialog.DialogCode.Accepted:
7376 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) 7382 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState())
7377 7383
7378 def __configShortcuts(self): 7384 def __configShortcuts(self):
7379 """ 7385 """
7380 Private slot to configure the keyboard shortcuts. 7386 Private slot to configure the keyboard shortcuts.
7381 """ 7387 """
7382 if self.shortcutsDialog is None: 7388 if self.shortcutsDialog is None:
7383 from Preferences.ShortcutsDialog import ShortcutsDialog 7389 from eric7.Preferences.ShortcutsDialog import ShortcutsDialog
7384 7390
7385 self.shortcutsDialog = ShortcutsDialog(self) 7391 self.shortcutsDialog = ShortcutsDialog(self)
7386 self.shortcutsDialog.populate() 7392 self.shortcutsDialog.populate()
7387 self.shortcutsDialog.show() 7393 self.shortcutsDialog.show()
7388 7394
7420 if fpath.exists() 7426 if fpath.exists()
7421 else True 7427 else True
7422 ) 7428 )
7423 7429
7424 if ok: 7430 if ok:
7425 from Preferences import Shortcuts 7431 from eric7.Preferences import Shortcuts
7426 7432
7427 Shortcuts.exportShortcuts(str(fpath)) 7433 Shortcuts.exportShortcuts(str(fpath))
7428 7434
7429 def __importShortcuts(self): 7435 def __importShortcuts(self):
7430 """ 7436 """
7438 "Keyboard Shortcuts File (*.ekj);;" "XML Keyboard shortcut file (*.e4k)" 7444 "Keyboard Shortcuts File (*.ekj);;" "XML Keyboard shortcut file (*.e4k)"
7439 ), 7445 ),
7440 ) 7446 )
7441 7447
7442 if fn: 7448 if fn:
7443 from Preferences import Shortcuts 7449 from eric7.Preferences import Shortcuts
7444 7450
7445 Shortcuts.importShortcuts(fn) 7451 Shortcuts.importShortcuts(fn)
7446 7452
7447 def __showCertificatesDialog(self): 7453 def __showCertificatesDialog(self):
7448 """ 7454 """
7449 Private slot to show the certificates management dialog. 7455 Private slot to show the certificates management dialog.
7450 """ 7456 """
7451 from EricNetwork.EricSslCertificatesDialog import EricSslCertificatesDialog 7457 from eric7.EricNetwork.EricSslCertificatesDialog import (
7458 EricSslCertificatesDialog,
7459 )
7452 7460
7453 dlg = EricSslCertificatesDialog(self) 7461 dlg = EricSslCertificatesDialog(self)
7454 dlg.exec() 7462 dlg.exec()
7455 7463
7456 def __clearPrivateData(self): 7464 def __clearPrivateData(self):
7489 # clear the shell histories 7497 # clear the shell histories
7490 self.shell.clearAllHistories() 7498 self.shell.clearAllHistories()
7491 if testing: 7499 if testing:
7492 # clear the unit test histories 7500 # clear the unit test histories
7493 if self.__testingWidget is None: 7501 if self.__testingWidget is None:
7494 from Testing.TestingWidget import clearSavedHistories 7502 from eric7.Testing.TestingWidget import clearSavedHistories
7495 7503
7496 clearSavedHistories() 7504 clearSavedHistories()
7497 else: 7505 else:
7498 self.__testingWidget.clearRecent() 7506 self.__testingWidget.clearRecent()
7499 if vcs: 7507 if vcs:
7513 7521
7514 def __projectOpened(self): 7522 def __projectOpened(self):
7515 """ 7523 """
7516 Private slot to handle the projectOpened signal. 7524 Private slot to handle the projectOpened signal.
7517 """ 7525 """
7518 import Testing 7526 from eric7 import Testing
7519 7527
7520 self.__setWindowCaption(project=self.project.name) 7528 self.__setWindowCaption(project=self.project.name)
7521 supported = Testing.isLanguageSupported(self.project.getProjectLanguage()) 7529 supported = Testing.isLanguageSupported(self.project.getProjectLanguage())
7522 self.testProjectAct.setEnabled(supported) 7530 self.testProjectAct.setEnabled(supported)
7523 self.__testingProjectOpen = supported 7531 self.__testingProjectOpen = supported
7566 @param fn filename of the opened editor (string) 7574 @param fn filename of the opened editor (string)
7567 """ 7575 """
7568 self.wizardsMenuAct.setEnabled(len(self.__menus["wizards"].actions()) > 0) 7576 self.wizardsMenuAct.setEnabled(len(self.__menus["wizards"].actions()) > 0)
7569 7577
7570 if fn and str(fn) != "None": 7578 if fn and str(fn) != "None":
7571 import Testing 7579 from eric7 import Testing
7572 7580
7573 if Testing.isLanguageSupported( 7581 if Testing.isLanguageSupported(
7574 self.viewmanager.getOpenEditor(fn).getFileType() 7582 self.viewmanager.getOpenEditor(fn).getFileType()
7575 ): 7583 ):
7576 self.testScriptAct.setEnabled(True) 7584 self.testScriptAct.setEnabled(True)
7583 @param editor editor window 7591 @param editor editor window
7584 """ 7592 """
7585 fn = editor.getFileName() if editor else None 7593 fn = editor.getFileName() if editor else None
7586 7594
7587 if fn: 7595 if fn:
7588 import Testing 7596 from eric7 import Testing
7589 7597
7590 if Testing.isLanguageSupported(editor.getFileType()): 7598 if Testing.isLanguageSupported(editor.getFileType()):
7591 self.testScriptAct.setEnabled(True) 7599 self.testScriptAct.setEnabled(True)
7592 self.__testingEditorOpen = True 7600 self.__testingEditorOpen = True
7593 return 7601 return
7613 # try old style XML file second 7621 # try old style XML file second
7614 fn = os.path.join(Utilities.getConfigDir(), "eric7tasks.e6t") 7622 fn = os.path.join(Utilities.getConfigDir(), "eric7tasks.e6t")
7615 if os.path.exists(fn): 7623 if os.path.exists(fn):
7616 f = QFile(fn) 7624 f = QFile(fn)
7617 if f.open(QIODevice.OpenModeFlag.ReadOnly): 7625 if f.open(QIODevice.OpenModeFlag.ReadOnly):
7618 from EricXML.TasksReader import TasksReader 7626 from eric7.EricXML.TasksReader import TasksReader
7619 7627
7620 reader = TasksReader(f, viewer=self.taskViewer) 7628 reader = TasksReader(f, viewer=self.taskViewer)
7621 reader.readXML() 7629 reader.readXML()
7622 f.close() 7630 f.close()
7623 else: 7631 else:
7683 self.__readingSession = False 7691 self.__readingSession = False
7684 else: 7692 else:
7685 # old XML based format 7693 # old XML based format
7686 f = QFile(fn) 7694 f = QFile(fn)
7687 if f.open(QIODevice.OpenModeFlag.ReadOnly): 7695 if f.open(QIODevice.OpenModeFlag.ReadOnly):
7688 from EricXML.SessionReader import SessionReader 7696 from eric7.EricXML.SessionReader import SessionReader
7689 7697
7690 self.__readingSession = True 7698 self.__readingSession = True
7691 reader = SessionReader(f, True) 7699 reader = SessionReader(f, True)
7692 reader.readXML() 7700 reader.readXML()
7693 self.__readingSession = False 7701 self.__readingSession = False
8003 8011
8004 def __showPluginInfo(self): 8012 def __showPluginInfo(self):
8005 """ 8013 """
8006 Private slot to show the plugin info dialog. 8014 Private slot to show the plugin info dialog.
8007 """ 8015 """
8008 from PluginManager.PluginInfoDialog import PluginInfoDialog 8016 from eric7.PluginManager.PluginInfoDialog import PluginInfoDialog
8009 8017
8010 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self) 8018 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self)
8011 self.__pluginInfoDialog.show() 8019 self.__pluginInfoDialog.show()
8012 8020
8013 @pyqtSlot() 8021 @pyqtSlot()
8016 Private slot to show a dialog to install a new plugin. 8024 Private slot to show a dialog to install a new plugin.
8017 8025
8018 @param pluginFileNames list of plugin files suggested for 8026 @param pluginFileNames list of plugin files suggested for
8019 installation list of strings 8027 installation list of strings
8020 """ 8028 """
8021 from PluginManager.PluginInstallDialog import PluginInstallDialog 8029 from eric7.PluginManager.PluginInstallDialog import PluginInstallDialog
8022 8030
8023 self.__pluginInstallDialog = PluginInstallDialog( 8031 self.__pluginInstallDialog = PluginInstallDialog(
8024 self.pluginManager, 8032 self.pluginManager,
8025 [] if pluginFileNames is None else pluginFileNames[:], 8033 [] if pluginFileNames is None else pluginFileNames[:],
8026 self, 8034 self,
8043 8051
8044 def __deinstallPlugin(self): 8052 def __deinstallPlugin(self):
8045 """ 8053 """
8046 Private slot to show a dialog to uninstall a plugin. 8054 Private slot to show a dialog to uninstall a plugin.
8047 """ 8055 """
8048 from PluginManager.PluginUninstallDialog import PluginUninstallDialog 8056 from eric7.PluginManager.PluginUninstallDialog import PluginUninstallDialog
8049 8057
8050 dlg = PluginUninstallDialog(self.pluginManager, self) 8058 dlg = PluginUninstallDialog(self.pluginManager, self)
8051 dlg.exec() 8059 dlg.exec()
8052 8060
8053 @pyqtSlot() 8061 @pyqtSlot()
8054 def __showPluginsAvailable(self): 8062 def __showPluginsAvailable(self):
8055 """ 8063 """
8056 Private slot to show the plugins available for download. 8064 Private slot to show the plugins available for download.
8057 """ 8065 """
8058 from PluginManager.PluginRepositoryDialog import PluginRepositoryDialog 8066 from eric7.PluginManager.PluginRepositoryDialog import PluginRepositoryDialog
8059 8067
8060 dlg = PluginRepositoryDialog(self.pluginManager, self) 8068 dlg = PluginRepositoryDialog(self.pluginManager, self)
8061 res = dlg.exec() 8069 res = dlg.exec()
8062 if res == (QDialog.DialogCode.Accepted + 1): 8070 if res == (QDialog.DialogCode.Accepted + 1):
8063 self.__installPlugins(dlg.getDownloadedPlugins()) 8071 self.__installPlugins(dlg.getDownloadedPlugins())

eric ide

mercurial