From 6ff0d7a565adf1545c5091e3c3e1ff4b7518882d Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Tue, 5 Feb 2008 16:36:39 +0000 Subject: [PATCH] Systray tooltip text now gets its value from the main application.properties file. --- build.xml | 2 ++ .../communicator/impl/systray/Resources.java | 24 +++++++++++++++++++ .../systray/jdic/SystrayServiceJdicImpl.java | 2 +- .../impl/systray/resources.properties | 1 - .../impl/systray/resources_de.properties | 1 - 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 42ae75eda..bd95093cc 100644 --- a/build.xml +++ b/build.xml @@ -1319,6 +1319,8 @@ javax.swing.event, javax.swing.border"/> prefix="resources/images/impl/gui/buttons"/> + diff --git a/src/net/java/sip/communicator/impl/systray/Resources.java b/src/net/java/sip/communicator/impl/systray/Resources.java index 49fa2fa2e..ce9abf183 100644 --- a/src/net/java/sip/communicator/impl/systray/Resources.java +++ b/src/net/java/sip/communicator/impl/systray/Resources.java @@ -32,6 +32,12 @@ public class Resources private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle .getBundle(BUNDLE_NAME); + private static final String APPLICATION_RESUORCE_LOCATION + = "resources.application"; + + private static final ResourceBundle applicationBundle + = ResourceBundle.getBundle(APPLICATION_RESUORCE_LOCATION); + /** * Returns an internationalized string corresponding to the given key. * @@ -112,4 +118,22 @@ public static ImageIcon getImage(String imageID) return new ImageIcon(image); } + + /** + * Returns the application property string corresponding to the given key. + * + * @param key The key of the string. + * @return the application property string corresponding to the given key + */ + public static String getApplicationString(String key) + { + try + { + return applicationBundle.getString(key); + } + catch (MissingResourceException e) + { + return '!' + key + '!'; + } + } } diff --git a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java index bc7bf6025..c4246b60f 100644 --- a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java +++ b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java @@ -143,7 +143,7 @@ else if (osName.startsWith("Mac OS X")) currentIcon = logoIcon; trayIcon = new TrayIcon(logoIcon, - Resources.getString("systrayToolTip"), + Resources.getApplicationString("applicationName"), menu); trayIcon.setIconAutoSize(true); diff --git a/src/net/java/sip/communicator/impl/systray/resources.properties b/src/net/java/sip/communicator/impl/systray/resources.properties index a3d23d1d7..91db023f4 100644 --- a/src/net/java/sip/communicator/impl/systray/resources.properties +++ b/src/net/java/sip/communicator/impl/systray/resources.properties @@ -24,7 +24,6 @@ onlineStatus=Online offlineStatus=Offline messageReceived=Message received from failedToLoadAddContactDialog=Failed to load the "Add contact" wizard dialog. -systrayToolTip=SIP Communicator setStatusMessage=Set status message newStatusMessage=New status message statusMessageInfo=In the field below you can specify the new message you would like to use. diff --git a/src/net/java/sip/communicator/impl/systray/resources_de.properties b/src/net/java/sip/communicator/impl/systray/resources_de.properties index 518ac03d0..bd5442bca 100644 --- a/src/net/java/sip/communicator/impl/systray/resources_de.properties +++ b/src/net/java/sip/communicator/impl/systray/resources_de.properties @@ -26,7 +26,6 @@ onlineStatus=Online offlineStatus=Offline messageReceived=Nachricht erhalten von failedToLoadAddContactDialog=Der "Kontakt hinzufügen"-Dialog konnte nicht gestartet werden. -systrayToolTip=SIP Communicator setStatusMessage=Setze Statusnachricht newStatusMessage=Neue Statusnachricht statusMessageInfo=Im Eingabefeld können Sie die neue Statusnachricht angeben.