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

Method setVersionCode

src/main/java/net/bither/Bither.java:337–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335 }
336
337 private static void setVersionCode() {
338 if (UpgradeUtil.needUpgrade()) {
339 final DialogProgress dialogProgress = new DialogProgress();
340 UpgradeUtil.upgradeNewVerion(new RunnableListener() {
341 @Override
342 public void prepare() {
343 PeerUtil.stopPeer();
344 SwingUtilities.invokeLater(new Runnable() {
345 @Override
346 public void run() {
347 dialogProgress.pack();
348 dialogProgress.setVisible(true);
349 }
350 });
351
352 }
353
354 @Override
355 public void success(Object obj) {
356 PeerUtil.startPeer();
357 SwingUtilities.invokeLater(new Runnable() {
358 @Override
359 public void run() {
360 dialogProgress.dispose();
361 Bither.refreshFrame();
362 UserPreference.getInstance().setVerionCode(BitherSetting.VERSION_CODE);
363 PeerUtil.startPeer();
364 }
365 });
366 }
367
368 @Override
369 public void error(int errorCode, String errorMsg) {
370 SwingUtilities.invokeLater(new Runnable() {
371 @Override
372 public void run() {
373 dialogProgress.dispose();
374 DialogConfirmTask dialogConfirmTask =
375 new DialogConfirmTask(LocaliserUtils.getString("upgrade_error_db_is_lock"), null);
376 dialogConfirmTask.pack();
377 dialogConfirmTask.setVisible(true);
378
379 ExitAction exitAction = new ExitAction();
380 exitAction.actionPerformed(null);
381 }
382 });
383
384 }
385 });
386 } else {
387 if (UserPreference.getInstance().getVerionCode() < BitherSetting.VERSION_CODE) {
388 UserPreference.getInstance().setVerionCode(BitherSetting.VERSION_CODE);
389 }
390 PeerUtil.startPeer();
391 }
392
393
394 }

Callers 1

initControllerMethod · 0.95

Calls 6

needUpgradeMethod · 0.95
upgradeNewVerionMethod · 0.95
getInstanceMethod · 0.95
startPeerMethod · 0.95
getVerionCodeMethod · 0.80
setVerionCodeMethod · 0.80

Tested by

no test coverage detected