svn commit: r3310 - trunk/src/net/java/sip/communicator/impl: gui/i18n gui/main/presence systray systray/jdic

yanas at dev.java.net yanas at dev.java.net
Tue Dec 11 14:55:39 CET 2007


Author: yanas
Date: 2007-12-11 13:55:36+0000
New Revision: 3310

Added:
   trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSelector.java
   trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSubMenu.java
Modified:
   trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties
   trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java
   trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java
   trunk/src/net/java/sip/communicator/impl/systray/Resources.java
   trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
   trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java
   trunk/src/net/java/sip/communicator/impl/systray/resources.properties

Log:
Change status message interface added

Modified: trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties&p2=trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/i18n/messages.properties	2007-12-11 13:55:36+0000
@@ -66,6 +66,8 @@
 banFailedGeneralError=Failed to ban {0}. A general server error occured.
 banFailedNotAllowed=Failed to ban {0}. The owner and the administratior of the room could not be banned.
 banFailedNotEnoughPermissions=Failed to ban {0}. You don't have enough privileges to do that.
+brbMessage=I'm gone right now, but I'll be back.
+busyMessage=Sorry, I'm busy right now.
 call=Call
 callVia=Call via:
 callList=Call list
@@ -199,15 +201,18 @@
 next=&Next
 new=&New
 newAccount=&New account
+newMessage=New message...
 newName=New name:
+newStatusMessage=New status message
 no=No
 noAccountFound=In order to use the SIP-Communicator you need at least one registered account. The following pages will guide you through the process of creating an account.
 noAvailableRooms=The list of rooms for this server is currently not available.
+noMessage=No message
 noMultiChatAccountAvailable=No accounts, supporting multi user chat found. Check sip-communicator.org for more information on which protocols support multi user chat.
 nonEmptyChatWindowClose=You're trying to close a chat with a non-sent message. Are you sure you want to close this chat?
 nonExistingUserId=The {0} server does not recognize specified user id.
 notifications=Notifications
-ok=&OK
+ok=&Ok
 offline=Offline
 olderCalls=Older calls
 online=Online
@@ -263,6 +268,7 @@
 selectContactSupportingInfo=There is no info for this contact.
 sendMessage=&Send a message
 sendVia=Send via
+setStatusMessage=Set status message
 settings=&Settings
 showCallPanel=Show call panel
 showChannelsList=Show channels list
@@ -273,6 +279,7 @@
 statusChangedChatMessage=has become {0}
 statusChangeGeneralError=Failed to change status for account: User name: {0}, Server name: {1}, due to a general error.
 statusChangeNetworkFailure=Failed to change status for account: User name: {0}, Server name: {1}, due to a network problem.
+statusMessageInfo=In the field below you can specify the new message you would like to use.
 subject=Subject
 summary=Summary
 today=Today

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusSelectorBox.java	2007-12-11 13:55:36+0000
@@ -18,6 +18,7 @@
 import net.java.sip.communicator.impl.gui.i18n.*;
 import net.java.sip.communicator.impl.gui.main.*;
 import net.java.sip.communicator.impl.gui.main.login.*;
+import net.java.sip.communicator.impl.gui.main.presence.message.*;
 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.service.protocol.*;
 import net.java.sip.communicator.util.*;
@@ -113,6 +114,11 @@
                 .getBytesInImage(status.getStatusIcon())),
                 new ItemActionListener());
         }
+
+        this.addSeparator();
+
+        this.add(new StatusMessageMenu(protocolProvider));
+
         this.setSelectedStatus(offlineStatus);
     }
 
