fix mailbox msg remove bug, add setup for release version

This commit is contained in:
Manfred Karrer 2015-11-18 13:46:47 +01:00
parent 9b1108aa0a
commit 82e766e6b1
38 changed files with 333 additions and 277 deletions

View file

@ -73,7 +73,8 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
public class BitsquareApp extends Application {
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
public static final boolean DEV_MODE = false;
public static final boolean DEV_MODE = true;
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
private static Environment env;
@ -90,7 +91,6 @@ public class BitsquareApp extends Application {
private MainView mainView;
public static Runnable shutDownHandler;
public static Runnable restartDownHandler;
public static void setEnvironment(Environment env) {
BitsquareApp.env = env;
@ -98,16 +98,12 @@ public class BitsquareApp extends Application {
@Override
public void start(Stage primaryStage) throws IOException {
BitsquareApp.primaryStage = primaryStage;
Log.setup(Paths.get(env.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY), "bitsquare").toString());
Log.PRINT_TRACE_METHOD = DEV_MODE;
String logPath = Paths.get(env.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY), "bitsquare").toString();
Log.setup(logPath, IS_RELEASE_VERSION);
log.info("Log files under: " + logPath);
UserThread.setExecutor(Platform::runLater);
shutDownHandler = this::stop;
restartDownHandler = this::restart;
// setup UncaughtExceptionHandler
Thread.UncaughtExceptionHandler handler = (thread, throwable) -> {
// Might come from another thread
@ -123,6 +119,11 @@ public class BitsquareApp extends Application {
Security.addProvider(new BouncyCastleProvider());
BitsquareApp.primaryStage = primaryStage;
shutDownHandler = this::stop;
try {
// Guice
bitsquareAppModule = new BitsquareAppModule(env, primaryStage);
@ -148,30 +149,33 @@ public class BitsquareApp extends Application {
"/io/bitsquare/gui/images.css");
// configure the system tray
SystemTray.create(primaryStage, this::stop);
SystemTray systemTray = SystemTray.create(primaryStage, shutDownHandler);
primaryStage.setOnCloseRequest(e -> {
e.consume();
stop();
if (BitsquareApp.IS_RELEASE_VERSION)
systemTray.hideStage();
else
stop();
});
scene.setOnKeyReleased(keyEvent -> {
// For now we exit when closing/quit the app.
// Later we will only hide the window (systemTray.hideStage()) and use the exit item in the system tray for
// shut down.
if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(keyEvent) ||
new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
stop();
else if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
//if (BitsquareApp.DEV_MODE)
showDebugWindow();
else if (new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showFPSWindow();
else if (new KeyCodeCombination(KeyCode.E, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
new KeyCodeCombination(KeyCode.Q, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
if (BitsquareApp.IS_RELEASE_VERSION)
systemTray.hideStage();
else
stop();
} else if (new KeyCodeCombination(KeyCode.E, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
showEmptyWalletPopup();
else if (new KeyCodeCombination(KeyCode.M, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
} else if (new KeyCodeCombination(KeyCode.M, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
showSendAlertMessagePopup();
} else if (BitsquareApp.DEV_MODE) {
if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showDebugWindow();
else if (new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showFPSWindow();
}
});
// configure the primary stage
primaryStage.setTitle(env.getRequiredProperty(APP_NAME_KEY));
primaryStage.setScene(scene);
@ -285,7 +289,6 @@ public class BitsquareApp extends Application {
stage.setWidth(200);
stage.setHeight(100);
stage.show();
}
@Override
@ -323,10 +326,4 @@ public class BitsquareApp extends Application {
System.exit(1);
}
}
private void restart() {
//TODO
stop();
//gracefulShutDown(UpdateFX::restartApp);
}
}

View file

@ -51,8 +51,9 @@ public class SystemTray {
private final Runnable onExit;
private final MenuItem toggleShowHideItem = new MenuItem(HIDE_WINDOW_LABEL);
public static void create(Stage stage, Runnable onExit) {
public static SystemTray create(Stage stage, Runnable onExit) {
systemTray = new SystemTray(stage, onExit);
return systemTray;
}
private SystemTray(Stage stage, Runnable onExit) {
@ -114,8 +115,7 @@ public class SystemTray {
if (stage.isShowing()) {
toggleShowHideItem.setLabel(SHOW_WINDOW_LABEL);
UserThread.execute(stage::hide);
}
else {
} else {
toggleShowHideItem.setLabel(HIDE_WINDOW_LABEL);
UserThread.execute(stage::show);
}

View file

@ -356,10 +356,10 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
}
});
new Popup().information("To ensure that both traders follow the trade protocol they need to pay a security deposit.\n\n" +
"The deposit will stay in your local trading wallet until the offer gets accepted by another trader.\n" +
"It will be refunded to you after the trade has successfully completed.\n\n" +
"The security deposit will be refunded to you after the trade has successfully completed.\n\n" +
"You need to pay in the exact amount displayed to you from your external Bitcoin wallet into the " +
"Bitsquare trade wallet. The amount is the sum of the trade amount, the security deposit, " +
"Bitsquare trade wallet. In case you over pay, you will get it refunded after the trade.\n\n" +
"The amount needed for funding is the sum of the trade amount, the security deposit, " +
"the trading fee and the Bitcoin mining fee.\n" +
"You can see the details when you move the mouse over the question mark.").show();

View file

@ -75,7 +75,7 @@ createOffer.advancedBox.currency=Currency:
createOffer.advancedBox.county=Payments account country:
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The payments account details are used from your current selected payments account (if you have multiple payments accounts).
createOffer.success.headline=Your offer has been published to the offerbook.
createOffer.success.headline=Your offer has been published to the P2P network.
createOffer.success.info=You can manage your open offers in the \"Portfolio\" screen under \"Open offers\".
createOffer.error.message=An error occurred when placing the offer.\n\n{0}

View file

@ -18,50 +18,23 @@
<logger name="io.bitsquare.p2p.network.NetworkNode" level="TRACE"/>-->
<logger name="com.msopentech.thali.toronionproxy.OnionProxyManagerEventHandler" level="WARN"/>
<logger name="io.bitsquare.btc.AddressBasedCoinSelector" level="WARN"/>
<logger name="io.bitsquare.storage.Storage" level="WARN"/>
<logger name="io.bitsquare.gui.util.Profiler" level="ERROR"/>
<logger name="io.bitsquare.locale.BSResources" level="ERROR"/>
<logger name="io.bitsquare.temp.storage.RemoteStorage" level="WARN"/>
<logger name="io.bitsquare.storage.FileManager" level="WARN"/>
<!-- <logger name="com.msopentech.thali.toronionproxy.OnionProxyManagerEventHandler" level="WARN"/>
<logger name="io.bitsquare.btc.AddressBasedCoinSelector" level="WARN"/>
<logger name="io.bitsquare.storage.Storage" level="WARN"/>
<logger name="io.bitsquare.gui.util.Profiler" level="ERROR"/>
<logger name="io.bitsquare.locale.BSResources" level="ERROR"/>
<logger name="io.bitsquare.temp.storage.RemoteStorage" level="WARN"/>
<logger name="io.bitsquare.storage.FileManager" level="WARN"/>
<logger name="org.bitcoinj" level="WARN"/>
<logger name="org.bitcoinj.core.BitcoinSerializer" level="WARN"/>
<logger name="org.bitcoinj.core.Peer" level="WARN"/>
<logger name="org.bitcoinj.core.HeadersMessage" level="WARN"/>
<logger name="org.bitcoinj.core.AbstractBlockChain" level="ERROR"/>-->
<logger name="org.bitcoinj" level="WARN"/>
<logger name="org.bitcoinj.core.BitcoinSerializer" level="WARN"/>
<logger name="org.bitcoinj.core.Peer" level="WARN"/>
<logger name="org.bitcoinj.core.HeadersMessage" level="WARN"/>
<logger name="org.bitcoinj.core.AbstractBlockChain" level="ERROR"/>
<!--
<logger name="io.netty" level="OFF"/>
<logger name="org.bitcoinj.core.BitcoinSerializer" level="ERROR"/>
<logger name="org.bitcoinj.core.Peer" level="ERROR"/>-->
<logger name="io.netty.util" level="WARN"/>
<logger name="io.netty.channel" level="WARN"/>
<logger name="io.netty.buffer" level="WARN"/>-->
<!-- <logger name="org.bitcoinj.core.BitcoinSerializer" level="WARN"/>
<logger name="org.bitcoinj.core.AbstractBlockChain" level="WARN"/>
<logger name="org.bitcoinj.wallet.DeterministicKeyChain" level="WARN"/>-->
<!-- <logger name="io.bitsquare.btc.WalletService" level="WARN"/>-->
<!--
<logger name="org.bitcoinj.core.Wallet" level="OFF"/>
<logger name="org.bitcoinj.core.MemoryPool" level="OFF"/>
<logger name="org.bitcoinj.net.discovery.DnsDiscovery" level="OFF"/>
<logger name="org.bitcoinj.core.DownloadListener" level="OFF"/>
<logger name="org.bitcoinj.core.TransactionOutput" level="OFF"/>
<logger name="org.bitcoinj.core.BitcoinSerializer" level="OFF"/>
<logger name="org.bitcoinj.core.Peer" level="OFF"/>
<logger name="org.bitcoinj.core.PeerGroup" level="OFF"/>
<logger name="org.bitcoinj.core.PeerSocketHandler" level="OFF"/>
<logger name="org.bitcoinj.net.NioClientManager" level="OFF"/>
<logger name="org.bitcoinj.net.ConnectionHandler" level="OFF"/>
-->
</configuration>