diff options
author | Yana Stamcheva <yana@jitsi.org> | 2010-09-29 17:28:13 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2010-09-29 17:28:13 +0000 |
commit | 73eb6b22b00fa15e97f2b71516df26251d0311c6 (patch) | |
tree | 6380da8bda9b4a18fda23670f1f9cfdaf964a2d3 /src/net/java/sip/communicator/impl/gui | |
parent | dcc9ea2fe3c47ff0b33dd2f789f3ae8244ea5cf8 (diff) | |
download | jitsi-73eb6b22b00fa15e97f2b71516df26251d0311c6.zip jitsi-73eb6b22b00fa15e97f2b71516df26251d0311c6.tar.gz jitsi-73eb6b22b00fa15e97f2b71516df26251d0311c6.tar.bz2 |
Added a property allowing to hide option menus and buttons and account configuration form.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui')
4 files changed, 65 insertions, 14 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java index a2ec6b0..ecdd6a6 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/ExtendedMainToolBar.java @@ -15,6 +15,7 @@ import javax.swing.*; import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.main.chat.*; import net.java.sip.communicator.impl.gui.main.chat.history.*; +import net.java.sip.communicator.impl.gui.main.configforms.*; import net.java.sip.communicator.impl.gui.main.contactlist.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; @@ -98,7 +99,7 @@ public class ExtendedMainToolBar public ExtendedMainToolBar(ChatWindow messageWindow) { super(messageWindow); - } + } protected void init() { @@ -108,12 +109,20 @@ public class ExtendedMainToolBar this.add(cutButton); this.add(copyButton); this.add(pasteButton); - this.add(settingsButton); this.add(previousButton); this.add(nextButton); this.add(historyButton); this.add(addButton); + Boolean showOptionsProp + = GuiActivator.getConfigurationService() + .getBoolean(ConfigurationFrame.SHOW_OPTIONS_WINDOW, true); + + if (showOptionsProp.booleanValue()) + { + this.add(settingsButton); + } + this.saveButton.setName("save"); this.saveButton.setToolTipText( GuiActivator.getResources().getI18NString("service.gui.SAVE") diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java index 501d45d..c9d1647 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java @@ -20,6 +20,7 @@ import net.java.sip.communicator.impl.gui.main.call.*; import net.java.sip.communicator.impl.gui.main.chat.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.main.chat.history.*; +import net.java.sip.communicator.impl.gui.main.configforms.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.*; @@ -130,7 +131,18 @@ public class MainToolBar this.add(callButton); this.add(historyButton); - this.add(optionsButton); + + // We only add the options button if the property SHOW_OPTIONS_WINDOW + // specifies so or if it's not set. + Boolean showOptionsProp + = GuiActivator.getConfigurationService() + .getBoolean(ConfigurationFrame.SHOW_OPTIONS_WINDOW, true); + + if (showOptionsProp.booleanValue()) + { + this.add(optionsButton); + } + this.add(sendFileButton); this.add(previousButton); diff --git a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java index b11ee44..2926041 100644 --- a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java @@ -44,6 +44,20 @@ public class ConfigurationFrame = new TransparentPanel(new BorderLayout(5, 5)); /** + * Indicates if the account config form should be shown. + */ + private static final String SHOW_ACCOUNT_CONFIG_PROPERTY + = "net.java.sip.communicator.impl.gui.main." + + "configforms.SHOW_ACCOUNT_CONFIG"; + + /** + * Indicates if the configuration window should be shown. + */ + public static final String SHOW_OPTIONS_WINDOW + = "net.java.sip.communicator.impl.gui.main." + + "configforms.SHOW_OPTIONS_WINDOW"; + + /** * Initializes a new <tt>ConfigurationFrame</tt> instance. * * @param mainFrame The main application window. @@ -127,13 +141,19 @@ public class ConfigurationFrame */ public void addDefaultForms() { - addConfigurationForm( - new LazyConfigurationForm( - "net.java.sip.communicator.impl.gui.main.account.AccountsConfigurationPanel", - getClass().getClassLoader(), - "service.gui.icons.ACCOUNT_ICON", - "service.gui.ACCOUNTS", - 0)); + Boolean showAccountConfigProp + = GuiActivator.getConfigurationService() + .getBoolean(SHOW_ACCOUNT_CONFIG_PROPERTY, true); + + if (showAccountConfigProp.booleanValue()) + addConfigurationForm( + new LazyConfigurationForm( + "net.java.sip.communicator.impl.gui.main." + + "account.AccountsConfigurationPanel", + getClass().getClassLoader(), + "service.gui.icons.ACCOUNT_ICON", + "service.gui.ACCOUNTS", + 0)); } /** diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java index c617911..955833a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java @@ -15,6 +15,7 @@ import net.java.sip.communicator.impl.gui.*; import net.java.sip.communicator.impl.gui.event.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.main.call.conference.*; +import net.java.sip.communicator.impl.gui.main.configforms.*; import net.java.sip.communicator.impl.gui.main.contactlist.*; import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.gui.*; @@ -213,11 +214,20 @@ public class ToolsMenu */ private void registerMenuItems() { - UIService uiService = GuiActivator.getUIService(); - if ((uiService == null) || !uiService.useMacOSXScreenMenuBar() - || !registerConfigMenuItemMacOSX()) + // We only add the options button if the property SHOW_OPTIONS_WINDOW + // specifies so or if it's not set. + Boolean showOptionsProp + = GuiActivator.getConfigurationService() + .getBoolean(ConfigurationFrame.SHOW_OPTIONS_WINDOW, true); + + if (showOptionsProp.booleanValue()) { - registerConfigMenuItemNonMacOSX(); + UIService uiService = GuiActivator.getUIService(); + if ((uiService == null) || !uiService.useMacOSXScreenMenuBar() + || !registerConfigMenuItemMacOSX()) + { + registerConfigMenuItemNonMacOSX(); + } } // Marks this feature as an ongoing work until its completed and fully |