From f0b3fa709d7d9ebf887abfbbf84a61e9ee7d316a Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 8 Apr 2016 21:59:26 +0200 Subject: [PATCH] Small improvements... --- .../java/io/bitsquare/app/BitsquareApp.java | 70 ++++++++++--------- .../disputes/trader/TraderDisputeView.java | 2 +- .../bitsquare/gui/main/overlays/Overlay.java | 11 ++- .../gui/main/settings/about/AboutView.java | 2 +- .../settings/preferences/PreferencesView.java | 2 +- gui/src/main/resources/logback.xml | 2 +- .../p2p/seed/SeedNodesRepository.java | 13 +--- 7 files changed, 51 insertions(+), 51 deletions(-) diff --git a/gui/src/main/java/io/bitsquare/app/BitsquareApp.java b/gui/src/main/java/io/bitsquare/app/BitsquareApp.java index badde5bcfd..cf61f7da3f 100644 --- a/gui/src/main/java/io/bitsquare/app/BitsquareApp.java +++ b/gui/src/main/java/io/bitsquare/app/BitsquareApp.java @@ -91,6 +91,7 @@ public class BitsquareApp extends Application { private MainView mainView; public static Runnable shutDownHandler; + private boolean shutDownRequested; public static void setEnvironment(Environment env) { BitsquareApp.env = env; @@ -189,7 +190,7 @@ public class BitsquareApp extends Application { // configure the primary stage primaryStage.setTitle(env.getRequiredProperty(APP_NAME_KEY)); primaryStage.setScene(scene); - primaryStage.setMinWidth(1080); + primaryStage.setMinWidth(1130); primaryStage.setMinHeight(620); // on windows the title icon is also used as task bar icon in a larger size @@ -229,37 +230,39 @@ public class BitsquareApp extends Application { } private void showErrorPopup(Throwable throwable, boolean doShutDown) { - if (scene == null) { - scene = new Scene(new StackPane(), 1000, 650); - primaryStage.setScene(scene); - primaryStage.show(); - } - try { - try { - if (!popupOpened) { - String message = throwable.getMessage(); - popupOpened = true; - if (message != null) - new Popup().error(message).onClose(() -> popupOpened = false).show(); - else - new Popup().error(throwable.toString()).onClose(() -> popupOpened = false).show(); - } - } catch (Throwable throwable3) { - log.error("Error at displaying Throwable."); - throwable3.printStackTrace(); + if (!shutDownRequested) { + if (scene == null) { + scene = new Scene(new StackPane(), 1000, 650); + primaryStage.setScene(scene); + primaryStage.show(); + } + try { + try { + if (!popupOpened) { + String message = throwable.getMessage(); + popupOpened = true; + if (message != null) + new Popup().error(message).onClose(() -> popupOpened = false).show(); + else + new Popup().error(throwable.toString()).onClose(() -> popupOpened = false).show(); + } + } catch (Throwable throwable3) { + log.error("Error at displaying Throwable."); + throwable3.printStackTrace(); + } + if (doShutDown) + stop(); + } catch (Throwable throwable2) { + // If printStackTrace cause a further exception we don't pass the throwable to the Popup. + Dialogs.create() + .owner(primaryStage) + .title("Error") + .message(throwable.toString()) + .masthead("A fatal exception occurred at startup.") + .showError(); + if (doShutDown) + stop(); } - if (doShutDown) - stop(); - } catch (Throwable throwable2) { - // If printStackTrace cause a further exception we don't pass the throwable to the Popup. - Dialogs.create() - .owner(primaryStage) - .title("Error") - .message(throwable.toString()) - .masthead("A fatal exception occurred at startup.") - .showError(); - if (doShutDown) - stop(); } } @@ -308,6 +311,7 @@ public class BitsquareApp extends Application { @Override public void stop() { + shutDownRequested = true; gracefulShutDown(() -> { log.info("App shutdown complete"); System.exit(0); @@ -318,7 +322,9 @@ public class BitsquareApp extends Application { log.debug("gracefulShutDown"); new Popup().headLine("Shut down in progress") .backgroundInfo("Shutting down application can take a few seconds.\n" + - "Please don't interrupt that process.").closeButtonText("Ok") + "Please don't interrupt that process.") + .hideCloseButton() + .useAnimation(false) .show(); try { if (injector != null) { diff --git a/gui/src/main/java/io/bitsquare/gui/main/disputes/trader/TraderDisputeView.java b/gui/src/main/java/io/bitsquare/gui/main/disputes/trader/TraderDisputeView.java index d7a73f61e2..ca2f65477c 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/disputes/trader/TraderDisputeView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/disputes/trader/TraderDisputeView.java @@ -496,7 +496,7 @@ public class TraderDisputeView extends ActivatableView { statusIcon.setStyle("-fx-font-size: 10;"); // TODO icon not displayed correctly (too small), don't knwo why.... - AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); + AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY, "16.0"); copyIcon.getStyleClass().add("copy-icon");// -fx-cursor: hand; Tooltip.install(copyIcon, new Tooltip("Copy to clipboard")); messageAnchorPane.getChildren().addAll(bg, arrow, headerLabel, messageLabel, copyIcon, attachmentsBox, statusIcon); diff --git a/gui/src/main/java/io/bitsquare/gui/main/overlays/Overlay.java b/gui/src/main/java/io/bitsquare/gui/main/overlays/Overlay.java index 10d59b49cd..5e2d95e75f 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/overlays/Overlay.java +++ b/gui/src/main/java/io/bitsquare/gui/main/overlays/Overlay.java @@ -57,7 +57,6 @@ import static io.bitsquare.gui.util.FormBuilder.addCheckBox; public abstract class Overlay { protected final Logger log = LoggerFactory.getLogger(this.getClass()); - /////////////////////////////////////////////////////////////////////////////////////////// // Enum /////////////////////////////////////////////////////////////////////////////////////////// @@ -130,7 +129,8 @@ public abstract class Overlay { protected double buttonDistance = 20; protected Type type = Type.Undefined; protected boolean hideCloseButton; - + protected boolean useAnimation; + /////////////////////////////////////////////////////////////////////////////////////////// // Public API @@ -341,6 +341,11 @@ public abstract class Overlay { return (T) this; } + public T useAnimation(boolean useAnimation) { + this.useAnimation = useAnimation; + return (T) this; + } + /////////////////////////////////////////////////////////////////////////////////////////// // Protected @@ -746,7 +751,7 @@ public abstract class Overlay { } protected double getDuration(double duration) { - return Preferences.useAnimations() ? duration : 1; + return useAnimation && Preferences.useAnimations() ? duration : 1; } @Override diff --git a/gui/src/main/java/io/bitsquare/gui/main/settings/about/AboutView.java b/gui/src/main/java/io/bitsquare/gui/main/settings/about/AboutView.java index 50fa45e47f..6858b9c935 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/settings/about/AboutView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/settings/about/AboutView.java @@ -61,7 +61,7 @@ public class AboutView extends ActivatableViewAndModel { titledGroupBg = addTitledGroupBg(root, ++gridRow, 3, "Support Bitsquare", Layout.GROUP_DISTANCE); GridPane.setColumnSpan(titledGroupBg, 2); - label = addLabel(root, gridRow, "Bitsquare is not a company but a community project and open for participation. If you want to participate check out our web page.", Layout.FIRST_ROW_AND_GROUP_DISTANCE); + label = addLabel(root, gridRow, "Bitsquare is not a company but a community project and open for participation. If you want to participate or support Bitsquare please follow the links below.", Layout.FIRST_ROW_AND_GROUP_DISTANCE); label.setWrapText(true); GridPane.setColumnSpan(label, 2); GridPane.setHalignment(label, HPos.LEFT); diff --git a/gui/src/main/java/io/bitsquare/gui/main/settings/preferences/PreferencesView.java b/gui/src/main/java/io/bitsquare/gui/main/settings/preferences/PreferencesView.java index b325338d9a..eae0cf0016 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/settings/preferences/PreferencesView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/settings/preferences/PreferencesView.java @@ -311,7 +311,7 @@ public class PreferencesView extends ActivatableViewAndModel deviationInputTextField.setText(formatter.formatToPercent(preferences.getMaxPriceDistanceInPercent())), 100, TimeUnit.MILLISECONDS); }; - transactionFeeInputTextField = addLabelInputTextField(root, ++gridRow, "Transaction fee (satoshi/byte):").second; + transactionFeeInputTextField = addLabelInputTextField(root, ++gridRow, "Withdrawal transaction fee (satoshi/byte):").second; transactionFeeFocusedListener = (o, oldValue, newValue) -> { if (oldValue && !newValue) { try { diff --git a/gui/src/main/resources/logback.xml b/gui/src/main/resources/logback.xml index de468733bc..4b31fa8087 100644 --- a/gui/src/main/resources/logback.xml +++ b/gui/src/main/resources/logback.xml @@ -42,6 +42,6 @@ --> - + diff --git a/network/src/main/java/io/bitsquare/p2p/seed/SeedNodesRepository.java b/network/src/main/java/io/bitsquare/p2p/seed/SeedNodesRepository.java index 12eb358170..b9bd742d4d 100644 --- a/network/src/main/java/io/bitsquare/p2p/seed/SeedNodesRepository.java +++ b/network/src/main/java/io/bitsquare/p2p/seed/SeedNodesRepository.java @@ -21,23 +21,12 @@ public class SeedNodesRepository { // access still his his app // mainnet - // v0.3.3 - /* new NodeAddress("oyyii5ogv7y7iadi.onion:8000"), - new NodeAddress("ugcro2f5xnkguash.onion:8000"), - new NodeAddress("qarhpdsl6mfhbnud.onion:8000"),*/ - - // v0.3.4 - /* new NodeAddress("lih5zsr2bvxi24pk.onion:8000"), - new NodeAddress("s5xpstlooosehtxm.onion:8000"), - new NodeAddress("izs5oz7i5ta7c2ir.onion:8000"),*/ - // v0.3.5, v0.3.6 (backwards compatible) /*new NodeAddress("hulvbm5xjn7b7ku4.onion:8000"), new NodeAddress("3efgjjbdvhbvck3x.onion:8000"), new NodeAddress("3unfcshgwipxhxfm.onion:8000"),*/ - - // v0.3.7 + // v0.4.0 new NodeAddress("ybmi4iaesugslxrw.onion:8000"), new NodeAddress("ufwnvo775jfnjeux.onion:8000"), new NodeAddress("b66vnevaljo6xt5a.onion:8000"),