Skip to content

Commit 7387d0c

Browse files
committed
add links to wiki
1 parent b2687ff commit 7387d0c

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed

src/main/java/blobsaver/Controller.java

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import com.sun.javafx.PlatformUtil;
2222
import com.sun.javafx.scene.control.skin.LabeledText;
23-
import eu.hansolo.enzo.notification.Notification;
2423
import javafx.application.Platform;
2524
import javafx.beans.value.ObservableValue;
2625
import javafx.collections.FXCollections;
@@ -853,9 +852,10 @@ public void backgroundSettingsHandler() {
853852
chooseTimeToRunButton.setVisible(true);
854853
forceCheckForBlobs.setVisible(true);
855854
startBackgroundButton.setVisible(true);
856-
if (appPrefs.getBoolean("Background setup", false)) {
855+
if (!appPrefs.getBoolean("Background setup", false)) {
857856
startBackgroundButton.setDisable(true);
858857
forceCheckForBlobs.setDisable(true);
858+
chooseTimeToRunButton.setDisable(true);
859859
}
860860
} else {
861861
backgroundSettingsButton.setDefaultButton(false);
@@ -873,6 +873,7 @@ public void backgroundSettingsHandler() {
873873
btn.setText("Load " + btn.getText().substring("Use ".length()));
874874
}
875875
});
876+
chooseTimeToRunButton.setDisable(false);
876877
chooseTimeToRunButton.setVisible(false);
877878
forceCheckForBlobs.setDisable(false);
878879
forceCheckForBlobs.setVisible(false);
@@ -994,16 +995,35 @@ public void debugLogHandler() {
994995
}
995996
}
996997

997-
public void showWiki() {
998+
public void showWiki(ActionEvent event) {
998999
try {
9991000
Desktop.getDesktop().browse(new URI("https://github.com/airsquared/blobsaver/wiki"));
10001001
} catch (IOException | URISyntaxException e) {
10011002
e.printStackTrace();
10021003
}
1003-
}
1004-
1005-
public void throwException() {
1006-
throw new EnumConstantNotPresentException(Notification.Notifier.class, "");
1004+
String url;
1005+
switch (((MenuItem) event.getTarget()).getText()) {
1006+
case "What are blobs?":
1007+
url = "https://github.com/airsquared/blobsaver/wiki/What-are-blobs-and-why-do-you-need-them%3F";
1008+
break;
1009+
case "Getting the required information":
1010+
url = "https://github.com/airsquared/blobsaver/wiki/Getting-the-required-information";
1011+
break;
1012+
case "Setting it up to run in the background":
1013+
url = "https://github.com/airsquared/blobsaver/wiki/Setting-up-the-background";
1014+
break;
1015+
case "Running on system startup":
1016+
url = "https://github.com/airsquared/blobsaver/wiki/Running-on-system-startup";
1017+
break;
1018+
default:
1019+
url = "https://github.com/airsquared/blobsaver/wiki";
1020+
break;
1021+
}
1022+
try {
1023+
Desktop.getDesktop().browse(new URI(url));
1024+
} catch (IOException | URISyntaxException e) {
1025+
e.printStackTrace();
1026+
}
10071027
}
10081028

10091029
private void log(String msg) {

src/main/resources/blobsaver/blobsaver.fxml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,25 @@
2626
<Menu mnemonicParsing="false" text="Options">
2727
<MenuItem mnemonicParsing="false" onAction="#debugLogHandler"
2828
text="Debug log"/>
29-
<MenuItem mnemonicParsing="false" onAction="#throwException"
30-
text="Throw exception"/>
3129
<MenuItem mnemonicParsing="false" onAction="#checkBlobs"
3230
text="Check for valid blobs..."/>
3331
<MenuItem mnemonicParsing="false" onAction="#checkForUpdatesHandler"
3432
text="Check for Updates..."/>
3533
<MenuItem mnemonicParsing="false" onAction="#resetAppHandler" text="Clear all data"/>
3634
</Menu>
3735
<Menu mnemonicParsing="false" text="Help">
38-
<MenuItem mnemonicParsing="false" onAction="#showWiki"
39-
text="blobsaver Wiki"/>
36+
<Menu mnemonicParsing="false" text="Wiki">
37+
<MenuItem mnemonicParsing="false" onAction="#showWiki"
38+
text="Wiki Home"/>
39+
<MenuItem mnemonicParsing="false" onAction="#showWiki"
40+
text="What are blobs?"/>
41+
<MenuItem mnemonicParsing="false" onAction="#showWiki"
42+
text="Getting the required information"/>
43+
<MenuItem mnemonicParsing="false" onAction="#showWiki"
44+
text="Setting it up to run in the background"/>
45+
<MenuItem mnemonicParsing="false" onAction="#showWiki"
46+
text="Running on system startup"/>
47+
</Menu>
4048
<MenuItem mnemonicParsing="false" onAction="#newGithubIssue"
4149
text="Send Feedback(Github Issue)"/>
4250
<MenuItem mnemonicParsing="false" onAction="#sendRedditPM"

0 commit comments

Comments
 (0)