Skip to content

Commit

Permalink
runelite-client: Add app name to RuneliteProperties
Browse files Browse the repository at this point in the history
deathbeam authored and Adam- committed Dec 20, 2017
1 parent 4b799e1 commit 728df2b
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ public class RuneLite
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
public static final File SESSION_FILE = new File(RUNELITE_DIR, "session");
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
public static final String APP_NAME = "RuneLite";

public static Image ICON;

@@ -211,11 +210,11 @@ public void setTitle(String extra)
{
if (!Strings.isNullOrEmpty(extra))
{
gui.setTitle(APP_NAME + " " + properties.getVersion() + " " + extra);
gui.setTitle(properties.getTitle() + " " + properties.getVersion() + " " + extra);
}
else
{
gui.setTitle(APP_NAME + " " + properties.getVersion());
gui.setTitle(properties.getTitle() + " " + properties.getVersion());
}
}

@@ -228,7 +227,7 @@ private void setupTrayIcon()

SystemTray systemTray = SystemTray.getSystemTray();

trayIcon = new TrayIcon(ICON, APP_NAME);
trayIcon = new TrayIcon(ICON, properties.getTitle());
trayIcon.setImageAutoSize(true);

try
@@ -417,7 +416,7 @@ public void notify(String message)

public void notify(String message, TrayIcon.MessageType type)
{
notifier.sendNotification(APP_NAME, message, type, null);
notifier.sendNotification(properties.getTitle(), message, type, null);
Toolkit.getDefaultToolkit().beep();
}

Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
@Slf4j
public class RuneliteProperties
{
private static final String RUNELITE_TITLE = "runelite.title";
private static final String RUNELITE_VERSION = "runelite.version";

private final Properties properties = new Properties();
@@ -54,6 +55,11 @@ public RuneliteProperties()
}
}

public String getTitle()
{
return properties.getProperty(RUNELITE_TITLE);
}

public String getVersion()
{
return properties.getProperty(RUNELITE_VERSION);
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
runelite.title=RuneLite
runelite.version=${project.version}

0 comments on commit 728df2b

Please sign in to comment.