@@ -127,7 +133,6 @@
         {
             if (e.getSource() instanceof JMenuItem)
             {
-
                 JMenuItem menuItem = (JMenuItem) e.getSource();
 
                 LoginManager loginManager = mainFrame.getLoginManager();

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/presence/StatusSelectorBox.java	2007-12-11 13:55:36+0000
@@ -27,23 +27,27 @@
     extends SIPCommMenu
 {
     /**
+     * Starts the connecting animation.
      * 
-     * @param images
+     * @param images the animated image to play
      */
     public void startConnecting(BufferedImage[] images){}
 
     /**
-     * 
+     * Updates the current status.
      */
     public void updateStatus(){}
 
     /**
+     * Returns the account index (In case of more than one account for one and
+     * the same protocol).
      * 
-     * @return
+     * @return the account index
      */
     public int getAccountIndex(){return -1;}
 
     /**
+     * Sets the account index.
      * 
      * @param index
      */

Modified: trunk/src/net/java/sip/communicator/impl/systray/Resources.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/Resources.java?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/systray/Resources.java&p2=trunk/src/net/java/sip/communicator/impl/systray/Resources.java&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/systray/Resources.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/systray/Resources.java	2007-12-11 13:55:36+0000
@@ -7,9 +7,13 @@
 
 package net.java.sip.communicator.impl.systray;
 
+import java.awt.image.*;
 import java.io.*;
 import java.util.*;
 
+import javax.imageio.*;
+import javax.swing.*;
+
 import net.java.sip.communicator.util.*;
 /**
  * The Messages class manages the access to the internationalization
@@ -31,43 +35,82 @@
     
     /**
      * Returns an internationalized string corresponding to the given key.
+     * 
      * @param key The key of the string.
      * @return An internationalized string corresponding to the given key.
      */
-    public static String getString(String key) 
+    public static String getString(String key)
     {
-        try 
+        try
         {
-            return RESOURCE_BUNDLE.getString(key);
+            String resourceString = RESOURCE_BUNDLE.getString(key);
+
+            int mnemonicIndex = resourceString.indexOf('&');
+
+            if(mnemonicIndex > -1)
+            {
+                String firstPart = resourceString.substring(0, mnemonicIndex);
+                String secondPart = resourceString.substring(mnemonicIndex + 1);
+
+                resourceString = firstPart.concat(secondPart);
+            }
 
-        } catch (MissingResourceException e) 
+            return resourceString;
+        }
+        catch (MissingResourceException e)
         {
             return '!' + key + '!';
         }
-    }   
-    
+    }
+
+    /**
+     * Returns an internationalized string corresponding to the given key.
+     * 
+     * @param key The key of the string.
+     * @return An internationalized string corresponding to the given key.
+     */
+    public static char getMnemonic(String key)
+    {
+        try
+        {
+            String resourceString = RESOURCE_BUNDLE.getString(key);
+
+            int mnemonicIndex = resourceString.indexOf('&');
+
+            if(mnemonicIndex > -1)
+                return resourceString.charAt(mnemonicIndex + 1);
+        }
+        catch (MissingResourceException e)
+        {
+            return 0;
+        }
+
+        return 0;
+    }
+
     /**
      * Loads an image from a given image identifier.
-     * @param key The key of the image.
+     * 
+     * @param imageID The identifier of the image.
      * @return The image for the given identifier.
      */
-    public static byte[] getImage(String key) 
+    public static ImageIcon getImage(String imageID)
     {
-        byte[] image = new byte[100000];
+        BufferedImage image = null;
 
-        String path=Resources.getString(key);
-        
-        try 
-        {    
-            Resources.class.getClassLoader()
-                    .getResourceAsStream(path).read(image);
-            
-        } catch (IOException e) 
+        String path = Resources.getString(imageID);
+        try
         {
-            log.error("Failed to load image:" + key, e);
+            image =
+                ImageIO.read(Resources.class.getClassLoader()
+                    .getResourceAsStream(path));
+
+        }
+        catch (IOException e)
+        {
+            log.error("Failed to load image:" + path, e);
         }
-        
-        return image;
-    }
 
+        return new ImageIcon(image);
+    }
 }

