* Added Font Size preferences.

* Added enabling of debugger through advanced login page.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@8395 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-05-25 18:29:12 +00:00
committed by derek
parent d23ba5ceb8
commit cc665a14eb
9 changed files with 150 additions and 38 deletions

View File

@ -724,6 +724,9 @@ public final class LoginDialog {
if (!hasErrors) { if (!hasErrors) {
localPref = SettingsManager.getLocalPreferences(); localPref = SettingsManager.getLocalPreferences();
if (localPref.isDebuggerEnabled()) {
XMPPConnection.DEBUG_ENABLED = true;
}
SmackConfiguration.setPacketReplyTimeout(localPref.getTimeOut() * 1000); SmackConfiguration.setPacketReplyTimeout(localPref.getTimeOut() * 1000);

View File

@ -89,6 +89,8 @@ public class LoginSettingDialog implements PropertyChangeListener {
private JCheckBox useSSOBox = new JCheckBox(); private JCheckBox useSSOBox = new JCheckBox();
private JTextField ssoServerField = new JTextField(); private JTextField ssoServerField = new JTextField();
private JCheckBox debuggerBox = new JCheckBox();
/** /**
* Empty Constructor. * Empty Constructor.
*/ */
@ -136,6 +138,7 @@ public class LoginSettingDialog implements PropertyChangeListener {
ResourceUtils.resLabel(resourceLabel, resourceField, Res.getString("label.resource")); ResourceUtils.resLabel(resourceLabel, resourceField, Res.getString("label.resource"));
ResourceUtils.resButton(compressionBox, "Use Co&mpression"); ResourceUtils.resButton(compressionBox, "Use Co&mpression");
ResourceUtils.resButton(useSSOBox, "&Use Single Sign-On (SSO)"); ResourceUtils.resButton(useSSOBox, "&Use Single Sign-On (SSO)");
ResourceUtils.resButton(debuggerBox, "Start &Debugger on startup");
inputPanel.add(autoDiscoverBox, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); inputPanel.add(autoDiscoverBox, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
@ -171,6 +174,7 @@ public class LoginSettingDialog implements PropertyChangeListener {
inputPanel.add(useSSLBox, new GridBagConstraints(0, 4, 2, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); inputPanel.add(useSSLBox, new GridBagConstraints(0, 4, 2, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
inputPanel.add(compressionBox, new GridBagConstraints(0, 5, 2, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); inputPanel.add(compressionBox, new GridBagConstraints(0, 5, 2, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
inputPanel.add(debuggerBox, new GridBagConstraints(0, 6, 2, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
// Create the title panel for this dialog // Create the title panel for this dialog
titlePanel = new TitlePanel("Advanced Connection Preferences", "", SparkRes.getImageIcon(SparkRes.BLANK_24x24), true); titlePanel = new TitlePanel("Advanced Connection Preferences", "", SparkRes.getImageIcon(SparkRes.BLANK_24x24), true);
@ -232,6 +236,8 @@ public class LoginSettingDialog implements PropertyChangeListener {
} }
}); });
debuggerBox.setSelected(localPreferences.isDebuggerEnabled());
// Construct main panel w/ layout. // Construct main panel w/ layout.
final JPanel mainPanel = new JPanel(); final JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout()); mainPanel.setLayout(new BorderLayout());
@ -317,6 +323,7 @@ public class LoginSettingDialog implements PropertyChangeListener {
localPreferences.setSSL(useSSLBox.isSelected()); localPreferences.setSSL(useSSLBox.isSelected());
localPreferences.setXmppHost(xmppHostField.getText()); localPreferences.setXmppHost(xmppHostField.getText());
localPreferences.setCompressionEnabled(compressionBox.isSelected()); localPreferences.setCompressionEnabled(compressionBox.isSelected());
localPreferences.setDebuggerEnabled(debuggerBox.isSelected());
optionsDialog.setVisible(false); optionsDialog.setVisible(false);
localPreferences.setResource(resource); localPreferences.setResource(resource);

View File

@ -14,22 +14,21 @@ import de.javasoft.plaf.synthetica.SyntheticaBlueMoonLookAndFeel;
import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel; import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel;
import org.jivesoftware.resource.Default; import org.jivesoftware.resource.Default;
import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.spark.util.log.Log; import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences; import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager; import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
import java.awt.Color;
import java.awt.Font;
import java.io.File;
import java.io.IOException;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.Color;
import java.awt.Font;
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
* type of system Spark is running on, and also the arguments which were passed into Spark on startup. The <code>Spark</code> * type of system Spark is running on, and also the arguments which were passed into Spark on startup. The <code>Spark</code>
@ -59,11 +58,6 @@ public final class Spark {
} }
public void startup() { public void startup() {
EnhancedDebuggerWindow.PERSISTED_DEBUGGER = true;
EnhancedDebuggerWindow.MAX_TABLE_ROWS = 10;
XMPPConnection.DEBUG_ENABLED = true;
String current = System.getProperty("java.library.path"); String current = System.getProperty("java.library.path");
String classPath = System.getProperty("java.class.path"); String classPath = System.getProperty("java.class.path");
@ -308,6 +302,7 @@ public final class Spark {
public static String getUserHome() { public static String getUserHome() {
return USER_HOME; return USER_HOME;
} }
/** /**
* Returns the Spark directory for the current user (user.home). The user home is where all user specific * Returns the Spark directory for the current user (user.home). The user home is where all user specific
* files are placed to run Spark within a multi-user system. * files are placed to run Spark within a multi-user system.

View File

@ -18,6 +18,8 @@ import org.jivesoftware.spark.util.BrowserLauncher;
import org.jivesoftware.spark.util.ModelUtil; import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.log.Log; import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.plugin.emoticons.EmoticonManager; import org.jivesoftware.sparkimpl.plugin.emoticons.EmoticonManager;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
@ -99,6 +101,12 @@ public class ChatArea extends JTextPane implements MouseListener, MouseMotionLis
public ChatArea() { public ChatArea() {
emoticonManager = EmoticonManager.getInstance(); emoticonManager = EmoticonManager.getInstance();
// Set Default Font
final LocalPreferences pref = SettingsManager.getLocalPreferences();
int fs = pref.getChatRoomFontSize();
fontSize = fs;
setFontSize(fs);
// Cut Action // Cut Action
final Action cutAction = new AbstractAction() { final Action cutAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

View File

@ -27,6 +27,8 @@ import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.TaskEngine; import org.jivesoftware.spark.util.TaskEngine;
import org.jivesoftware.spark.util.log.Log; import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.profile.VCardManager; import org.jivesoftware.sparkimpl.profile.VCardManager;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.Icon; import javax.swing.Icon;
@ -69,6 +71,7 @@ public class ContactItem extends JPanel {
private JLabel sideIcon; private JLabel sideIcon;
private int fontSize;
/** /**
* Creates a new instance of a contact. * Creates a new instance of a contact.
@ -79,6 +82,10 @@ public class ContactItem extends JPanel {
public ContactItem(String nickname, String fullyQualifiedJID) { public ContactItem(String nickname, String fullyQualifiedJID) {
setLayout(new GridBagLayout()); setLayout(new GridBagLayout());
// Set Default Font
final LocalPreferences pref = SettingsManager.getLocalPreferences();
fontSize = pref.getContactListFontSize();
// Set default presence // Set default presence
presence = new Presence(Presence.Type.unavailable); presence = new Presence(Presence.Type.unavailable);
@ -94,7 +101,7 @@ public class ContactItem extends JPanel {
nicknameLabel.setText(nickname); nicknameLabel.setText(nickname);
descriptionLabel.setFont(new Font("Dialog", Font.PLAIN, 11)); descriptionLabel.setFont(new Font("Dialog", Font.PLAIN, fontSize));
descriptionLabel.setForeground((Color)UIManager.get("ContactItemDescription.foreground")); descriptionLabel.setForeground((Color)UIManager.get("ContactItemDescription.foreground"));
descriptionLabel.setHorizontalTextPosition(JLabel.LEFT); descriptionLabel.setHorizontalTextPosition(JLabel.LEFT);
descriptionLabel.setHorizontalAlignment(JLabel.LEFT); descriptionLabel.setHorizontalAlignment(JLabel.LEFT);
@ -375,7 +382,7 @@ public class ContactItem extends JPanel {
isAvailable = true; isAvailable = true;
} }
else if (!presence.isAvailable()) { else if (!presence.isAvailable()) {
getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, fontSize));
getNicknameLabel().setForeground((Color)UIManager.get("ContactItemOffline.color")); getNicknameLabel().setForeground((Color)UIManager.get("ContactItemOffline.color"));
RosterEntry entry = SparkManager.getConnection().getRoster().getEntry(getJID()); RosterEntry entry = SparkManager.getConnection().getRoster().getEntry(getJID());
@ -383,13 +390,13 @@ public class ContactItem extends JPanel {
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) {
// Do not move out of group. // Do not move out of group.
setIcon(SparkRes.getImageIcon(SparkRes.SMALL_QUESTION)); setIcon(SparkRes.getImageIcon(SparkRes.SMALL_QUESTION));
getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, fontSize));
setStatusText("Pending"); setStatusText("Pending");
} }
else { else {
setIcon(null); setIcon(null);
setFont(new Font("Dialog", Font.PLAIN, 11)); setFont(new Font("Dialog", Font.PLAIN, fontSize));
getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, fontSize));
setAvailable(false); setAvailable(false);
if (ModelUtil.hasLength(status)) { if (ModelUtil.hasLength(status)) {
setStatusText(status); setStatusText(status);
@ -425,7 +432,7 @@ public class ContactItem extends JPanel {
if (isAvailable) { if (isAvailable) {
getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, fontSize));
if ("Online".equals(status) || Res.getString("available").equalsIgnoreCase(status)) { if ("Online".equals(status) || Res.getString("available").equalsIgnoreCase(status)) {
setStatusText(""); setStatusText("");
} }
@ -434,7 +441,7 @@ public class ContactItem extends JPanel {
} }
} }
else if (presence.isAvailable()) { else if (presence.isAvailable()) {
getNicknameLabel().setFont(new Font("Dialog", Font.ITALIC, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.ITALIC, fontSize));
getNicknameLabel().setForeground(Color.gray); getNicknameLabel().setForeground(Color.gray);
if (status != null) { if (status != null) {
setStatusText(status); setStatusText(status);
@ -475,7 +482,7 @@ public class ContactItem extends JPanel {
*/ */
public void showUserComingOnline() { public void showUserComingOnline() {
// Change Font // Change Font
getNicknameLabel().setFont(new Font("Dialog", Font.BOLD, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.BOLD, fontSize));
getNicknameLabel().setForeground(new Color(255, 128, 0)); getNicknameLabel().setForeground(new Color(255, 128, 0));
} }
@ -484,7 +491,7 @@ public class ContactItem extends JPanel {
*/ */
public void showUserGoingOfflineOnline() { public void showUserGoingOfflineOnline() {
// Change Font // Change Font
getNicknameLabel().setFont(new Font("Dialog", Font.BOLD, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.BOLD, fontSize));
getNicknameLabel().setForeground(Color.red); getNicknameLabel().setForeground(Color.red);
} }

View File

@ -23,21 +23,6 @@ import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences; import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager; import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -53,6 +38,21 @@ import javax.swing.text.Style;
import javax.swing.text.StyleConstants; import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument; import javax.swing.text.StyledDocument;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/** /**
* The <CODE>TranscriptWindow</CODE> class. Provides a default implementation * The <CODE>TranscriptWindow</CODE> class. Provides a default implementation
* of a Chat Window. In general, extensions could override this class * of a Chat Window. In general, extensions could override this class
@ -70,7 +70,7 @@ public class TranscriptWindow extends ChatArea {
/** /**
* The default font used in the chat window for all messages. * The default font used in the chat window for all messages.
*/ */
private Font defaultFont = new Font("Dialog", Font.PLAIN, 12); private Font defaultFont;
private Date lastPost; private Date lastPost;
@ -80,6 +80,12 @@ public class TranscriptWindow extends ChatArea {
public TranscriptWindow() { public TranscriptWindow() {
setEditable(false); setEditable(false);
// Set Default Font
final LocalPreferences pref = SettingsManager.getLocalPreferences();
int fontSize = pref.getChatRoomFontSize();
defaultFont = new Font("Dialog", Font.PLAIN, fontSize);
addMouseListener(this); addMouseListener(this);
addMouseMotionListener(this); addMouseMotionListener(this);
setDragEnabled(true); setDragEnabled(true);
@ -467,7 +473,7 @@ public class TranscriptWindow extends ChatArea {
writer.write(buf.toString()); writer.write(buf.toString());
writer.close(); writer.close();
JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Chat transcript has been saved.", JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Chat transcript has been saved.",
"Chat Transcript Saved", JOptionPane.INFORMATION_MESSAGE); "Chat Transcript Saved", JOptionPane.INFORMATION_MESSAGE);
} }
} }
catch (Exception ex) { catch (Exception ex) {
@ -477,7 +483,7 @@ public class TranscriptWindow extends ChatArea {
} }
public void cleanup(){ public void cleanup() {
clear(); clear();
} }

View File

@ -29,6 +29,7 @@ import javax.swing.JLabel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import java.awt.Color; import java.awt.Color;
@ -54,6 +55,12 @@ public class ThemePanel extends JPanel {
private JButton addThemeButton; private JButton addThemeButton;
private JButton addEmoticonButton; private JButton addEmoticonButton;
private JTextField contactListFontField;
private JLabel contactListFontLabel;
private JTextField chatRoomFontField;
private JLabel chatRoomFontLabel;
private JCheckBox emoticonCheckBox; private JCheckBox emoticonCheckBox;
private JFileChooser fc; private JFileChooser fc;
@ -80,6 +87,13 @@ public class ThemePanel extends JPanel {
systemLookAndFeelBox = new JCheckBox(); systemLookAndFeelBox = new JCheckBox();
contactListFontField = new JTextField();
contactListFontLabel = new JLabel();
chatRoomFontField = new JTextField();
chatRoomFontLabel = new JLabel();
// Set ResourceUtils // Set ResourceUtils
ResourceUtils.resLabel(messageStyleLabel, messageStyleBox, Res.getString("label.message.style") + ":"); ResourceUtils.resLabel(messageStyleLabel, messageStyleBox, Res.getString("label.message.style") + ":");
ResourceUtils.resLabel(emoticonsLabel, emoticonBox, Res.getString("label.emoticons") + ":"); ResourceUtils.resLabel(emoticonsLabel, emoticonBox, Res.getString("label.emoticons") + ":");
@ -89,6 +103,9 @@ public class ThemePanel extends JPanel {
ResourceUtils.resButton(addThemeButton, "&Add..."); ResourceUtils.resButton(addThemeButton, "&Add...");
ResourceUtils.resButton(addEmoticonButton, "A&dd..."); ResourceUtils.resButton(addEmoticonButton, "A&dd...");
ResourceUtils.resLabel(contactListFontLabel, contactListFontField, "Contact &List font size:");
ResourceUtils.resLabel(chatRoomFontLabel, chatRoomFontField, "Chat &Room font size:");
// Build UI // Build UI
buildUI(); buildUI();
} }
@ -114,6 +131,12 @@ public class ThemePanel extends JPanel {
if (Spark.isWindows()) { if (Spark.isWindows()) {
add(systemLookAndFeelBox, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(systemLookAndFeelBox, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
} }
add(chatRoomFontLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(chatRoomFontField, new GridBagConstraints(1, 5, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 50, 0));
add(contactListFontLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(contactListFontField, new GridBagConstraints(1, 6, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 50, 0));
// Activate live one. // Activate live one.
LocalPreferences pref = SettingsManager.getLocalPreferences(); LocalPreferences pref = SettingsManager.getLocalPreferences();
String theme = pref.getTheme(); String theme = pref.getTheme();
@ -147,6 +170,17 @@ public class ThemePanel extends JPanel {
emoticonCheckBox.setSelected(pref.areEmoticonsEnabled()); emoticonCheckBox.setSelected(pref.areEmoticonsEnabled());
systemLookAndFeelBox.setSelected(pref.useSystemLookAndFeel()); systemLookAndFeelBox.setSelected(pref.useSystemLookAndFeel());
try {
int chatRoomFontSize = pref.getChatRoomFontSize();
int contactListFontSize = pref.getContactListFontSize();
chatRoomFontField.setText(Integer.toString(chatRoomFontSize));
contactListFontField.setText(Integer.toString(contactListFontSize));
}
catch (Exception e) {
Log.error(e);
}
} }
/** /**
@ -284,4 +318,12 @@ public class ThemePanel extends JPanel {
} }
} }
public String getChatRoomFontSize(){
return chatRoomFontField.getText();
}
public String getContactListFontSize(){
return contactListFontField.getText();
}
} }

View File

@ -12,6 +12,7 @@ package org.jivesoftware.spark.ui.themes;
import org.jivesoftware.resource.SparkRes; import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.spark.preference.Preference; import org.jivesoftware.spark.preference.Preference;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences; import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager; import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
@ -85,6 +86,17 @@ public class ThemePreference implements Preference {
pref.setEmoticonPack(pack); pref.setEmoticonPack(pack);
pref.setEmoticonsEnabled(emotEnabled); pref.setEmoticonsEnabled(emotEnabled);
pref.setUseSystemLookAndFeel(panel.useSystemLookAndFeel()); pref.setUseSystemLookAndFeel(panel.useSystemLookAndFeel());
try {
String chatRoomFontSize = panel.getChatRoomFontSize();
String contactListFontSize = panel.getContactListFontSize();
pref.setChatRoomFontSize(Integer.parseInt(chatRoomFontSize));
pref.setContactListFontSize(Integer.parseInt(contactListFontSize));
}
catch (NumberFormatException e) {
Log.error(e);
}
} }

View File

@ -559,6 +559,30 @@ public class LocalPreferences {
return getBoolean("ssoEnabled", false); return getBoolean("ssoEnabled", false);
} }
public void setDebuggerEnabled(boolean enabled) {
setBoolean("debuggerEnabled", enabled);
}
public boolean isDebuggerEnabled() {
return getBoolean("debuggerEnabled", false);
}
public void setContactListFontSize(int fontSize) {
setInt("contactListFontSize", fontSize);
}
public int getContactListFontSize() {
return getInt("contactListFontSize", 11);
}
public void setChatRoomFontSize(int fontSize) {
setInt("chatRoomFontSize", fontSize);
}
public int getChatRoomFontSize() {
return getInt("chatRoomFontSize", 12);
}
private boolean getBoolean(String property, boolean defaultValue) { private boolean getBoolean(String property, boolean defaultValue) {
return Boolean.parseBoolean(props.getProperty(property, Boolean.toString(defaultValue))); return Boolean.parseBoolean(props.getProperty(property, Boolean.toString(defaultValue)));
} }
@ -567,4 +591,12 @@ public class LocalPreferences {
props.setProperty(property, Boolean.toString(value)); props.setProperty(property, Boolean.toString(value));
} }
private int getInt(String property, int defaultValue) {
return Integer.parseInt(props.getProperty(property, Integer.toString(defaultValue)));
}
private void setInt(String property, int value) {
props.setProperty(property, Integer.toString(value));
}
} }