(String[] args)
| 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 |
no test coverage detected