jpackage build fixes

This commit is contained in:
Craig Raw 2020-04-02 12:54:41 +02:00
parent 05a62cee70
commit b25aa27375
9 changed files with 42 additions and 4 deletions

View file

@ -44,7 +44,9 @@ dependencies {
mainClassName = 'com.sparrowwallet.sparrow.MainApp' mainClassName = 'com.sparrowwallet.sparrow.MainApp'
run {
applicationDefaultJvmArgs = ["-Xdock:name=Sparrow", "-Xdock:icon=/Users/scy/git/sparrow/src/main/resources/sparrow.png"]
}
jlink { jlink {
mergedModule { mergedModule {
@ -59,4 +61,21 @@ jlink {
name = 'sparrow' name = 'sparrow'
} }
addExtraDependencies("javafx") addExtraDependencies("javafx")
jpackage {
imageName = "Sparrow"
installerName = "Sparrow"
appVersion = "0.1"
imageOptions = []
installerOptions = [
'--file-associations', 'src/main/resources/associations.properties',
]
if (org.gradle.internal.os.OperatingSystem.current().windows) {
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu']
}
if (org.gradle.internal.os.OperatingSystem.current().macOsX) {
imageOptions += ['--icon', 'src/main/resources/sparrow.icns']
installerType = "dmg"
}
}
} }

2
drongo

@ -1 +1 @@
Subproject commit c7fe182241226be5a5e9d587267e810a786d1e19 Subproject commit 8c4e6f4ac831ad613be5d52481db6097da5a981b

View file

@ -5,6 +5,7 @@ import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.psbt.PSBT; import com.sparrowwallet.drongo.psbt.PSBT;
import com.sparrowwallet.drongo.psbt.PSBTParseException; import com.sparrowwallet.drongo.psbt.PSBTParseException;
import com.sparrowwallet.sparrow.transaction.TransactionController; import com.sparrowwallet.sparrow.transaction.TransactionController;
import com.sparrowwallet.sparrow.transaction.TransactionListener;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
@ -28,6 +29,16 @@ public class AppController implements Initializable {
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {
}
void initializeView() {
tabs.getSelectionModel().selectedItemProperty().addListener((observable, old_val, new_val) -> {
String tabName = new_val.getText();
Stage tabStage = (Stage)tabs.getScene().getWindow();
tabStage.setTitle("Sparrow - " + tabName);
});
addExampleTxTabs(); addExampleTxTabs();
} }

View file

@ -4,19 +4,24 @@ import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage; import javafx.stage.Stage;
public class MainApp extends Application { public class MainApp extends Application {
@Override @Override
public void start(Stage stage) throws Exception { public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("app.fxml")); FXMLLoader transactionLoader = new FXMLLoader(getClass().getResource("app.fxml"));
Parent root = transactionLoader.load();
AppController appController = transactionLoader.getController();
appController.initializeView();
Scene scene = new Scene(root); Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("app.css").toExternalForm()); scene.getStylesheets().add(getClass().getResource("app.css").toExternalForm());
stage.setTitle("Sparrow"); stage.setTitle("Sparrow");
stage.setScene(scene); stage.setScene(scene);
stage.getIcons().add(new Image(MainApp.class.getResourceAsStream("/sparrow.png")));
stage.show(); stage.show();
} }

View file

@ -0,0 +1,3 @@
extension=psbt
mime-type=application/octet-stream
description=Partially Signed Bitcoin Transaction

View file

@ -5,7 +5,7 @@
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="900.0" fx:controller="com.sparrowwallet.sparrow.AppController" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1"> <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="900.0" fx:controller="com.sparrowwallet.sparrow.AppController" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<MenuBar> <MenuBar useSystemMenuBar="true">
<menus> <menus>
<Menu mnemonicParsing="false" text="File"> <Menu mnemonicParsing="false" text="File">
<items> <items>

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 KiB