Added: trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSelector.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSelector.java?view=auto&rev=3310
==============================================================================
--- (empty file)
+++ trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSelector.java	2007-12-11 13:55:36+0000
@@ -0,0 +1,226 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+ 
+package net.java.sip.communicator.impl.systray.jdic;
+
+
+import java.awt.event.*;
+import java.util.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.impl.systray.*;
+import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
+
+
+/**
+ * The <tt>StatusSelector</tt> is a submenu which allows to select a status for
+ * a protocol provider which supports the OperationSetPresence.
+ * 
+ * @author Nicolas Chamouard
+ *
+ */
+public class StatusSelector
+    extends JMenu
+    implements ActionListener
+{
+    /**
+     * A reference of <tt>Systray</tt>
+     */
+    private SystrayServiceJdicImpl parentSystray;
+    /**
+     * The protocol provider
+     */
+    private ProtocolProviderService provider;
+    /**
+     * The presence status
+     */
+    private OperationSetPresence presence;
+    
+    /**
+     * The logger for this class.
+     */
+    private Logger logger = Logger.getLogger(
+            StatusSelector.class.getName());
+
+    private StatusMessageMenu statusMessageMenu;
+
+    /**
+     * Creates an instance of StatusSelector
+     * 
+     * @param jdicSystray a reference of the parent <tt>Systray</tt>
+     * @param provider the protocol provider
+     * @param presence the presence status
+     */
+    public StatusSelector(  SystrayServiceJdicImpl jdicSystray,
+                            ProtocolProviderService provider,
+                            OperationSetPresence presence)
+    {
+        this.parentSystray = jdicSystray;
+        this.provider = provider;
+        this.presence = presence;
+
+        this.statusMessageMenu = new StatusMessageMenu(provider);
+        /* the parent item */
+
+        this.setText(provider.getAccountID().getUserID());
+        this.setIcon(new ImageIcon(
+                presence.getPresenceStatus().getStatusIcon()));
+
+        /* the submenu itself */
+
+        Iterator statusIterator = this.presence.getSupportedStatusSet();
+
+        while(statusIterator.hasNext()) 
+        {
+            PresenceStatus status = (PresenceStatus) statusIterator.next();
+
+            ImageIcon icon = new ImageIcon(status.getStatusIcon());
+            JMenuItem item = new JMenuItem(status.getStatusName(),icon);
+
+            item.addActionListener(this);
+
+            this.add(item);
+        }
+
+        this.addSeparator();
+
+        this.add(statusMessageMenu);
+    }
+
+    /**
+     * Change the status of the protocol according to
+     * the menu item selected
+     * @param evt the event containing the menu item name
+     */
+    public void actionPerformed(ActionEvent evt)
+    {
+        JMenuItem menuItem = (JMenuItem) evt.getSource();
+
+        Iterator statusSet = presence.getSupportedStatusSet();
+
+        while (statusSet.hasNext()) 
+        {
+            PresenceStatus status = ((PresenceStatus) statusSet.next());
+
+            if (status.getStatusName().equals(menuItem.getText())) 
+            {
+                
+                if (this.provider.getRegistrationState()
+                        == RegistrationState.REGISTERED
+                    && !presence.getPresenceStatus().equals(status))
+                {
+                    if (status.isOnline()) 
+                    {
+                        new PublishPresenceStatusThread(status).start();
+                    }
+                    else
+                    {
+                        new ProviderUnRegistration(this.provider).start();
+                    }
+                }
+                else if (this.provider.getRegistrationState()
+                            != RegistrationState.REGISTERED
+                        && this.provider.getRegistrationState()
+                            != RegistrationState.REGISTERING
+                        && this.provider.getRegistrationState()
+                            != RegistrationState.AUTHENTICATING
+                        && status.isOnline())
+                {
+                    new ProviderRegistration(provider).start();
+                }
+                else
+                {
+                    if(!status.isOnline()
+                        && !(this.provider.getRegistrationState()
+                        == RegistrationState.UNREGISTERING))
+                    {
+                        new ProviderUnRegistration(this.provider).start();
+                    }
+                }    
+                
+                parentSystray.saveStatusInformation(
+                    provider, status.getStatusName());
+                
+                break;
+            }
+        }
+    }
+
+    /**
+     * Stops the timer that manages the connecting animated icon.
+     */
+    public void updateStatus(PresenceStatus presenceStatus)
+    {
+        logger.trace("Systray update status for provider: "
+            + provider.getAccountID().getAccountAddress()
+            + ". The new status will be: " + presenceStatus.getStatusName());
+
+        this.setIcon(new ImageIcon(presenceStatus.getStatusIcon()));
+    }
+
+    /**
+     *  This class allow to use a thread to change the presence status.
+     */
+    private class PublishPresenceStatusThread extends Thread
+    {
+        PresenceStatus status;
+        
+        public PublishPresenceStatusThread(PresenceStatus status)
+        {
+            this.status = status;
+        }
+
+        public void run()
+        {
+            try {
+                presence.publishPresenceStatus(status, "");
+            }
+            catch (IllegalArgumentException e1)
+            {
+
+                logger.error("Error - changing status", e1);
+            }
+            catch (IllegalStateException e1)
+            {
+
+                logger.error("Error - changing status", e1);
+            }
+            catch (OperationFailedException e1)
+            {
+                
+                if (e1.getErrorCode()
+                    == OperationFailedException.GENERAL_ERROR)
+                {
+                    logger.error(
+                        "General error occured while "
+                        + "publishing presence status.",
+                        e1);
+                }
+                else if (e1.getErrorCode()
+                        == OperationFailedException
+                            .NETWORK_FAILURE) 
+                {
+                    logger.error(
+                        "Network failure occured while "
+                        + "publishing presence status.",
+                        e1);
+                } 
+                else if (e1.getErrorCode()
+                        == OperationFailedException
+                            .PROVIDER_NOT_REGISTERED) 
+                {
+                    logger.error(
+                        "Protocol provider must be"
+                        + "registered in order to change status.",
+                        e1);
+                }
+            }
+        }
+    }
+}

