20 import Utilities |
20 import Utilities |
21 from UI.Info import Version |
21 from UI.Info import Version |
22 |
22 |
23 import UI.PixmapCache |
23 import UI.PixmapCache |
24 |
24 |
25 from eric4config import getConfig |
25 from eric5config import getConfig |
26 |
26 |
27 |
27 |
28 def makeAppInfo(argv, name, arg, description, options = []): |
28 def makeAppInfo(argv, name, arg, description, options = []): |
29 """ |
29 """ |
30 Module function to generate a dictionary describing the application. |
30 Module function to generate a dictionary describing the application. |
152 @param app reference to the application object (QApplication) |
152 @param app reference to the application object (QApplication) |
153 @param translationFiles tuple of additional translations to |
153 @param translationFiles tuple of additional translations to |
154 be loaded (tuple of strings) |
154 be loaded (tuple of strings) |
155 @return the requested locale (string) |
155 @return the requested locale (string) |
156 """ |
156 """ |
157 translations = ("qt", "eric4") + translationFiles |
157 translations = ("qt", "eric5") + translationFiles |
158 loc = Preferences.getUILanguage() |
158 loc = Preferences.getUILanguage() |
159 if loc is None: |
159 if loc is None: |
160 return |
160 return |
161 |
161 |
162 if loc == "System": |
162 if loc == "System": |
171 translator, ok = loadTranslatorForLocale(dirs, tf) |
171 translator, ok = loadTranslatorForLocale(dirs, tf) |
172 loaded_translators[tf] = translator |
172 loaded_translators[tf] = translator |
173 if ok: |
173 if ok: |
174 app.installTranslator(translator) |
174 app.installTranslator(translator) |
175 else: |
175 else: |
176 if tf.startswith("eric4"): |
176 if tf.startswith("eric5"): |
177 loca = None |
177 loca = None |
178 loc = loca |
178 loc = loca |
179 else: |
179 else: |
180 loc = None |
180 loc = None |
181 return loc |
181 return loc |
182 |
182 |
183 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed = True): |
183 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed = True): |
184 """ |
184 """ |
185 Module function to start up an application that doesn't need a specialized start up. |
185 Module function to start up an application that doesn't need a specialized start up. |
186 |
186 |
187 This function is used by all of eric4's helper programs. |
187 This function is used by all of eric5's helper programs. |
188 |
188 |
189 @param argv list of commandline parameters (list of strings) |
189 @param argv list of commandline parameters (list of strings) |
190 @param appinfo dictionary describing the application |
190 @param appinfo dictionary describing the application |
191 @param mwFactory factory function generating the main widget. This |
191 @param mwFactory factory function generating the main widget. This |
192 function must accept the following parameter. |
192 function must accept the following parameter. |