Skip to content

Commit 8c0588d

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a8dac30 + 74bb770 commit 8c0588d

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ If you have an antivirus or firewall, you may need to disable some other setting
2828
Please send feedback via [Github Issue](https://github.com/airsquared/blobsaver/issues/new/choose) or [Reddit PM](https://www.reddit.com//message/compose?to=01110101_00101111&subject=Blobsaver+Feedback) if you encounter any bugs/problems or have a feature request.
2929

3030
## TODO:
31-
- Fix reading the information from the device on Windows
32-
- Better notifications
31+
See Github issues tagged [enhancement](https://github.com/airsquared/blobsaver/labels/enhancement)
3332

3433
## Built With
3534
- JDK 8

src/main/java/com/airsquared/blobsaver/Controller.java

+28-14
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
import javafx.event.ActionEvent;
2929
import javafx.event.EventHandler;
3030
import javafx.fxml.FXML;
31+
import javafx.scene.control.Button;
32+
import javafx.scene.control.Label;
33+
import javafx.scene.control.Menu;
34+
import javafx.scene.control.MenuBar;
35+
import javafx.scene.control.MenuItem;
36+
import javafx.scene.control.TextField;
3137
import javafx.scene.control.*;
3238
import javafx.scene.effect.DropShadow;
3339
import javafx.scene.input.MouseEvent;
@@ -52,12 +58,7 @@
5258

5359
import static com.airsquared.blobsaver.Main.appPrefs;
5460
import static com.airsquared.blobsaver.Main.primaryStage;
55-
import static com.airsquared.blobsaver.Shared.githubIssue;
56-
import static com.airsquared.blobsaver.Shared.newReportableError;
57-
import static com.airsquared.blobsaver.Shared.newUnreportableError;
58-
import static com.airsquared.blobsaver.Shared.redditPM;
59-
import static com.airsquared.blobsaver.Shared.reportError;
60-
import static com.airsquared.blobsaver.Shared.resizeAlertButtons;
61+
import static com.airsquared.blobsaver.Shared.*;
6162

6263
public class Controller {
6364

@@ -335,7 +336,7 @@ public void initialize() {
335336
@Override
336337
public void handle(WindowEvent event) {
337338
useMacOSMenuBar();
338-
log("using macos menu bar");
339+
log("using macOS menu bar");
339340
primaryStage.removeEventHandler(event.getEventType(), this);
340341
}
341342
});
@@ -813,7 +814,6 @@ public void helpLabelHandler(MouseEvent evt) {
813814
e.printStackTrace();
814815
}
815816
}
816-
alert.showAndWait();
817817
break;
818818
case "boardConfig":
819819
openLink = new ButtonType("BMSSM app");
@@ -852,11 +852,23 @@ public void aboutMenuHandler() {
852852
ButtonType viewLicense = new ButtonType("View License");
853853
ButtonType librariesUsed = new ButtonType("Libraries Used");
854854
ButtonType donate = new ButtonType("Donate!");
855-
Alert alert = new Alert(Alert.AlertType.INFORMATION, "About text here", librariesUsed, viewLicense, donate, githubRepo, ButtonType.OK);
855+
ButtonType customOK = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE);
856+
Alert alert = new Alert(Alert.AlertType.INFORMATION, "About text here",
857+
librariesUsed, viewLicense, donate, githubRepo, customOK);
856858
alert.setTitle("About");
859+
860+
//Deactivate default behavior for librariesUsed Button:
861+
Button libButton = (Button) alert.getDialogPane().lookupButton(librariesUsed);
862+
libButton.setDefaultButton(false);
863+
864+
//Activate default behavior for OK-Button:
865+
Button OkButton = (Button) alert.getDialogPane().lookupButton(customOK);
866+
OkButton.setDefaultButton(true);
867+
857868
alert.setHeaderText("blobsaver " + Main.appVersion);
858869
alert.setContentText("blobsaver Copyright (c) 2018 airsquared\n\n" +
859870
"This program is licensed under GNU GPL v3.0-only");
871+
860872
resizeAlertButtons(alert);
861873
alert.showAndWait();
862874
switch (alert.getResult().getText()) {
@@ -886,7 +898,7 @@ public void aboutMenuHandler() {
886898
out.close();
887899
licenseFile.deleteOnExit();
888900
licenseFile.setReadOnly();
889-
java.awt.Desktop.getDesktop().edit(licenseFile);
901+
Desktop.getDesktop().edit(licenseFile);
890902
} catch (IOException e) {
891903
e.printStackTrace();
892904
}
@@ -910,7 +922,7 @@ public void aboutMenuHandler() {
910922
out.close();
911923
libsUsedFile.deleteOnExit();
912924
libsUsedFile.setReadOnly();
913-
java.awt.Desktop.getDesktop().edit(libsUsedFile);
925+
Desktop.getDesktop().edit(libsUsedFile);
914926
} catch (IOException e) {
915927
e.printStackTrace();
916928
}
@@ -957,7 +969,7 @@ private void useMacOSMenuBar() {
957969
windowMenu.getItems().add(tk.createMinimizeMenuItem());
958970
windowMenu.getItems().add(tk.createCycleWindowsItem());
959971

960-
MenuItem debugLogMenuItem = new MenuItem("Open/Close Debug log");
972+
MenuItem debugLogMenuItem = new MenuItem("Open/Close Debug Log");
961973
debugLogMenuItem.setOnAction(event -> {
962974
debugLogHandler();
963975
tk.setMenuBar(DebugWindow.getDebugStage(), macOSMenuBar);
@@ -1136,7 +1148,9 @@ public void resetAppHandler() {
11361148
try {
11371149
Alert confirmationAlert = new Alert(Alert.AlertType.CONFIRMATION, "Are you sure you would like to uninstall this application?", ButtonType.NO, ButtonType.YES);
11381150
confirmationAlert.showAndWait();
1139-
if ((confirmationAlert.getResult() == null) || ButtonType.CANCEL.equals(confirmationAlert.getResult()) || ButtonType.NO.equals(confirmationAlert.getResult())) {
1151+
if ((confirmationAlert.getResult() == null)
1152+
|| ButtonType.CANCEL.equals(confirmationAlert.getResult())
1153+
|| ButtonType.NO.equals(confirmationAlert.getResult())) {
11401154
return;
11411155
}
11421156
Preferences prefs = Preferences.userRoot().node("airsquared/blobsaver");
@@ -1486,4 +1500,4 @@ public void goButtonHandler() {
14861500
run(Shared.textToIdentifier(deviceModel));
14871501
}
14881502
}
1489-
}
1503+
}

src/main/resources/com/airsquared/blobsaver/blobsaver.fxml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<VBox maxHeight="Infinity" maxWidth="-Infinity" minHeight="580.0" prefWidth="500.0">
2727
<MenuBar fx:id="menuBar">
2828
<Menu mnemonicParsing="false" text="Options">
29-
<MenuItem mnemonicParsing="false" onAction="#debugLogHandler" text="Debug log"/>
29+
<MenuItem mnemonicParsing="false" onAction="#debugLogHandler" text="Debug Log"/>
3030
<MenuItem mnemonicParsing="false" onAction="#checkBlobs" text="Check for valid blobs..."/>
3131
<MenuItem mnemonicParsing="false" onAction="#checkForUpdatesHandler"
3232
text="Check for Updates..."/>
@@ -48,8 +48,8 @@
4848
text="How do I get a crash log?"/>
4949
</Menu>
5050
<MenuItem mnemonicParsing="false" onAction="#newGithubIssue"
51-
text="Send Feedback(Github Issue)"/>
52-
<MenuItem mnemonicParsing="false" onAction="#sendRedditPM" text="Send Feedback(Reddit PM)"/>
51+
text="Send Feedback (Github Issue)"/>
52+
<MenuItem mnemonicParsing="false" onAction="#sendRedditPM" text="Send Feedback (Reddit PM)"/>
5353
<SeparatorMenuItem mnemonicParsing="false"/>
5454
<MenuItem mnemonicParsing="false" onAction="#donate" text="Donate!"/>
5555
<SeparatorMenuItem mnemonicParsing="false"/>

0 commit comments

Comments
 (0)