Updated version string to 2.6.0.

[SPARK-969] and [SPARK-937] File transfer notifications now reflect transfer itself, not message before it.


git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@10360 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Daniel Henninger
2008-05-08 15:25:48 +00:00
committed by dhenninger
parent a82d33ed0a
commit 88636eff1f
7 changed files with 56 additions and 35 deletions

View File

@ -22,8 +22,8 @@
<!-- Optional add this file to override any of the properties below --> <!-- Optional add this file to override any of the properties below -->
<property file="${basedir}/build/build.properties"/> <property file="${basedir}/build/build.properties"/>
<property name="version.major" value="2"/> <property name="version.major" value="2"/>
<property name="version.minor" value="5"/> <property name="version.minor" value="6"/>
<property name="version.revision" value="9"/> <property name="version.revision" value="0"/>
<property name="version.extra" value=""/> <property name="version.extra" value=""/>
<!-- For 'beta' or 'alpha' --> <!-- For 'beta' or 'alpha' -->

View File

@ -166,7 +166,7 @@ hr {
<table border=0> <table border=0>
<tr> <tr>
<td align="right">version:</td> <td align="right">version:</td>
<td><b>2.5.9</b></td> <td><b>2.6.0</b></td>
</tr> </tr>
<tr> <tr>
<td align="right">released:</td> <td align="right">released:</td>

View File

@ -54,6 +54,7 @@ import org.jivesoftware.sparkimpl.plugin.manager.Enterprise;
import java.awt.AWTException; import java.awt.AWTException;
import java.awt.Component; import java.awt.Component;
import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.FileDialog; import java.awt.FileDialog;
import java.awt.Frame; import java.awt.Frame;
@ -246,6 +247,7 @@ public class SparkTransferManager {
String requestor = request.getRequestor(); String requestor = request.getRequestor();
String bareJID = StringUtils.parseBareAddress(requestor); String bareJID = StringUtils.parseBareAddress(requestor);
String fileName = request.getFileName();
ContactItem contactItem = contactList.getContactItemByJID(bareJID); ContactItem contactItem = contactList.getContactItemByJID(bareJID);
@ -260,7 +262,8 @@ public class SparkTransferManager {
TranscriptWindow transcriptWindow = chatRoom.getTranscriptWindow(); TranscriptWindow transcriptWindow = chatRoom.getTranscriptWindow();
StyledDocument doc = (StyledDocument)transcriptWindow.getDocument(); StyledDocument doc = (StyledDocument)transcriptWindow.getDocument();
transcriptWindow.insertCustomText(Res.getString("message.file.transfer.chat.window"), true, false, Color.BLACK);
// The image must first be wrapped in a style // The image must first be wrapped in a style
Style style = doc.addStyle("StyleName", null); Style style = doc.addStyle("StyleName", null);
@ -288,7 +291,7 @@ public class SparkTransferManager {
chatRoom.scrollToBottom(); chatRoom.scrollToBottom();
SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(chatRoom); SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(chatRoom, true, fileName);
} }

View File

@ -363,7 +363,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
chatFrame.setVisible(true); chatFrame.setVisible(true);
} }
else if (chatFrame.isVisible() && !chatFrame.isInFocus()) { else if (chatFrame.isVisible() && !chatFrame.isInFocus()) {
startFlashing(component); startFlashing(component, false, null);
} }
else if (chatFrame.isVisible() && chatFrame.getState() == Frame.ICONIFIED) { else if (chatFrame.isVisible() && chatFrame.getState() == Frame.ICONIFIED) {
// Set to new tab. // Set to new tab.
@ -372,12 +372,12 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// If the ContactList is in the tray, we need better notification by flashing // If the ContactList is in the tray, we need better notification by flashing
// the chatframe. // the chatframe.
startFlashing(component); startFlashing(component, false, null);
} }
// Handle when chat frame is visible but the Contact List is not. // Handle when chat frame is visible but the Contact List is not.
else if (chatFrame.isVisible() && !SparkManager.getMainWindow().isVisible()) { else if (chatFrame.isVisible() && !SparkManager.getMainWindow().isVisible()) {
startFlashing(component); startFlashing(component, false, null);
} }
else if (!chatFrame.isVisible()) { else if (!chatFrame.isVisible()) {
// Set to new tab. // Set to new tab.
@ -395,10 +395,10 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// If the ContactList is in the tray, we need better notification by flashing // If the ContactList is in the tray, we need better notification by flashing
// the chatframe. // the chatframe.
if (!SparkManager.getMainWindow().isVisible()) { if (!SparkManager.getMainWindow().isVisible()) {
startFlashing(component); startFlashing(component, false, null);
} }
else if (chatFrame.getState() == Frame.ICONIFIED) { else if (chatFrame.getState() == Frame.ICONIFIED) {
startFlashing(component); startFlashing(component, false, null);
} }
if (component instanceof ChatRoom) { if (component instanceof ChatRoom) {
@ -408,7 +408,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
} }
private void handleMessageNotification(final ChatRoom chatRoom) { private void handleMessageNotification(final ChatRoom chatRoom, boolean fNameT, String fNameN) {
ChatRoom activeChatRoom = null; ChatRoom activeChatRoom = null;
try { try {
activeChatRoom = getActiveChatRoom(); activeChatRoom = getActiveChatRoom();
@ -420,7 +420,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
if (chatFrame.isVisible() && (chatFrame.getState() == Frame.ICONIFIED || chatFrame.getInactiveTime() > 20000)) { if (chatFrame.isVisible() && (chatFrame.getState() == Frame.ICONIFIED || chatFrame.getInactiveTime() > 20000)) {
int tabLocation = indexOfComponent(chatRoom); int tabLocation = indexOfComponent(chatRoom);
setSelectedIndex(tabLocation); setSelectedIndex(tabLocation);
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
return; return;
} }
@ -429,7 +429,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
chatFrame.setVisible(true); chatFrame.setVisible(true);
} }
else if (chatFrame.isVisible() && !chatFrame.isInFocus()) { else if (chatFrame.isVisible() && !chatFrame.isInFocus()) {
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
else if (chatFrame.isVisible() && chatFrame.getState() == Frame.ICONIFIED) { else if (chatFrame.isVisible() && chatFrame.getState() == Frame.ICONIFIED) {
// Set to new tab. // Set to new tab.
@ -438,12 +438,12 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// If the ContactList is in the tray, we need better notification by flashing // If the ContactList is in the tray, we need better notification by flashing
// the chatframe. // the chatframe.
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
// Handle when chat frame is visible but the Contact List is not. // Handle when chat frame is visible but the Contact List is not.
else if (chatFrame.isVisible() && !SparkManager.getMainWindow().isVisible() && !chatFrame.isInFocus()) { else if (chatFrame.isVisible() && !SparkManager.getMainWindow().isVisible() && !chatFrame.isInFocus()) {
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
else if (!chatFrame.isVisible()) { else if (!chatFrame.isVisible()) {
// Set to new tab. // Set to new tab.
@ -460,16 +460,16 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// If the ContactList is in the tray, we need better notification by flashing // If the ContactList is in the tray, we need better notification by flashing
// the chatframe. // the chatframe.
if (!SparkManager.getMainWindow().isVisible()) { if (!SparkManager.getMainWindow().isVisible()) {
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
else if (chatFrame.getState() == Frame.ICONIFIED) { else if (chatFrame.getState() == Frame.ICONIFIED) {
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
chatFrame.setTitle(chatRoom.getRoomTitle()); chatFrame.setTitle(chatRoom.getRoomTitle());
} }
else if (chatRoom != activeChatRoom) { else if (chatRoom != activeChatRoom) {
startFlashing(chatRoom); startFlashing(chatRoom, fNameT, fNameN);
} }
} }
@ -657,13 +657,20 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
public void messageReceived(ChatRoom room, Message message) { public void messageReceived(ChatRoom room, Message message) {
room.increaseUnreadMessageCount(); room.increaseUnreadMessageCount();
fireNotifyOnMessage(room); fireNotifyOnMessage(room, false, null);
} }
public void fireNotifyOnMessage(final ChatRoom chatRoom) { /**
* Used for Tray Notifications.
*
* @param chatRoom the ChatRoom where the message was received.
* @param fileTransfer whether the notification is a file transfer
* @param fileTName the filename of the transfering files (if true)
*/
public void fireNotifyOnMessage(final ChatRoom chatRoom, final boolean fileTransferD, final String fileTNameC) {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
handleMessageNotification(chatRoom); handleMessageNotification(chatRoom, fileTransferD, fileTNameC);
} }
}); });
} }
@ -897,7 +904,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
* @param comp the Component to check if a message has been inserted * @param comp the Component to check if a message has been inserted
* but the room is not the selected room. * but the room is not the selected room.
*/ */
public void startFlashing(final Component comp) { public void startFlashing(final Component comp, final boolean fTransferB, final String fTransferA) {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
try { try {
@ -906,7 +913,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// Check notifications. // Check notifications.
if (SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(comp instanceof GroupChatRoom)) { if (SettingsManager.getLocalPreferences().isChatRoomNotificationsOn() || !(comp instanceof GroupChatRoom)) {
if (comp instanceof ChatRoom) { if (comp instanceof ChatRoom) {
checkNotificationPreferences((ChatRoom)comp); checkNotificationPreferences((ChatRoom)comp, fTransferB, fTransferA);
} }
} }
@ -963,8 +970,11 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
* Handles Notification preferences for incoming messages and rooms. * Handles Notification preferences for incoming messages and rooms.
* *
* @param room the chat room. * @param room the chat room.
* @param fileTransfer if it is a file transfer then true
* @param fileTName the file name being transfered (if fileTransfer applies)
*
*/ */
private void checkNotificationPreferences(final ChatRoom room) { private void checkNotificationPreferences(final ChatRoom room, boolean fileTransfer, String fileTName) {
LocalPreferences pref = SettingsManager.getLocalPreferences(); LocalPreferences pref = SettingsManager.getLocalPreferences();
if (pref.getWindowTakesFocus()) { if (pref.getWindowTakesFocus()) {
chatFrame.setState(Frame.NORMAL); chatFrame.setState(Frame.NORMAL);
@ -986,18 +996,23 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
toaster.setDisplayTime(5000); toaster.setDisplayTime(5000);
toaster.setBorder(BorderFactory.createBevelBorder(0)); toaster.setBorder(BorderFactory.createBevelBorder(0));
String nickname = room.getRoomTitle(); String nickname = room.getRoomTitle();
toaster.setTitle(nickname);
toaster.setToasterHeight(150); toaster.setToasterHeight(150);
toaster.setToasterWidth(200); toaster.setToasterWidth(200);
int size = room.getTranscripts().size(); int size = room.getTranscripts().size();
if (size > 0) { if(fileTransfer) {
Message message = room.getTranscripts().get(size - 1); toaster.setTitle(Res.getString("message.file.transfer.notification"));
toaster.showToaster(room.getTabIcon(), nickname + " " + Res.getString("message.file.transfer.short.message") + " " + fileTName);
} else {
toaster.setTitle(nickname);
if (size > 0) {
Message message = room.getTranscripts().get(size - 1);
toaster.showToaster(room.getTabIcon(), message.getBody()); toaster.showToaster(room.getTabIcon(), message.getBody());
}
} }
} }
} }

View File

@ -154,7 +154,7 @@ public class ConferenceServices {
chatRoom.scrollToBottom(); chatRoom.scrollToBottom();
SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(chatRoom); SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(chatRoom, false, null);
} }
catch (ChatRoomNotFoundException e) { catch (ChatRoomNotFoundException e) {
// If it doesn't exists. Create a new Group Chat Room // If it doesn't exists. Create a new Group Chat Room
@ -178,7 +178,7 @@ public class ConferenceServices {
groupChatRoom.scrollToBottom(); groupChatRoom.scrollToBottom();
SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(groupChatRoom); SparkManager.getChatManager().getChatContainer().fireNotifyOnMessage(groupChatRoom, false, null);
} }
// If no listeners handled the invitation, default to generic invite. // If no listeners handled the invitation, default to generic invite.
//new ConversationInvitation(conn, room, inviter, reason, password, message); //new ConversationInvitation(conn, room, inviter, reason, password, message);

View File

@ -17,11 +17,11 @@ public class JiveInfo {
} }
public static String getVersion() { public static String getVersion() {
return "2.5.9"; return "2.6.0";
} }
public static String getBuildNumber() { public static String getBuildNumber() {
return "2.5.9"; return "2.6.0";
} }
public static String getOS() { public static String getOS() {

View File

@ -318,7 +318,7 @@ checkbox.tabs.on.top = &Chat tabs appear on top (Requires restart)
checkbox.use.compression = Use Co&mpression checkbox.use.compression = Use Co&mpression
checkbox.use.proxy.server = &Use Proxy Server checkbox.use.proxy.server = &Use Proxy Server
checkbox.use.system.look.and.feel = Use System Look And &Feel (Requires restart) checkbox.use.system.look.and.feel = Use System Look And &Feel (Requires restart)
checkbox.window.to.front = &Bring window to fron checkbox.window.to.front = &Bring window to front
delete.log.permanently = Permanently delete log delete.log.permanently = Permanently delete log
delete.permanently = Permanently delete? delete.permanently = Permanently delete?
@ -579,6 +579,9 @@ message.file.exists.question = The file already exists. Overwrite?
message.file.size = File Size: {0} message.file.size = File Size: {0}
message.file.transfer.canceled = You have cancelled the file transfer. message.file.transfer.canceled = You have cancelled the file transfer.
message.file.transfer.rejected = The file transfer was not accepted by {0}. message.file.transfer.rejected = The file transfer was not accepted by {0}.
message.file.transfer.notification = File Transfer Notification
message.file.transfer.short.message = is sending you a file called:
message.file.transfer.chat.window = File Transfer Request:
message.find.conference.services = Find conference services message.find.conference.services = Find conference services
message.forbidden.error = Received a forbidden error from the server. message.forbidden.error = Received a forbidden error from the server.
message.gateway.username.error = Username needs to be supplied. message.gateway.username.error = Username needs to be supplied.