MCPcopy Create free account
hub / github.com/bither/bither-desktop-java / initController

Method initController

src/main/java/net/bither/Bither.java:277–335  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

275 }
276
277 private static void initController(String[] args) {
278 try {
279 coreController = new CoreController();
280 GenericApplicationSpecification specification = new GenericApplicationSpecification();
281 specification.getOpenURIEventListeners().add(coreController);
282 specification.getPreferencesEventListeners().add(coreController);
283 specification.getAboutEventListeners().add(coreController);
284 specification.getQuitEventListeners().add(coreController);
285 genericApplication = GenericApplicationFactory.INSTANCE.buildGenericApplication(specification);
286 runRawURI(args);
287 Localiser localiser;
288 String userLanguageCode = UserPreference.getInstance().getUserLanguageCode();
289 if (userLanguageCode == null) {
290 // Initial install - no language info supplied - see if we can
291 // use the user default, else Localiser will set it to English.
292 localiser = new Localiser(Locale.getDefault());
293 UserPreference.getInstance().setUserLanguageCode(localiser.getLocale().getLanguage());
294
295 } else {
296 if (BitherSetting.USER_LANGUAGE_IS_DEFAULT.equals(userLanguageCode)) {
297 localiser = new Localiser(Locale.getDefault());
298 } else {
299 localiser = new Localiser(new Locale(userLanguageCode));
300 }
301 }
302
303 LocaliserUtils.setLocaliser(localiser);
304
305
306 // Initialise replay manager.
307 ReplayManager.INSTANCE.initialise(false);
308
309
310 // Initialise singletons.
311 ColorAndFontConstants.init();
312 FontSizer.INSTANCE.initialise();
313
314 mainFrame = new MainFrame(coreController, coreController.getCurrentView());
315 coreController.registerViewSystem(mainFrame);
316 runProcessCommandLineURIWithArgs(args);
317 // Indicate to the application that startup has completed.
318 coreController.setApplicationStarting(false);
319 // Check for any pending URI operations.
320 // bitcoinController.handleOpenURI(rememberedRawBitcoinURI);
321
322 // Check to see if there is a new version.
323 } catch (Exception e) {
324 // An odd unrecoverable error occurred.
325 e.printStackTrace();
326 e.printStackTrace();
327 // Try saving any dirty wallets.
328 if (coreController != null) {
329 ExitAction exitAction = new ExitAction();
330 exitAction.actionPerformed(null);
331 }
332 }
333 setVersionCode();
334

Callers 2

initAppMethod · 0.95
runMethod · 0.95

Calls 15

getQuitEventListenersMethod · 0.95
runRawURIMethod · 0.95
getInstanceMethod · 0.95
getLocaleMethod · 0.95
setLocaliserMethod · 0.95
initMethod · 0.95
actionPerformedMethod · 0.95
setVersionCodeMethod · 0.95

Tested by

no test coverage detected