runelite-client: Add app name to RuneliteProperties

This commit is contained in:
Tomas Slusny
2017-12-19 20:37:40 -05:00
committed by Adam
parent 3769cab5b4
commit 7c989dc105
3 changed files with 11 additions and 5 deletions

View File

@@ -78,7 +78,6 @@ public class RuneLite
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles"); 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 SESSION_FILE = new File(RUNELITE_DIR, "session");
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins"); public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
public static final String APP_NAME = "RuneLite";
public static Image ICON; public static Image ICON;
@@ -211,11 +210,11 @@ public class RuneLite
{ {
if (!Strings.isNullOrEmpty(extra)) if (!Strings.isNullOrEmpty(extra))
{ {
gui.setTitle(APP_NAME + " " + properties.getVersion() + " " + extra); gui.setTitle(properties.getTitle() + " " + properties.getVersion() + " " + extra);
} }
else else
{ {
gui.setTitle(APP_NAME + " " + properties.getVersion()); gui.setTitle(properties.getTitle() + " " + properties.getVersion());
} }
} }
@@ -228,7 +227,7 @@ public class RuneLite
SystemTray systemTray = SystemTray.getSystemTray(); SystemTray systemTray = SystemTray.getSystemTray();
trayIcon = new TrayIcon(ICON, APP_NAME); trayIcon = new TrayIcon(ICON, properties.getTitle());
trayIcon.setImageAutoSize(true); trayIcon.setImageAutoSize(true);
try try
@@ -417,7 +416,7 @@ public class RuneLite
public void notify(String message, TrayIcon.MessageType type) 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(); Toolkit.getDefaultToolkit().beep();
} }

View File

@@ -36,6 +36,7 @@ import javax.inject.Singleton;
@Slf4j @Slf4j
public class RuneliteProperties public class RuneliteProperties
{ {
private static final String RUNELITE_TITLE = "runelite.title";
private static final String RUNELITE_VERSION = "runelite.version"; private static final String RUNELITE_VERSION = "runelite.version";
private final Properties properties = new Properties(); private final Properties properties = new Properties();
@@ -54,6 +55,11 @@ public class RuneliteProperties
} }
} }
public String getTitle()
{
return properties.getProperty(RUNELITE_TITLE);
}
public String getVersion() public String getVersion()
{ {
return properties.getProperty(RUNELITE_VERSION); return properties.getProperty(RUNELITE_VERSION);

View File

@@ -1,2 +1,3 @@
runelite.title=RuneLite
runelite.version=${project.version} runelite.version=${project.version}