Added: trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSubMenu.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSubMenu.java?view=auto&rev=3310
==============================================================================
--- (empty file)
+++ trunk/src/net/java/sip/communicator/impl/systray/jdic/StatusSubMenu.java	2007-12-11 13:55:36+0000
@@ -0,0 +1,227 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+ 
+package net.java.sip.communicator.impl.systray.jdic;
+
+import java.awt.*;
+import java.beans.*;
+import java.util.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.impl.systray.*;
+import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.service.protocol.event.*;
+import net.java.sip.communicator.util.*;
+
+import org.osgi.framework.*;
+
+/**
+ * The <tt>StatusSubMenu</tt> provides a menu which allow
+ * to select the status for each of the protocol providers
+ * registered when the menu appears
+ * 
+ * @author Nicolas Chamouard
+ *
+ */
+
+public class StatusSubMenu
+    extends JMenu
+{
+    /**
+     * A reference of <tt>Systray</tt>
+     */
+    private SystrayServiceJdicImpl parentSystray;
+
+    /**
+     * Contains all accounts and corresponding menus.
+     */
+    private Hashtable accountSelectors = new Hashtable();
+
+    private Logger logger = Logger.getLogger(StatusSubMenu.class);
+
+    /**
+     * Creates an instance of <tt>StatusSubMenu</tt>.
+     * @param tray a reference of the parent <tt>Systray</tt>
+     */
+    public StatusSubMenu(SystrayServiceJdicImpl tray)
+    {
+        
+        parentSystray = tray;
+
+        this.setText(Resources.getString("setStatus"));
+        this.setIcon(Resources.getImage("statusMenuIcon"));
+
+        /* makes the menu look better */
+        this.setPreferredSize(new java.awt.Dimension(28, 24));
+
+        this.init();
+    }
+
+    /**
+     * Adds the account corresponding to the given protocol provider to this
+     * menu.
+     * 
+     * @param protocolProvider the protocol provider corresponding to the
+     * account to add
+     */
+    private void addAccount(ProtocolProviderService protocolProvider)
+    {
+        OperationSetPresence presence = (OperationSetPresence)
+            protocolProvider.getOperationSet(OperationSetPresence.class);
+
+        if (presence == null)
+        {
+            StatusSimpleSelector simpleSelector = 
+                new StatusSimpleSelector(parentSystray, protocolProvider);
+
+            this.accountSelectors.put(  protocolProvider.getAccountID(),
+                                        simpleSelector);
+            this.add(simpleSelector);
+        }
+        else
+        {
+            StatusSelector statusSelector = 
+                new StatusSelector( parentSystray,
+                                    protocolProvider,
+                                    presence);
+
+            this.accountSelectors.put(  protocolProvider.getAccountID(),
+                                        statusSelector);
+            this.add(statusSelector);
+
+            presence.addProviderPresenceStatusListener(
+                new SystrayProviderPresenceStatusListener());
+        }
+    }
+
+    /**
+     * Removes the account corresponding to the given protocol provider from
+     * this menu.
+     * 
+     * @param protocolProvider the protocol provider corresponding to the
+     * account to remove.
+     */
+    private void removeAccount(ProtocolProviderService protocolProvider)
+    {
+        Component c = (Component) this.accountSelectors
+            .get(protocolProvider.getAccountID());
+
+        this.remove(c);
+    }
+
+    /**
+     * We fill the protocolProviderTable with all
+     * running protocol providers at the start of
+     * the bundle.
+     */
+    private void init()
+    {
+        SystrayActivator.bundleContext
+            .addServiceListener(new ProtocolProviderServiceListener());
+
+        ServiceReference[] protocolProviderRefs = null;
+        try
+        {
+            protocolProviderRefs
+                = SystrayActivator.bundleContext.getServiceReferences(
+                    ProtocolProviderService.class.getName(),null);
+        }
+        catch (InvalidSyntaxException ex)
+        {
+            // this shouldn't happen since we're providing no parameter string
+            // but let's log just in case.
+            logger .error("Error while retrieving service refs", ex);
+            return;
+        }
+
+        // in case we found any
+        if (protocolProviderRefs != null)
+        {
+
+            for (int i = 0; i < protocolProviderRefs.length; i++)
+            {
+                ProtocolProviderService provider
+                    = (ProtocolProviderService) SystrayActivator.bundleContext
+                        .getService(protocolProviderRefs[i]);
+
+                this.addAccount(provider);
+            }
+        }
+    }
+
+    /**
+     * Listens for <tt>ServiceEvent</tt>s indicating that a
+     * <tt>ProtocolProviderService</tt> has been registered and completes the
+     * account status menu.
+     */
+    private class ProtocolProviderServiceListener implements ServiceListener
+    {
+        /**
+         * When a service is registered or unregistered, we update
+         * the provider tables and add/remove listeners (if it supports
+         * BasicInstantMessenging implementation)
+         *
+         * @param event ServiceEvent
+         */
+        public void serviceChanged(ServiceEvent event)
+        {
+            //if the event is caused by a bundle being stopped, we don't want to
+            //know
+            if(event.getServiceReference().getBundle().getState()
+                == Bundle.STOPPING)
+            {
+                return;
+            }
+
+            Object service = SystrayActivator.bundleContext
+                .getService( event.getServiceReference());
+
+            if (! (service instanceof ProtocolProviderService))
+                return;
+
+            ProtocolProviderService provider = (ProtocolProviderService)service;
+
+            if (event.getType() == ServiceEvent.REGISTERED)
+                addAccount(provider);
+
+            if (event.getType() == ServiceEvent.UNREGISTERING)
+               removeAccount(provider);
+        }
+    }
+
+    /**
+     * Listens for all providerStatusChanged and providerStatusMessageChanged
+     * events in order to refresh the account status panel, when a status is
+     * changed.
+     */
+    private class SystrayProviderPresenceStatusListener
+        implements ProviderPresenceStatusListener
+    {
+        /**
+         * Fired when an account has changed its status. We update the icon
+         * in the menu.
+         */
+        public void providerStatusChanged(ProviderPresenceStatusChangeEvent evt)
+        {
+            ProtocolProviderService pps = evt.getProvider();
+
+            StatusSelector selectorBox 
+                = (StatusSelector) accountSelectors.get(pps.getAccountID());
+        
+            if(selectorBox == null)
+                return;
+
+            selectorBox.updateStatus(evt.getNewStatus());
+        }
+
+        public void providerStatusMessageChanged(PropertyChangeEvent evt)
+        {
+        }
+    }
+
+}
\ No newline at end of file

Modified: trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java&p2=trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java	2007-12-11 13:55:36+0000
@@ -123,30 +123,22 @@
         // background.
         if (osName.startsWith("Windows"))
         {
-            logoIcon = new ImageIcon(
-                    Resources.getImage("trayIconWindows"));
-            envelopeIcon = new ImageIcon(
-                    Resources.getImage("messageIconWindows"));
+            logoIcon = Resources.getImage("trayIconWindows");
+            envelopeIcon = Resources.getImage("messageIconWindows");
         }
         // If we're running under MacOSX, we use a special black and 
         // white icons without background.
         else if (osName.startsWith("Mac OS X"))
         {
-            logoIcon = new ImageIcon(
-                    Resources.getImage("trayIconMacOSX"));
-            logoIconWhite = new ImageIcon(
-                    Resources.getImage("trayIconMacOSXWhite"));
-            envelopeIcon = new ImageIcon(
-                    Resources.getImage("messageIconMacOSX"));
-            envelopeIconWhite = new ImageIcon(
-                    Resources.getImage("messageIconMacOSXWhite"));
+            logoIcon = Resources.getImage("trayIconMacOSX");
+            logoIconWhite = Resources.getImage("trayIconMacOSXWhite");
+            envelopeIcon = Resources.getImage("messageIconMacOSX");
+            envelopeIconWhite = Resources.getImage("messageIconMacOSXWhite");
         }
         else
         {
-            logoIcon = new ImageIcon(
-                    Resources.getImage("trayIcon"));
-            envelopeIcon = new ImageIcon(
-                    Resources.getImage("messageIcon"));
+            logoIcon = Resources.getImage("trayIcon");
+            envelopeIcon = Resources.getImage("messageIcon");
         }
 
         currentIcon = logoIcon;

