35 ] |
35 ] |
36 restartArgs = [arg for arg in sys.argv[1:] if arg.split("=", 1)[0] in restartArgsList] |
36 restartArgs = [arg for arg in sys.argv[1:] if arg.split("=", 1)[0] in restartArgsList] |
37 |
37 |
38 try: |
38 try: |
39 from PyQt6.QtCore import QCoreApplication, QLibraryInfo, QTimer, qWarning |
39 from PyQt6.QtCore import QCoreApplication, QLibraryInfo, QTimer, qWarning |
|
40 from PyQt6.QtGui import QGuiApplication |
40 except ImportError: |
41 except ImportError: |
41 try: |
42 try: |
42 from tkinter import messagebox |
43 from tkinter import messagebox |
43 except ImportError: |
44 except ImportError: |
44 sys.exit(100) |
45 sys.exit(100) |
84 QSettings.setPath( |
85 QSettings.setPath( |
85 QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir |
86 QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir |
86 ) |
87 ) |
87 sys.argv.remove(arg) |
88 sys.argv.remove(arg) |
88 |
89 |
89 # make Third-Party package available as a packages repository |
90 # make Third-Party package 'Jasy' available as a packages repository |
90 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "ThirdParty", "Jasy")) |
91 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "ThirdParty", "Jasy")) |
|
92 |
|
93 # make Python debug client available as a package repository (needed for 'coverage') |
|
94 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "DebugClients", "Python")) |
91 |
95 |
92 from eric7.EricWidgets.EricApplication import EricApplication |
96 from eric7.EricWidgets.EricApplication import EricApplication |
93 |
97 |
94 |
98 |
95 def handleSingleApplication(ddindex): |
99 def handleSingleApplication(ddindex): |
228 |
232 |
229 global app, args, mainWindow, splash, restartArgs, inMainLoop |
233 global app, args, mainWindow, splash, restartArgs, inMainLoop |
230 |
234 |
231 sys.excepthook = excepthook |
235 sys.excepthook = excepthook |
232 multiprocessing.set_start_method("spawn") |
236 multiprocessing.set_start_method("spawn") |
233 |
|
234 from PyQt6.QtGui import QGuiApplication |
|
235 |
237 |
236 QGuiApplication.setDesktopFileName("eric7.desktop") |
238 QGuiApplication.setDesktopFileName("eric7.desktop") |
237 |
239 |
238 options = [ |
240 options = [ |
239 ( |
241 ( |
280 exeDir = os.path.dirname(sys.executable) |
282 exeDir = os.path.dirname(sys.executable) |
281 if exeDir not in pathList: |
283 if exeDir not in pathList: |
282 pathList.insert(0, exeDir) |
284 pathList.insert(0, exeDir) |
283 os.environ["PATH"] = os.pathsep.join(pathList) |
285 os.environ["PATH"] = os.pathsep.join(pathList) |
284 |
286 |
285 from eric7.Toolbox import Startup |
287 from eric7.Toolbox import Startup # __IGNORE_WARNING_I101__ |
286 |
288 |
287 # set the library paths for plugins |
289 # set the library paths for plugins |
288 Startup.setLibraryPaths() |
290 Startup.setLibraryPaths() |
289 |
291 |
290 if WEBENGINE_AVAILABLE: |
292 if WEBENGINE_AVAILABLE: |
295 |
297 |
296 app = EricApplication(sys.argv) |
298 app = EricApplication(sys.argv) |
297 ddindex = Startup.handleArgs(sys.argv, appinfo) |
299 ddindex = Startup.handleArgs(sys.argv, appinfo) |
298 |
300 |
299 logging.debug("Importing Preferences") |
301 logging.debug("Importing Preferences") |
300 from eric7 import Preferences |
302 from eric7 import Preferences # __IGNORE_WARNING_I101__ |
301 |
303 |
302 if Preferences.getUI("SingleApplicationMode"): |
304 if Preferences.getUI("SingleApplicationMode"): |
303 handleSingleApplication(ddindex) |
305 handleSingleApplication(ddindex) |
304 |
306 |
305 # set the application style sheet |
307 # set the application style sheet |
307 |
309 |
308 # set the search path for icons |
310 # set the search path for icons |
309 Startup.initializeResourceSearchPath(app) |
311 Startup.initializeResourceSearchPath(app) |
310 |
312 |
311 # generate and show a splash window, if not suppressed |
313 # generate and show a splash window, if not suppressed |
312 from eric7.UI.SplashScreen import NoneSplashScreen, SplashScreen |
314 from eric7.UI.SplashScreen import ( # __IGNORE_WARNING_I101__ |
|
315 NoneSplashScreen, |
|
316 SplashScreen, |
|
317 ) |
313 |
318 |
314 if "--no-splash" in sys.argv and sys.argv.index("--no-splash") < ddindex: |
319 if "--no-splash" in sys.argv and sys.argv.index("--no-splash") < ddindex: |
315 sys.argv.remove("--no-splash") |
320 sys.argv.remove("--no-splash") |
316 ddindex -= 1 |
321 ddindex -= 1 |
317 splash = NoneSplashScreen() |
322 splash = NoneSplashScreen() |
376 |
381 |
377 # Load translation files and install them |
382 # Load translation files and install them |
378 loc = Startup.loadTranslators(qtTransDir, app, ("qscintilla",)) |
383 loc = Startup.loadTranslators(qtTransDir, app, ("qscintilla",)) |
379 |
384 |
380 # Initialize SSL stuff |
385 # Initialize SSL stuff |
381 from eric7.EricNetwork.EricSslUtilities import initSSL |
386 from eric7.EricNetwork.EricSslUtilities import initSSL # __IGNORE_WARNING_I101__ |
382 |
387 |
383 initSSL() |
388 initSSL() |
384 |
389 |
385 splash.showMessage(QCoreApplication.translate("eric7_ide", "Starting...")) |
390 splash.showMessage(QCoreApplication.translate("eric7_ide", "Starting...")) |
386 # We can only import these after creating the EricApplication because they |
391 # We can only import these after creating the EricApplication because they |
387 # make Qt calls that need the EricApplication to exist. |
392 # make Qt calls that need the EricApplication to exist. |
388 from eric7.UI.UserInterface import UserInterface |
393 from eric7.UI.UserInterface import UserInterface # __IGNORE_WARNING_I101__ |
389 |
394 |
390 splash.showMessage( |
395 splash.showMessage( |
391 QCoreApplication.translate("eric7_ide", "Generating Main Window...") |
396 QCoreApplication.translate("eric7_ide", "Generating Main Window...") |
392 ) |
397 ) |
393 mainWindow = UserInterface( |
398 mainWindow = UserInterface( |
406 mainWindow.show() |
411 mainWindow.show() |
407 |
412 |
408 QTimer.singleShot(0, uiStartUp) |
413 QTimer.singleShot(0, uiStartUp) |
409 |
414 |
410 # generate a graphical error handler |
415 # generate a graphical error handler |
411 from eric7.EricWidgets import EricErrorMessage |
416 from eric7.EricWidgets import EricErrorMessage # __IGNORE_WARNING_I101__ |
412 |
417 |
413 eMsg = EricErrorMessage.qtHandler() |
418 eMsg = EricErrorMessage.qtHandler() |
414 eMsg.setMinimumSize(600, 400) |
419 eMsg.setMinimumSize(600, 400) |
415 |
420 |
416 # start the event loop |
421 # start the event loop |