From c0e44b2c5540971746bf5885ddb73363ba1f5e2b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 10 Mar 2021 12:51:17 +0200 Subject: [PATCH] show online docs and log file from help menu --- .../com/sparrowwallet/sparrow/AppController.java | 13 +++++++++++++ .../resources/com/sparrowwallet/sparrow/app.fxml | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 605b42fa..f6433173 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -270,6 +270,19 @@ public class AppController implements Initializable { } } + public void showDocumentation(ActionEvent event) throws IOException { + AppServices.get().getApplication().getHostServices().showDocument("https://sparrowwallet.com/docs"); + } + + public void showLogFile(ActionEvent event) throws IOException { + File logFile = new File(Storage.getSparrowHome(), "sparrow.log"); + if(logFile.exists()) { + AppServices.get().getApplication().getHostServices().showDocument(logFile.toPath().toUri().toString()); + } else { + AppServices.showErrorDialog("Log file unavailable", "Cannot find log file at " + logFile.getCanonicalPath()); + } + } + public void showAbout(ActionEvent event) { Stage aboutStage = getAboutStage(); aboutStage.show(); diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml index 71314413..048938a2 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml @@ -91,6 +91,8 @@ + +