47 try: |
47 try: |
48 import pygments |
48 import pygments |
49 except ImportError: |
49 except ImportError: |
50 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "ThirdParty", "Pygments")) |
50 sys.path.insert(2, os.path.join(os.path.dirname(__file__), "ThirdParty", "Pygments")) |
51 |
51 |
52 from E4Gui.E4Application import E4Application |
52 from E5Gui.E5Application import E5Application |
53 |
53 |
54 from UI.Info import Program, Version, BugAddress |
54 from UI.Info import Program, Version, BugAddress |
55 from UI.SplashScreen import SplashScreen, NoneSplashScreen |
55 from UI.SplashScreen import SplashScreen, NoneSplashScreen |
56 from E4Gui.E4SingleApplication import E4SingleApplicationClient |
56 from E5Gui.E5SingleApplication import E5SingleApplicationClient |
57 |
57 |
58 import Utilities |
58 import Utilities |
59 from Utilities import Startup |
59 from Utilities import Startup |
60 |
60 |
61 logging.debug("Importing Preferences") |
61 logging.debug("Importing Preferences") |
65 """ |
65 """ |
66 Global function to handle the single application mode. |
66 Global function to handle the single application mode. |
67 |
67 |
68 @param ddindex index of a '--' option in the options list |
68 @param ddindex index of a '--' option in the options list |
69 """ |
69 """ |
70 client = E4SingleApplicationClient() |
70 client = E5SingleApplicationClient() |
71 res = client.connect() |
71 res = client.connect() |
72 if res > 0: |
72 if res > 0: |
73 if "--nosplash" in sys.argv and sys.argv.index("--nosplash") < ddindex: |
73 if "--nosplash" in sys.argv and sys.argv.index("--nosplash") < ddindex: |
74 del sys.argv[sys.argv.index("--nosplash")] |
74 del sys.argv[sys.argv.index("--nosplash")] |
75 if "--noopen" in sys.argv and sys.argv.index("--noopen") < ddindex: |
75 if "--noopen" in sys.argv and sys.argv.index("--noopen") < ddindex: |
172 ddindex = Startup.handleArgs(sys.argv, appinfo) |
172 ddindex = Startup.handleArgs(sys.argv, appinfo) |
173 |
173 |
174 if Preferences.getUI("SingleApplicationMode"): |
174 if Preferences.getUI("SingleApplicationMode"): |
175 handleSingleApplication(ddindex) |
175 handleSingleApplication(ddindex) |
176 |
176 |
177 app = E4Application(sys.argv) |
177 app = E5Application(sys.argv) |
178 |
178 |
179 # set the searchpath for icons |
179 # set the searchpath for icons |
180 Startup.initializeResourceSearchPath() |
180 Startup.initializeResourceSearchPath() |
181 |
181 |
182 # generate and show a splash window, if not suppressed |
182 # generate and show a splash window, if not suppressed |
223 |
223 |
224 QTextCodec.setCodecForCStrings(QTextCodec.codecForName(\ |
224 QTextCodec.setCodecForCStrings(QTextCodec.codecForName(\ |
225 str(Preferences.getSystem("StringEncoding")))) |
225 str(Preferences.getSystem("StringEncoding")))) |
226 |
226 |
227 splash.showMessage(QApplication.translate("eric5", "Importing packages...")) |
227 splash.showMessage(QApplication.translate("eric5", "Importing packages...")) |
228 # We can only import these after creating the E4Application because they |
228 # We can only import these after creating the E5Application because they |
229 # make Qt calls that need the E4Application to exist. |
229 # make Qt calls that need the E5Application to exist. |
230 from UI.UserInterface import UserInterface |
230 from UI.UserInterface import UserInterface |
231 |
231 |
232 splash.showMessage(QApplication.translate("eric5", "Generating Main Window...")) |
232 splash.showMessage(QApplication.translate("eric5", "Generating Main Window...")) |
233 try: |
233 try: |
234 mainWindow = UserInterface(loc, splash, pluginFile, noopen, restartArgs) |
234 mainWindow = UserInterface(loc, splash, pluginFile, noopen, restartArgs) |