mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-20 21:04:28 -04:00
offer creation screen, model updates, confirm comp.
This commit is contained in:
parent
a3bee7652b
commit
3f398755ad
53 changed files with 1261 additions and 1297 deletions
|
@ -6,7 +6,7 @@ import io.bitsquare.btc.WalletFacade;
|
|||
import io.bitsquare.di.BitSquareModule;
|
||||
import io.bitsquare.di.GuiceFXMLLoader;
|
||||
import io.bitsquare.gui.util.Localisation;
|
||||
import io.bitsquare.settings.Startup;
|
||||
import io.bitsquare.settings.Settings;
|
||||
import io.bitsquare.storage.Storage;
|
||||
import io.bitsquare.user.User;
|
||||
import javafx.application.Application;
|
||||
|
@ -16,6 +16,8 @@ import javafx.stage.Stage;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class BitSquare extends Application
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(BitSquare.class);
|
||||
|
@ -34,24 +36,30 @@ public class BitSquare extends Application
|
|||
|
||||
// apply stored data
|
||||
final User user = injector.getInstance(User.class);
|
||||
final Settings settings = injector.getInstance(Settings.class);
|
||||
final Storage storage = injector.getInstance(Storage.class);
|
||||
user.updateFromStorage((User) storage.read(user.getClass().getName()));
|
||||
|
||||
//TODO remove
|
||||
final Startup setup = injector.getInstance(Startup.class);
|
||||
setup.applyPersistedData();
|
||||
settings.updateFromStorage((Settings) storage.read(settings.getClass().getName()));
|
||||
initSettings(settings, storage);
|
||||
|
||||
stage.setTitle("BitSquare");
|
||||
|
||||
GuiceFXMLLoader.setInjector(injector);
|
||||
final GuiceFXMLLoader loader = new GuiceFXMLLoader(getClass().getResource("/io/bitsquare/gui/MainView.fxml"), Localisation.getResourceBundle());
|
||||
final Parent mainView = loader.load();
|
||||
|
||||
final Scene scene = new Scene(mainView, 800, 600);
|
||||
stage.setScene(scene);
|
||||
|
||||
final String global = getClass().getResource("/io/bitsquare/gui/global.css").toExternalForm();
|
||||
scene.getStylesheets().setAll(global);
|
||||
|
||||
stage.setMinWidth(740);
|
||||
stage.setMinHeight(400);
|
||||
stage.setWidth(800);
|
||||
stage.setHeight(600);
|
||||
|
||||
stage.show();
|
||||
}
|
||||
|
||||
|
@ -62,4 +70,31 @@ public class BitSquare extends Application
|
|||
|
||||
super.stop();
|
||||
}
|
||||
|
||||
private void initSettings(Settings settings, Storage storage)
|
||||
{
|
||||
Settings savedSettings = (Settings) storage.read(settings.getClass().getName());
|
||||
if (savedSettings == null)
|
||||
{
|
||||
settings.getAcceptedCountryLocales().clear();
|
||||
settings.getAcceptedLanguageLocales().clear();
|
||||
|
||||
settings.addAcceptedLanguageLocale(Locale.getDefault());
|
||||
settings.addAcceptedCountryLocale(Locale.getDefault());
|
||||
|
||||
//TODO mock
|
||||
settings.addAcceptedLanguageLocale(new Locale("en", "US"));
|
||||
settings.addAcceptedLanguageLocale(new Locale("es", "ES"));
|
||||
|
||||
settings.addAcceptedCountryLocale(new Locale("de", "AT"));
|
||||
settings.addAcceptedCountryLocale(new Locale("en", "US"));
|
||||
settings.addAcceptedCountryLocale(new Locale("es", "ES"));
|
||||
|
||||
storage.write(settings.getClass().getName(), settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
settings.updateFromStorage(savedSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue