Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public enum MageTray {

private int state = 0;

public void install() {

public void install() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix indentation back to how it was

if (!SystemTray.isSupported()) {
log.warn("SystemTray is not supported");
return;
Expand All @@ -40,7 +41,15 @@ public void install() {
frame.setState(Frame.NORMAL);
});

final SystemTray tray = SystemTray.getSystemTray();
// --- YOUR FIX STARTS HERE ---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for the your fix starts/ends comments

final SystemTray tray;
try {
tray = SystemTray.getSystemTray();
} catch (UnsupportedOperationException e) {
log.warn("SystemTray is supported but not available: " + e.getMessage());
return; // Exit safely if the OS lies about SystemTray support
}
// --- YOUR FIX ENDS HERE ---

final PopupMenu popup = new PopupMenu();

Expand All @@ -52,15 +61,10 @@ public void install() {
MenuItem exitItem = new MenuItem("Exit");

imagesItem.addActionListener(e -> MageFrame.getInstance().downloadImages());

iconsItem.addActionListener(e -> MageFrame.getInstance().downloadAdditionalResources());

stopBlinkItem.addActionListener(e -> stopBlink());

preferencesItem.addActionListener(e -> MageFrame.getInstance().btnPreferencesActionPerformed(null));

aboutItem.addActionListener(e -> MageFrame.getInstance().btnAboutActionPerformed(null));

exitItem.addActionListener(e -> MageFrame.getInstance().exitApp());

popup.add(imagesItem);
Expand Down
Loading