Skip to content

Commit e38ed6f

Browse files
committed
Add SHOW_BREAKPOINT options for when running from the IDE(thanks @SwiftWinds)
1 parent f7a2b4c commit e38ed6f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ static void startBackground(boolean runOnlyOnce) {
112112
popup.add(openItem);
113113
popup.addSeparator();
114114
popup.add(exitItem);
115+
if (Main.SHOW_BREAKPOINT) {
116+
MenuItem breakpointItem = new MenuItem("Breakpoint");
117+
breakpointItem.addActionListener(e -> System.out.println("breakpoint"));
118+
popup.add(breakpointItem);
119+
}
115120
trayIcon.setPopupMenu(popup);
116121

117122
// add the application tray icon to the system tray.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ public void savePresetHandler() {
446446
public void checkBlobs() { openURL("https://tsssaver.1conan.com/check.php"); }
447447

448448
public void helpLabelHandler(MouseEvent evt) {
449+
if (Main.SHOW_BREAKPOINT) return; // remember to put a breakpoint here
450+
449451
String labelID;
450452
// if user clicks on question mark instead of padding, evt.getTarget() returns LabeledText instead of Label
451453
if (evt.getTarget() instanceof LabeledText) {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public class Main {
4040
private static final String appID = "com.airsquared.blobsaver";
4141
static Stage primaryStage;
4242

43+
/**
44+
* Enables a menu item in the system tray to activate a breakpoint when in background and
45+
* replaces the question mark help labels with activating a breakpoint instead.
46+
* Remember to add a breakpoint in the correct methods to use this.
47+
*/
48+
static final boolean SHOW_BREAKPOINT = false;
49+
4350
public static void main(String[] args) {
4451
try {
4552
JUnique.acquireLock(appID);

0 commit comments

Comments
 (0)