From 972d72fcfb32903bbfe80376b242947d73f68f58 Mon Sep 17 00:00:00 2001 From: yanas Date: Wed, 8 May 2013 10:29:19 +0200 Subject: [PATCH] =?UTF-8?q?Fixes=20status=20change=20problems=20in=20chat?= =?UTF-8?q?=20window.=20Includes=20fixes=20for=20multiple=20status=20messa?= =?UTF-8?q?ges=20and=20status=20icon=20incorrect=20changes=20reported=20by?= =?UTF-8?q?=20Richard=20Karmaz=C3=ADn.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/styles/defaultStyle.css | 6 +++--- .../impl/gui/main/chat/ChatPanel.java | 18 +++++++++++++++--- .../gui/main/chat/ChatSessionRenderer.java | 9 +++++++++ .../main/chat/ChatTransportSelectorBox.java | 4 ++++ .../main/chat/MetaContactChatTransport.java | 5 ++++- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/resources/styles/defaultStyle.css b/resources/styles/defaultStyle.css index 80814fa5e..13a2197e6 100644 --- a/resources/styles/defaultStyle.css +++ b/resources/styles/defaultStyle.css @@ -24,9 +24,9 @@ h3 h4 { margin: 0px; - font-size: 100%; - font-weight: bold; - color: #FFC875; + font-size: 8px; + font-weight: normal; + color: #8F8F8F; } h5 diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java index 4e7f1a5f9..4ac7257e4 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java @@ -1989,6 +1989,9 @@ public void run() writeMessagePanel.updateChatTransportStatus(chatTransport); + if (!chatTransport.equals(chatSession.getCurrentChatTransport())) + return; + if(ConfigurationUtils.isShowStatusChangedInChat()) { // Show a status message to the user. @@ -2002,13 +2005,22 @@ public void run() "text/plain"); } + setChatIcon(new ImageIcon( + Constants.getStatusIcon(chatTransport.getStatus()))); + } + + /** + * Sets the chat icon. + * + * @param icon the chat icon to set + */ + public void setChatIcon(Icon icon) + { if(ConfigurationUtils.isMultiChatWindowEnabled()) { if (getChatContainer().getChatCount() > 0) { - getChatContainer().setChatIcon(this, - new ImageIcon( - Constants.getStatusIcon(chatTransport.getStatus()))); + getChatContainer().setChatIcon(this, icon); } } } diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatSessionRenderer.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatSessionRenderer.java index 8d563b5b3..bf25ebce4 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatSessionRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatSessionRenderer.java @@ -6,6 +6,8 @@ */ package net.java.sip.communicator.impl.gui.main.chat; +import javax.swing.*; + /** * The ChatSessionRenderer is the connector between the * ChatSession and the ChatPanel, which represents the UI @@ -85,4 +87,11 @@ public void updateChatContactStatus(ChatContact chatContact, * @param subject the new subject to set. */ public void setChatSubject(String subject); + + /** + * Sets the chat icon. + * + * @param icon the chat icon to set + */ + public void setChatIcon(Icon icon); } diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java index 036550840..1e2ea70e7 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatTransportSelectorBox.java @@ -202,6 +202,10 @@ public void actionPerformed(ActionEvent e) chatTransport, (ImageIcon) menuItem.getIcon()); + chatSession.getChatSessionRenderer() + .setChatIcon(new ImageIcon( + Constants.getStatusIcon(chatTransport.getStatus()))); + return; } } diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java index e7f93dbaf..d08eb47ef 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java @@ -686,7 +686,10 @@ public void contactPresenceStatusChanged( ContactPresenceStatusChangeEvent evt) { if (evt.getSourceContact().equals(contact) - && !evt.getOldStatus().equals(evt.getNewStatus())) + && !evt.getOldStatus().equals(evt.getNewStatus()) + && contactResource == null) // If the contact source is set then the + // status will be updated from the + // MetaContactChatSession. { this.updateContactStatus(); }