SPARK-1258 more customization

settings include:
Remove Advanced Configuration from LoginWindow

Disable Spark Updates

HelpMenu->UserGuide Location configurable
Disable HelpMenu->UserGuide

HelpMenu->HelpForum Location configurable
HelpMenu->HelpForum Text configurable
Disable HelpMenu->HelpForum


git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12161 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Wolf Posdorfer
2011-03-22 12:39:27 +00:00
committed by wolf.posdorfer
parent f49d754068
commit c97166a9f2
6 changed files with 101 additions and 55 deletions

View File

@ -328,15 +328,17 @@ public final class LoginDialog {
savePasswordBox.addActionListener(this); savePasswordBox.addActionListener(this);
autoLoginBox.addActionListener(this); autoLoginBox.addActionListener(this);
if (!Default.getBoolean(Default.ACCOUNT_DISABLED)) { if (!Default.getBoolean(Default.ACCOUNT_DISABLED)) {
buttonPanel.add(createAccountButton, buttonPanel.add(createAccountButton,
new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
} }
if(!Default.getBoolean(Default.ADVANCED_DISABLED)){
buttonPanel.add(advancedButton, buttonPanel.add(advancedButton,
new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
}
buttonPanel.add(loginButton, buttonPanel.add(loginButton,
new GridBagConstraints(3, 0, 4, 1, 1.0, 0.0, new GridBagConstraints(3, 0, 4, 1, 1.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));

View File

@ -93,7 +93,7 @@ public final class MainWindow extends ChatFrame implements ActionListener {
private JCheckBoxMenuItem alwaysOnTopItem; private JCheckBoxMenuItem alwaysOnTopItem;
private final JMenuItem menuAbout = new JMenuItem(SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE)); private final JMenuItem menuAbout = new JMenuItem(SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE));
private final JMenuItem helpMenuItem = new JMenuItem(); private final JMenuItem sparkforumItem = new JMenuItem();
private final JMenuBar mainWindowBar = new JMenuBar(); private final JMenuBar mainWindowBar = new JMenuBar();
@ -475,11 +475,14 @@ public final class MainWindow extends ChatFrame implements ActionListener {
viewErrors.putValue(Action.NAME, Res.getString("menuitem.view.logs")); viewErrors.putValue(Action.NAME, Res.getString("menuitem.view.logs"));
final Action viewHelpGuideAction = new AbstractAction() { final Action viewHelpGuideAction = new AbstractAction() {
final String url = Default.getString(Default.HELP_USER_GUIDE);
private static final long serialVersionUID = 2680369963282231348L; private static final long serialVersionUID = 2680369963282231348L;
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
try { try {
BrowserLauncher.openURL("http://www.igniterealtime.org/builds/spark/docs/spark_user_guide.pdf");
BrowserLauncher.openURL(url);
} }
catch (Exception e) { catch (Exception e) {
Log.error("Unable to load online help.", e); Log.error("Unable to load online help.", e);
@ -487,14 +490,16 @@ public final class MainWindow extends ChatFrame implements ActionListener {
} }
}; };
//EventQueue.invokeLater(new Runnable() {
// public void run() {
if (!Spark.isCustomBuild()) { if (!Default.getBoolean("HELP_USER_GUIDE_DISABLED")) {
viewHelpGuideAction.putValue(Action.NAME, Res.getString("menuitem.user.guide")); viewHelpGuideAction.putValue(Action.NAME,
viewHelpGuideAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_QUESTION)); Res.getString("menuitem.user.guide"));
viewHelpGuideAction.putValue(Action.SMALL_ICON,
SparkRes.getImageIcon(SparkRes.SMALL_QUESTION));
helpMenu.add(viewHelpGuideAction); helpMenu.add(viewHelpGuideAction);
helpMenu.add(helpMenuItem); }
if (!Default.getBoolean("HELP_FORUM_DISABLED")) {
helpMenu.add(sparkforumItem);
} }
// Build Help Menu // Build Help Menu
@ -507,8 +512,12 @@ public final class MainWindow extends ChatFrame implements ActionListener {
ResourceUtils.resButton(preferenceMenuItem, Res.getString("menuitem.preferences")); ResourceUtils.resButton(preferenceMenuItem, Res.getString("menuitem.preferences"));
ResourceUtils.resButton(helpMenu, Res.getString("menuitem.help")); ResourceUtils.resButton(helpMenu, Res.getString("menuitem.help"));
ResourceUtils.resButton(menuAbout, Res.getString("menuitem.about")); ResourceUtils.resButton(menuAbout, Res.getString("menuitem.about"));
ResourceUtils.resButton(helpMenuItem, Res.getString("menuitem.online.help"));
if (Default.getString("HELP_FORUM_TEXT").length() > 0) {
ResourceUtils.resButton(sparkforumItem, Default.getString("HELP_FORUM_TEXT"));
} else {
ResourceUtils.resButton(sparkforumItem, Res.getString("menuitem.online.help"));
}
// Register shutdown with the exit menu. // Register shutdown with the exit menu.
exitMenuItem.addActionListener(new AbstractAction() { exitMenuItem.addActionListener(new AbstractAction() {
private static final long serialVersionUID = -2301236575241532698L; private static final long serialVersionUID = -2301236575241532698L;
@ -518,14 +527,15 @@ public final class MainWindow extends ChatFrame implements ActionListener {
} }
}); });
helpMenuItem.addActionListener(new AbstractAction() { sparkforumItem.addActionListener(new AbstractAction() {
private static final long serialVersionUID = -1423433460333010339L; private static final long serialVersionUID = -1423433460333010339L;
final String url = Default.getString("HELP_FORUM");
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
BrowserLauncher.openURL("http://www.igniterealtime.org/forum/forum.jspa?forumID=49"); BrowserLauncher.openURL(url);
} } catch (Exception browserException) {
catch (Exception browserException) {
Log.error("Error launching browser:", browserException); Log.error("Error launching browser:", browserException);
} }
} }

View File

@ -405,8 +405,8 @@ public final class Spark {
return System.getProperties().getProperty("user.home"); return System.getProperties().getProperty("user.home");
} }
public static boolean isCustomBuild() { public static boolean disableUpdatesOnCustom() {
return Default.getBoolean("CUSTOM"); return Default.getBoolean("DISABLE_UPDATES");
} }
public static void setApplicationFont(Font f) { public static void setApplicationFont(Font f) {

View File

@ -44,7 +44,7 @@ public class Default {
public static final String SHOW_POWERED_BY = "SHOW_POWERED_BY"; public static final String SHOW_POWERED_BY = "SHOW_POWERED_BY";
public static final String TOP_BOTTOM_BACKGROUND_IMAGE = "TOP_BOTTOM_BACKGROUND_IMAGE"; public static final String TOP_BOTTOM_BACKGROUND_IMAGE = "TOP_BOTTOM_BACKGROUND_IMAGE";
public static final String BRANDED_IMAGE = "BRANDED_IMAGE"; public static final String BRANDED_IMAGE = "BRANDED_IMAGE";
public static final String CUSTOM = "CUSTOM"; public static final String DISABLE_UPDATES = "DISABLE_UPDATES";
public static final String SECONDARY_BACKGROUND_IMAGE = "SECONDARY_BACKGROUND_IMAGE"; public static final String SECONDARY_BACKGROUND_IMAGE = "SECONDARY_BACKGROUND_IMAGE";
public static final String HOVER_TEXT_COLOR = "HOVER_TEXT_COLOR"; public static final String HOVER_TEXT_COLOR = "HOVER_TEXT_COLOR";
public static final String TEXT_COLOR = "TEXT_COLOR"; public static final String TEXT_COLOR = "TEXT_COLOR";
@ -63,7 +63,8 @@ public class Default {
public static final String DEFAULT_LOOK_AND_FEEL = "DEFAULT_LOOK_AND_FEEL"; public static final String DEFAULT_LOOK_AND_FEEL = "DEFAULT_LOOK_AND_FEEL";
public static final String INSTALL_PLUGINS_DISABLED = "INSTALL_PLUGINS_DISABLED"; public static final String INSTALL_PLUGINS_DISABLED = "INSTALL_PLUGINS_DISABLED";
public static final String DEINSTALL_PLUGINS_DISABLED = "DEINSTALL_PLUGINS_DISABLED"; public static final String DEINSTALL_PLUGINS_DISABLED = "DEINSTALL_PLUGINS_DISABLED";
public static final String ADVANCED_DISABLED = "ADVANCED_DISABLED";
public static final String HELP_USER_GUIDE = "HELP_USER_GUIDE";
static ClassLoader cl = SparkRes.class.getClassLoader(); static ClassLoader cl = SparkRes.class.getClassLoader();
@ -88,7 +89,7 @@ public class Default {
} }
public static boolean getBoolean(String propertyName) { public static boolean getBoolean(String propertyName) {
return prb.getString(propertyName).equals("true"); return getString(propertyName).equals("true");
} }
public static ImageIcon getImageIcon(String imageName) { public static ImageIcon getImageIcon(String imageName) {

View File

@ -1,3 +1,6 @@
#################################################
################# Login Window #################
#################################################
# The Login image # The Login image
# suggested image dimensions 244 x 188 pixels # suggested image dimensions 244 x 188 pixels
MAIN_IMAGE = images/spark.png MAIN_IMAGE = images/spark.png
@ -7,19 +10,33 @@ LOGIN_DIALOG_BACKGROUND_IMAGE = images/login_dialog_background.png
TOP_BOTTOM_BACKGROUND_IMAGE = images/top_bottom_background_image.png TOP_BOTTOM_BACKGROUND_IMAGE = images/top_bottom_background_image.png
SECONDARY_BACKGROUND_IMAGE = images/steel.png SECONDARY_BACKGROUND_IMAGE = images/steel.png
# Specify a fixed Hostname
# Changing the Hostname will also be prohibited if set
HOST_NAME =
# Proxy Settings
PROXY_HOST =
PROXY_PORT =
# Remove account creation Button from Loginwindow
ACCOUNT_DISABLED =
# Remove Advanced Configuration Button from Loginwindow
ADVANCED_DISABLED =
# Branding only # Branding only
# Branded images appear in the Top-Right corner, and must be included in the classpath # Branded images appear in the Top-Right corner, and must be included in the classpath
# place them in src/resource/images and path will be "images/file.jpg" # place them in src/resource/images and path will be "images/file.jpg"
BRANDED_IMAGE = BRANDED_IMAGE =
# Specify a fixed Hostname
# Changing the Hostname will also be prohibited if set
HOST_NAME =
SHOW_POWERED_BY = SHOW_POWERED_BY =
# if Custom build = true, there will be no references anywhere to igniterealtime.org # Disables updateability, you should set this, if you have a custom Spark-build
CUSTOM = DISABLE_UPDATES =
#################################################
################## Main Window ##################
#################################################
# Roster Management # Roster Management
HOVER_TEXT_COLOR = HOVER_TEXT_COLOR =
TEXT_COLOR = TEXT_COLOR =
@ -30,12 +47,10 @@ CONTACT_GROUP_END_COLOR =
TAB_START_COLOR = TAB_START_COLOR =
TAB_END_COLOR = TAB_END_COLOR =
# Proxy Settings
PROXY_HOST =
PROXY_PORT =
# Remove account creation Button from Loginwindow #################################################
ACCOUNT_DISABLED = ################ Settings Window ################
#################################################
# Disables adding of contacts # Disables adding of contacts
ADD_CONTACT_DISABLED = ADD_CONTACT_DISABLED =
@ -49,6 +64,24 @@ LOOK_AND_FEEL_DISABLED =
# If Setting this you should also consider disabling the above # If Setting this you should also consider disabling the above
DEFAULT_LOOK_AND_FEEL = DEFAULT_LOOK_AND_FEEL =
# Sets the Location of the Userguide
#Default is http://www.igniterealtime.org/builds/spark/docs/spark_user_guide.pdf
HELP_USER_GUIDE = http://www.igniterealtime.org/builds/spark/docs/spark_user_guide.pdf
HELP_USER_GUIDE_DISABLED =
# Sets the Location of the Help-Forum
#Default is http://www.igniterealtime.org/forum/forum.jspa?forumID=49
HELP_FORUM = http://www.igniterealtime.org/forum/forum.jspa?forumID=49
HELP_FORUM_DISABLED =
# Following Text will be displayed instead of "Spark forum"
# leave blank for default
HELP_FORUM_TEXT =
#################################################
################ Plugins ################
#################################################
# Disable Installing of Plugins # Disable Installing of Plugins
# set true if you want to disable installing of Plugins # set true if you want to disable installing of Plugins
INSTALL_PLUGINS_DISABLED = INSTALL_PLUGINS_DISABLED =

View File

@ -98,7 +98,7 @@ public class CheckUpdates {
} }
public SparkVersion newBuildAvailable() { public SparkVersion newBuildAvailable() {
if (!sparkPluginInstalled && !Spark.isCustomBuild()) { if (!sparkPluginInstalled && !Spark.disableUpdatesOnCustom()) {
// Handle Jivesoftware.org update // Handle Jivesoftware.org update
return isNewBuildAvailableFromJivesoftware(); return isNewBuildAvailableFromJivesoftware();
} }