Craig Raw
4 years ago
9 changed files with 124 additions and 8 deletions
@ -1 +1 @@ |
|||
Subproject commit 488752c142765bacd0373390faccbdb11b47487a |
|||
Subproject commit 9faacb055c635d22ce0dd7318f2b87814da85bcd |
@ -0,0 +1,30 @@ |
|||
package com.sparrowwallet.sparrow.wallet; |
|||
|
|||
import com.sparrowwallet.drongo.wallet.Wallet; |
|||
import com.sparrowwallet.sparrow.EventManager; |
|||
import com.sparrowwallet.sparrow.event.SettingsChangedEvent; |
|||
import javafx.fxml.FXML; |
|||
import javafx.fxml.Initializable; |
|||
import javafx.scene.control.Spinner; |
|||
import javafx.scene.control.SpinnerValueFactory; |
|||
|
|||
import java.net.URL; |
|||
import java.util.ResourceBundle; |
|||
|
|||
public class AdvancedController implements Initializable { |
|||
@FXML |
|||
private Spinner<Integer> gapLimit; |
|||
|
|||
@Override |
|||
public void initialize(URL location, ResourceBundle resources) { |
|||
|
|||
} |
|||
|
|||
public void initializeView(Wallet wallet) { |
|||
gapLimit.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(Wallet.DEFAULT_LOOKAHEAD, 10000, wallet.getGapLimit())); |
|||
gapLimit.valueProperty().addListener((observable, oldValue, newValue) -> { |
|||
wallet.setGapLimit(newValue); |
|||
EventManager.get().post(new SettingsChangedEvent(wallet, SettingsChangedEvent.Type.GAP_LIMIT)); |
|||
}); |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.sparrowwallet.sparrow.wallet; |
|||
|
|||
import com.sparrowwallet.drongo.wallet.Wallet; |
|||
import com.sparrowwallet.sparrow.AppController; |
|||
import javafx.fxml.FXMLLoader; |
|||
import javafx.scene.control.ButtonBar; |
|||
import javafx.scene.control.ButtonType; |
|||
import javafx.scene.control.Dialog; |
|||
import javafx.scene.control.DialogPane; |
|||
import org.controlsfx.tools.Borders; |
|||
|
|||
import java.io.IOException; |
|||
|
|||
public class AdvancedDialog extends Dialog<Void> { |
|||
public AdvancedDialog(Wallet wallet) { |
|||
final DialogPane dialogPane = getDialogPane(); |
|||
AppController.setStageIcon(dialogPane.getScene().getWindow()); |
|||
|
|||
try { |
|||
FXMLLoader advancedLoader = new FXMLLoader(AppController.class.getResource("wallet/advanced.fxml")); |
|||
dialogPane.setContent(Borders.wrap(advancedLoader.load()).lineBorder().outerPadding(0).innerPadding(0).buildAll()); |
|||
AdvancedController settingsAdvancedController = advancedLoader.getController(); |
|||
settingsAdvancedController.initializeView(wallet); |
|||
|
|||
final ButtonType closeButtonType = new javafx.scene.control.ButtonType("Close", ButtonBar.ButtonData.CANCEL_CLOSE); |
|||
dialogPane.getButtonTypes().addAll(closeButtonType); |
|||
|
|||
dialogPane.setPrefWidth(400); |
|||
dialogPane.setPrefHeight(300); |
|||
} |
|||
catch(IOException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
|
|||
<?import java.lang.*?> |
|||
<?import java.util.*?> |
|||
<?import javafx.scene.*?> |
|||
<?import javafx.scene.control.*?> |
|||
<?import javafx.scene.layout.*?> |
|||
<?import tornadofx.control.Form?> |
|||
<?import tornadofx.control.Fieldset?> |
|||
<?import tornadofx.control.Field?> |
|||
<?import com.sparrowwallet.sparrow.control.HelpLabel?> |
|||
<?import javafx.geometry.Insets?> |
|||
|
|||
<BorderPane stylesheets="@../general.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.wallet.AdvancedController"> |
|||
<center> |
|||
<GridPane hgap="10.0" vgap="10.0"> |
|||
<padding> |
|||
<Insets left="25.0" right="25.0" top="25.0" /> |
|||
</padding> |
|||
<columnConstraints> |
|||
<ColumnConstraints percentWidth="100" /> |
|||
</columnConstraints> |
|||
<rowConstraints> |
|||
<RowConstraints /> |
|||
</rowConstraints> |
|||
|
|||
<Form GridPane.columnIndex="0" GridPane.rowIndex="0"> |
|||
<Fieldset inputGrow="SOMETIMES" text="Advanced Settings" styleClass="wideLabelFieldSet"> |
|||
<Field text="Gap limit:"> |
|||
<Spinner fx:id="gapLimit" editable="true" prefWidth="90" /> |
|||
<HelpLabel helpText="Change how far ahead to look for additional transactions beyond the highest derivation with previous transaction outputs"/> |
|||
</Field> |
|||
</Fieldset> |
|||
</Form> |
|||
</GridPane> |
|||
</center> |
|||
</BorderPane> |
|||
|
Loading…
Reference in new issue