mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 19:57:28 +00:00
1) Fixed title pane.
2) Fixed reconnection UI confusion. 3) Added JID to Vcard Profile. git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@4647 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
e09aa9d934
commit
0807e1b794
@ -26,6 +26,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In many cases, you will need to know the structure of the Spark installation, such as the directory structures, what
|
* In many cases, you will need to know the structure of the Spark installation, such as the directory structures, what
|
||||||
@ -96,7 +97,12 @@ public final class Spark {
|
|||||||
BIN_DIRECTORY = new File(workingDir, "bin").getAbsoluteFile();
|
BIN_DIRECTORY = new File(workingDir, "bin").getAbsoluteFile();
|
||||||
LOG_DIRECTORY = new File(USER_HOME, "/Spark/logs").getAbsoluteFile();
|
LOG_DIRECTORY = new File(USER_HOME, "/Spark/logs").getAbsoluteFile();
|
||||||
LOG_DIRECTORY.mkdirs();
|
LOG_DIRECTORY.mkdirs();
|
||||||
buf.append(RESOURCE_DIRECTORY.getAbsolutePath()).append(";");
|
try {
|
||||||
|
buf.append(RESOURCE_DIRECTORY.getCanonicalPath()).append(";");
|
||||||
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import org.jivesoftware.smack.packet.Presence;
|
|||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
|
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
|
||||||
import org.jivesoftware.smackx.packet.DelayInformation;
|
import org.jivesoftware.smackx.packet.DelayInformation;
|
||||||
|
import org.jivesoftware.spark.component.tabbedPane.SparkTabbedPane;
|
||||||
import org.jivesoftware.spark.filetransfer.SparkTransferManager;
|
import org.jivesoftware.spark.filetransfer.SparkTransferManager;
|
||||||
import org.jivesoftware.spark.search.SearchManager;
|
import org.jivesoftware.spark.search.SearchManager;
|
||||||
import org.jivesoftware.spark.ui.ChatRoom;
|
import org.jivesoftware.spark.ui.ChatRoom;
|
||||||
@ -31,7 +32,6 @@ import org.jivesoftware.spark.ui.conferences.Conferences;
|
|||||||
import org.jivesoftware.spark.ui.status.StatusBar;
|
import org.jivesoftware.spark.ui.status.StatusBar;
|
||||||
import org.jivesoftware.spark.util.SwingWorker;
|
import org.jivesoftware.spark.util.SwingWorker;
|
||||||
import org.jivesoftware.spark.util.log.Log;
|
import org.jivesoftware.spark.util.log.Log;
|
||||||
import org.jivesoftware.spark.component.tabbedPane.SparkTabbedPane;
|
|
||||||
import org.jivesoftware.sparkimpl.plugin.manager.Enterprise;
|
import org.jivesoftware.sparkimpl.plugin.manager.Enterprise;
|
||||||
import org.jivesoftware.sparkimpl.plugin.transcripts.ChatTranscriptPlugin;
|
import org.jivesoftware.sparkimpl.plugin.transcripts.ChatTranscriptPlugin;
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ import javax.swing.JTabbedPane;
|
|||||||
import javax.swing.KeyStroke;
|
import javax.swing.KeyStroke;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
import java.awt.CardLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
@ -81,6 +82,12 @@ public class Workspace extends JPanel implements PacketListener {
|
|||||||
private List offlineMessages = new ArrayList();
|
private List offlineMessages = new ArrayList();
|
||||||
|
|
||||||
|
|
||||||
|
private JPanel cardPanel;
|
||||||
|
private CardLayout cardLayout;
|
||||||
|
|
||||||
|
final public static String WORKSPACE_PANE = "WORKSPACE_PANE";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the singleton instance of <CODE>Workspace</CODE>,
|
* Returns the singleton instance of <CODE>Workspace</CODE>,
|
||||||
* creating it if necessary.
|
* creating it if necessary.
|
||||||
@ -134,12 +141,17 @@ public class Workspace extends JPanel implements PacketListener {
|
|||||||
|
|
||||||
// Initialize workspace pane, defaulting the tabs to the bottom.
|
// Initialize workspace pane, defaulting the tabs to the bottom.
|
||||||
workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM);
|
workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM);
|
||||||
//workspacePane.setBoldActiveTab(true);
|
workspacePane.setActiveButtonBold(true);
|
||||||
//workspacePane.setHideOneTab(true);
|
|
||||||
|
// Add Panels.
|
||||||
|
cardLayout = new CardLayout();
|
||||||
|
cardPanel = new JPanel(cardLayout);
|
||||||
|
cardPanel.setOpaque(false);
|
||||||
|
cardPanel.add(WORKSPACE_PANE, workspacePane);
|
||||||
|
|
||||||
// Build default workspace
|
// Build default workspace
|
||||||
this.setLayout(new GridBagLayout());
|
this.setLayout(new GridBagLayout());
|
||||||
add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
|
add(cardPanel, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
|
||||||
add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0));
|
add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0));
|
||||||
|
|
||||||
|
|
||||||
@ -155,7 +167,7 @@ public class Workspace extends JPanel implements PacketListener {
|
|||||||
Color menuBarColor = new Color(235, 233, 237);
|
Color menuBarColor = new Color(235, 233, 237);
|
||||||
setBackground(menuBarColor);
|
setBackground(menuBarColor);
|
||||||
|
|
||||||
workspacePane.setActiveButtonBold(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -407,4 +419,12 @@ public class Workspace extends JPanel implements PacketListener {
|
|||||||
public ContactList getContactList() {
|
public ContactList getContactList() {
|
||||||
return contactList;
|
return contactList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void changeCardLayout(String layout) {
|
||||||
|
cardLayout.show(cardPanel, layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
public JPanel getCardPanel() {
|
||||||
|
return cardPanel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ public final class TitlePanel extends JPanel {
|
|||||||
add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0));
|
add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0));
|
||||||
add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
setBackground(Color.black);
|
setBackground(Color.white);
|
||||||
|
|
||||||
titleLabel.setFont(new Font("dialog", Font.BOLD, 11));
|
titleLabel.setFont(new Font("dialog", Font.BOLD, 11));
|
||||||
descriptionLabel.setFont(new Font("dialog", 0, 10));
|
descriptionLabel.setFont(new Font("dialog", 0, 10));
|
||||||
|
|||||||
@ -74,7 +74,6 @@ import javax.swing.SwingUtilities;
|
|||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.CardLayout;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
@ -140,8 +139,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
private LocalPreferences localPreferences;
|
private LocalPreferences localPreferences;
|
||||||
|
|
||||||
|
|
||||||
final private static String ROSTER_PANEL = "ROSTER_PANEL";
|
public final static String RETRY_PANEL = "RETRY_PANEL";
|
||||||
final private static String RETRY_PANEL = "RETRY_PANEL";
|
|
||||||
|
|
||||||
|
|
||||||
// Command Bar
|
// Command Bar
|
||||||
@ -151,6 +149,8 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
private RetryPanel retryPanel;
|
private RetryPanel retryPanel;
|
||||||
private RetryPanel.ReconnectListener reconnectListener;
|
private RetryPanel.ReconnectListener reconnectListener;
|
||||||
|
|
||||||
|
private Workspace workspace;
|
||||||
|
|
||||||
public ContactList() {
|
public ContactList() {
|
||||||
// Load Local Preferences
|
// Load Local Preferences
|
||||||
localPreferences = SettingsManager.getLocalPreferences();
|
localPreferences = SettingsManager.getLocalPreferences();
|
||||||
@ -172,7 +172,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
renameMenu.addActionListener(this);
|
renameMenu.addActionListener(this);
|
||||||
|
|
||||||
|
|
||||||
setLayout(new CardLayout());
|
setLayout(new BorderLayout());
|
||||||
|
|
||||||
addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE));
|
addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE));
|
||||||
|
|
||||||
@ -189,10 +189,14 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
treeScroller.getVerticalScrollBar().setBlockIncrement(50);
|
treeScroller.getVerticalScrollBar().setBlockIncrement(50);
|
||||||
treeScroller.getVerticalScrollBar().setUnitIncrement(20);
|
treeScroller.getVerticalScrollBar().setUnitIncrement(20);
|
||||||
|
|
||||||
add(treeScroller, ROSTER_PANEL);
|
|
||||||
|
|
||||||
retryPanel = new RetryPanel();
|
retryPanel = new RetryPanel();
|
||||||
add(retryPanel, RETRY_PANEL);
|
|
||||||
|
workspace = SparkManager.getWorkspace();
|
||||||
|
|
||||||
|
workspace.getCardPanel().add(RETRY_PANEL, retryPanel);
|
||||||
|
|
||||||
|
|
||||||
|
add(mainPanel, BorderLayout.CENTER);
|
||||||
|
|
||||||
// Load Properties file
|
// Load Properties file
|
||||||
props = new Properties();
|
props = new Properties();
|
||||||
@ -1971,9 +1975,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
retryPanel.addReconnectionListener(reconnectListener);
|
retryPanel.addReconnectionListener(reconnectListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show reconnect panel
|
workspace.changeCardLayout(RETRY_PANEL);
|
||||||
CardLayout cl = (CardLayout)getLayout();
|
|
||||||
cl.show(this, RETRY_PANEL);
|
|
||||||
|
|
||||||
retryPanel.setDisconnectReason(message);
|
retryPanel.setDisconnectReason(message);
|
||||||
|
|
||||||
@ -1989,8 +1991,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
|
|
||||||
private void removeAllUsers() {
|
private void removeAllUsers() {
|
||||||
// Show reconnect panel
|
// Show reconnect panel
|
||||||
CardLayout cardLayout = (CardLayout)getLayout();
|
workspace.changeCardLayout(RETRY_PANEL);
|
||||||
cardLayout.show(this, ROSTER_PANEL);
|
|
||||||
|
|
||||||
// Behind the scenes, move everyone to the offline group.
|
// Behind the scenes, move everyone to the offline group.
|
||||||
Iterator contactGroups = new ArrayList(getContactGroups()).iterator();
|
Iterator contactGroups = new ArrayList(getContactGroups()).iterator();
|
||||||
@ -2020,8 +2021,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardLayout cl = (CardLayout)getLayout();
|
workspace.changeCardLayout(Workspace.WORKSPACE_PANE);
|
||||||
cl.show(this, ROSTER_PANEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connectionClosedOnError(final Exception ex) {
|
public void connectionClosedOnError(final Exception ex) {
|
||||||
|
|||||||
@ -28,6 +28,9 @@ public class PersonalPanel extends JPanel {
|
|||||||
private JTextField lastNameField;
|
private JTextField lastNameField;
|
||||||
private JTextField nicknameField;
|
private JTextField nicknameField;
|
||||||
private JTextField emailAddressField;
|
private JTextField emailAddressField;
|
||||||
|
private JTextField jidField;
|
||||||
|
private JLabel jidLabel = new JLabel();
|
||||||
|
|
||||||
|
|
||||||
public PersonalPanel() {
|
public PersonalPanel() {
|
||||||
setLayout(new GridBagLayout());
|
setLayout(new GridBagLayout());
|
||||||
@ -67,6 +70,16 @@ public class PersonalPanel extends JPanel {
|
|||||||
ResourceUtils.resLabel(emaiAddressLabel, emailAddressField, "&Email Address:");
|
ResourceUtils.resLabel(emaiAddressLabel, emailAddressField, "&Email Address:");
|
||||||
add(emaiAddressLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
add(emaiAddressLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
add(emailAddressField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
add(emailAddressField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
|
||||||
|
|
||||||
|
jidField = new JTextField();
|
||||||
|
ResourceUtils.resLabel(jidLabel, jidField, "&JID:");
|
||||||
|
add(jidLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
add(jidField, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
|
||||||
|
jidLabel.setVisible(false);
|
||||||
|
jidField.setVisible(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
@ -114,6 +127,15 @@ public class PersonalPanel extends JPanel {
|
|||||||
firstNameField.requestFocus();
|
firstNameField.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setJID(String jid) {
|
||||||
|
jidField.setText(jid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showJID(boolean show) {
|
||||||
|
jidLabel.setVisible(show);
|
||||||
|
jidField.setVisible(show);
|
||||||
|
}
|
||||||
|
|
||||||
public void allowEditing(boolean allowEditing) {
|
public void allowEditing(boolean allowEditing) {
|
||||||
Component[] comps = getComponents();
|
Component[] comps = getComponents();
|
||||||
final int no = comps != null ? comps.length : 0;
|
final int no = comps != null ? comps.length : 0;
|
||||||
|
|||||||
@ -22,9 +22,9 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.packet.VCard;
|
import org.jivesoftware.smackx.packet.VCard;
|
||||||
import org.jivesoftware.spark.SparkManager;
|
import org.jivesoftware.spark.SparkManager;
|
||||||
import org.jivesoftware.spark.ui.status.StatusBar;
|
|
||||||
import org.jivesoftware.spark.component.TitlePanel;
|
import org.jivesoftware.spark.component.TitlePanel;
|
||||||
import org.jivesoftware.spark.component.borders.PartialLineBorder;
|
import org.jivesoftware.spark.component.borders.PartialLineBorder;
|
||||||
|
import org.jivesoftware.spark.ui.status.StatusBar;
|
||||||
import org.jivesoftware.spark.util.GraphicUtils;
|
import org.jivesoftware.spark.util.GraphicUtils;
|
||||||
import org.jivesoftware.spark.util.ModelUtil;
|
import org.jivesoftware.spark.util.ModelUtil;
|
||||||
import org.jivesoftware.spark.util.ResourceUtils;
|
import org.jivesoftware.spark.util.ResourceUtils;
|
||||||
@ -114,6 +114,8 @@ public class VCardManager {
|
|||||||
final JTabbedPane tabbedPane = new JTabbedPane();
|
final JTabbedPane tabbedPane = new JTabbedPane();
|
||||||
|
|
||||||
personalPanel = new PersonalPanel();
|
personalPanel = new PersonalPanel();
|
||||||
|
personalPanel.showJID(false);
|
||||||
|
|
||||||
tabbedPane.addTab("Personal", personalPanel);
|
tabbedPane.addTab("Personal", personalPanel);
|
||||||
|
|
||||||
businessPanel = new BusinessPanel();
|
businessPanel = new BusinessPanel();
|
||||||
@ -214,6 +216,8 @@ public class VCardManager {
|
|||||||
final JTabbedPane tabbedPane = new JTabbedPane();
|
final JTabbedPane tabbedPane = new JTabbedPane();
|
||||||
|
|
||||||
personalPanel = new PersonalPanel();
|
personalPanel = new PersonalPanel();
|
||||||
|
personalPanel.showJID(true);
|
||||||
|
|
||||||
tabbedPane.addTab("Personal", personalPanel);
|
tabbedPane.addTab("Personal", personalPanel);
|
||||||
|
|
||||||
businessPanel = new BusinessPanel();
|
businessPanel = new BusinessPanel();
|
||||||
@ -485,6 +489,7 @@ public class VCardManager {
|
|||||||
personalPanel.setLastName(vcard.getLastName());
|
personalPanel.setLastName(vcard.getLastName());
|
||||||
personalPanel.setEmailAddress(vcard.getEmailHome());
|
personalPanel.setEmailAddress(vcard.getEmailHome());
|
||||||
personalPanel.setNickname(vcard.getNickName());
|
personalPanel.setNickname(vcard.getNickName());
|
||||||
|
personalPanel.setJID(vcard.getJabberId());
|
||||||
|
|
||||||
businessPanel.setCompany(vcard.getOrganization());
|
businessPanel.setCompany(vcard.getOrganization());
|
||||||
businessPanel.setDepartment(vcard.getOrganizationUnit());
|
businessPanel.setDepartment(vcard.getOrganizationUnit());
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class JiveInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getVersion() {
|
public static String getVersion() {
|
||||||
return "1.1.9.2";
|
return "1.1.9.3";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getOS() {
|
public static String getOS() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user