mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-25 16:05:28 -04:00
Add setup process UIs. Improve navigation UI.
This commit is contained in:
parent
ed39369d8e
commit
c00c4b4400
79 changed files with 3068 additions and 259 deletions
101
src/test/java/io/bitsquare/gui/account/AccountUITestRunner.java
Normal file
101
src/test/java/io/bitsquare/gui/account/AccountUITestRunner.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.account;
|
||||
|
||||
import io.bitsquare.di.BitSquareModule;
|
||||
import io.bitsquare.di.GuiceFXMLLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class AccountUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccountUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Node view;
|
||||
private StackPane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitSquareModule());
|
||||
GuiceFXMLLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
GuiceFXMLLoader loader = new GuiceFXMLLoader(
|
||||
getUrl("/io/bitsquare/gui/account/AccountView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getStackTrace().toString());
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
101
src/test/java/io/bitsquare/gui/account/SetupUITestRunner.java
Normal file
101
src/test/java/io/bitsquare/gui/account/SetupUITestRunner.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.account;
|
||||
|
||||
import io.bitsquare.di.BitSquareModule;
|
||||
import io.bitsquare.di.GuiceFXMLLoader;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class SetupUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(SetupUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
||||
private boolean devTest = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
Injector injector = Guice.createInjector(new BitSquareModule());
|
||||
GuiceFXMLLoader.setInjector(injector);
|
||||
|
||||
pane = new StackPane();
|
||||
scene = new Scene(pane, 1000, 630);
|
||||
scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+S"), this::loadMainWindow);
|
||||
loadMainWindow();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public void loadMainWindow() {
|
||||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
GuiceFXMLLoader loader = new GuiceFXMLLoader(
|
||||
getUrl("/io/bitsquare/gui/account/setup/SetupView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getStackTrace().toString());
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
scene.getStylesheets().clear();
|
||||
scene.getStylesheets().setAll(getUrl("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
}
|
||||
|
||||
private URL getUrl(String subPath) {
|
||||
if (devTest) {
|
||||
try {
|
||||
// load from file system location to make a reload possible. makes dev process easier with hot reload
|
||||
return new URL("file:///Users/mk/Documents/_intellij/bitsquare/src/main/java" + subPath);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return getClass().getResource(subPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.registration.uimock;
|
||||
package io.bitsquare.gui.account.registration.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package io.bitsquare.gui.registration.uimock;
|
||||
package io.bitsquare.gui.account.registration.uimock;
|
||||
|
||||
import io.bitsquare.di.BitSquareModule;
|
||||
import io.bitsquare.di.GuiceFXMLLoader;
|
|
@ -21,10 +21,10 @@
|
|||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../java/io/bitsquare/gui/bitsquare.css"
|
||||
vgap="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.registration.uimock.FundRegistrationWalletControllerUIMock">
|
||||
fx:controller="io.bitsquare.gui.account.registration.uimock.FundRegistrationWalletControllerUIMock">
|
||||
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="26.0"/>
|
|
@ -15,7 +15,7 @@
|
|||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.registration.uimock;
|
||||
package io.bitsquare.gui.account.registration.uimock;
|
||||
|
||||
import java.net.URL;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package io.bitsquare.gui.registration.uimock;
|
||||
package io.bitsquare.gui.account.registration.uimock;
|
||||
|
||||
import io.bitsquare.di.BitSquareModule;
|
||||
import io.bitsquare.di.GuiceFXMLLoader;
|
||||
|
@ -51,7 +51,7 @@ public class RegistrationUIMockRunner extends Application {
|
|||
log.debug("re load");
|
||||
pane.getChildren().removeAll();
|
||||
GuiceFXMLLoader loader = new GuiceFXMLLoader(
|
||||
getUrl("/io/bitsquare/gui/registration/uimock/RegistrationViewUIMock.fxml"), false);
|
||||
getUrl("/io/bitsquare/gui/account/registration/uimock/RegistrationViewUIMock.fxml"), false);
|
||||
|
||||
try {
|
||||
view = loader.load();
|
|
@ -22,9 +22,9 @@
|
|||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<BorderPane fx:id="root" prefHeight="660.0" prefWidth="1000.0" style="-fx-background-color: f4f4f4;"
|
||||
stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
stylesheets="@../../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.registration.uimock.RegistrationControllerUIMock">
|
||||
fx:controller="io.bitsquare.gui.account.registration.uimock.RegistrationControllerUIMock">
|
||||
<left>
|
||||
|
||||
<VBox spacing="5" prefWidth="300.0" BorderPane.alignment="CENTER">
|
||||
|
@ -41,7 +41,7 @@
|
|||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../main/resources/images/tick.png"/>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../main/resources/images/tick.png"/>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../main/resources/images/tick.png"/>
|
||||
<Image url="@../../../../../../../../main/resources/images/tick.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
|
@ -128,7 +128,7 @@
|
|||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../main/resources/images/arrow_blue.png"/>
|
||||
<Image url="@../../../../../../../../main/resources/images/arrow_blue.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
|
@ -158,7 +158,7 @@
|
|||
<Insets left="8.0" top="8.0"/>
|
||||
</HBox.margin>
|
||||
<image>
|
||||
<Image url="@../../../../../../../main/resources/images/arrow_grey.png"/>
|
||||
<Image url="@../../../../../../../../main/resources/images/arrow_grey.png"/>
|
||||
</image>
|
||||
|
||||
</ImageView>
|
||||
|
@ -185,11 +185,11 @@
|
|||
</left>
|
||||
<center>
|
||||
<Pane fx:id="content">
|
||||
<fx:include source="../../settings/uimock/SeedWordsViewUIMock.fxml" visible="true" prefWidth="690"/>
|
||||
<fx:include source="../../settings/uimock/SetPasswordViewUIMock.fxml" visible="false" prefWidth="690"/>
|
||||
<fx:include source="../../settings/uimock/BankAccountSettingsViewUIMock.fxml" visible="false"
|
||||
<fx:include source="../../../settings/uimock/SeedWordsViewUIMock.fxml" visible="true" prefWidth="690"/>
|
||||
<fx:include source="../../../settings/uimock/SetPasswordViewUIMock.fxml" visible="false" prefWidth="690"/>
|
||||
<fx:include source="../../../settings/uimock/BankAccountSettingsViewUIMock.fxml" visible="false"
|
||||
prefWidth="690"/>
|
||||
<fx:include source="../../settings/uimock/RestrictionSettingsViewUIMock.fxml" visible="false"
|
||||
<fx:include source="../../../settings/uimock/RestrictionSettingsViewUIMock.fxml" visible="false"
|
||||
prefWidth="690"/>
|
||||
<fx:include source="FundRegistrationWalletViewUIMock.fxml" visible="false" prefWidth="690"/>
|
||||
</Pane>
|
|
@ -21,8 +21,10 @@
|
|||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css"
|
||||
vgap="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
<?import javafx.scene.text.*?>
|
||||
<GridPane fx:id="root" hgap="5.0" prefHeight="630.0" prefWidth="1000.0"
|
||||
stylesheets="@../../../../../../../main/java/io/bitsquare/gui/bitsquare.css" vgap="5.0"
|
||||
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
|
||||
AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="io.bitsquare.gui.settings.uimock.SeedWordsControllerUIMock">
|
||||
|
||||
|
@ -32,46 +34,42 @@
|
|||
|
||||
<children>
|
||||
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" visible="true" GridPane.columnSpan="3"
|
||||
GridPane.rowSpan="4">
|
||||
<Pane id="form-group-background-active" fx:id="payFundsPane" GridPane.columnSpan="3" GridPane.rowSpan="4">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="-10.0" left="-10.0" right="-10.0" top="-10.0"/>
|
||||
</GridPane.margin>
|
||||
<children>
|
||||
<Label id="form-group-title-active" fx:id="payFundsTitleLabel" layoutX="8" layoutY="-8"
|
||||
text="Setup password">
|
||||
text="Backup your wallet seed words">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
</children>
|
||||
</Pane>
|
||||
|
||||
<Label fx:id="totalToPayLabel" text="Enter password:" visible="true">
|
||||
<Label text="Wallet seed words:" GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
<Insets top="7.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
|
||||
<PasswordField promptText="Enter password:" GridPane.columnIndex="1" GridPane.columnSpan="2">
|
||||
<TextArea prefHeight="100.0" text="essay case modify essay case modify essay case modify essay case modify"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
<Insets/>
|
||||
</GridPane.margin>
|
||||
</PasswordField>
|
||||
<font>
|
||||
<Font size="16.0"/>
|
||||
</font>
|
||||
</TextArea>
|
||||
|
||||
<Label fx:id="addressLabel" text="Repeat password:" visible="true" GridPane.rowIndex="1"/>
|
||||
<PasswordField promptText="Repeat password" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="1"/>
|
||||
|
||||
<Button GridPane.columnIndex="1" GridPane.rowIndex="2" defaultButton="true"
|
||||
text="Save password" visible="true">
|
||||
<Button defaultButton="true" text="I have made my backup" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10"/>
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
|
||||
<ImageView fx:id="payFundsInfoIcon" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true"
|
||||
visible="true" GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
GridPane.rowIndex="3" GridPane.valignment="TOP">
|
||||
<image>
|
||||
<Image fx:id="infoIcon" url="@../../../../../../../main/resources/images/info_44.png"/>
|
||||
</image>
|
||||
|
@ -81,8 +79,8 @@
|
|||
</ImageView>
|
||||
|
||||
<Label fx:id="payFundsInfoLabel" prefWidth="740.0"
|
||||
text="Protect your wallet with a strong password. You need to enter the password any time you withdraw Bitcoins from your trading wallets. You can change the password later in the settings. Open the help menu for more information."
|
||||
visible="true" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
text="You can recreate your wallet our of these words when you lose your wallet. Backup it on paper to have better protection against cycer criminals. Open the help menu for more information."
|
||||
wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
|
@ -92,9 +90,9 @@
|
|||
</children>
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="200"/>
|
||||
<ColumnConstraints halignment="RIGHT" minWidth="200.0"/>
|
||||
<ColumnConstraints hgrow="ALWAYS"/>
|
||||
<ColumnConstraints hgrow="NEVER" prefWidth="25.0"/>
|
||||
<ColumnConstraints/>
|
||||
</columnConstraints>
|
||||
|
||||
<rowConstraints>
|
||||
|
|
|
@ -93,10 +93,10 @@ public class CreateOfferPMTest {
|
|||
|
||||
|
||||
model.collateralAsLong.set(100);
|
||||
assertEquals("Collateral (10.0 %):", presenter.collateralLabel.get());
|
||||
assertEquals("Refundable collateral (10.0 %):", presenter.collateralLabel.get());
|
||||
|
||||
model.collateralAsLong.set(0);
|
||||
assertEquals("Collateral (0.0 %):", presenter.collateralLabel.get());
|
||||
assertEquals("Refundable collateral (0.0 %):", presenter.collateralLabel.get());
|
||||
|
||||
|
||||
model.bankAccountType.set(BankAccountType.SEPA.toString());
|
||||
|
|
|
@ -40,8 +40,8 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* For testing single isolated UI screens
|
||||
*/
|
||||
public class UITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(UITestRunner.class);
|
||||
public class CreateOfferUITestRunner extends Application {
|
||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferUITestRunner.class);
|
||||
private Scene scene;
|
||||
private Pane view;
|
||||
private Pane pane;
|
Loading…
Add table
Add a link
Reference in a new issue