Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,6 @@ This library is maintained by CodeDead. You can find more about us using the fol
* [Twitter](https://twitter.com/C0DEDEAD)
* [Facebook](https://facebook.com/deadlinecodedead)
* [Reddit](https://reddit.com/r/CodeDead)
* [ X ](https://x.com/C0DEDEAD)

Copyright © 2024 CodeDead
20 changes: 16 additions & 4 deletions src/main/java/com/codedead/opal/controller/TrayIconController.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ public void showTrayIcon() throws IOException {
logger.info("Displaying tray icon");
if (trayIcon == null) {
createTrayIcon();
if (trayIcon == null) {
logger.warn("TrayIcon cannot be null!");
if (!validTrayIcon()) {
return;
}
}
Expand All @@ -119,8 +118,8 @@ public void showTrayIcon() throws IOException {
*/
public void hideTrayIcon() {
logger.info("Hiding tray icon");
if (trayIcon == null) {
logger.warn("TrayIcon cannot be null!");

if (!validTrayIcon()) {
return;
}

Expand All @@ -129,4 +128,17 @@ public void hideTrayIcon() {

trayIcon = null;
}

/**
* Check if the tray icon is valid
*
* @return True if the tray icon is valid, false otherwise
*/
private boolean validTrayIcon() {
if (trayIcon == null) {
logger.warn("TrayIcon cannot be null!");
return false;
}
return true;
}
}
101 changes: 0 additions & 101 deletions src/main/resources/translations/OpalApplication_en_US.properties

This file was deleted.