92 """ |
92 """ |
93 Module function to find and load a specific translation. |
93 Module function to find and load a specific translation. |
94 |
94 |
95 @param dirs Searchpath for the translations. (list of strings) |
95 @param dirs Searchpath for the translations. (list of strings) |
96 @param tn The translation to be loaded. (string) |
96 @param tn The translation to be loaded. (string) |
97 @return Tuple of a status flag and the loaded translator. (int, QTranslator) |
97 @return Tuple of a status flag and the loaded translator |
|
98 (int, QTranslator) |
98 """ |
99 """ |
99 trans = QTranslator(None) |
100 trans = QTranslator(None) |
100 for dir in dirs: |
101 for dir in dirs: |
101 loaded = trans.load(tn, dir) |
102 loaded = trans.load(tn, dir) |
102 if loaded: |
103 if loaded: |
185 |
186 |
186 |
187 |
187 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True, |
188 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True, |
188 app=None, raiseIt=True, installErrorHandler=False): |
189 app=None, raiseIt=True, installErrorHandler=False): |
189 """ |
190 """ |
190 Module function to start up an application that doesn't need a specialized start up. |
191 Module function to start up an application that doesn't need a specialized |
|
192 start up. |
191 |
193 |
192 This function is used by all of eric5's helper programs. |
194 This function is used by all of eric5's helper programs. |
193 |
195 |
194 @param argv list of commandline parameters (list of strings) |
196 @param argv list of commandline parameters (list of strings) |
195 @param appinfo dictionary describing the application |
197 @param appinfo dictionary describing the application |
200 <dd>list of commandline parameters (list of strings)</dd> |
202 <dd>list of commandline parameters (list of strings)</dd> |
201 </dl> |
203 </dl> |
202 @keyparam quitOnLastWindowClosed flag indicating to quit the application, |
204 @keyparam quitOnLastWindowClosed flag indicating to quit the application, |
203 if the last window was closed (boolean) |
205 if the last window was closed (boolean) |
204 @keyparam app reference to the application object (QApplication or None) |
206 @keyparam app reference to the application object (QApplication or None) |
205 @keyparam raiseIt flag indicating to raise the generated application window (boolean) |
207 @keyparam raiseIt flag indicating to raise the generated application |
|
208 window (boolean) |
206 @keyparam installErrorHandler flag indicating to install an error |
209 @keyparam installErrorHandler flag indicating to install an error |
207 handler dialog (boolean) |
210 handler dialog (boolean) |
|
211 @return exit result (integer) |
208 """ |
212 """ |
209 handleArgs(argv, appinfo) |
213 handleArgs(argv, appinfo) |
210 if app is None: |
214 if app is None: |
211 app = E5Application(argv) |
215 app = E5Application(argv) |
212 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed) |
216 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed) |