Skip to content

Commit 396189e

Browse files
committed
Support unlimited saved devices, UI updates, allow exporting and importing saved devices
1 parent 4b24197 commit 396189e

File tree

12 files changed

+62
-124
lines changed

12 files changed

+62
-124
lines changed

.idea/blobsaver.iml

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.idea/modules/blobsaver.main.iml

Lines changed: 1 addition & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/blobsaver.test.iml

Lines changed: 1 addition & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2222
plugins {
2323
id 'java'
2424
id 'application'
25-
id 'com.github.ben-manes.versions' version '0.36.0'
25+
id 'com.github.ben-manes.versions' version '0.38.0'
2626
id 'org.beryx.jlink' version '2.23.3'
2727

2828
id 'idea'
@@ -33,7 +33,7 @@ idea.module.outputDir file("out/production/classes") // fix running via IntelliJ
3333
* REMEMBER: also update the version string in:
3434
* - Main.java
3535
*/
36-
version = "3.0"
36+
version = "2.6"
3737
description = "A cross-platform GUI app for saving SHSH blobs"
3838
String appIdentifier = "airsquared.blobsaver.app"
3939
String copyright = "Copyright (c) 2020 airsquared"
@@ -60,7 +60,7 @@ dependencies {
6060
implementation 'de.jangassen:nsmenufx:3.1.0'
6161
// implementation 'net.java.dev.jna:jna:jpms:5.7.0'
6262

63-
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0'
63+
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
6464
}
6565

6666
java {

src/main/java/airsquared/blobsaver/app/Background.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ private static void macosBackgroundFile() {
6262
"</dict>" +
6363
"</plist>";
6464
try {
65+
Files.createDirectories(Path.of(System.getProperty("user.home"), "Library/LaunchAgents"));
6566
Files.writeString(plistFilePath, plist);
6667
} catch (IOException e) {
6768
throw new UncheckedIOException(e);

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ private void updateBackgroundSettings() {
335335
startBackgroundButton.setDisable(disableBackgroundSettings);
336336
forceCheckForBlobs.setDisable(disableBackgroundSettings || !Background.isBackgroundEnabled());
337337
chooseTimeToRunButton.setDisable(disableBackgroundSettings);
338+
339+
if (Background.isBackgroundEnabled()) {
340+
startBackgroundButton.setText("Stop Background");
341+
} else {
342+
startBackgroundButton.setText("Start Background");
343+
}
338344
}
339345

340346
public void backgroundSettingsHandler() {
@@ -349,9 +355,6 @@ public void backgroundSettingsHandler() {
349355
property.addListener((obs, old, newValue) -> addBackgroundHandler(device, property));
350356
return property;
351357
}));
352-
if (Background.isBackgroundEnabled()) {
353-
startBackgroundButton.setText("Stop Background");
354-
}
355358
} else {
356359
savedDevicesVBox.setEffect(null);
357360
savedDevicesLabel.setText("Saved Devices");
@@ -415,13 +418,13 @@ public void chooseTimeToRunHandler() {
415418
public void startBackgroundHandler() {
416419
if (Background.isBackgroundEnabled()) { //stops background if already in background
417420
Background.stopBackground();
418-
startBackgroundButton.setText("Start background");
421+
updateBackgroundSettings();
419422
} else {
420423
Background.startBackground();
424+
updateBackgroundSettings();
421425
Alert alert = new Alert(Alert.AlertType.INFORMATION,
422426
"Background saving has been enabled. You can now close this application and it will continue saving blobs at the interval you set, and won't use any resources when it is not running.", ButtonType.OK);
423427
alert.showAndWait();
424-
startBackgroundButton.setText("Stop background");
425428
}
426429
}
427430

src/main/java/airsquared/blobsaver/app/Devices.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ static String getOSNameForType(String deviceType) {
183183
};
184184
}
185185

186+
static String getOSNameForIdentifier(String identifier) {
187+
return getOSNameForType(getDeviceType(identifier));
188+
}
189+
186190
static boolean doesRequireBoardConfig(String deviceIdentifier) {
187191
return requiresBoardConfig.containsKey(deviceIdentifier) || !containsIdentifier(deviceIdentifier);
188192
}

src/main/java/airsquared/blobsaver/app/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
public class Main {
3737

38-
static final String appVersion = "v3.0b0";
38+
static final String appVersion = "v2.6";
3939
static Stage primaryStage;
4040
// make sure to set system property before running (automatically set if running from gradle)
4141
static final File jarDirectory;

0 commit comments

Comments
 (0)