1) i18n work.

2) Update Login Screen.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@5146 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2006-08-31 21:25:53 +00:00
committed by derek
parent 3cabf2363b
commit 5bae72d621
13 changed files with 130 additions and 115 deletions

View File

@ -125,7 +125,7 @@ public final class LoginDialog {
new Insets(0, 0, 2, 0), 0, 0));
}
imagePanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.lightGray));
// imagePanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.lightGray));
loginPanel.setOpaque(false);
mainPanel.add(loginPanel,
@ -229,10 +229,10 @@ public final class LoginDialog {
add(savePasswordBox,
new GridBagConstraints(0, 5, 2, 1, 1.0, 0.0,
new GridBagConstraints(1, 5, 2, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
add(autoLoginBox,
new GridBagConstraints(0, 6, 2, 1, 1.0, 0.0,
new GridBagConstraints(1, 6, 2, 1, 1.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
// Add button but disable the login button initially

View File

@ -13,6 +13,7 @@ package org.jivesoftware.spark.ui;
import org.jivesoftware.MainWindow;
import org.jivesoftware.Spark;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.resource.Res;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.filter.AndFilter;
import org.jivesoftware.smack.filter.FromContainsFilter;
@ -263,7 +264,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
catch (InterruptedException e1) {
Log.error(e1);
}
return "";
return true;
}
public void finished() {
@ -581,7 +582,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
Log.error(e1);
}
if (chatFrame.isVisible() && (chatFrame.getState() == Frame.ICONIFIED || !chatFrame.isInFocus())) {
if (chatFrame.isVisible() && (chatFrame.getState() == Frame.ICONIFIED || chatFrame.getInactiveTime() > 10000)) {
int tabLocation = indexOfComponent(chatRoom);
setSelectedIndex(tabLocation);
startFlashing(chatRoom);
@ -712,9 +713,8 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
// Confirm end session
boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT;
if (isGroupChat) {
String message = "Would you like to end this session?";
final int ok = JOptionPane.showConfirmDialog(chatFrame, message,
"Confirmation", JOptionPane.YES_NO_OPTION);
final int ok = JOptionPane.showConfirmDialog(chatFrame, Res.getString("message.end.conversation"),
Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION);
if (ok == JOptionPane.OK_OPTION) {
room.closeChatRoom();
return;
@ -1180,7 +1180,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
}
}
};
closeThisAction.putValue(Action.NAME, "Close this chat");
closeThisAction.putValue(Action.NAME, Res.getString("message.close.this.chat"));
popup.add(closeThisAction);
@ -1199,7 +1199,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
}
};
closeOthersAction.putValue(Action.NAME, "Close all other chats");
closeOthersAction.putValue(Action.NAME, Res.getString("message.close.other.chats"));
popup.add(closeOthersAction);
Action closeOldAction = new AbstractAction() {
@ -1209,7 +1209,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
}
}
};
closeOldAction.putValue(Action.NAME, "Close stale chats");
closeOldAction.putValue(Action.NAME, Res.getString("message.close.stale.chats"));
popup.add(closeOldAction);
}

View File

@ -11,6 +11,7 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.resource.Res;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
@ -243,8 +244,8 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
getChatInputEditor().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl F4"), "closeTheRoom");
getChatInputEditor().getActionMap().put("closeTheRoom", new AbstractAction("closeTheRoom") {
public void actionPerformed(ActionEvent evt) {
final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?",
"Confirmation", JOptionPane.YES_NO_OPTION);
final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), Res.getString("message.end.chat"),
Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION);
if (ok == JOptionPane.OK_OPTION) {
// Leave this chat.
closeChatRoom();
@ -336,7 +337,7 @@ public abstract class ChatRoom extends BackgroundPanel implements ActionListener
if (updateDate && transcriptWindow.getLastUpdated() != null) {
// Set new label date
notificationLabel.setIcon(SparkRes.getImageIcon(SparkRes.SMALL_ABOUT_IMAGE));
notificationLabel.setText("Last message received on " + SparkManager.DATE_SECOND_FORMATTER.format(transcriptWindow.getLastUpdated()));
notificationLabel.setText(Res.getString("message.last.message.received", SparkManager.DATE_SECOND_FORMATTER.format(transcriptWindow.getLastUpdated())));
}
scrollToBottom();

View File

@ -18,5 +18,8 @@ package org.jivesoftware.spark.ui;
*/
public interface ChatRoomClosingListener {
/**
* Notifies users that the room is closing.
*/
void closing();
}

View File

@ -10,6 +10,7 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.resource.Res;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.component.VerticalFlowLayout;
import org.jivesoftware.spark.component.panes.CollapsiblePane;
@ -17,6 +18,12 @@ import org.jivesoftware.spark.component.renderer.JPanelRenderer;
import org.jivesoftware.spark.util.GraphicUtils;
import org.jivesoftware.spark.util.log.Log;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JWindow;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
@ -38,12 +45,6 @@ import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JWindow;
/**
* Container representing a RosterGroup within the Contact List.
*/
@ -628,10 +629,7 @@ public class ContactGroup extends CollapsiblePane implements MouseListener {
protected void setSharedGroup(boolean sharedGroup) {
this.sharedGroup = sharedGroup;
if (sharedGroup) {
//setIcon(LaRes.getImageIcon(LaRes.SMALL_ALL_AGENTS_IMAGE));
// Allow for mouse events to take place on the title bar
setToolTipText(getGroupName() + " is a Shared Group");
//setHorizontalTextPosition(JLabel.LEFT);
setToolTipText(Res.getString("message.is.shared.group", getGroupName()));
}
}

View File

@ -65,7 +65,6 @@ public class ContactItem extends JPanel {
private String hash = "";
private Date awayTime;
private List presenceHistory = new ArrayList();
private File contactsDir = null;
private JLabel sideIcon;
@ -260,7 +259,6 @@ public class ContactItem extends JPanel {
if (presence == null) {
if (this.presence != null && (this.presence.getMode() == Presence.Mode.available || this.presence.getMode() == Presence.Mode.chat)) {
awayTime = new Date();
presenceHistory.add("Signed out at " + date);
}
return;
}
@ -274,8 +272,6 @@ public class ContactItem extends JPanel {
if (!ModelUtil.hasLength(status)) {
status = "Available";
}
presenceHistory.add(status + " at " + date);
}
}
else if (this.presence != null && (this.presence.getMode() == Presence.Mode.available || this.presence.getMode() == Presence.Mode.chat)) {
@ -285,24 +281,16 @@ public class ContactItem extends JPanel {
if (!ModelUtil.hasLength(status)) {
status = "Away";
}
presenceHistory.add(status + " at " + date);
}
else {
awayTime = null;
if (!ModelUtil.hasLength(status)) {
status = "Away";
}
presenceHistory.add(status + " at " + date);
}
}
}
public Collection getPresenceHistory() {
return presenceHistory;
}
public void updatePresenceIcon(Presence presence) {
ChatManager chatManager = SparkManager.getChatManager();
boolean handled = chatManager.fireContactItemPresenceChanged(this, presence);

View File

@ -12,6 +12,7 @@ package org.jivesoftware.spark.ui;
import org.jivesoftware.MainWindowListener;
import org.jivesoftware.Spark;
import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketListener;
@ -35,7 +36,6 @@ import org.jivesoftware.spark.ChatManager;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.Workspace;
import org.jivesoftware.spark.component.InputDialog;
import org.jivesoftware.spark.component.MessageDialog;
import org.jivesoftware.spark.component.RolloverButton;
import org.jivesoftware.spark.component.VerticalFlowLayout;
import org.jivesoftware.spark.component.WrappedLabel;
@ -58,7 +58,6 @@ import javax.swing.Icon;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
@ -156,12 +155,12 @@ public final class ContactList extends JPanel implements ActionListener, Contact
JToolBar toolbar = new JToolBar();
toolbar.setFloatable(false);
addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16));
addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE));
addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16));
addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE));
removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE));
chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE));
renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE));
removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE));
chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE));
renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE));
addContactMenu.addActionListener(this);
removeContactFromGroupMenu.addActionListener(this);
@ -244,7 +243,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16));
commandPanel.add(addContactButton);
addContactButton.setToolTipText("Add a contact");
addContactButton.setToolTipText(Res.getString("message.add.a.contact"));
addContactButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new RosterDialog().showRosterDialog();
@ -454,7 +453,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
/**
* Called when NEW entries are added.
*
* @param addresses the addressss added.
* @param addresses the address added.
*/
public void entriesAdded(final Collection addresses) {
SwingUtilities.invokeLater(new Runnable() {
@ -1018,7 +1017,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
String oldNickname = activeItem.getNickname();
String newNickname = JOptionPane.showInputDialog(this, "Rename to:", oldNickname);
String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname);
if (ModelUtil.hasLength(newNickname)) {
String address = activeItem.getFullJID();
ContactGroup contactGroup = getContactGroup(activeItem.getGroupName());
@ -1176,8 +1175,8 @@ public final class ContactList extends JPanel implements ActionListener, Contact
fireContextMenuListenerPopup(popup, group);
JMenuItem delete = new JMenuItem("Delete");
JMenuItem rename = new JMenuItem("Rename");
JMenuItem delete = new JMenuItem(Res.getString("menuitem.delete"));
JMenuItem rename = new JMenuItem(Res.getString("menuitem.rename"));
if (!group.isSharedGroup()) {
popup.addSeparator();
popup.add(delete);
@ -1186,7 +1185,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
delete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (ok == JOptionPane.YES_OPTION) {
String groupName = group.getGroupName();
Roster roster = SparkManager.getConnection().getRoster();
@ -1215,7 +1214,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
rename.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE);
String newName = JOptionPane.showInputDialog(group, Res.getString("title.rename.roster.group"), Res.getString("label.rename.to") + ":", JOptionPane.QUESTION_MESSAGE);
if (!ModelUtil.hasLength(newName)) {
return;
}
@ -1263,7 +1262,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
};
sendAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.DOCUMENT_16x16));
sendAction.putValue(Action.NAME, "Send a File");
sendAction.putValue(Action.NAME, Res.getString("menuitem.send.a.file"));
if (item.getPresence() != null) {
popup.add(sendAction);
@ -1296,7 +1295,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
};
removeAction.putValue(Action.NAME, "Remove from Roster");
removeAction.putValue(Action.NAME, Res.getString("menuitem.remove.from.roster"));
removeAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_CIRCLE_DELETE));
// Check if user is in shared group.
@ -1328,44 +1327,20 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
};
viewProfile.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE));
viewProfile.putValue(Action.NAME, "View Profile");
viewProfile.putValue(Action.NAME, Res.getString("menuitem.view.profile"));
popup.add(viewProfile);
popup.addSeparator();
Action viewPresenceAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
JEditorPane pane = new JEditorPane();
StringBuffer buf = new StringBuffer();
Collection col = item.getPresenceHistory();
Iterator iter = col.iterator();
while (iter.hasNext()) {
String history = (String)iter.next();
buf.append(history + "\n");
}
pane.setText(buf.toString());
MessageDialog.showComponent("Presence History", "History of user activity while online.",
SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane),
getGUI(), 400, 400, false);
}
};
/*
viewPresenceAction.putValue(Action.NAME, "View Presence History");
viewPresenceAction.putValue(Action.SMALL_ICON, LaRes.getImageIcon(LaRes.VIEW_IMAGE));
popup.add(viewPresenceAction);
*/
Action lastActivityAction = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
try {
LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID());
long idleTime = (activity.getIdleTime() * 1000);
String time = ModelUtil.getTimeFromLong(idleTime);
JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(getGUI(), Res.getString("message.idle.for", time), Res.getString("title.last.activity"), JOptionPane.INFORMATION_MESSAGE);
}
catch (XMPPException e1) {
}
@ -1373,7 +1348,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
};
lastActivityAction.putValue(Action.NAME, "View Last Activity");
lastActivityAction.putValue(Action.NAME, Res.getString("menuitem.view.last.activity"));
lastActivityAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_USER1_STOPWATCH));
if (contactGroup == offlineGroup) {
@ -1391,7 +1366,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
};
subscribeAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_USER1_INFORMATION));
subscribeAction.putValue(Action.NAME, "Subscribe To");
subscribeAction.putValue(Action.NAME, Res.getString("menuitem.subscribe.to"));
Roster roster = SparkManager.getConnection().getRoster();
RosterEntry entry = roster.getEntry(item.getFullJID());
@ -1417,7 +1392,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
final JPopupMenu popup = new JPopupMenu();
final JMenuItem sendMessagesMenu = new JMenuItem("Send a Message...", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE));
final JMenuItem sendMessagesMenu = new JMenuItem(Res.getString("menuitem.send.a.message"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE));
fireContextMenuListenerPopup(popup, items);
@ -1452,7 +1427,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
private void sendMessages(Collection items) {
InputDialog dialog = new InputDialog();
final String messageText = dialog.getInput("Broadcast Message", "Enter message to broadcast to selected users.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), SparkManager.getMainWindow());
final String messageText = dialog.getInput(Res.getString("title.broadcast.message"), Res.getString("message.enter.broadcast.message"), SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), SparkManager.getMainWindow());
if (ModelUtil.hasLength(messageText)) {
Iterator contacts = items.iterator();
while (contacts.hasNext()) {
@ -1648,7 +1623,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
addContactGroupMenu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE);
String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE);
if (ModelUtil.hasLength(groupName)) {
ContactGroup contactGroup = getContactGroup(groupName);
if (contactGroup == null) {
@ -1662,7 +1637,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
});
// Add Toggle Contacts Menu
ResourceUtils.resButton(showHideMenu, "&Show Empty Groups");
ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups"));
contactsMenu.add(showHideMenu);
showHideMenu.addActionListener(new ActionListener() {
@ -1726,7 +1701,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
String message = jid + " would like to see your online presence and add you to their roster. Do you accept?";
String message = Res.getString("message.approve.subscription", jid);
final JPanel layoutPanel = new JPanel();
layoutPanel.setBackground(Color.white);
@ -1736,9 +1711,9 @@ public final class ContactList extends JPanel implements ActionListener, Contact
messageLabel.setText(message);
layoutPanel.add(messageLabel, new GridBagConstraints(0, 0, 5, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
RolloverButton acceptButton = new RolloverButton("Accept");
RolloverButton viewInfoButton = new RolloverButton("Profile");
RolloverButton denyButton = new RolloverButton("Deny");
RolloverButton acceptButton = new RolloverButton(Res.getString("button.accept"));
RolloverButton viewInfoButton = new RolloverButton(Res.getString("button.profile"));
RolloverButton denyButton = new RolloverButton(Res.getString("button.deny"));
layoutPanel.add(acceptButton, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
layoutPanel.add(viewInfoButton, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
layoutPanel.add(denyButton, new GridBagConstraints(4, 1, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
@ -1751,7 +1726,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
SparkManager.getConnection().sendPacket(response);
int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (ok == JOptionPane.OK_OPTION) {
RosterDialog rosterDialog = new RosterDialog();
rosterDialog.setDefaultJID(jid);
@ -1803,13 +1778,13 @@ public final class ContactList extends JPanel implements ActionListener, Contact
//ListDataIntelliHints hints = new ListDataIntelliHints(contactField, new ArrayList(contacts));
// hints.setCaseSensitive(false);
final JDialog frame = new JDialog(SparkManager.getMainWindow(), "Find Contacts", false);
final JDialog frame = new JDialog(SparkManager.getMainWindow(), Res.getString("title.find.contacts"), false);
JPanel layoutPanel = new JPanel();
layoutPanel.setLayout(new GridBagLayout());
frame.getContentPane().setLayout(new BorderLayout());
JLabel enterLabel = new JLabel("Contact To Find?");
enterLabel.setFont(new Font("Verdana", Font.BOLD, 10));
JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find"));
enterLabel.setFont(new Font("dialog", Font.BOLD, 10));
layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0));
layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0));
layoutPanel.setBorder(BorderFactory.createBevelBorder(0));
@ -2055,7 +2030,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
public void connectionClosedOnError(final Exception ex) {
String errorMessage = "Your connection was closed due to an error.";
String errorMessage = Res.getString("message.disconnected.error");
boolean conflictError = false;
if (ex != null && ex instanceof XMPPException) {
@ -2063,11 +2038,11 @@ public final class ContactList extends JPanel implements ActionListener, Contact
StreamError error = xmppEx.getStreamError();
String reason = error.getCode();
if ("conflict".equals(reason)) {
errorMessage = "A user with the same account has logged in from another location.";
errorMessage = Res.getString("message.disconnected.conflict.error");
conflictError = true;
}
else {
errorMessage = "You have lost your connection to the server.\n\nReason: " + reason;
errorMessage = Res.getString("message.general.error", reason);
}
}

View File

@ -10,15 +10,13 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.component.RolloverButton;
import org.jivesoftware.spark.component.WrappedLabel;
import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.SwingWorker;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.spark.util.ResourceUtils;
import javax.swing.JPanel;
import javax.swing.Timer;
@ -63,7 +61,9 @@ public class RetryPanel extends JPanel {
descriptionLabel = new WrappedLabel();
retryButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_CHECK));
cancelButton = new RolloverButton("Reconnect", SparkRes.getImageIcon(SparkRes.SMALL_CHECK));
cancelButton = new RolloverButton("", SparkRes.getImageIcon(SparkRes.SMALL_CHECK));
ResourceUtils.resButton(cancelButton, Res.getString("button.reconnect"));
layoutComponents();
@ -92,8 +92,8 @@ public class RetryPanel extends JPanel {
* @param reason the reason the user was disconnected from the server.
*/
public void setDisconnectReason(String reason) {
if(!ModelUtil.hasLength(reason)){
reason = "You have lost your connection to the server. To login again, click on the Reconnect button below.";
if (!ModelUtil.hasLength(reason)) {
reason = Res.getString("message.generic.reconnect.message");
}
descriptionLabel.setText(reason);
}

View File

@ -11,6 +11,7 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.resource.Res;
import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.RosterEntry;
import org.jivesoftware.smack.packet.Presence;
@ -35,7 +36,6 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
/**
@ -57,7 +57,7 @@ public class RosterPickList extends JPanel {
this.add(rosterLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
this.add(new JScrollPane(rosterList), new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
ResourceUtils.resLabel(rosterLabel, rosterList, "&Available users in Roster");
ResourceUtils.resLabel(rosterLabel, rosterList, Res.getString("label.available.users.in.roster"));
}
/**
@ -69,7 +69,7 @@ public class RosterPickList extends JPanel {
public Collection showRoster(JDialog parent) {
// Populate Invite Panel with Available users.
Roster roster = SparkManager.getConnection().getRoster();
for(RosterEntry entry : roster.getEntries()){
for (RosterEntry entry : roster.getEntries()) {
Presence presence = roster.getPresence(entry.getUser());
if (presence != null) {
ContactItem item = new ContactItem(entry.getName(), entry.getUser());
@ -83,7 +83,7 @@ public class RosterPickList extends JPanel {
TitlePanel titlePanel;
// Create the title panel for this dialog
titlePanel = new TitlePanel("Roster", "Select one ore more users in your Roster.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true);
titlePanel = new TitlePanel(Res.getString("title.roster"), Res.getString("message.select.one.or.more"), SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true);
// Construct main panel w/ layout.
final JPanel mainPanel = new JPanel();
@ -91,14 +91,14 @@ public class RosterPickList extends JPanel {
mainPanel.add(titlePanel, BorderLayout.NORTH);
// The user should only be able to close this dialog.
Object[] options = {"Ok", "Cancel"};
Object[] options = {Res.getString("ok"), Res.getString("cancel")};
pane = new JOptionPane(this, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]);
mainPanel.add(pane, BorderLayout.CENTER);
final JOptionPane p = new JOptionPane();
final JDialog dlg = p.createDialog(parent, "Roster");
final JDialog dlg = p.createDialog(parent, Res.getString("title.roster"));
dlg.setModal(true);
dlg.pack();
@ -110,12 +110,12 @@ public class RosterPickList extends JPanel {
PropertyChangeListener changeListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
String value = (String)pane.getValue();
if ("Cancel".equals(value)) {
if (Res.getString("cancel").equals(value)) {
rosterList.clearSelection();
pane.setValue(JOptionPane.UNINITIALIZED_VALUE);
dlg.dispose();
}
else if ("Ok".equals(value)) {
else if (Res.getString("ok").equals(value)) {
pane.setValue(JOptionPane.UNINITIALIZED_VALUE);
dlg.dispose();
}

View File

@ -37,7 +37,7 @@ public class TranscriptAlert extends JPanel {
add(imageLabel, new GridBagConstraints(0, 0, 1, 3, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(titleLabel, new GridBagConstraints(1, 0, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
titleLabel.setFont(new Font("Verdana", Font.BOLD, 11));
titleLabel.setFont(new Font("Dialog", Font.BOLD, 11));
titleLabel.setForeground(new Color(211, 174, 102));
add(yesButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
@ -46,8 +46,8 @@ public class TranscriptAlert extends JPanel {
yesButton.setForeground(new Color(73, 113, 196));
cancelButton.setForeground(new Color(73, 113, 196));
cancelButton.setFont(new Font("Verdana", Font.BOLD, 10));
yesButton.setFont(new Font("Verdana", Font.BOLD, 10));
cancelButton.setFont(new Font("Dialog", Font.BOLD, 10));
yesButton.setFont(new Font("Dialog", Font.BOLD, 10));
yesButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));
cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));

View File

@ -8,6 +8,12 @@ button.create.account = &Create Account
button.close = C&lose
button.advanced = Ad&vanced
button.browse = &Browse...
button.approve = &Approve
button.deny = &Deny
button.accept = &Accept
button.profile = *Profile
button.add.a.contact = &Add A Contact
button.reconnect = &Reconnect
checkbox.save.password = &Save Password
checkbox.auto.login = &Auto Login
@ -36,6 +42,9 @@ label.receieved = &Received
label.transfer.timeout = &Transfer Timeout(min):
label.transfer.download.directory = &Download Directory:
label.find = &Find
label.rename.to = Rename to
label.contact.to.find = Contact To Find?
label.available.users.in.roster = &Available users in Roster
message.username.error = Specify a username for the account.
message.password.error = Specify a password for this account.
@ -63,7 +72,24 @@ message.send.picture = Send a picture of your desktop.
message.sent.offline.files = You have just been sent offline file(s).
message.spark.secure = Spark is running in secure mode.
message.search.for.contacts = Search for contacts.
message.end.conversation = Would you like to end this session?
message.end.chat = Would you like to end this chat?
message.close.this.chat = Close this chat
message.close.other.chats = Close all other chats
message.close.stale.chats = Close stale chats
message.last.message.received = Last message received on {0}
message.shared.group = Shared Group
message.is.shared.group = {0} is a shared group.
message.delete.confirmation = Are you sure you want to delete {0}?
message.idle.for = Idle for {0}
message.enter.broadcast.message = Enter message to broadcast to selected users.
message.name.of.group = Name of Group
message.approve.subscription = Allow {0} to add you to their roster?
message.add.user = Add user to your roster?
message.general.error = You have lost your connection to the server due to {0}.
message.add.a.contact = Add a contact.
message.generic.reconnect.message = You have lost your connection to the server. To login again, click on the Reconnect button below.
message.select.one.or.more = Select one ore more users in your Roster.
title.passwords.no.match = Confirm passwords.
title.create.problem = Account Creation Problem
@ -82,6 +108,13 @@ title.broadcast.message = Broadcast Message
title.tray.information = Tray Information
title.select.file.to.send = Select File(s) To Send
title.choose.directory = Choose Directory
title.confirmation = Confirmation
title.last.activity = Last Activity
title.add.new.group = Add New Group
title.add.to.roster = Add To Roster
title.find.contacts = Find Contacts
title.rename.roster.group = Rename Roster Group
title.roster = Roster
menuitem.contacts = Contacts
menuitem.actions = Actions
@ -99,10 +132,27 @@ menuitem.open = Open
menuitem.hide = Hide
menuitem.status = Status
menuitem.view.downloads = View Downloads
menuitem.save = Save
menuitem.add.contact = Add Contact
menuitem.add.contact.group = Add Contact Group
menuitem.remove.from.group = Remove From Group
menuitem.start.a.chat = Start a Chat
menuitem.rename = Rename
menuitem.delete = Delete
menuitem.remove.from.roster = Remove from Roster
menuitem.view.profile = View Profile
menuitem.subscribe.to = Subscribe To
menuitem.send.a.message = Send a Message...
menuitem.show.empty.groups = Show Empty Groups
menuitem.send.a.file = Send A File
menuitem.view.last.activity = View Last Activity
tab.general = General
tab.proxy = Proxy
tab.contacts = Contacts
group.connection = Connection

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB