Improve usability, fix bugs

This commit is contained in:
Manfred Karrer 2014-10-02 14:30:05 +02:00
parent a334beb1a7
commit b9b7d4b3e0
29 changed files with 322 additions and 152 deletions
src/main/java/io/bitsquare

View file

@ -22,9 +22,9 @@ import io.bitsquare.di.BitSquareModule;
import io.bitsquare.gui.AWTSystemTray;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.gui.util.Profiler;
import io.bitsquare.msg.MessageFacade;
import io.bitsquare.msg.SeedNodeAddress;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.settings.Settings;
import io.bitsquare.user.User;
@ -38,10 +38,10 @@ import com.google.inject.Injector;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.image.*;
import javafx.scene.input.*;
import javafx.stage.Stage;
@ -67,9 +67,35 @@ public class BitSquare extends Application {
if (args.length > 0)
APP_NAME = APP_NAME + "_" + args[0];
/*Thread seedNodeThread = new Thread(new Runnable() {
@Override
public void run() {
startSeedNode();
}
});
seedNodeThread.start();*/
launch(args);
}
private static void startSeedNode() {
List<SeedNodeAddress.StaticSeedNodeAddresses> staticSedNodeAddresses = SeedNodeAddress
.StaticSeedNodeAddresses.getAllSeedNodeAddresses();
SeedNode seedNode = new SeedNode(new SeedNodeAddress(staticSedNodeAddresses.get(0)));
seedNode.setDaemon(true);
seedNode.start();
try {
// keep main thread up
Thread.sleep(Long.MAX_VALUE);
log.debug("Localhost seed node started");
} catch (InterruptedException e) {
log.error(e.toString());
}
}
public static Stage getPrimaryStage() {
return primaryStage;
}
@ -113,12 +139,6 @@ public class BitSquare extends Application {
settings.applyPersistedSettings((Settings) persistence.read(settings.getClass().getName()));
primaryStage.setTitle("BitSquare (" + APP_NAME + ")");
if (ImageUtil.isRetina())
primaryStage.getIcons().add(new Image(BitSquare.class.getResourceAsStream
("/images/window_icon@2x.png")));
else
primaryStage.getIcons().add(new Image(BitSquare.class.getResourceAsStream
("/images/window_icon.png")));
ViewLoader.setInjector(injector);
@ -127,7 +147,7 @@ public class BitSquare extends Application {
try {
final Parent view = loader.load();
final Scene scene = new Scene(view, 1000, 800);
final Scene scene = new Scene(view, 1000, 900);
scene.getStylesheets().setAll(getClass().getResource("/io/bitsquare/gui/bitsquare.css").toExternalForm(),
getClass().getResource("/io/bitsquare/gui/images.css").toExternalForm());