mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
jpackage build fixes
This commit is contained in:
parent
05a62cee70
commit
b25aa27375
9 changed files with 42 additions and 4 deletions
21
build.gradle
21
build.gradle
|
@ -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
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit c7fe182241226be5a5e9d587267e810a786d1e19
|
Subproject commit 8c4e6f4ac831ad613be5d52481db6097da5a981b
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
src/main/resources/associations.properties
Normal file
3
src/main/resources/associations.properties
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
extension=psbt
|
||||||
|
mime-type=application/octet-stream
|
||||||
|
description=Partially Signed Bitcoin Transaction
|
|
@ -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>
|
||||||
|
|
BIN
src/main/resources/sparrow-small.png
Normal file
BIN
src/main/resources/sparrow-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
BIN
src/main/resources/sparrow.icns
Normal file
BIN
src/main/resources/sparrow.icns
Normal file
Binary file not shown.
BIN
src/main/resources/sparrow.png
Normal file
BIN
src/main/resources/sparrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 690 KiB |
Loading…
Reference in a new issue