UI/UserInterface.py

branch
maintenance
changeset 6273
0daf79d65080
parent 6206
a02b03b7bfec
parent 6267
350655a6c85f
child 6319
df201b9fbad4
equal deleted inserted replaced
6207:0a74c1efab70 6273:0daf79d65080
162 BottomSide = 2 162 BottomSide = 2
163 RightSide = 3 163 RightSide = 3
164 164
165 ErrorLogFileName = "eric6_error.log" 165 ErrorLogFileName = "eric6_error.log"
166 166
167 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, 167 def __init__(self, app, locale, splash, plugin, disabledPlugins,
168 noCrashOpenAtStartup, disableCrashSession, restartArguments): 168 noOpenAtStartup, noCrashOpenAtStartup, disableCrashSession,
169 restartArguments):
169 """ 170 """
170 Constructor 171 Constructor
171 172
172 @param app reference to the application object (E5Application) 173 @param app reference to the application object
173 @param locale locale to be used by the UI (string) 174 @type E5Application
175 @param locale locale to be used by the UI
176 @type str
174 @param splash reference to the splashscreen 177 @param splash reference to the splashscreen
175 (UI.SplashScreen.SplashScreen) 178 @type UI.SplashScreen.SplashScreen
176 @param plugin filename of a plugin to be loaded (used for plugin 179 @param plugin filename of a plug-in to be loaded (used for plugin
177 development) 180 development)
181 @type str
182 @param disabledPlugins list of plug-ins that have been disabled via
183 the command line parameters '--disable-plugin='
184 @type list of str
178 @param noOpenAtStartup flag indicating that the open at startup option 185 @param noOpenAtStartup flag indicating that the open at startup option
179 should not be executed (boolean) 186 should not be executed
187 @type bool
180 @param noCrashOpenAtStartup flag indicating to ignore any crash session 188 @param noCrashOpenAtStartup flag indicating to ignore any crash session
181 file found at statup (boolean) 189 file found at statup
190 @type bool
182 @param disableCrashSession flag indicating to disable the crash session 191 @param disableCrashSession flag indicating to disable the crash session
183 support (boolean) 192 support
193 @type bool
184 @param restartArguments list of command line parameters to be used for 194 @param restartArguments list of command line parameters to be used for
185 a restart (list of strings) 195 a restart
196 @type list of str
186 """ 197 """
187 super(UserInterface, self).__init__() 198 super(UserInterface, self).__init__()
188 199
189 self.__restartArgs = restartArguments[:] 200 self.__restartArgs = restartArguments[:]
190 201
194 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") 205 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength")
195 self.locale = locale 206 self.locale = locale
196 self.__noOpenAtStartup = noOpenAtStartup 207 self.__noOpenAtStartup = noOpenAtStartup
197 self.__noCrashOpenAtStartup = noCrashOpenAtStartup 208 self.__noCrashOpenAtStartup = noCrashOpenAtStartup
198 self.__disableCrashSession = disableCrashSession 209 self.__disableCrashSession = disableCrashSession
210 self.__disabledPlugins = disabledPlugins[:]
199 211
200 self.layoutType, self.embeddedShell, self.embeddedFileBrowser = \ 212 self.layoutType, self.embeddedShell, self.embeddedFileBrowser = \
201 Preferences.getUILayout() 213 Preferences.getUILayout()
202 214
203 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled") 215 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled")
243 255
244 splash.showMessage(self.tr("Initializing Plugin Manager...")) 256 splash.showMessage(self.tr("Initializing Plugin Manager..."))
245 257
246 # Initialize the Plugin Manager (Plugins are initialized later 258 # Initialize the Plugin Manager (Plugins are initialized later
247 from PluginManager.PluginManager import PluginManager 259 from PluginManager.PluginManager import PluginManager
248 self.pluginManager = PluginManager(self, develPlugin=plugin) 260 self.pluginManager = PluginManager(self, self.__disabledPlugins,
261 develPlugin=plugin)
249 262
250 splash.showMessage(self.tr("Generating Main User Interface...")) 263 splash.showMessage(self.tr("Generating Main User Interface..."))
251 264
252 # Create the main window now so that we can connect QActions to it. 265 # Create the main window now so that we can connect QActions to it.
253 logging.debug("Creating Layout...") 266 logging.debug("Creating Layout...")
390 self.project.projectClosed.connect(self.__projectClosed) 403 self.project.projectClosed.connect(self.__projectClosed)
391 self.project.projectClosed.connect( 404 self.project.projectClosed.connect(
392 self.backgroundService.preferencesOrProjectChanged) 405 self.backgroundService.preferencesOrProjectChanged)
393 self.project.projectOpened.connect(self.__writeCrashSession) 406 self.project.projectOpened.connect(self.__writeCrashSession)
394 self.project.projectClosed.connect(self.__writeCrashSession) 407 self.project.projectClosed.connect(self.__writeCrashSession)
408 self.project.appendStdout.connect(self.appendToStdout)
409 self.project.appendStderr.connect(self.appendToStderr)
395 410
396 self.multiProject.multiProjectOpened.connect( 411 self.multiProject.multiProjectOpened.connect(
397 self.__activateMultiProjectBrowser) 412 self.__activateMultiProjectBrowser)
398 self.multiProject.multiProjectOpened.connect( 413 self.multiProject.multiProjectOpened.connect(
399 self.__writeCrashSession) 414 self.__writeCrashSession)
413 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) 428 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted)
414 self.debuggerUI.compileForms.connect( 429 self.debuggerUI.compileForms.connect(
415 self.projectBrowser.pfBrowser.compileChangedForms) 430 self.projectBrowser.pfBrowser.compileChangedForms)
416 self.debuggerUI.compileResources.connect( 431 self.debuggerUI.compileResources.connect(
417 self.projectBrowser.prBrowser.compileChangedResources) 432 self.projectBrowser.prBrowser.compileChangedResources)
433 self.debuggerUI.executeMake.connect(self.project.executeMake)
418 self.debuggerUI.appendStdout.connect(self.appendToStdout) 434 self.debuggerUI.appendStdout.connect(self.appendToStdout)
419 435
420 debugServer.passiveDebugStarted.connect( 436 debugServer.passiveDebugStarted.connect(
421 self.debugViewer.exceptionLogger.debuggingStarted) 437 self.debugViewer.exceptionLogger.debuggingStarted)
422 debugServer.passiveDebugStarted.connect( 438 debugServer.passiveDebugStarted.connect(
2564 """ 2580 """
2565 Private slot to create the menus. 2581 Private slot to create the menus.
2566 """ 2582 """
2567 self.__menus = {} 2583 self.__menus = {}
2568 mb = self.menuBar() 2584 mb = self.menuBar()
2569 # TODO: make this configurable (True default)
2570 if Utilities.isLinuxPlatform() and \ 2585 if Utilities.isLinuxPlatform() and \
2571 not Preferences.getUI("UseNativeMenuBar"): 2586 not Preferences.getUI("UseNativeMenuBar"):
2572 mb.setNativeMenuBar(False) 2587 mb.setNativeMenuBar(False)
2573 2588
2574 self.__menus["file"] = self.viewmanager.initFileMenu() 2589 self.__menus["file"] = self.viewmanager.initFileMenu()

eric ide

mercurial