Modified: trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java&p2=trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/systray/jdic/TrayMenu.java	2007-12-11 13:55:36+0000
@@ -39,15 +39,15 @@
         
     private JMenuItem settingsItem = new JMenuItem(
             Resources.getString("settings"),
-            new ImageIcon(Resources.getImage("settingsMenuIcon")));
+            Resources.getImage("settingsMenuIcon"));
     
     private JMenuItem closeItem = new JMenuItem(
             Resources.getString("close"),
-            new ImageIcon(Resources.getImage("closeMenuIcon")));
+            Resources.getImage("closeMenuIcon"));
     
     private JMenuItem addContactMenuItem = new JMenuItem(
             Resources.getString("addContact"),
-            new ImageIcon(Resources.getImage("addContactIcon")));
+            Resources.getImage("addContactIcon"));
         
     private StatusSubMenu statusMenu;
     

Modified: trunk/src/net/java/sip/communicator/impl/systray/resources.properties
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/resources.properties?view=diff&rev=3310&p1=trunk/src/net/java/sip/communicator/impl/systray/resources.properties&p2=trunk/src/net/java/sip/communicator/impl/systray/resources.properties&r1=3309&r2=3310
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/systray/resources.properties	(original)
+++ trunk/src/net/java/sip/communicator/impl/systray/resources.properties	2007-12-11 13:55:36+0000
@@ -17,6 +17,7 @@
 messageIconWindows=net/java/sip/communicator/impl/systray/resources/envelopeWindows.png
 messageIconMacOSX=net/java/sip/communicator/impl/systray/resources/envelopeMacOSX.png
 messageIconMacOSXWhite=net/java/sip/communicator/impl/systray/resources/envelopeMacOSXWhite.png
+newStatusMessageIcon=resources/images/impl/gui/common/renameDialogIcon.png
 settings=Settings...
 addContact=Add contact...
 setStatus=Set Status
@@ -26,3 +27,12 @@
 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.
+noMessage=No message
+newMessage=New message...
+busyMessage=Sorry, I'm busy right now.
+brbMessage=I'm gone right now, but I'll be back.
+ok=&Ok
+cancel=&Cancel

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list