aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2012-11-21 14:56:12 +0000
committerYana Stamcheva <yana@jitsi.org>2012-11-21 14:56:12 +0000
commitf87c4cf9ba1685942e1ee170b45359f8918ecf66 (patch)
treed12b8d74435adc400cbbb23ae1b97c22bd4314eb /src
parent4f3d81f0ccdecc7528114f7470a0c2749a908982 (diff)
downloadjitsi-f87c4cf9ba1685942e1ee170b45359f8918ecf66.zip
jitsi-f87c4cf9ba1685942e1ee170b45359f8918ecf66.tar.gz
jitsi-f87c4cf9ba1685942e1ee170b45359f8918ecf66.tar.bz2
Removes the ConfigurationManager-s from impl.gui and plugin.generalconfig packages and create a NotificationUtils class that manages all common configuration properties and is accessible through the util package.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/gui/GuiActivator.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/UIServiceImpl.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/MainFrame.java11
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/SingleWindowContainer.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallManager.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/DesktopSharingButton.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/LocalVideoButton.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceInviteDialog.java4
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java4
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java15
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java12
-rwxr-xr-xsrc/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java39
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/ContactPhotoPanel.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/FontChooser.java14
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatSession.java7
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/AdHocConferenceChatSession.java8
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomProviderWrapper.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomSubjectPanel.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomWrapper.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java7
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatSession.java8
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/menus/EditMenu.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/menus/FileMenu.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/menus/OptionsMenu.java13
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/toolBars/MainToolBar.java9
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomList.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java24
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java14
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableUI.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java6
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/CommonRightButtonMenu.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListModel.java8
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactListManager.java17
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java13
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/PresenceFilter.java5
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java3
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java4
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/UnknownContactPanel.java4
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIGroup.java4
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/menus/AutoAnswerMenu.java10
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/menus/FileMenu.java18
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java7
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java2
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java6
-rw-r--r--src/net/java/sip/communicator/plugin/generalconfig/ConfigurationManager.java721
-rw-r--r--src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java2
-rw-r--r--src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java57
-rw-r--r--src/net/java/sip/communicator/plugin/generalconfig/SIPConfigForm.java15
-rw-r--r--src/net/java/sip/communicator/util/ConfigurationUtils.java (renamed from src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java)444
-rw-r--r--src/net/java/sip/communicator/util/UtilActivator.java65
56 files changed, 709 insertions, 996 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/GuiActivator.java b/src/net/java/sip/communicator/impl/gui/GuiActivator.java
index e04ff49..abb051a 100644
--- a/src/net/java/sip/communicator/impl/gui/GuiActivator.java
+++ b/src/net/java/sip/communicator/impl/gui/GuiActivator.java
@@ -11,7 +11,6 @@ import java.util.*;
import net.java.sip.communicator.impl.gui.main.account.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
import net.java.sip.communicator.impl.gui.main.presence.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.browserlauncher.*;
import net.java.sip.communicator.service.callhistory.*;
import net.java.sip.communicator.service.contactlist.*;
@@ -127,7 +126,7 @@ public class GuiActivator implements BundleActivator
isStarted = true;
GuiActivator.bundleContext = bContext;
- ConfigurationManager.loadGuiConfigurations();
+ ConfigurationUtils.loadGuiConfigurations();
try
{
diff --git a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
index 4ff784d..9f2c290 100644
--- a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
@@ -138,7 +138,7 @@ public class UIServiceImpl
// Initialize the single window container if we're in this case. This
// should be done before initializing the main window, because he'll
// search for it.
- if (ConfigurationManager.isSingleWindowInterfaceEnabled())
+ if (ConfigurationUtils.isSingleWindowInterfaceEnabled())
singleWindowContainer = new SingleWindowContainer();
// Initialize the main window.
@@ -170,7 +170,7 @@ public class UIServiceImpl
this.wizardContainer = new AccountRegWizardContainerImpl(mainFrame);
- if (ConfigurationManager.isTransparentWindowEnabled())
+ if (ConfigurationUtils.isTransparentWindowEnabled())
{
try
{
@@ -179,11 +179,11 @@ public class UIServiceImpl
catch (UnsupportedOperationException ex)
{
logger.error(ex.getMessage(), ex);
- ConfigurationManager.setTransparentWindowEnabled(false);
+ ConfigurationUtils.setTransparentWindowEnabled(false);
}
}
- if(ConfigurationManager.isApplicationVisible())
+ if(ConfigurationUtils.isApplicationVisible())
mainFrame.setFrameVisible(true);
SwingUtilities.invokeLater(new RunLoginGui());
@@ -1148,7 +1148,7 @@ public class UIServiceImpl
.showDialog();
}
- ConfigurationManager.setTransparentWindowEnabled(false);
+ ConfigurationUtils.setTransparentWindowEnabled(false);
}
}
else if (propertyName.equals(
diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
index 191c86a..3f3aa8d 100644
--- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
+++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
@@ -22,7 +22,6 @@ import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
import net.java.sip.communicator.impl.gui.main.menus.*;
import net.java.sip.communicator.impl.gui.main.presence.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contacteventhandler.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
@@ -180,7 +179,7 @@ public class MainFrame
*/
public MainFrame()
{
- if (!ConfigurationManager.isWindowDecorated())
+ if (!ConfigurationUtils.isWindowDecorated())
{
this.setUndecorated(true);
}
@@ -1724,7 +1723,7 @@ public class MainFrame
*/
public void setFrameVisible(final boolean isVisible)
{
- ConfigurationManager.setApplicationVisible(isVisible);
+ ConfigurationUtils.setApplicationVisible(isVisible);
SwingUtilities.invokeLater(new Runnable(){
public void run()
@@ -1887,7 +1886,7 @@ public class MainFrame
{
public void run()
{
- if (ConfigurationManager.isQuitWarningShown())
+ if (ConfigurationUtils.isQuitWarningShown())
{
MessageDialog dialog =
new MessageDialog(null,
@@ -1897,12 +1896,12 @@ public class MainFrame
"service.gui.HIDE_MAIN_WINDOW"), false);
if (dialog.showDialog() == MessageDialog.OK_DONT_ASK_CODE)
- ConfigurationManager.setQuitWarningShown(false);
+ ConfigurationUtils.setQuitWarningShown(false);
}
}
});
- ConfigurationManager.setApplicationVisible(false);
+ ConfigurationUtils.setApplicationVisible(false);
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/SingleWindowContainer.java b/src/net/java/sip/communicator/impl/gui/main/SingleWindowContainer.java
index 3df56cc..1b3ba4d 100644
--- a/src/net/java/sip/communicator/impl/gui/main/SingleWindowContainer.java
+++ b/src/net/java/sip/communicator/impl/gui/main/SingleWindowContainer.java
@@ -19,7 +19,6 @@ import net.java.sip.communicator.impl.gui.*;
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.toolBars.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@@ -282,7 +281,7 @@ public class SingleWindowContainer
MainFrame mainWindow = GuiActivator.getUIService().getMainFrame();
if(mainWindow.getExtendedState() != JFrame.ICONIFIED)
{
- if(ConfigurationManager.isAutoPopupNewMessage()
+ if(ConfigurationUtils.isAutoPopupNewMessage()
|| setSelected)
mainWindow.toFront();
}
@@ -414,7 +413,7 @@ public class SingleWindowContainer
northPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
northPanel.setPreferredSize(new Dimension(500, 35));
- northPanel.setVisible(ConfigurationManager.isChatToolbarVisible());
+ northPanel.setVisible(ConfigurationUtils.isChatToolbarVisible());
northPanel.add(mainToolBar, BorderLayout.EAST);
northPanel.add(contactPhotoPanel, BorderLayout.WEST);
diff --git a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java
index 1c6514a..5760662 100644
--- a/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/account/NewAccountDialog.java
@@ -117,7 +117,7 @@ public class NewAccountDialog
mainPanel.add(buttonPanel, BorderLayout.SOUTH);
- if (!ConfigurationManager.isAdvancedAccountConfigDisabled())
+ if (!ConfigurationUtils.isAdvancedAccountConfigDisabled())
{
buttonPanel.add(advancedButton, BorderLayout.WEST);
this.advancedButton.addActionListener(this);
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
index 63371ff..b9d244a 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
@@ -92,7 +92,7 @@ public class CallManager
Call sourceCall = ev.getSourceCall();
boolean isVideoCall
= ev.isVideoCall()
- && ConfigurationManager.hasEnabledVideoFormat(
+ && ConfigurationUtils.hasEnabledVideoFormat(
sourceCall.getProtocolProvider());
final ReceivedCallDialog receivedCallDialog
= new ReceivedCallDialog(
@@ -783,7 +783,7 @@ public class CallManager
callString = callString.trim();
// Removes special characters from phone numbers.
- if (ConfigurationManager.isNormalizePhoneNumber())
+ if (ConfigurationUtils.isNormalizePhoneNumber())
callString = PhoneNumberI18nService.normalize(callString);
List<ProtocolProviderService> telephonyProviders
@@ -1768,7 +1768,7 @@ public class CallManager
Contact contact = this.contact;
String stringContact = this.stringContact;
- if (ConfigurationManager.isNormalizePhoneNumber())
+ if (ConfigurationUtils.isNormalizePhoneNumber())
{
if (contact != null)
{
@@ -2099,7 +2099,7 @@ public class CallManager
String[] contactArray
= contactList.toArray(new String[contactList.size()]);
- if (ConfigurationManager.isNormalizePhoneNumber())
+ if (ConfigurationUtils.isNormalizePhoneNumber())
normalizePhoneNumbers(contactArray);
/* Try to have a single Call per ProtocolProviderService. */
@@ -2231,7 +2231,7 @@ public class CallManager
if (opSetVideoBridge == null || !opSetVideoBridge.isActive())
return;
- if (ConfigurationManager.isNormalizePhoneNumber())
+ if (ConfigurationUtils.isNormalizePhoneNumber())
normalizePhoneNumbers(callees);
try
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/DesktopSharingButton.java b/src/net/java/sip/communicator/impl/gui/main/call/DesktopSharingButton.java
index fa85e47..a8a1627 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/DesktopSharingButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/DesktopSharingButton.java
@@ -14,6 +14,7 @@ import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
/**
* The button responsible to start(the <tt>Call</tt> of) an associated
@@ -71,7 +72,7 @@ public class DesktopSharingButton
"service.gui.NO_DESKTOP_SHARING_FOR_PROTOCOL"));
desktopSharingAvailable = false;
}
- else if(!ConfigurationManager.hasEnabledVideoFormat(
+ else if(!ConfigurationUtils.hasEnabledVideoFormat(
call.getProtocolProvider()))
{
setToolTipText(GuiActivator.getResources()
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/LocalVideoButton.java b/src/net/java/sip/communicator/impl/gui/main/call/LocalVideoButton.java
index 586008d..5b50e37 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/LocalVideoButton.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/LocalVideoButton.java
@@ -11,6 +11,7 @@ import java.util.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.device.*;
@@ -145,7 +146,7 @@ public class LocalVideoButton
hasVideoTelephony = true;
}
if (!hasEnabledVideoFormat
- && ConfigurationManager.hasEnabledVideoFormat(
+ && ConfigurationUtils.hasEnabledVideoFormat(
protocolProvider))
{
hasEnabledVideoFormat = true;
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceInviteDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceInviteDialog.java
index d9ce3e4..b7231ba 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceInviteDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceInviteDialog.java
@@ -148,7 +148,7 @@ public class ConferenceInviteDialog
// Store the last used account in order to pre-select it
// next time.
- ConfigurationManager.setLastCallConferenceProvider(
+ ConfigurationUtils.setLastCallConferenceProvider(
preselectedProtocolProvider);
dispose();
@@ -360,7 +360,7 @@ public class ConferenceInviteDialog
// Try to select the last used account if available.
ProtocolProviderService pps
- = ConfigurationManager.getLastCallConferenceProvider();
+ = ConfigurationUtils.getLastCallConferenceProvider();
if (pps == null && conference != null)
{
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
index ac93932..ed66903 100755
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
@@ -276,7 +276,7 @@ public class ChatConversationPanel
GuiActivator.getResources().getI18nMnemonic(
"service.gui.COPY_LINK"));
- this.isSimpleTheme = ConfigurationManager.isChatSimpleThemeEnabled();
+ this.isSimpleTheme = ConfigurationUtils.isChatSimpleThemeEnabled();
/*
* When we append a new message (regardless of whether it is a string or
@@ -1353,7 +1353,7 @@ public class ChatConversationPanel
this.document = (HTMLDocument) editorKit.createDefaultDocument();
Constants.loadSimpleStyle(
document.getStyleSheet(), chatTextPane.getFont());
- this.isSimpleTheme = ConfigurationManager.isChatSimpleThemeEnabled();
+ this.isSimpleTheme = ConfigurationUtils.isChatSimpleThemeEnabled();
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
index 725c296..9afa043 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
@@ -29,6 +29,7 @@ import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -828,7 +829,7 @@ public class ChatPanel
return;
}
- if (ConfigurationManager.isHistoryShown() && !isHistoryLoaded)
+ if (ConfigurationUtils.isHistoryShown() && !isHistoryLoaded)
{
synchronized (incomingEventBuffer)
{
@@ -1407,7 +1408,7 @@ public class ChatPanel
fileTransferTransport.getDisplayName(),
file);
- if (ConfigurationManager.isHistoryShown() && !isHistoryLoaded)
+ if (ConfigurationUtils.isHistoryShown() && !isHistoryLoaded)
{
synchronized (incomingEventBuffer)
{
@@ -1839,7 +1840,7 @@ public class ChatPanel
// Load the last N=CHAT_HISTORY_SIZE messages from history.
historyList = chatSession.getHistory(
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
return historyList;
}
@@ -1983,7 +1984,7 @@ public class ChatPanel
writeMessagePanel.updateChatTransportStatus(chatTransport);
- if(ConfigurationManager.isShowStatusChangedInChat())
+ if(ConfigurationUtils.isShowStatusChangedInChat())
{
// Show a status message to the user.
this.addMessage(
@@ -1996,7 +1997,7 @@ public class ChatPanel
"text/plain");
}
- if(ConfigurationManager.isMultiChatWindowEnabled())
+ if(ConfigurationUtils.isMultiChatWindowEnabled())
{
if (getChatContainer().getChatCount() > 0)
{
@@ -2250,7 +2251,7 @@ public class ChatPanel
= new ReceiveFileConversationComponent(
this, fileTransferOpSet, request, date);
- if (ConfigurationManager.isHistoryShown() && !isHistoryLoaded)
+ if (ConfigurationUtils.isHistoryShown() && !isHistoryLoaded)
{
synchronized (incomingEventBuffer)
{
@@ -2558,7 +2559,7 @@ public class ChatPanel
= messagePane.getHeight() - dividerLocation
- messagePane.getDividerSize();
- ConfigurationManager
+ ConfigurationUtils
.setChatWriteAreaSize(writeAreaSize);
// writeMessagePanel.setPreferredSize(
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java
index 07c758b..929e0de 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java
@@ -101,7 +101,7 @@ public class ChatWindow
*/
public ChatWindow()
{
- if (!ConfigurationManager.isWindowDecorated())
+ if (!ConfigurationUtils.isWindowDecorated())
this.setUndecorated(true);
this.addWindowFocusListener(this);
@@ -109,7 +109,7 @@ public class ChatWindow
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
//If in mode TABBED_CHAT_WINDOW initialize the tabbed pane
- if(ConfigurationManager.isMultiChatWindowEnabled())
+ if(ConfigurationUtils.isMultiChatWindowEnabled())
chatTabbedPane = new ConversationTabbedPane();
menuBar = new MessageWindowMenuBar(this);
@@ -204,7 +204,7 @@ public class ChatWindow
*/
public void addChat(final ChatPanel chatPanel)
{
- if (ConfigurationManager.isMultiChatWindowEnabled())
+ if (ConfigurationUtils.isMultiChatWindowEnabled())
addChatTab(chatPanel);
else
addSimpleChat(chatPanel);
@@ -230,7 +230,7 @@ public class ChatWindow
mainToolBar = new MainToolBar(this);
boolean chatToolbarVisible
- = ConfigurationManager.isChatToolbarVisible();
+ = ConfigurationUtils.isChatToolbarVisible();
if (OSUtils.IS_MAC)
{
@@ -1133,7 +1133,7 @@ public class ChatWindow
if(getExtendedState() != JFrame.ICONIFIED)
{
- if (ConfigurationManager.isAutoPopupNewMessage() || setSelected)
+ if (ConfigurationUtils.isAutoPopupNewMessage() || setSelected)
{
if (!isVisible())
setVisible(true);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java
index 06fbde5..eca47d1 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java
@@ -16,11 +16,11 @@ import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.impl.gui.main.chatroomslist.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import org.jitsi.util.*;
@@ -444,7 +444,7 @@ public class ChatWindowManager
synchronized (chatSyncRoot)
{
- if (ConfigurationManager.isMultiChatWindowEnabled())
+ if (ConfigurationUtils.isMultiChatWindowEnabled())
{
if (chatPanelsIter.hasNext())
{
@@ -1015,7 +1015,7 @@ public class ChatWindowManager
this.chatPanels.add(chatPanel);
}
- if (ConfigurationManager.isHistoryShown())
+ if (ConfigurationUtils.isHistoryShown())
chatPanel.loadHistory(escapedMessageID);
fireChatCreated(chatPanel);
@@ -1041,7 +1041,7 @@ public class ChatWindowManager
// If we're in a multi-window mode we have two possibilities - multi
// chat window or single chat windows.
- if (ConfigurationManager.isMultiChatWindowEnabled())
+ if (ConfigurationUtils.isMultiChatWindowEnabled())
{
Iterator<ChatPanel> chatPanelsIter = chatPanels.iterator();
@@ -1117,7 +1117,7 @@ public class ChatWindowManager
this.chatPanels.add(chatPanel);
}
- if (ConfigurationManager.isHistoryShown())
+ if (ConfigurationUtils.isHistoryShown())
chatPanel.loadHistory(escapedMessageID);
fireChatCreated(chatPanel);
@@ -1150,7 +1150,7 @@ public class ChatWindowManager
this.chatPanels.add(chatPanel);
}
- if (ConfigurationManager.isHistoryShown())
+ if (ConfigurationUtils.isHistoryShown())
chatPanel.loadHistory(escapedMessageID);
fireChatCreated(chatPanel);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
index 44d965f..2851392 100755
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWritePanel.java
@@ -20,7 +20,6 @@ import javax.swing.undo.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.impl.gui.main.chat.menus.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@@ -103,7 +102,7 @@ public class ChatWritePanel
centerPanel = createCenter();
- int chatAreaSize = ConfigurationManager.getChatWriteAreaSize();
+ int chatAreaSize = ConfigurationUtils.getChatWriteAreaSize();
Dimension writeMessagePanelDefaultSize
= new Dimension(500, (chatAreaSize > 0) ? chatAreaSize : 28);
Dimension writeMessagePanelMinSize = new Dimension(500, 28);
@@ -136,7 +135,7 @@ public class ChatWritePanel
this.changeSendCommand((messageCommand == null || messageCommand
.equalsIgnoreCase("enter")));
- if(ConfigurationManager.isFontSupportEnabled())
+ if(ConfigurationUtils.isFontSupportEnabled())
initDefaultFontConfiguration();
}
@@ -145,20 +144,20 @@ public class ChatWritePanel
*/
private void initDefaultFontConfiguration()
{
- String fontFamily = ConfigurationManager.getChatDefaultFontFamily();
- int fontSize = ConfigurationManager.getChatDefaultFontSize();
+ String fontFamily = ConfigurationUtils.getChatDefaultFontFamily();
+ int fontSize = ConfigurationUtils.getChatDefaultFontSize();
// Font family and size
if (fontFamily != null && fontSize > 0)
setFontFamilyAndSize(fontFamily, fontSize);
// Font style
- setBoldStyleEnable(ConfigurationManager.isChatFontBold());
- setItalicStyleEnable(ConfigurationManager.isChatFontItalic());
- setUnderlineStyleEnable(ConfigurationManager.isChatFontUnderline());
+ setBoldStyleEnable(ConfigurationUtils.isChatFontBold());
+ setItalicStyleEnable(ConfigurationUtils.isChatFontItalic());
+ setUnderlineStyleEnable(ConfigurationUtils.isChatFontUnderline());
// Font color
- Color fontColor = ConfigurationManager.getChatDefaultFontColor();
+ Color fontColor = ConfigurationUtils.getChatDefaultFontColor();
if (fontColor != null)
setFontColor(fontColor);
@@ -530,7 +529,7 @@ public class ChatWritePanel
*/
public void keyTyped(KeyEvent e)
{
- if (ConfigurationManager.isSendTypingNotifications())
+ if (ConfigurationUtils.isSendTypingNotifications())
{
if (typingState != OperationSetTypingNotifications.STATE_TYPING)
{
@@ -938,7 +937,7 @@ public class ChatWritePanel
chatPanel.getChatSession(),
chatPanel.getChatSession().getCurrentChatTransport());
- if(ConfigurationManager.isHideAccountSelectionWhenPossibleEnabled()
+ if(ConfigurationUtils.isHideAccountSelectionWhenPossibleEnabled()
&& transportSelectorBox.getMenu().getItemCount() <= 1)
transportSelectorBox.setVisible(false);
}
@@ -985,7 +984,7 @@ public class ChatWritePanel
}
else
{
- if( ConfigurationManager
+ if( ConfigurationUtils
.isHideAccountSelectionWhenPossibleEnabled()
&& transportSelectorBox.getMenu().getItemCount() <= 1)
{
@@ -1045,7 +1044,7 @@ public class ChatWritePanel
// it was hidden cause we wanted to hide when there is only one
// provider
if(!transportSelectorBox.isVisible()
- && ConfigurationManager
+ && ConfigurationUtils
.isHideAccountSelectionWhenPossibleEnabled()
&& transportSelectorBox.getMenu().getItemCount() > 1)
{
@@ -1087,7 +1086,7 @@ public class ChatWritePanel
transportSelectorBox.removeChatTransport(chatTransport);
if(transportSelectorBox.getMenu().getItemCount() == 1
- && ConfigurationManager.isHideAccountSelectionWhenPossibleEnabled())
+ && ConfigurationUtils.isHideAccountSelectionWhenPossibleEnabled())
{
transportSelectorBox.setVisible(false);
}
@@ -1128,12 +1127,12 @@ public class ChatWritePanel
boolean isUnderline,
Color color)
{
- ConfigurationManager.setChatDefaultFontFamily(fontFamily);
- ConfigurationManager.setChatDefaultFontSize(fontSize);
- ConfigurationManager.setChatFontIsBold(isBold);
- ConfigurationManager.setChatFontIsItalic(isItalic);
- ConfigurationManager.setChatFontIsUnderline(isUnderline);
- ConfigurationManager.setChatDefaultFontColor(color);
+ ConfigurationUtils.setChatDefaultFontFamily(fontFamily);
+ ConfigurationUtils.setChatDefaultFontSize(fontSize);
+ ConfigurationUtils.setChatFontIsBold(isBold);
+ ConfigurationUtils.setChatFontIsItalic(isItalic);
+ ConfigurationUtils.setChatFontIsUnderline(isUnderline);
+ ConfigurationUtils.setChatDefaultFontColor(color);
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ContactPhotoPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ContactPhotoPanel.java
index e36fe19..ba2e489 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/ContactPhotoPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/ContactPhotoPanel.java
@@ -124,7 +124,7 @@ public class ContactPhotoPanel extends JLayeredPane
// cannot be saved with add contact dialog
if (!chatSession.isDescriptorPersistent()
&& !(chatSession instanceof ConferenceChatSession)
- && !ConfigurationManager.isAddContactDisabled())
+ && !ConfigurationUtils.isAddContactDisabled())
this.add(addContactButton, 0);
else
this.remove(addContactButton);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/FontChooser.java b/src/net/java/sip/communicator/impl/gui/main/chat/FontChooser.java
index 4945aed..bae7567 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/FontChooser.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/FontChooser.java
@@ -13,7 +13,7 @@ import javax.swing.*;
import javax.swing.event.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
import org.jitsi.service.resources.*;
@@ -169,13 +169,13 @@ public class FontChooser
private void initDefaults()
{
String defaultFontFamily
- = ConfigurationManager.getChatDefaultFontFamily();
+ = ConfigurationUtils.getChatDefaultFontFamily();
int defaultFontSize
- = ConfigurationManager.getChatDefaultFontSize();
+ = ConfigurationUtils.getChatDefaultFontSize();
Color defaultFontColor
- = ConfigurationManager.getChatDefaultFontColor();
+ = ConfigurationUtils.getChatDefaultFontColor();
if (defaultFontFamily != null)
setFontFamily(defaultFontFamily);
@@ -183,9 +183,9 @@ public class FontChooser
if (defaultFontSize > 0)
setFontSize(defaultFontSize);
- setBoldStyle(ConfigurationManager.isChatFontBold());
- setItalicStyle(ConfigurationManager.isChatFontItalic());
- setUnderlineStyle(ConfigurationManager.isChatFontUnderline());
+ setBoldStyle(ConfigurationUtils.isChatFontBold());
+ setItalicStyle(ConfigurationUtils.isChatFontItalic());
+ setUnderlineStyle(ConfigurationUtils.isChatFontUnderline());
if (defaultFontColor != null)
setColor(defaultFontColor);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatSession.java b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatSession.java
index 061369a..10c64b1 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatSession.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatSession.java
@@ -18,6 +18,7 @@ import net.java.sip.communicator.service.filehistory.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
+import net.java.sip.communicator.util.*;
/**
* An implementation of the <tt>ChatSession</tt> interface that represents a
@@ -111,7 +112,7 @@ public class MetaContactChatSession
return metaHistory.findLast(
chatHistoryFilter,
metaContact,
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
@@ -134,7 +135,7 @@ public class MetaContactChatSession
return metaHistory.findLastMessagesBefore(
chatHistoryFilter,
- metaContact, date, ConfigurationManager.getChatHistorySize());
+ metaContact, date, ConfigurationUtils.getChatHistorySize());
}
/**
@@ -157,7 +158,7 @@ public class MetaContactChatSession
return metaHistory.findFirstMessagesAfter(
chatHistoryFilter,
- metaContact, date, ConfigurationManager.getChatHistorySize());
+ metaContact, date, ConfigurationUtils.getChatHistorySize());
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java
index 73a8ae9..110b7fb 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java
@@ -11,7 +11,6 @@ import java.net.*;
import javax.swing.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@@ -97,8 +96,8 @@ public class MetaContactChatTransport
*/
private void checkImCaps()
{
- if (ConfigurationManager.getChatDefaultFontFamily() != null
- && ConfigurationManager.getChatDefaultFontSize() > 0)
+ if (ConfigurationUtils.getChatDefaultFontFamily() != null
+ && ConfigurationUtils.getChatDefaultFontSize() > 0)
{
OperationSetBasicInstantMessaging imOpSet
= contact.getProtocolProvider()
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/AdHocConferenceChatSession.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/AdHocConferenceChatSession.java
index 6d35818..104e837 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/AdHocConferenceChatSession.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/AdHocConferenceChatSession.java
@@ -12,11 +12,11 @@ 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.utils.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.globalstatus.*;
+import net.java.sip.communicator.util.*;
/**
* An implementation of <tt>ChatSession</tt> for ad-hoc conference chatting.
@@ -145,7 +145,7 @@ public class AdHocConferenceChatSession
return metaHistory.findLast(
chatHistoryFilter,
chatRoomWrapper.getAdHocChatRoom(),
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
@@ -170,7 +170,7 @@ public class AdHocConferenceChatSession
chatHistoryFilter,
chatRoomWrapper.getAdHocChatRoom(),
date,
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
@@ -195,7 +195,7 @@ public class AdHocConferenceChatSession
chatHistoryFilter,
chatRoomWrapper.getAdHocChatRoom(),
date,
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomProviderWrapper.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomProviderWrapper.java
index 1d9c0c7..f1bd829 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomProviderWrapper.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomProviderWrapper.java
@@ -9,7 +9,6 @@ package net.java.sip.communicator.impl.gui.main.chat.conference;
import java.util.*;
import net.java.sip.communicator.impl.gui.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@@ -244,7 +243,7 @@ public class ChatRoomProviderWrapper
if(chatRoomWrapper.isAutojoin())
{
String nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
@@ -281,7 +280,7 @@ public class ChatRoomProviderWrapper
true);
String nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomSubjectPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomSubjectPanel.java
index 85da533..39c6af8 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomSubjectPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomSubjectPanel.java
@@ -82,7 +82,7 @@ public class ChatRoomSubjectPanel
ChatRoomMemberRole role = ((ChatRoomWrapper)chatSession.getDescriptor())
.getChatRoom().getUserRole();
- if(!ConfigurationManager.isChatRoomConfigDisabled()
+ if(!ConfigurationUtils.isChatRoomConfigDisabled()
&& (role.equals(ChatRoomMemberRole.ADMINISTRATOR)
|| role.equals(ChatRoomMemberRole.MODERATOR)
|| role.equals(ChatRoomMemberRole.OWNER)))
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomWrapper.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomWrapper.java
index 8bb58cb..de43ce0 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomWrapper.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ChatRoomWrapper.java
@@ -6,8 +6,8 @@
*/
package net.java.sip.communicator.impl.gui.main.chat.conference;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
/**
* The <tt>ChatRoomWrapper</tt> is the representation of the <tt>ChatRoom</tt>
@@ -180,7 +180,7 @@ public class ChatRoomWrapper
{
if(autoJoin == null)
{
- String val = ConfigurationManager.getChatRoomProperty(
+ String val = ConfigurationUtils.getChatRoomProperty(
getParentProvider().getProtocolProvider(),
getChatRoomID(), AUTOJOIN_PROPERTY_NAME);
@@ -206,7 +206,7 @@ public class ChatRoomWrapper
{
setPersistent(true);
- ConfigurationManager.saveChatRoom(
+ ConfigurationUtils.saveChatRoom(
getParentProvider().getProtocolProvider(),
getChatRoomID(),
getChatRoomID(),
@@ -215,13 +215,13 @@ public class ChatRoomWrapper
if(value)
{
- ConfigurationManager.updateChatRoomProperty(
+ ConfigurationUtils.updateChatRoomProperty(
getParentProvider().getProtocolProvider(),
chatRoomID, AUTOJOIN_PROPERTY_NAME, Boolean.toString(autoJoin));
}
else
{
- ConfigurationManager.updateChatRoomProperty(
+ ConfigurationUtils.updateChatRoomProperty(
getParentProvider().getProtocolProvider(),
chatRoomID, AUTOJOIN_PROPERTY_NAME, null);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
index d7f557a..0751784 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
@@ -14,7 +14,6 @@ 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.chatroomslist.*;
import net.java.sip.communicator.impl.gui.main.chatroomslist.joinforms.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
@@ -1128,7 +1127,7 @@ public class ConferenceChatManager
// We save the choice of the user, before the chat room is really
// joined, because even the join fails we want the next time when
// we login to join this chat room automatically.
- ConfigurationManager.updateChatRoomStatus(
+ ConfigurationUtils.updateChatRoomStatus(
chatRoomWrapper.getParentProvider().getProtocolProvider(),
chatRoomWrapper.getChatRoomID(),
GlobalStatusEnum.OFFLINE_STATUS);
@@ -1525,7 +1524,7 @@ public class ConferenceChatManager
catch (ExecutionException ignore)
{}
- ConfigurationManager.updateChatRoomStatus(
+ ConfigurationUtils.updateChatRoomStatus(
chatRoomWrapper.getParentProvider().getProtocolProvider(),
chatRoomWrapper.getChatRoomID(),
GlobalStatusEnum.ONLINE_STATUS);
@@ -1662,7 +1661,7 @@ public class ConferenceChatManager
catch (ExecutionException ignore)
{}
- ConfigurationManager.updateChatRoomStatus(
+ ConfigurationUtils.updateChatRoomStatus(
adHocChatRoomWrapper.getParentProvider().getProtocolProvider(),
adHocChatRoomWrapper.getAdHocChatRoomID(),
GlobalStatusEnum.ONLINE_STATUS);
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatSession.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatSession.java
index 40e3e4c..d8e3a4b 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatSession.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatSession.java
@@ -12,11 +12,11 @@ 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.utils.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.globalstatus.*;
+import net.java.sip.communicator.util.*;
/**
* An implementation of <tt>ChatSession</tt> for conference chatting.
@@ -96,7 +96,7 @@ public class ConferenceChatSession
*/
public void dispose()
{
- if(ConfigurationManager.isLeaveChatRoomOnWindowCloseEnabled())
+ if(ConfigurationUtils.isLeaveChatRoomOnWindowCloseEnabled())
{
ChatRoom chatRoom = chatRoomWrapper.getChatRoom();
chatRoom.removeMemberPresenceListener(this);
@@ -181,7 +181,7 @@ public class ConferenceChatSession
return metaHistory.findLast(
chatHistoryFilter,
chatRoomWrapper.getChatRoom(),
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
@@ -231,7 +231,7 @@ public class ConferenceChatSession
chatHistoryFilter,
chatRoomWrapper.getChatRoom(),
date,
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/menus/EditMenu.java b/src/net/java/sip/communicator/impl/gui/main/chat/menus/EditMenu.java
index 50cb359..82aa8d1 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/menus/EditMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/menus/EditMenu.java
@@ -13,6 +13,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.utils.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -68,7 +69,7 @@ public class EditMenu
this.add(copyMenuItem);
this.add(pasteMenuItem);
- if(ConfigurationManager.isFontSupportEnabled())
+ if(ConfigurationUtils.isFontSupportEnabled())
{
this.addSeparator();
this.fontDialogMenuItem.setName("font");
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/menus/FileMenu.java b/src/net/java/sip/communicator/impl/gui/main/chat/menus/FileMenu.java
index f188fc0..260734b 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/menus/FileMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/menus/FileMenu.java
@@ -15,6 +15,7 @@ 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.chatroomslist.*;
import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -57,7 +58,7 @@ public class FileMenu
this.setMnemonic(
GuiActivator.getResources().getI18nMnemonic("service.gui.FILE"));
- if (!ConfigurationManager.isGoToChatroomDisabled())
+ if (!ConfigurationUtils.isGoToChatroomDisabled())
{
this.add(myChatRoomsItem);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/menus/OptionsMenu.java b/src/net/java/sip/communicator/impl/gui/main/chat/menus/OptionsMenu.java
index 86cc8bf..9511adf 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/menus/OptionsMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/menus/OptionsMenu.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.utils.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
/**
* The <tt>OptionMenu</tt> is a menu in the chat window menu bar.
@@ -75,13 +76,13 @@ public class OptionsMenu
private void initValues()
{
this.viewToolBar.setSelected(
- ConfigurationManager.isChatToolbarVisible());
+ ConfigurationUtils.isChatToolbarVisible());
this.viewSmileys.setSelected(
- ConfigurationManager.isShowSmileys());
+ ConfigurationUtils.isShowSmileys());
this.chatSimpleTheme.setSelected(
- ConfigurationManager.isChatSimpleThemeEnabled());
+ ConfigurationUtils.isChatSimpleThemeEnabled());
}
/**
@@ -96,16 +97,16 @@ public class OptionsMenu
if (action.equals(ACTCMD_VIEW_TOOLBAR))
{
this.chatWindow.setToolbarVisible(viewToolBar.isSelected());
- ConfigurationManager
+ ConfigurationUtils
.setChatToolbarVisible(viewToolBar.isSelected());
}
else if (action.equals(ACTCMD_VIEW_SMILEYS))
{
- ConfigurationManager.setShowSmileys(viewSmileys.isSelected());
+ ConfigurationUtils.setShowSmileys(viewSmileys.isSelected());
}
else if (action.equals(ACTCMD_VIEW_SIMPLE_THEME))
{
- ConfigurationManager.setChatSimpleThemeEnabled(
+ ConfigurationUtils.setChatSimpleThemeEnabled(
chatSimpleTheme.isSelected());
List<ChatPanel> currentChats = chatWindow.getChats();
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 d8a4746..c3e5c91 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
@@ -30,6 +30,7 @@ import net.java.sip.communicator.service.protocol.ServerStoredDetails.FaxDetail;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.GenericDetail;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.PagerDetail;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.PhoneNumberDetail;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
import net.java.sip.communicator.util.swing.SwingWorker;
@@ -182,7 +183,7 @@ public class MainToolBar
// if we leave a chat room when we close the window
// there is no need for this button
- if(!ConfigurationManager.isLeaveChatRoomOnWindowCloseEnabled())
+ if(!ConfigurationUtils.isLeaveChatRoomOnWindowCloseEnabled())
this.add(leaveChatRoomButton);
this.add(callButton);
@@ -215,7 +216,7 @@ public class MainToolBar
this.addSeparator();
- if(ConfigurationManager.isFontSupportEnabled())
+ if(ConfigurationUtils.isFontSupportEnabled())
{
this.add(fontButton);
fontButton.setName("font");
@@ -444,11 +445,11 @@ public class MainToolBar
{
SipCommFileChooser scfc = GenericFileDialog.create(
null, "Send file...", SipCommFileChooser.LOAD_FILE_OPERATION,
- ConfigurationManager.getSendFileLastDir());
+ ConfigurationUtils.getSendFileLastDir());
File selectedFile = scfc.getFileFromDialog();
if(selectedFile != null)
{
- ConfigurationManager.setSendFileLastDir(
+ ConfigurationUtils.setSendFileLastDir(
selectedFile.getParent());
chatContainer.getCurrentChat().sendFile(selectedFile);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomList.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomList.java
index 4ef442d..9cee780 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomList.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomList.java
@@ -10,7 +10,6 @@ import java.util.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.chat.conference.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@@ -213,7 +212,7 @@ public class ChatRoomList
if (chatRoomWrapper.isPersistent())
{
- ConfigurationManager.saveChatRoom(
+ ConfigurationUtils.saveChatRoom(
chatRoomProvider.getProtocolProvider(),
chatRoomWrapper.getChatRoomID(),
chatRoomWrapper.getChatRoomID(),
@@ -237,7 +236,7 @@ public class ChatRoomList
if (chatRoomWrapper.isPersistent())
{
- ConfigurationManager.saveChatRoom(
+ ConfigurationUtils.saveChatRoom(
chatRoomProvider.getProtocolProvider(),
chatRoomWrapper.getChatRoomID(),
null, // The new identifier.
diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java
index 3bcba30..e6cc86b 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomRightButtonMenu.java
@@ -19,6 +19,7 @@ import net.java.sip.communicator.impl.gui.main.chatroomslist.joinforms.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.resources.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
import org.jitsi.service.resources.*;
@@ -117,7 +118,7 @@ public class ChatRoomRightButtonMenu
String nickName = null;
nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
@@ -138,7 +139,7 @@ public class ChatRoomRightButtonMenu
String nickName = null;
nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
@@ -166,15 +167,15 @@ public class ChatRoomRightButtonMenu
"",
false,
true);
-
+
String nickName = null;
-
+
nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
-
+
if(nickName == null)
nickName = getNickname();
@@ -202,13 +203,13 @@ public class ChatRoomRightButtonMenu
else if(itemName.equals("nickNameChatRoom"))
{
String nickName = null;
-
+
nickName =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
-
+
ChatOperationReasonDialog reasonDialog =
new ChatOperationReasonDialog(GuiActivator.getResources()
.getI18NString("service.gui.CHANGE_NICKNAME"), GuiActivator
@@ -225,11 +226,10 @@ public class ChatRoomRightButtonMenu
{
nickName = reasonDialog.getReason().trim();
}
-
- ConfigurationManager.updateChatRoomProperty(chatRoomWrapper
+
+ ConfigurationUtils.updateChatRoomProperty(chatRoomWrapper
.getParentProvider().getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName", nickName);
-
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
index 7ea29eb..a6c2bc5 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
@@ -19,8 +19,8 @@ import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.*;
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.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
import org.jitsi.util.*;
@@ -363,7 +363,7 @@ public class ChatRoomTableDialog
{
nickName = reasonDialog.getReason().trim();
- ConfigurationManager.updateChatRoomProperty(
+ ConfigurationUtils.updateChatRoomProperty(
getSelectedProvider().getProtocolProvider(),
chatRoomWrapper.getChatRoomID(), "userNickName", nickName);
}
@@ -410,7 +410,7 @@ public class ChatRoomTableDialog
{
nickName = reasonDialog.getReason().trim();
- ConfigurationManager.updateChatRoomProperty(
+ ConfigurationUtils.updateChatRoomProperty(
getSelectedProvider().getProtocolProvider(),
chatRoomWrapper.getChatRoomID(), "userNickName",
nickName);
@@ -434,7 +434,7 @@ public class ChatRoomTableDialog
if (!selectedRoom.getChatRoom().isJoined())
{
String savedNick =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
selectedRoom.getParentProvider()
.getProtocolProvider(), selectedRoom
.getChatRoomID(), "userNickName");
@@ -461,7 +461,7 @@ public class ChatRoomTableDialog
true);
String savedNick =
- ConfigurationManager.getChatRoomProperty(
+ ConfigurationUtils.getChatRoomProperty(
chatRoomWrapper.getParentProvider()
.getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
@@ -486,12 +486,12 @@ public class ChatRoomTableDialog
{
nickName = reasonDialog.getReason().trim();
- ConfigurationManager.updateChatRoomProperty(
+ ConfigurationUtils.updateChatRoomProperty(
getSelectedProvider().getProtocolProvider(),
chatRoomWrapper.getChatRoomID(),
"userNickName", nickName);
}
-
+
GuiActivator.getUIService().getConferenceChatManager()
.joinChatRoom(chatRoomWrapper,nickName,null);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableUI.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableUI.java
index fba6560..9d9cbd8 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableUI.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableUI.java
@@ -20,6 +20,7 @@ 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.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
/**
@@ -170,7 +171,7 @@ public class ChatRoomTableUI
}
String savedNick =
- ConfigurationManager.getChatRoomProperty(chatRoomWrapper
+ ConfigurationUtils.getChatRoomProperty(chatRoomWrapper
.getParentProvider().getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName");
@@ -192,7 +193,7 @@ public class ChatRoomTableUI
{
nickName = reasonDialog.getReason().trim();
- ConfigurationManager.updateChatRoomProperty(chatRoomWrapper
+ ConfigurationUtils.updateChatRoomProperty(chatRoomWrapper
.getParentProvider().getProtocolProvider(), chatRoomWrapper
.getChatRoomID(), "userNickName", nickName);
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java
index d6bd128..e0a8979 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/AddContactDialog.java
@@ -165,7 +165,7 @@ public class AddContactDialog
// we have an empty choice and one account
if(accountCombo.getItemCount() > 2
|| (accountCombo.getItemCount() == 2
- && !ConfigurationManager
+ && !ConfigurationUtils
.isHideAccountSelectionWhenPossibleEnabled()))
{
labelsPanel.add(accountLabel);
@@ -213,7 +213,7 @@ public class AddContactDialog
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
- if(ConfigurationManager.isHideAccountSelectionWhenPossibleEnabled())
+ if(ConfigurationUtils.isHideAccountSelectionWhenPossibleEnabled())
this.setPreferredSize(new Dimension(450, 205));
else
this.setPreferredSize(new Dimension(450, 250));
@@ -327,7 +327,7 @@ public class AddContactDialog
final String newGroupString = GuiActivator.getResources()
.getI18NString("service.gui.CREATE_GROUP");
- if (!ConfigurationManager.isCreateGroupDisabled())
+ if (!ConfigurationUtils.isCreateGroupDisabled())
{
groupCombo.addItem(newGroupString);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/CommonRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/CommonRightButtonMenu.java
index a2cdbbd..f2cf1f0 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/CommonRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/CommonRightButtonMenu.java
@@ -14,6 +14,7 @@ import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.main.contactlist.addgroup.*;
import net.java.sip.communicator.impl.gui.utils.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -48,10 +49,10 @@ public class CommonRightButtonMenu
{
this.mainFrame = mainFrame;
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
this.add(addContactItem);
- if (!ConfigurationManager.isCreateGroupDisabled())
+ if (!ConfigurationUtils.isCreateGroupDisabled())
this.add(createGroupItem);
this.addContactItem.setMnemonic(GuiActivator.getResources()
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListModel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListModel.java
index 6763353..1ecdb50 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListModel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListModel.java
@@ -10,9 +10,9 @@ import java.util.*;
import javax.swing.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
/**
* Implements <tt>ListModel</tt> for <tt>MetaContactListService</tt> in order to
@@ -383,7 +383,7 @@ public class ContactListModel
this.closedGroups.add(group);
- ConfigurationManager.setContactListGroupCollapsed(
+ ConfigurationUtils.setContactListGroupCollapsed(
group.getMetaUID(),
true);
}
@@ -402,7 +402,7 @@ public class ContactListModel
contentAdded(this.indexOf(group.getMetaContact(0)), this.indexOf(group
.getMetaContact(countContactsAndSubgroups(group) - 1)));
- ConfigurationManager.setContactListGroupCollapsed(
+ ConfigurationUtils.setContactListGroupCollapsed(
group.getMetaUID(),
false);
}
@@ -516,7 +516,7 @@ public class ContactListModel
private void initGroupsStatus(MetaContactGroup group)
{
- boolean isClosed = ConfigurationManager
+ boolean isClosed = ConfigurationUtils
.isContactListGroupCollapsed(group.getMetaUID());
if (isClosed)
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java
index 430b485..594b742 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java
@@ -842,7 +842,7 @@ public class ContactListTreeCellRenderer
OperationSetVideoTelephony.class);
if (videoContact != null
- || (ConfigurationManager
+ || (ConfigurationUtils
.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& hasPhone
&& GuiActivator.getOpSetRegisteredProviders(
@@ -858,7 +858,7 @@ public class ContactListTreeCellRenderer
OperationSetDesktopSharingServer.class);
if (desktopContact != null
- || (ConfigurationManager
+ || (ConfigurationUtils
.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& hasPhone
&& GuiActivator.getOpSetRegisteredProviders(
@@ -870,7 +870,7 @@ public class ContactListTreeCellRenderer
}
if (uiContact.getDescriptor() instanceof SourceContact
- && !ConfigurationManager.isAddContactDisabled())
+ && !ConfigurationUtils.isAddContactDisabled())
{
x += addButton(addContactButton, ++gridX, x, false);
}
@@ -1113,7 +1113,7 @@ public class ContactListTreeCellRenderer
= contactDescriptor.getContactDetailsForOperationSet(
OperationSetVideoTelephony.class);
- if(ConfigurationManager.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
+ if(ConfigurationUtils.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& contactDescriptor.getDescriptor() instanceof MetaContact)
{
videoContacts.addAll(CallManager.getAdditionalNumbers(
@@ -1230,7 +1230,7 @@ public class ContactListTreeCellRenderer
= contactDescriptor.getContactDetailsForOperationSet(
OperationSetDesktopSharingServer.class);
- if(ConfigurationManager.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
+ if(ConfigurationUtils.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& contactDescriptor.getDescriptor() instanceof MetaContact)
{
desktopContacts.addAll(CallManager.getAdditionalNumbers(
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java
index 8c45425..6512a97 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/GroupRightButtonMenu.java
@@ -66,7 +66,7 @@ public class GroupRightButtonMenu
this.group = group;
this.mainFrame = mainFrame;
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
this.add(addContactItem);
this.addSeparator();
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactListManager.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactListManager.java
index eb074c5..cc6859a 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactListManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactListManager.java
@@ -13,6 +13,7 @@ import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
/**
@@ -140,7 +141,7 @@ public class MetaContactListManager
@SuppressWarnings("fallthrough") //intentional
public void run()
{
- if (!ConfigurationManager.isMoveContactConfirmationRequested())
+ if (!ConfigurationUtils.isMoveContactConfirmationRequested())
{
// we move the specified contact
GuiActivator.getContactListService()
@@ -165,7 +166,7 @@ public class MetaContactListManager
switch (dialog.showDialog())
{
case MessageDialog.OK_DONT_ASK_CODE:
- ConfigurationManager.setMoveContactConfirmationRequested(false);
+ ConfigurationUtils.setMoveContactConfirmationRequested(false);
// do fall through
case MessageDialog.OK_RETURN_CODE:
@@ -196,7 +197,7 @@ public class MetaContactListManager
@SuppressWarnings("fallthrough") //intentional
public void run()
{
- if (!ConfigurationManager.isMoveContactConfirmationRequested())
+ if (!ConfigurationUtils.isMoveContactConfirmationRequested())
{
// We move all subcontacts of the source MetaContact to the
// destination MetaContact.
@@ -221,7 +222,7 @@ public class MetaContactListManager
switch (dialog.showDialog())
{
case MessageDialog.OK_DONT_ASK_CODE:
- ConfigurationManager.setMoveContactConfirmationRequested(false);
+ ConfigurationUtils.setMoveContactConfirmationRequested(false);
// do fall through
case MessageDialog.OK_RETURN_CODE:
@@ -266,7 +267,7 @@ public class MetaContactListManager
public void run()
{
- if (!ConfigurationManager.isMoveContactConfirmationRequested())
+ if (!ConfigurationUtils.isMoveContactConfirmationRequested())
{
// we move the specified contact
GuiActivator.getContactListService()
@@ -291,7 +292,7 @@ public class MetaContactListManager
switch (dialog.showDialog())
{
case MessageDialog.OK_DONT_ASK_CODE:
- ConfigurationManager.setMoveContactConfirmationRequested(false);
+ ConfigurationUtils.setMoveContactConfirmationRequested(false);
// do fall through
case MessageDialog.OK_RETURN_CODE:
@@ -323,7 +324,7 @@ public class MetaContactListManager
@SuppressWarnings("fallthrough")
public void run()
{
- if (!ConfigurationManager.isMoveContactConfirmationRequested())
+ if (!ConfigurationUtils.isMoveContactConfirmationRequested())
{
// we move the specified contact
try
@@ -355,7 +356,7 @@ public class MetaContactListManager
switch (dialog.showDialog())
{
case MessageDialog.OK_DONT_ASK_CODE:
- ConfigurationManager.setMoveContactConfirmationRequested(false);
+ ConfigurationUtils.setMoveContactConfirmationRequested(false);
// do fall through
case MessageDialog.OK_RETURN_CODE:
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java
index bd720ba..0902cf4 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/MetaContactRightButtonMenu.java
@@ -469,7 +469,7 @@ public class MetaContactRightButtonMenu
}
routingForVideoEnabled =
- ConfigurationManager
+ ConfigurationUtils
.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& phones.size() > 0
&& GuiActivator.getOpSetRegisteredProviders(
@@ -477,7 +477,7 @@ public class MetaContactRightButtonMenu
null,
null).size() > 0;
routingForDesktopEnabled =
- ConfigurationManager
+ ConfigurationUtils
.isRouteVideoAndDesktopUsingPhoneNumberEnabled()
&& phones.size() > 0
&& GuiActivator.getOpSetRegisteredProviders(
@@ -485,7 +485,6 @@ public class MetaContactRightButtonMenu
null,
null).size() > 0;
-
// add all the contacts that support telephony to the call menu
if (metaContact.getContactCount() > 1 || phones.size() > 0)
{
@@ -655,12 +654,12 @@ public class MetaContactRightButtonMenu
addSeparator();
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
add(addContactItem);
addSeparator();
- if (!ConfigurationManager.isRemoveContactDisabled())
+ if (!ConfigurationUtils.isRemoveContactDisabled())
add(removeContactMenu);
add(renameContactItem);
@@ -931,11 +930,11 @@ public class MetaContactRightButtonMenu
SipCommFileChooser scfc = GenericFileDialog.create(
null, "Send file...",
SipCommFileChooser.LOAD_FILE_OPERATION,
- ConfigurationManager.getSendFileLastDir());
+ ConfigurationUtils.getSendFileLastDir());
File selectedFile = scfc.getFileFromDialog();
if(selectedFile != null)
{
- ConfigurationManager.setSendFileLastDir(
+ ConfigurationUtils.setSendFileLastDir(
selectedFile.getParent());
// Obtain the corresponding chat panel.
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/PresenceFilter.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/PresenceFilter.java
index 133f82b..b934ce8 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/PresenceFilter.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/PresenceFilter.java
@@ -10,7 +10,6 @@ import java.util.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.contactlist.contactsource.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.event.*;
@@ -44,7 +43,7 @@ public class PresenceFilter
*/
public PresenceFilter()
{
- isShowOffline = ConfigurationManager.isShowOffline();
+ isShowOffline = ConfigurationUtils.isShowOffline();
}
/**
@@ -117,7 +116,7 @@ public class PresenceFilter
{
this.isShowOffline = isShowOffline;
- ConfigurationManager.setShowOffline(isShowOffline);
+ ConfigurationUtils.setShowOffline(isShowOffline);
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java
index 1aa3e44..6a4f4d0 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/SourceContactRightButtonMenu.java
@@ -19,6 +19,7 @@ import net.java.sip.communicator.impl.gui.main.contactlist.contactsource.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactsource.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -79,7 +80,7 @@ public class SourceContactRightButtonMenu
add(initCallMenu());
// Only create the menu if the add contact functionality is enabled.
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
{
addContactComponent
= TreeContactList.createAddContactMenu(sourceContact);
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
index c3501bd..c401f26 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
@@ -1314,7 +1314,7 @@ public class TreeContactList
GroupNode groupNode = (GroupNode) collapsedNode;
String id = groupNode.getGroupDescriptor().getId();
if (id != null)
- ConfigurationManager
+ ConfigurationUtils
.setContactListGroupCollapsed(id, true);
}
}
@@ -1336,7 +1336,7 @@ public class TreeContactList
GroupNode groupNode = (GroupNode) collapsedNode;
String id = groupNode.getGroupDescriptor().getId();
if (id != null)
- ConfigurationManager
+ ConfigurationUtils
.setContactListGroupCollapsed(id, false);
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/UnknownContactPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/UnknownContactPanel.java
index 38ce960..ce9e360 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/UnknownContactPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/UnknownContactPanel.java
@@ -16,8 +16,8 @@ import javax.swing.text.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.main.call.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
import net.java.sip.communicator.util.swing.event.*;
@@ -71,7 +71,7 @@ public class UnknownContactPanel
this.add(mainPanel, BorderLayout.NORTH);
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
{
initAddContactButton();
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java
index b0bf17d..3c8bccc 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIContact.java
@@ -443,7 +443,7 @@ public class MetaUIContact
&& protocolContact.getStatusMessage().length() > 0)
statusMessage = protocolContact.getStatusMessage();
- if(ConfigurationManager.isHideAccountStatusSelectorsEnabled())
+ if(ConfigurationUtils.isHideAccountStatusSelectorsEnabled())
break;
ImageIcon protocolStatusIcon
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIGroup.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIGroup.java
index 2824d84..54f3404 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIGroup.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/contactsource/MetaUIGroup.java
@@ -10,9 +10,9 @@ import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
-import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.util.*;
/**
* The <tt>MetaUIGroup</tt> is the implementation of the UIGroup for the
@@ -88,7 +88,7 @@ public class MetaUIGroup
*/
public boolean isGroupCollapsed()
{
- return ConfigurationManager
+ return ConfigurationUtils
.isContactListGroupCollapsed(metaGroup.getMetaUID());
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/AutoAnswerMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/AutoAnswerMenu.java
index d701c38..5967877 100644
--- a/src/net/java/sip/communicator/impl/gui/main/menus/AutoAnswerMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/menus/AutoAnswerMenu.java
@@ -84,7 +84,7 @@ public class AutoAnswerMenu
// if we are in disabled menu mode and we have only one item
// change its name (like global auto answer)
- if( ConfigurationManager.isAutoAnswerDisableSubmenu()
+ if( ConfigurationUtils.isAutoAnswerDisableSubmenu()
&& getAutoAnswerItemCount(parentMenu) == 1)
{
updateItem(getAutoAnswerItem(parentMenu, 0), true);
@@ -162,7 +162,7 @@ public class AutoAnswerMenu
int itemsCount = getAutoAnswerItemCount(parentMenu);
// if menu is disabled for autoanswer and we have added an item
- if(ConfigurationManager.isAutoAnswerDisableSubmenu()
+ if(ConfigurationUtils.isAutoAnswerDisableSubmenu()
&& itemsCount != initialCount)
{
// if initial count was 1, lets change provider name to the
@@ -359,7 +359,7 @@ public class AutoAnswerMenu
// if menu is disabled for auto answer and we have left with one
// item set its name like a global one
- if(ConfigurationManager.isAutoAnswerDisableSubmenu()
+ if(ConfigurationUtils.isAutoAnswerDisableSubmenu()
&& getAutoAnswerItemCount(parentMenu) == 1)
{
updateItem(getAutoAnswerItem(parentMenu, 0), true);
@@ -566,7 +566,7 @@ public class AutoAnswerMenu
private static String getItemDisplayName(
ProtocolProviderService provider)
{
- if(ConfigurationManager.isAutoAnswerDisableSubmenu())
+ if(ConfigurationUtils.isAutoAnswerDisableSubmenu())
return GuiActivator.getResources()
.getI18NString("service.gui.AUTO_ANSWER")
+ " - " + provider.getAccountID().getDisplayName();
@@ -912,7 +912,7 @@ public class AutoAnswerMenu
answerWithVideoCheckBox.isSelected());
// as settings changed lets update items
- if( ConfigurationManager.isAutoAnswerDisableSubmenu()
+ if( ConfigurationUtils.isAutoAnswerDisableSubmenu()
&& getAutoAnswerItemCount(parentMenu) == 1)
{
updateItem(getAutoAnswerItem(parentMenu, 0), true);
diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/FileMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/FileMenu.java
index ddf2145..657b619 100644
--- a/src/net/java/sip/communicator/impl/gui/main/menus/FileMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/menus/FileMenu.java
@@ -109,16 +109,16 @@ public class FileMenu
.getI18nMnemonic("service.gui.NEW_ACCOUNT"));
// add separator only if there are other items enabled
- if(!ConfigurationManager.isAddContactDisabled()
- || !ConfigurationManager.isCreateGroupDisabled()
- || !ConfigurationManager.isGoToChatroomDisabled())
+ if(!ConfigurationUtils.isAddContactDisabled()
+ || !ConfigurationUtils.isCreateGroupDisabled()
+ || !ConfigurationUtils.isGoToChatroomDisabled())
{
this.addSeparator();
endsWithSeparator = true;
}
}
- if (!ConfigurationManager.isAddContactDisabled())
+ if (!ConfigurationUtils.isAddContactDisabled())
{
addContactItem = new JMenuItem(
resources.getI18NString("service.gui.ADD_CONTACT") + "...");
@@ -134,8 +134,8 @@ public class FileMenu
// if next item is disabled add separator here
// only if there is something next
- if(ConfigurationManager.isCreateGroupDisabled()
- && !ConfigurationManager.isGoToChatroomDisabled())
+ if(ConfigurationUtils.isCreateGroupDisabled()
+ && !ConfigurationUtils.isGoToChatroomDisabled())
{
this.addSeparator();
endsWithSeparator = true;
@@ -144,19 +144,19 @@ public class FileMenu
endsWithSeparator = false;
}
- if (!ConfigurationManager.isCreateGroupDisabled())
+ if (!ConfigurationUtils.isCreateGroupDisabled())
{
this.add(createGroupItem);
// add separator if there is something next
- if(!ConfigurationManager.isGoToChatroomDisabled())
+ if(!ConfigurationUtils.isGoToChatroomDisabled())
{
this.addSeparator();
endsWithSeparator = true;
}
}
- if (!ConfigurationManager.isGoToChatroomDisabled())
+ if (!ConfigurationUtils.isGoToChatroomDisabled())
{
this.add(myChatRoomsItem);
endsWithSeparator = false;
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 67d5374..83f48aa 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
@@ -26,6 +26,7 @@ import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.Container;
import net.java.sip.communicator.service.notification.*;
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
@@ -205,7 +206,7 @@ public class ToolsMenu
}
else if (itemName.equals("showHideOffline"))
{
- boolean isShowOffline = ConfigurationManager.isShowOffline();
+ boolean isShowOffline = ConfigurationUtils.isShowOffline();
TreeContactList.presenceFilter.setShowOffline(!isShowOffline);
@@ -346,7 +347,7 @@ public class ToolsMenu
if(!cfg.getBoolean(AUTO_ANSWER_MENU_DISABLED_PROP, false))
{
- if(ConfigurationManager.isAutoAnswerDisableSubmenu())
+ if(ConfigurationUtils.isAutoAnswerDisableSubmenu())
{
this.addSeparator();
AutoAnswerMenu.registerMenuItems(this);
@@ -361,7 +362,7 @@ public class ToolsMenu
this.addSeparator();
// Show/hide offline contacts menu item.
- String offlineTextKey = ConfigurationManager.isShowOffline()
+ String offlineTextKey = ConfigurationUtils.isShowOffline()
? "service.gui.HIDE_OFFLINE_CONTACTS"
: "service.gui.SHOW_OFFLINE_CONTACTS";
diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java
index 68b2587..902d294 100644
--- a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java
@@ -652,7 +652,7 @@ public class AccountStatusPanel
*/
public String getUIClassID()
{
- if(ConfigurationManager.isTransparentWindowEnabled())
+ if(ConfigurationUtils.isTransparentWindowEnabled())
return uiClassID;
else
return super.getUIClassID();
diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
index 5632217..3dab776 100644
--- a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
+++ b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
@@ -22,8 +22,6 @@ import net.java.sip.communicator.service.systray.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
-import org.jitsi.service.configuration.*;
-
/**
* The <tt>GlobalStatusSelectorBox</tt> is a global status selector box, which
* appears in the status panel, when the user has more than one account. It
@@ -124,7 +122,7 @@ public class GlobalStatusSelectorBox
offlineStatus = status;
}
- if(!ConfigurationManager.isHideAccountStatusSelectorsEnabled())
+ if(!ConfigurationUtils.isHideAccountStatusSelectorsEnabled())
this.addSeparator();
this.setFont(titleLabel.getFont().deriveFont(Font.PLAIN, 11f));
@@ -187,7 +185,7 @@ public class GlobalStatusSelectorBox
? new PresenceStatusMenu(protocolProvider)
: new SimpleStatusMenu(protocolProvider);
- if(ConfigurationManager.isHideAccountStatusSelectorsEnabled())
+ if(ConfigurationUtils.isHideAccountStatusSelectorsEnabled())
statusSelectorMenu.setVisible(false);
// If this is the first account in our menu.
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/ConfigurationManager.java b/src/net/java/sip/communicator/plugin/generalconfig/ConfigurationManager.java
deleted file mode 100644
index 847a13a..0000000
--- a/src/net/java/sip/communicator/plugin/generalconfig/ConfigurationManager.java
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
- * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package net.java.sip.communicator.plugin.generalconfig;
-
-import java.io.*;
-import java.util.*;
-
-import javax.net.ssl.*;
-
-import net.java.sip.communicator.service.protocol.*;
-import net.java.sip.communicator.service.resources.*;
-import net.java.sip.communicator.util.Logger;
-
-import org.jitsi.service.configuration.*;
-import org.jitsi.service.resources.*;
-import org.jitsi.util.*;
-
-public class ConfigurationManager
-{
- private static final Logger logger
- = Logger.getLogger(ConfigurationManager.class);
-
- public static final String ENTER_COMMAND = "Enter";
-
- public static final String CTRL_ENTER_COMMAND = "Ctrl-Enter";
-
- /**
- * Indicates whether the message automatic popup is enabled.
- */
- private static boolean autoPopupNewMessage;
-
- private static String sendMessageCommand;
-
- private static boolean isSendTypingNotifications;
-
- private static boolean isMultiChatWindowEnabled;
-
- private static boolean isLeaveChatRoomOnWindowCloseEnabled;
-
- private static boolean isHistoryLoggingEnabled;
-
- private static boolean isHistoryShown;
-
- private static int chatHistorySize;
-
- private static int windowTransparency;
-
- private static boolean isTransparentWindowEnabled;
-
- /**
- * Indicates if phone numbers should be normalized before dialed.
- */
- private static boolean isNormalizePhoneNumber;
-
- /**
- * Indicates if a string containing alphabetical characters might be
- * considered as a phone number.
- */
- private static boolean acceptPhoneNumberWithAlphaChars;
-
- private static ConfigurationService configService
- = GeneralConfigPluginActivator.getConfigurationService();
-
- /**
- *
- */
- public static void loadGuiConfigurations()
- {
- // Load the "auPopupNewMessage" property.
- String autoPopupProperty =
- "service.gui.AUTO_POPUP_NEW_MESSAGE";
-
- String autoPopup = configService.getString(autoPopupProperty);
-
- if(autoPopup == null)
- autoPopup = Resources.getSettingsString(autoPopupProperty);
-
- if(autoPopup != null && autoPopup.equalsIgnoreCase("yes"))
- autoPopupNewMessage = true;
-
- // Load the "sendMessageCommand" property.
- String messageCommandProperty =
- "service.gui.SEND_MESSAGE_COMMAND";
- String messageCommand = configService.getString(messageCommandProperty);
-
- if(messageCommand == null)
- messageCommand =
- Resources.getSettingsString(messageCommandProperty);
-
- if(messageCommand != null && messageCommand.length() > 0)
- {
- sendMessageCommand = messageCommand;
- }
-
- // Load the "sendTypingNotifications" property.
- String isSendTypingNotifProperty =
- "service.gui.SEND_TYPING_NOTIFICATIONS_ENABLED";
- String isSendTypingNotif =
- configService.getString(isSendTypingNotifProperty);
-
- if(isSendTypingNotif == null)
- isSendTypingNotif =
- Resources.getSettingsString(isSendTypingNotifProperty);
-
- if(isSendTypingNotif != null && isSendTypingNotif.length() > 0)
- {
- isSendTypingNotifications
- = new Boolean(isSendTypingNotif).booleanValue();
- }
-
- // Load the "isLeaveChatroomOnWindowCloseEnabled" property.
- String isLeaveChatRoomOnWindowCloseEnabledStringProperty
- = "service.gui.LEAVE_CHATROOM_ON_WINDOW_CLOSE";
-
- String isLeaveChatRoomOnWindowCloseEnabledString
- = configService.getString(isLeaveChatRoomOnWindowCloseEnabledStringProperty);
-
- if(isLeaveChatRoomOnWindowCloseEnabledString == null)
- isLeaveChatRoomOnWindowCloseEnabledString =
- Resources.
- getSettingsString(isLeaveChatRoomOnWindowCloseEnabledStringProperty);
-
- if(isLeaveChatRoomOnWindowCloseEnabledString != null
- && isLeaveChatRoomOnWindowCloseEnabledString.length() > 0)
- {
- isLeaveChatRoomOnWindowCloseEnabled
- = new Boolean(isLeaveChatRoomOnWindowCloseEnabledString)
- .booleanValue();
- }
-
- // Load the "isMultiChatWindowEnabled" property.
- String isMultiChatWindowEnabledStringProperty
- = "service.gui.IS_MULTI_CHAT_WINDOW_ENABLED";
-
- String isMultiChatWindowEnabledString
- = configService.getString(isMultiChatWindowEnabledStringProperty);
-
- if(isMultiChatWindowEnabledString == null)
- isMultiChatWindowEnabledString =
- Resources.
- getSettingsString(isMultiChatWindowEnabledStringProperty);
-
- if(isMultiChatWindowEnabledString != null
- && isMultiChatWindowEnabledString.length() > 0)
- {
- isMultiChatWindowEnabled
- = new Boolean(isMultiChatWindowEnabledString)
- .booleanValue();
- }
-
- // Load the "isHistoryLoggingEnabled" property.
- String isHistoryLoggingEnabledPropertyString =
- "impl.msghistory.IS_MESSAGE_HISTORY_ENABLED";
-
- String isHistoryLoggingEnabledString
- = configService.getString(
- isHistoryLoggingEnabledPropertyString);
-
- if(isHistoryLoggingEnabledString == null)
- isHistoryLoggingEnabledString =
- Resources.
- getSettingsString(isHistoryLoggingEnabledPropertyString);
-
- if(isHistoryLoggingEnabledString != null
- && isHistoryLoggingEnabledString.length() > 0)
- {
- isHistoryLoggingEnabled
- = new Boolean(isHistoryLoggingEnabledString)
- .booleanValue();
- }
-
- // Load the "isHistoryShown" property.
- String isHistoryShownStringProperty =
- "service.gui.IS_MESSAGE_HISTORY_SHOWN";
-
- String isHistoryShownString
- = configService.getString(isHistoryShownStringProperty);
-
- if(isHistoryShownString == null)
- isHistoryShownString =
- Resources.getSettingsString(isHistoryShownStringProperty);
-
- if(isHistoryShownString != null
- && isHistoryShownString.length() > 0)
- {
- isHistoryShown
- = new Boolean(isHistoryShownString)
- .booleanValue();
- }
-
- // Load the "chatHistorySize" property.
- String chatHistorySizeStringProperty =
- "service.gui.MESSAGE_HISTORY_SIZE";
- String chatHistorySizeString
- = configService.getString(chatHistorySizeStringProperty);
-
- if(chatHistorySizeString == null)
- chatHistorySizeString =
- Resources.getSettingsString(chatHistorySizeStringProperty);
-
- if(chatHistorySizeString != null
- && chatHistorySizeString.length() > 0)
- {
- chatHistorySize
- = Integer.parseInt(chatHistorySizeString);
- }
-
- // Load the "isTransparentWindowEnabled" property.
- String isTransparentWindowEnabledProperty =
- "impl.gui.IS_TRANSPARENT_WINDOW_ENABLED";
-
- String isTransparentWindowEnabledString
- = configService.getString(isTransparentWindowEnabledProperty);
-
- if(isTransparentWindowEnabledString == null)
- isTransparentWindowEnabledString =
- Resources.getSettingsString(isTransparentWindowEnabledProperty);
-
- if(isTransparentWindowEnabledString != null
- && isTransparentWindowEnabledString.length() > 0)
- {
- isTransparentWindowEnabled
- = new Boolean(isTransparentWindowEnabledString).booleanValue();
- }
-
- // Load the "windowTransparency" property.
- String windowTransparencyProperty =
- "impl.gui.WINDOW_TRANSPARENCY";
-
- String windowTransparencyString
- = configService.getString(windowTransparencyProperty);
-
- if(windowTransparencyString == null)
- windowTransparencyString =
- Resources.getSettingsString(windowTransparencyProperty);
-
- if(windowTransparencyString != null
- && windowTransparencyString.length() > 0)
- {
- windowTransparency
- = Integer.parseInt(windowTransparencyString);
- }
-
- // Load the "NORMALIZE_PHONE_NUMBER" property.
- String normalizePhoneNumberProperty =
- "impl.gui.NORMALIZE_PHONE_NUMBER";
-
- isNormalizePhoneNumber
- = configService.getBoolean(normalizePhoneNumberProperty, true);
-
- // Load the "ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS" property.
- String acceptPhoneNumberWithAlphaCharsProperty =
- "impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS";
-
- acceptPhoneNumberWithAlphaChars
- = configService.getBoolean(
- acceptPhoneNumberWithAlphaCharsProperty,
- true);
- }
-
- /**
- * Return TRUE if "autoPopupNewMessage" property is true, otherwise - return
- * FALSE. Indicates to the user interface whether new messages should be
- * opened and bring to front.
- * @return TRUE if "autoPopupNewMessage" property is true, otherwise - return
- * FALSE.
- */
- public static boolean isAutoPopupNewMessage()
- {
- return autoPopupNewMessage;
- }
-
- /**
- * Return TRUE if "sendTypingNotifications" property is true, otherwise -
- * return FALSE. Indicates to the user interface whether typing
- * notifications are enabled or disabled.
- * @return TRUE if "sendTypingNotifications" property is true, otherwise -
- * return FALSE.
- */
- public static boolean isSendTypingNotifications()
- {
- return isSendTypingNotifications;
- }
-
- /**
- * Returns <code>true</code> if the "isMultiChatWindowEnabled" property is
- * true, otherwise - returns <code>false</code>. Indicates to the user
- * interface whether the chat window could contain multiple chats or just
- * one chat.
- * @return <code>true</code> if the "isMultiChatWindowEnabled" property is
- * true, otherwise - returns <code>false</code>.
- */
- public static boolean isMultiChatWindowEnabled()
- {
- return isMultiChatWindowEnabled;
- }
-
- /**
- * Returns <code>true</code> if the "isLeaveChatRoomOnWindowCloseEnabled"
- * property is true, otherwise - returns <code>false</code>. Indicates to
- * the user interface whether when closing the chat window we would leave
- * the chat room.
- * @return <code>true</code> if the "isLeaveChatRoomOnWindowCloseEnabled"
- * property is true, otherwise - returns <code>false</code>.
- */
- public static boolean isLeaveChatRoomOnWindowCloseEnabled()
- {
- return isLeaveChatRoomOnWindowCloseEnabled;
- }
-
- /**
- * Returns <code>true</code> if the "isHistoryLoggingEnabled" property is
- * true, otherwise - returns <code>false</code>. Indicates to the user
- * interface whether the history logging is enabled.
- * @return <code>true</code> if the "isHistoryLoggingEnabled" property is
- * true, otherwise - returns <code>false</code>.
- */
- public static boolean isHistoryLoggingEnabled()
- {
- return isHistoryLoggingEnabled;
- }
-
- /**
- * Returns <code>true</code> if the "isHistoryShown" property is
- * true, otherwise - returns <code>false</code>. Indicates to the user
- * whether the history is shown in the chat window.
- * @return <code>true</code> if the "isHistoryShown" property is
- * true, otherwise - returns <code>false</code>.
- */
- public static boolean isHistoryShown()
- {
- return isHistoryShown;
- }
-
- /**
- * Returns the number of messages from chat history that would be shown in
- * the chat window.
- * @return the number of messages from chat history that would be shown in
- * the chat window.
- */
- public static int getChatHistorySize()
- {
- return chatHistorySize;
- }
-
- /**
- * Return the "sendMessageCommand" property that was saved previously
- * through the <tt>ConfigurationService</tt>. Indicates to the user
- * interface whether the default send message command is Enter or CTRL-Enter.
- * @return "Enter" or "CTRL-Enter" message commands.
- */
- public static String getSendMessageCommand()
- {
- return sendMessageCommand;
- }
-
- /**
- * Gets the configuration handler which is currently in use.
- *
- * @return the configuration handler which is currently in use
- */
- public static String getPopupHandlerConfig()
- {
- return (String) configService.getProperty("systray.POPUP_HANDLER");
- }
-
- /**
- * Saves the popup handler choice made by the user.
- *
- * @param handler the handler which will be used
- */
- public static void setPopupHandlerConfig(String handler)
- {
- configService.setProperty("systray.POPUP_HANDLER", handler);
- }
-
- /**
- * Returns <code>true</code> if transparent windows are enabled,
- * <code>false</code> otherwise.
- *
- * @return <code>true</code> if transparent windows are enabled,
- * <code>false</code> otherwise.
- */
- public static boolean isTransparentWindowEnabled()
- {
- return isTransparentWindowEnabled;
- }
-
- public static void setTransparentWindowEnabled(
- boolean isTransparentWindowEnabled)
- {
- ConfigurationManager.isTransparentWindowEnabled =
- isTransparentWindowEnabled;
-
- configService.setProperty(
- "impl.gui.IS_TRANSPARENT_WINDOW_ENABLED",
- new Boolean(isTransparentWindowEnabled).toString());
- }
-
- /**
- * Returns <code>true</code> if phone numbers should be normalized,
- * <code>false</code> otherwise.
- *
- * @return <code>true</code> if phone numbers should be normalized,
- * <code>false</code> otherwise.
- */
- public static boolean isNormalizePhoneNumber()
- {
- return isNormalizePhoneNumber;
- }
-
- /**
- * Updates the "NORMALIZE_PHONE_NUMBER" property.
- *
- * @param isNormalize indicates to the user interface whether all dialed
- * phone numbers should be normalized
- */
- public static void setNormalizePhoneNumber(boolean isNormalize)
- {
- ConfigurationManager.isNormalizePhoneNumber = isNormalize;
-
- configService.setProperty("impl.gui.NORMALIZE_PHONE_NUMBER",
- Boolean.toString(isNormalize));
- }
-
- /**
- * Returns <code>true</code> if a string with a alphabetical character migth
- * be considered as a phone number. <code>false</code> otherwise.
- *
- * @return <code>true</code> if a string with a alphabetical character migth
- * be considered as a phone number. <code>false</code> otherwise.
- */
- public static boolean acceptPhoneNumberWithAlphaChars()
- {
- return acceptPhoneNumberWithAlphaChars;
- }
-
- /**
- * Updates the "ACCEPT_PHONE_NUMBER_WITH_CHARS" property.
- *
- * @param accepPhoneNumberWithAlphaChars indicates to the user interface
- * whether a string with alphabetical characters might be accepted as a
- * phone number.
- */
- public static void setAcceptPhoneNumberWithAlphaChars(
- boolean acceptPhoneNumberWithAlphaChars)
- {
- ConfigurationManager.acceptPhoneNumberWithAlphaChars
- = acceptPhoneNumberWithAlphaChars;
-
- configService.setProperty(
- "impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS",
- Boolean.toString(acceptPhoneNumberWithAlphaChars));
- }
-
- /**
- * Returns the transparency value for all transparent windows.
- *
- * @return the transparency value for all transparent windows.
- */
- public static int getWindowTransparency()
- {
- return windowTransparency;
- }
-
- /**
- * Updates the "WINDOW_TRANSPARENCY" property.
- *
- * @param windowTransparency indicates to the user interface what is the
- * window transparency value
- **/
- public static void setWindowTransparency(int windowTransparency)
- {
- ConfigurationManager.windowTransparency = windowTransparency;
-
- configService.setProperty(
- "impl.gui.WINDOW_TRANSPARENCY",
- Integer.toString(windowTransparency));
- }
-
- /**
- * Updates the "autoPopupNewMessage" property.
- *
- * @param autoPopupNewMessage indicates to the user interface whether new
- * messages should be opened and bring to front.
- **/
- public static void setAutoPopupNewMessage(boolean autoPopupNewMessage)
- {
- ConfigurationManager.autoPopupNewMessage = autoPopupNewMessage;
-
- if(autoPopupNewMessage)
- configService.setProperty(
- "service.gui.AUTO_POPUP_NEW_MESSAGE",
- "yes");
- else
- configService.setProperty(
- "service.gui.AUTO_POPUP_NEW_MESSAGE",
- "no");
- }
-
- /**
- * Updates the "sendTypingNotifications" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param isSendTypingNotif <code>true</code> to indicate that typing
- * notifications are enabled, <code>false</code> otherwise.
- */
- public static void setSendTypingNotifications(boolean isSendTypingNotif)
- {
- isSendTypingNotifications = isSendTypingNotif;
-
- configService.setProperty(
- "service.gui.SEND_TYPING_NOTIFICATIONS_ENABLED",
- Boolean.toString(isSendTypingNotif));
- }
-
- /**
- * Updates the "sendMessageCommand" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param newMessageCommand the command used to send a message ( it could be
- * ENTER_COMMAND or CTRL_ENTER_COMMAND)
- */
- public static void setSendMessageCommand(String newMessageCommand)
- {
- sendMessageCommand = newMessageCommand;
-
- configService.setProperty(
- "service.gui.SEND_MESSAGE_COMMAND",
- newMessageCommand);
- }
-
- /**
- * Updates the "isMultiChatWindowEnabled" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param isMultiChatWindowEnabled indicates if the chat window could
- * contain multiple chats or only one chat.
- */
- public static void setMultiChatWindowEnabled(
- boolean isMultiChatWindowEnabled)
- {
- ConfigurationManager.isMultiChatWindowEnabled = isMultiChatWindowEnabled;
-
- configService.setProperty(
- "service.gui.IS_MULTI_CHAT_WINDOW_ENABLED",
- Boolean.toString(isMultiChatWindowEnabled));
- }
-
- /**
- * Updates the "isLeaveChatroomOnWindowClose" property through
- * the <tt>ConfigurationService</tt>.
- *
- * @param isLeaveChatroomOnWindowClose indicates whether
- * to leave chat room on window close.
- */
- public static void setLeaveChatRoomOnWindowClose(
- boolean isLeaveChatroomOnWindowClose)
- {
- ConfigurationManager.isLeaveChatRoomOnWindowCloseEnabled
- = isLeaveChatroomOnWindowClose;
-
- configService.setProperty(
- "service.gui.LEAVE_CHATROOM_ON_WINDOW_CLOSE",
- Boolean.toString(isLeaveChatroomOnWindowClose));
- }
- /**
- * Updates the "isHistoryLoggingEnabled" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param isHistoryLoggingEnabled indicates if the history logging is
- * enabled.
- */
- public static void setHistoryLoggingEnabled(
- boolean isHistoryLoggingEnabled)
- {
- ConfigurationManager.isHistoryLoggingEnabled = isHistoryLoggingEnabled;
-
- configService.setProperty(
- "impl.msghistory.IS_MESSAGE_HISTORY_ENABLED",
- Boolean.toString(isHistoryLoggingEnabled));
- }
-
- /**
- * Updates the "isHistoryShown" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param isHistoryShown indicates if the message history is
- * shown
- */
- public static void setHistoryShown(boolean isHistoryShown)
- {
- ConfigurationManager.isHistoryShown = isHistoryShown;
-
- configService.setProperty(
- "service.gui.IS_MESSAGE_HISTORY_SHOWN",
- Boolean.toString(isHistoryShown));
- }
-
- /**
- * Updates the "chatHistorySize" property through the
- * <tt>ConfigurationService</tt>.
- *
- * @param historySize indicates if the history logging is
- * enabled.
- */
- public static void setChatHistorySize(int historySize)
- {
- ConfigurationManager.chatHistorySize = historySize;
-
- configService.setProperty(
- "service.gui.MESSAGE_HISTORY_SIZE",
- Integer.toString(chatHistorySize));
- }
-
- public static Locale getCurrentLanguage()
- {
- String localeId
- = configService.getString(
- ResourceManagementService.DEFAULT_LOCALE_CONFIG);
-
- return
- (localeId != null)
- ? ResourceManagementServiceUtils.getLocale(localeId)
- : Locale.getDefault();
- }
-
- public static void setLanguage(Locale locale)
- {
- String language = locale.getLanguage();
- String country = locale.getCountry();
-
- configService.setProperty(
- ResourceManagementService.DEFAULT_LOCALE_CONFIG,
- (country.length() > 0) ? (language + '_' + country) : language);
- }
-
- public static void setClientPort(int port)
- {
- configService.setProperty(
- ProtocolProviderFactory.PREFERRED_CLEAR_PORT_PROPERTY_NAME,
- port);
- }
-
- public static void setClientSecurePort(int port)
- {
- configService.setProperty(
- ProtocolProviderFactory.PREFERRED_SECURE_PORT_PROPERTY_NAME,
- port);
- }
-
- public static int getClientPort()
- {
- return configService.getInt(
- ProtocolProviderFactory.PREFERRED_CLEAR_PORT_PROPERTY_NAME,
- 5060);
- }
-
- public static int getClientSecurePort()
- {
- return configService.getInt(
- ProtocolProviderFactory.PREFERRED_SECURE_PORT_PROPERTY_NAME,
- 5061);
- }
-
- public static String[] getAvailableSslProtocols()
- {
- SSLSocket temp;
- try
- {
- temp = (SSLSocket) SSLSocketFactory
- .getDefault().createSocket();
- return temp.getSupportedProtocols();
- }
- catch (IOException e)
- {
- logger.error(e);
- return new String[]{};
- }
- }
-
- public static String[] getEnabledSslProtocols()
- {
- String enabledSslProtocols = configService
- .getString("gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS");
- if(StringUtils.isNullOrEmpty(enabledSslProtocols, true))
- {
- SSLSocket temp;
- try
- {
- temp = (SSLSocket) SSLSocketFactory
- .getDefault().createSocket();
- return temp.getEnabledProtocols();
- }
- catch (IOException e)
- {
- logger.error(e);
- return getAvailableSslProtocols();
- }
- }
- return enabledSslProtocols.split("(,)|(,\\s)");
- }
-
- public static void setEnabledSslProtocols(String[] enabledProtocols)
- {
- if(enabledProtocols == null || enabledProtocols.length == 0)
- configService.removeProperty(
- "gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS");
- else
- {
- String protocols = Arrays.toString(enabledProtocols);
- configService.setProperty(
- "gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS",
- protocols.substring(1, protocols.length() - 1));
- }
- }
-}
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java
index 1e0a785..7960da7 100644
--- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java
+++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java
@@ -103,7 +103,7 @@ public class GeneralConfigPluginActivator
// If the general configuration form is disabled don't continue.
if (!getConfigurationService().getBoolean(DISABLED_PROP, false))
{
- ConfigurationManager.loadGuiConfigurations();
+ ConfigurationUtils.loadGuiConfigurations();
properties.put( ConfigurationForm.FORM_TYPE,
ConfigurationForm.GENERAL_TYPE);
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
index eb20cd9..34b2ea5 100644
--- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
+++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java
@@ -17,6 +17,7 @@ import javax.swing.event.*;
import net.java.sip.communicator.plugin.generalconfig.autoaway.*;
import net.java.sip.communicator.service.systray.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import net.java.sip.communicator.util.swing.*;
@@ -254,13 +255,13 @@ public class GeneralConfigurationPanel
groupMessagesCheckBox.setAlignmentX(JCheckBox.LEFT_ALIGNMENT);
groupMessagesCheckBox.setSelected(
- ConfigurationManager.isMultiChatWindowEnabled());
+ ConfigurationUtils.isMultiChatWindowEnabled());
groupMessagesCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setMultiChatWindowEnabled(
+ ConfigurationUtils.setMultiChatWindowEnabled(
groupMessagesCheckBox.isSelected());
}
});
@@ -281,13 +282,13 @@ public class GeneralConfigurationPanel
leaveChatroomCheckBox.setAlignmentX(JCheckBox.LEFT_ALIGNMENT);
leaveChatroomCheckBox.setSelected(
- ConfigurationManager.isLeaveChatRoomOnWindowCloseEnabled());
+ ConfigurationUtils.isLeaveChatRoomOnWindowCloseEnabled());
leaveChatroomCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setLeaveChatRoomOnWindowClose(
+ ConfigurationUtils.setLeaveChatRoomOnWindowClose(
leaveChatroomCheckBox.isSelected());
}
});
@@ -312,13 +313,13 @@ public class GeneralConfigurationPanel
logHistoryCheckBox.setText(
Resources.getString("plugin.generalconfig.LOG_HISTORY"));
logHistoryCheckBox.setSelected(
- ConfigurationManager.isHistoryLoggingEnabled());
+ ConfigurationUtils.isHistoryLoggingEnabled());
logHistoryCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setHistoryLoggingEnabled(
+ ConfigurationUtils.setHistoryLoggingEnabled(
logHistoryCheckBox.isSelected());
}
});
@@ -334,13 +335,13 @@ public class GeneralConfigurationPanel
showHistoryCheckBox.setText(
Resources.getString("plugin.generalconfig.SHOW_HISTORY"));
showHistoryCheckBox.setSelected(
- ConfigurationManager.isHistoryShown());
+ ConfigurationUtils.isHistoryShown());
showHistoryCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setHistoryShown(
+ ConfigurationUtils.setHistoryShown(
showHistoryCheckBox.isSelected());
}
});
@@ -352,7 +353,7 @@ public class GeneralConfigurationPanel
showHistoryPanel.add(historySizeSpinner);
historySizeSpinner.setModel(historySizeSpinnerModel);
historySizeSpinner.setValue(
- ConfigurationManager.getChatHistorySize());
+ ConfigurationUtils.getChatHistorySize());
logHistoryCheckBox.addChangeListener(new ChangeListener()
{
@@ -379,7 +380,7 @@ public class GeneralConfigurationPanel
{
public void stateChanged(ChangeEvent e)
{
- ConfigurationManager.setChatHistorySize(
+ ConfigurationUtils.setChatHistorySize(
((Integer) historySizeSpinner
.getValue()).intValue());
}
@@ -390,13 +391,13 @@ public class GeneralConfigurationPanel
historySizeLabel.setText(
Resources.getString("plugin.generalconfig.HISTORY_SIZE"));
- if (!ConfigurationManager.isHistoryLoggingEnabled())
+ if (!ConfigurationUtils.isHistoryLoggingEnabled())
{
showHistoryCheckBox.setEnabled(false);
historySizeSpinner.setEnabled(false);
}
- if (!ConfigurationManager.isHistoryShown())
+ if (!ConfigurationUtils.isHistoryShown())
{
historySizeSpinner.setEnabled(false);
}
@@ -422,19 +423,19 @@ public class GeneralConfigurationPanel
ComboBoxModel sendMessageComboBoxModel =
new DefaultComboBoxModel(
new String[] {
- ConfigurationManager.ENTER_COMMAND,
- ConfigurationManager.CTRL_ENTER_COMMAND });
+ ConfigurationUtils.ENTER_COMMAND,
+ ConfigurationUtils.CTRL_ENTER_COMMAND });
final JComboBox sendMessageComboBox = new JComboBox();
sendMessagePanel.add(sendMessageComboBox);
sendMessageComboBox.setModel(sendMessageComboBoxModel);
sendMessageComboBox.setSelectedItem(
- ConfigurationManager.getSendMessageCommand());
+ ConfigurationUtils.getSendMessageCommand());
sendMessageComboBox.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent arg0)
{
- ConfigurationManager.setSendMessageCommand(
+ ConfigurationUtils.setSendMessageCommand(
(String)sendMessageComboBox.getSelectedItem());
}
});
@@ -459,13 +460,13 @@ public class GeneralConfigurationPanel
new Dimension(253, 20));
enableTypingNotifiCheckBox.setSelected(
- ConfigurationManager.isSendTypingNotifications());
+ ConfigurationUtils.isSendTypingNotifications());
enableTypingNotifiCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setSendTypingNotifications(
+ ConfigurationUtils.setSendTypingNotifications(
enableTypingNotifiCheckBox.isSelected());
}
});
@@ -487,13 +488,13 @@ public class GeneralConfigurationPanel
bringToFrontCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
bringToFrontCheckBox.setSelected(
- ConfigurationManager.isAutoPopupNewMessage());
+ ConfigurationUtils.isAutoPopupNewMessage());
bringToFrontCheckBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setAutoPopupNewMessage(
+ ConfigurationUtils.setAutoPopupNewMessage(
bringToFrontCheckBox.isSelected());
}
});
@@ -566,7 +567,7 @@ public class GeneralConfigurationPanel
{
// "Auto" selected. Delete the user's preference and
// select the best available handler.
- ConfigurationManager.setPopupHandlerConfig(null);
+ ConfigurationUtils.setPopupHandlerConfig(null);
GeneralConfigPluginActivator.getSystrayService()
.selectBestPopupMessageHandler();
@@ -576,7 +577,7 @@ public class GeneralConfigurationPanel
(PopupMessageHandler)
notifConfigComboBox.getSelectedItem();
- ConfigurationManager.setPopupHandlerConfig(
+ ConfigurationUtils.setPopupHandlerConfig(
handler.getClass().getName());
GeneralConfigPluginActivator.getSystrayService()
@@ -610,7 +611,7 @@ public class GeneralConfigurationPanel
locale.getDisplayLanguage(locale));
}
Locale currLocale =
- ConfigurationManager.getCurrentLanguage();
+ ConfigurationUtils.getCurrentLanguage();
localesConfigComboBox.setSelectedItem(currLocale
.getDisplayLanguage(currLocale));
@@ -632,7 +633,7 @@ public class GeneralConfigurationPanel
if(locale.getDisplayLanguage(locale)
.equals(language))
{
- ConfigurationManager.setLanguage(locale);
+ ConfigurationUtils.setLanguage(locale);
break;
}
}
@@ -681,7 +682,7 @@ public class GeneralConfigurationPanel
JPanel checkBoxPanel = new TransparentPanel(new BorderLayout());
SIPCommCheckBox formatPhoneNumber = new SIPCommCheckBox("",
- ConfigurationManager.isNormalizePhoneNumber());
+ ConfigurationUtils.isNormalizePhoneNumber());
formatPhoneNumber.setAlignmentY(Component.TOP_ALIGNMENT);
@@ -689,7 +690,7 @@ public class GeneralConfigurationPanel
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setNormalizePhoneNumber(
+ ConfigurationUtils.setNormalizePhoneNumber(
((JCheckBox)e.getSource()).isSelected());
}
});
@@ -725,7 +726,7 @@ public class GeneralConfigurationPanel
// phone numbers.
SIPCommCheckBox acceptPhoneNumberWithAlphaChars
= new SIPCommCheckBox("",
- ConfigurationManager.acceptPhoneNumberWithAlphaChars());
+ ConfigurationUtils.acceptPhoneNumberWithAlphaChars());
acceptPhoneNumberWithAlphaChars.setAlignmentY(Component.TOP_ALIGNMENT);
@@ -733,7 +734,7 @@ public class GeneralConfigurationPanel
{
public void actionPerformed(ActionEvent e)
{
- ConfigurationManager.setAcceptPhoneNumberWithAlphaChars(
+ ConfigurationUtils.setAcceptPhoneNumberWithAlphaChars(
((JCheckBox)e.getSource()).isSelected());
}
});
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/SIPConfigForm.java b/src/net/java/sip/communicator/plugin/generalconfig/SIPConfigForm.java
index d65b9e3..b7a5e91 100644
--- a/src/net/java/sip/communicator/plugin/generalconfig/SIPConfigForm.java
+++ b/src/net/java/sip/communicator/plugin/generalconfig/SIPConfigForm.java
@@ -13,6 +13,7 @@ import java.util.List;
import javax.swing.*;
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
/**
@@ -65,7 +66,7 @@ public class SIPConfigForm
final JTextField clientPortField = new JTextField(6);
clientPortField.setText(
- String.valueOf(ConfigurationManager.getClientPort()));
+ String.valueOf(ConfigurationUtils.getClientPort()));
valuePanel.add(clientPortField);
clientPortField.addFocusListener(new FocusListener()
{
@@ -82,7 +83,7 @@ public class SIPConfigForm
throw new NumberFormatException(
"Not a port number");
- ConfigurationManager.setClientPort(port);
+ ConfigurationUtils.setClientPort(port);
}
catch (NumberFormatException ex)
{
@@ -107,7 +108,7 @@ public class SIPConfigForm
final JTextField clientSecurePortField = new JTextField(6);
clientSecurePortField.setText(
- String.valueOf(ConfigurationManager.getClientSecurePort()));
+ String.valueOf(ConfigurationUtils.getClientSecurePort()));
valuePanel.add(clientSecurePortField);
clientSecurePortField.addFocusListener(new FocusListener()
{
@@ -124,7 +125,7 @@ public class SIPConfigForm
throw new NumberFormatException(
"Not a port number");
- ConfigurationManager.setClientSecurePort(port);
+ ConfigurationUtils.setClientSecurePort(port);
}
catch (NumberFormatException ex)
{
@@ -148,13 +149,13 @@ public class SIPConfigForm
});
String configuredProtocols = Arrays.toString(
- ConfigurationManager.getEnabledSslProtocols());
+ ConfigurationUtils.getEnabledSslProtocols());
pnlSslProtocols = Box.createVerticalBox();
pnlSslProtocols.setBorder(BorderFactory.createTitledBorder(Resources
.getString("plugin.generalconfig.SIP_SSL_PROTOCOLS")));
pnlSslProtocols.setAlignmentX(Component.LEFT_ALIGNMENT);
- for(String protocol : ConfigurationManager.getAvailableSslProtocols())
+ for(String protocol : ConfigurationUtils.getAvailableSslProtocols())
{
JCheckBox chkProtocol = new SIPCommCheckBox(protocol);
chkProtocol.addActionListener(this);
@@ -179,7 +180,7 @@ public class SIPConfigForm
if(((JCheckBox) child).isSelected())
enabledSslProtocols.add(((JCheckBox) child).getText());
}
- ConfigurationManager.setEnabledSslProtocols(
+ ConfigurationUtils.setEnabledSslProtocols(
enabledSslProtocols.toArray(new String[]{}));
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java b/src/net/java/sip/communicator/util/ConfigurationUtils.java
index 8e5dfc6..2089eed 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/ConfigurationManager.java
+++ b/src/net/java/sip/communicator/util/ConfigurationUtils.java
@@ -4,19 +4,24 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
-package net.java.sip.communicator.impl.gui.utils;
+package net.java.sip.communicator.util;
import java.awt.*;
import java.beans.*;
+import java.io.*;
import java.util.*;
import java.util.List; /* disambiguation */
-import net.java.sip.communicator.impl.gui.*;
+import javax.net.ssl.*;
+
import net.java.sip.communicator.service.protocol.*;
+import net.java.sip.communicator.service.resources.*;
import org.jitsi.service.configuration.*;
import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.codec.*;
+import org.jitsi.service.resources.*;
+import org.jitsi.util.*;
import org.osgi.framework.*;
/**
@@ -26,9 +31,25 @@ import org.osgi.framework.*;
* @author Yana Stamcheva
* @author Damian Minkov
*/
-public class ConfigurationManager
+public class ConfigurationUtils
{
/**
+ * The logger for this class.
+ */
+ private static final Logger logger
+ = Logger.getLogger(ConfigurationUtils.class);
+
+ /**
+ * The send message command defined by the Enter key.
+ */
+ public static final String ENTER_COMMAND = "Enter";
+
+ /**
+ * The send message command defined by the Ctrl-Enter key.
+ */
+ public static final String CTRL_ENTER_COMMAND = "Ctrl-Enter";
+
+ /**
* Indicates whether the message automatic pop-up is enabled.
*/
private static boolean autoPopupNewMessage = false;
@@ -163,7 +184,7 @@ public class ConfigurationManager
* The configuration service.
*/
private static ConfigurationService configService
- = GuiActivator.getConfigurationService();
+ = UtilActivator.getConfigurationService();
/**
* The parent of the last contact.
@@ -273,6 +294,17 @@ public class ConfigurationManager
= "net.java.sip.communicator.service.gui.SINGLE_WINDOW_INTERFACE_ENABLED";
/**
+ * Indicates if phone numbers should be normalized before dialed.
+ */
+ private static boolean isNormalizePhoneNumber;
+
+ /**
+ * Indicates if a string containing alphabetical characters might be
+ * considered as a phone number.
+ */
+ private static boolean acceptPhoneNumberWithAlphaChars;
+
+ /**
* Loads all user interface configurations.
*/
public static void loadGuiConfigurations()
@@ -287,7 +319,7 @@ public class ConfigurationManager
String autoPopup = configService.getString(autoPopupProperty);
if(autoPopup == null)
- autoPopup = GuiActivator.getResources().
+ autoPopup = UtilActivator.getResources().
getSettingsString(autoPopupProperty);
if(autoPopup != null && autoPopup.equalsIgnoreCase("yes"))
@@ -300,7 +332,7 @@ public class ConfigurationManager
if(messageCommand == null)
messageCommand
- = GuiActivator.getResources()
+ = UtilActivator.getResources()
.getSettingsString(messageCommandProperty);
if(messageCommand == null || messageCommand.length() == 0)
@@ -351,7 +383,7 @@ public class ConfigurationManager
if(isSendTypingNotif == null)
isSendTypingNotif =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(isSendTypingNotifProperty);
if(isSendTypingNotif != null && isSendTypingNotif.length() > 0)
@@ -381,7 +413,7 @@ public class ConfigurationManager
if(isMultiChatWindowEnabledString == null)
isMultiChatWindowEnabledString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(isMultiChatWindowEnabledStringProperty);
if(isMultiChatWindowEnabledString != null
@@ -401,7 +433,7 @@ public class ConfigurationManager
if(isLeaveChatRoomOnWindowCloseEnabledString == null)
isLeaveChatRoomOnWindowCloseEnabledString =
- GuiActivator.getResources().getSettingsString(
+ UtilActivator.getResources().getSettingsString(
isLeaveChatRoomOnWindowCloseEnabledStringProperty);
if(isLeaveChatRoomOnWindowCloseEnabledString != null
@@ -433,7 +465,7 @@ public class ConfigurationManager
if(isHistoryShownString == null)
isHistoryShownString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(isHistoryShownStringProperty);
if(isHistoryShownString != null
@@ -451,7 +483,7 @@ public class ConfigurationManager
if(chatHistorySizeString == null)
chatHistorySizeString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(chatHistorySizeStringProperty);
if(chatHistorySizeString != null
@@ -468,7 +500,7 @@ public class ConfigurationManager
if(chatWriteAreaSizeString == null)
chatWriteAreaSizeString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(chatWriteAreaSizeStringProperty);
if(chatWriteAreaSizeString != null
@@ -487,7 +519,7 @@ public class ConfigurationManager
if(isTransparentWindowEnabledString == null)
isTransparentWindowEnabledString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(isTransparentWindowEnabledProperty);
if(isTransparentWindowEnabledString != null
@@ -506,7 +538,7 @@ public class ConfigurationManager
if(windowTransparencyString == null)
windowTransparencyString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(windowTransparencyProperty);
if(windowTransparencyString != null
@@ -525,7 +557,7 @@ public class ConfigurationManager
if(isWindowDecoratedString == null)
isWindowDecoratedString =
- GuiActivator.getResources().
+ UtilActivator.getResources().
getSettingsString(isWindowDecoratedProperty);
if(isWindowDecoratedString != null
@@ -598,7 +630,7 @@ public class ConfigurationManager
// Load the "net.java.sip.communicator.impl.gui.main.account
// .ADVANCED_CONFIG_DISABLED" property.
String advancedConfigDisabledDefaultProp
- = GuiActivator.getResources().getSettingsString(
+ = UtilActivator.getResources().getSettingsString(
"impl.gui.main.account.ADVANCED_CONFIG_DISABLED");
boolean isAdvancedConfigDisabled = false;
@@ -616,7 +648,7 @@ public class ConfigurationManager
// Single interface enabled property.
String singleInterfaceEnabledProp
- = GuiActivator.getResources().getSettingsString(
+ = UtilActivator.getResources().getSettingsString(
SINGLE_WINDOW_INTERFACE_ENABLED);
boolean isEnabled = false;
@@ -625,7 +657,7 @@ public class ConfigurationManager
isEnabled = Boolean.parseBoolean(singleInterfaceEnabledProp);
else
isEnabled = Boolean.parseBoolean(
- GuiActivator.getResources().getSettingsString(
+ UtilActivator.getResources().getSettingsString(
"impl.gui.SINGLE_WINDOW_INTERFACE"));
// Load the advanced account configuration disabled.
@@ -669,7 +701,7 @@ public class ConfigurationManager
String showStatusChangedInChatProperty
= "impl.gui.SHOW_STATUS_CHANGED_IN_CHAT";
- String showStatusChangedInChatDefault = GuiActivator.getResources().
+ String showStatusChangedInChatDefault = UtilActivator.getResources().
getSettingsString(showStatusChangedInChatProperty);
// if there is a default value use it
@@ -684,7 +716,7 @@ public class ConfigurationManager
String routeVideoAndDesktopUsingPhoneNumberProperty
= "impl.gui.ROUTE_VIDEO_AND_DESKTOP_TO_PNONENUMBER";
String routeVideoAndDesktopUsingPhoneNumberDefault =
- GuiActivator.getResources()
+ UtilActivator.getResources()
.getSettingsString(routeVideoAndDesktopUsingPhoneNumberProperty);
if(routeVideoAndDesktopUsingPhoneNumberDefault != null)
@@ -697,7 +729,7 @@ public class ConfigurationManager
String hideAccountMenuProperty
= "impl.gui.HIDE_SELECTION_ON_SINGLE_ACCOUNT";
- String hideAccountMenuDefaultValue = GuiActivator.getResources()
+ String hideAccountMenuDefaultValue = UtilActivator.getResources()
.getSettingsString(hideAccountMenuProperty);
if(hideAccountMenuDefaultValue != null)
@@ -710,7 +742,7 @@ public class ConfigurationManager
String hideAccountStatusSelectorsProperty
= "impl.gui.HIDE_ACCOUNT_STATUS_SELECTORS";
- String hideAccountsStatusDefaultValue = GuiActivator.getResources()
+ String hideAccountsStatusDefaultValue = UtilActivator.getResources()
.getSettingsString(hideAccountStatusSelectorsProperty);
if(hideAccountsStatusDefaultValue != null)
@@ -724,7 +756,7 @@ public class ConfigurationManager
String autoAnswerDisableSubmenuProperty
= "impl.gui.AUTO_ANSWER_DISABLE_SUBMENU";
String autoAnswerDisableSubmenuDefaultValue =
- GuiActivator.getResources()
+ UtilActivator.getResources()
.getSettingsString(autoAnswerDisableSubmenuProperty);
if(autoAnswerDisableSubmenuDefaultValue != null)
@@ -738,6 +770,15 @@ public class ConfigurationManager
isChatRoomConfigDisabled = configService.getBoolean(
CHAT_ROOM_CONFIG_DISABLED_PROP,
isChatRoomConfigDisabled);
+
+ isNormalizePhoneNumber
+ = configService.getBoolean("impl.gui.NORMALIZE_PHONE_NUMBER", true);
+
+ // Load the "ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS" property.
+ acceptPhoneNumberWithAlphaChars
+ = configService.getBoolean(
+ "impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS",
+ true);
}
/**
@@ -751,9 +792,9 @@ public class ConfigurationManager
"net.java.sip.communicator.impl.gui.FONT_SUPPORT_ENABLED";
boolean defaultValue = false;
-
+
String defaultSettingStr =
- GuiActivator.getResources().getSettingsString(fontDisabledProp);
+ UtilActivator.getResources().getSettingsString(fontDisabledProp);
if(defaultSettingStr != null)
defaultValue = Boolean.parseBoolean(defaultSettingStr);
@@ -775,6 +816,26 @@ public class ConfigurationManager
}
/**
+ * Updates the "autoPopupNewMessage" property.
+ *
+ * @param autoPopup indicates to the user interface whether new
+ * messages should be opened and bring to front.
+ **/
+ public static void setAutoPopupNewMessage(boolean autoPopup)
+ {
+ autoPopupNewMessage = autoPopup;
+
+ if(autoPopupNewMessage)
+ configService.setProperty(
+ "service.gui.AUTO_POPUP_NEW_MESSAGE",
+ "yes");
+ else
+ configService.setProperty(
+ "service.gui.AUTO_POPUP_NEW_MESSAGE",
+ "no");
+ }
+
+ /**
* Return TRUE if "showCallPanel" property is true, otherwise - return
* FALSE. Indicates to the user interface whether the panel containing the
* call and hangup buttons should be shown.
@@ -836,6 +897,22 @@ public class ConfigurationManager
}
/**
+ * Updates the "sendTypingNotifications" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param isSendTypingNotif <code>true</code> to indicate that typing
+ * notifications are enabled, <code>false</code> otherwise.
+ */
+ public static void setSendTypingNotifications(boolean isSendTypingNotif)
+ {
+ isSendTypingNotifications = isSendTypingNotif;
+
+ configService.setProperty(
+ "service.gui.SEND_TYPING_NOTIFICATIONS_ENABLED",
+ Boolean.toString(isSendTypingNotif));
+ }
+
+ /**
* Returns TRUE if the "isMoveContactConfirmationRequested" property is true,
* otherwise - returns FALSE. Indicates to the user interface whether the
* confirmation window during the move contact process is enabled or not.
@@ -860,6 +937,22 @@ public class ConfigurationManager
return isMultiChatWindowEnabled;
}
+ /**
+ * Updates the "isMultiChatWindowEnabled" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param isEnabled indicates if the chat window could
+ * contain multiple chats or only one chat.
+ */
+ public static void setMultiChatWindowEnabled(boolean isEnabled)
+ {
+ isMultiChatWindowEnabled = isEnabled;
+
+ configService.setProperty(
+ "service.gui.IS_MULTI_CHAT_WINDOW_ENABLED",
+ Boolean.toString(isMultiChatWindowEnabled));
+ }
+
/**
* Returns <code>true</code> if the "isLeaveChatRoomOnWindowCloseEnabled"
* property is true, otherwise - returns <code>false</code>. Indicates to
@@ -874,6 +967,21 @@ public class ConfigurationManager
}
/**
+ * Updates the "isLeaveChatroomOnWindowClose" property through
+ * the <tt>ConfigurationService</tt>.
+ *
+ * @param isLeave indicates whether to leave chat room on window close.
+ */
+ public static void setLeaveChatRoomOnWindowClose(boolean isLeave)
+ {
+ isLeaveChatRoomOnWindowCloseEnabled = isLeave;
+
+ configService.setProperty(
+ "service.gui.LEAVE_CHATROOM_ON_WINDOW_CLOSE",
+ Boolean.toString(isLeaveChatRoomOnWindowCloseEnabled));
+ }
+
+ /**
* Returns <code>true</code> if the "isHistoryLoggingEnabled" property is
* true, otherwise - returns <code>false</code>. Indicates to the user
* interface whether the history logging is enabled.
@@ -884,7 +992,23 @@ public class ConfigurationManager
{
return isHistoryLoggingEnabled;
}
-
+
+ /**
+ * Updates the "isHistoryLoggingEnabled" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param isEnabled indicates if the history logging is
+ * enabled.
+ */
+ public static void setHistoryLoggingEnabled(boolean isEnabled)
+ {
+ isHistoryLoggingEnabled = isEnabled;
+
+ configService.setProperty(
+ "impl.msghistory.IS_MESSAGE_HISTORY_ENABLED",
+ Boolean.toString(isHistoryLoggingEnabled));
+ }
+
/**
* Returns <code>true</code> if the "isHistoryShown" property is
* true, otherwise - returns <code>false</code>. Indicates to the user
@@ -896,7 +1020,22 @@ public class ConfigurationManager
{
return isHistoryShown;
}
-
+
+ /**
+ * Updates the "isHistoryShown" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param isShown indicates if the message history is shown
+ */
+ public static void setHistoryShown(boolean isShown)
+ {
+ isHistoryShown = isShown;
+
+ configService.setProperty(
+ "service.gui.IS_MESSAGE_HISTORY_SHOWN",
+ Boolean.toString(isHistoryShown));
+ }
+
/**
* Returns <code>true</code> if the "isWindowDecorated" property is
* true, otherwise - returns <code>false</code>..
@@ -907,7 +1046,7 @@ public class ConfigurationManager
{
return isWindowDecorated;
}
-
+
/**
* Returns <code>true</code> if the "isChatToolbarVisible" property is
* true, otherwise - returns <code>false</code>..
@@ -1108,6 +1247,22 @@ public class ConfigurationManager
}
/**
+ * Updates the "sendMessageCommand" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param newMessageCommand the command used to send a message ( it could be
+ * ENTER_COMMAND or CTRL_ENTER_COMMAND)
+ */
+ public static void setSendMessageCommand(String newMessageCommand)
+ {
+ sendMessageCommand = newMessageCommand;
+
+ configService.setProperty(
+ "service.gui.SEND_MESSAGE_COMMAND",
+ newMessageCommand);
+ }
+
+ /**
* Return the "lastContactParent" property that was saved previously
* through the <tt>ConfigurationService</tt>. Indicates
* the last selected group on adding new contact
@@ -1145,7 +1300,7 @@ public class ConfigurationManager
String savedAccountId)
{
ProtocolProviderService protocolProvider = null;
- for (ProtocolProviderFactory providerFactory : GuiActivator
+ for (ProtocolProviderFactory providerFactory : UtilActivator
.getProtocolProviderFactories().values())
{
ServiceReference serRef;
@@ -1159,7 +1314,7 @@ public class ConfigurationManager
serRef = providerFactory.getProviderForAccount(accountId);
protocolProvider
- = (ProtocolProviderService) GuiActivator.bundleContext
+ = (ProtocolProviderService) UtilActivator.bundleContext
.getService(serRef);
}
}
@@ -1179,6 +1334,22 @@ public class ConfigurationManager
}
/**
+ * Updates the "chatHistorySize" property through the
+ * <tt>ConfigurationService</tt>.
+ *
+ * @param historySize indicates if the history logging is
+ * enabled.
+ */
+ public static void setChatHistorySize(int historySize)
+ {
+ chatHistorySize = historySize;
+
+ configService.setProperty(
+ "service.gui.MESSAGE_HISTORY_SIZE",
+ Integer.toString(chatHistorySize));
+ }
+
+ /**
* Returns the preferred height of the chat write area.
*
* @return the preferred height of the chat write area.
@@ -1229,8 +1400,48 @@ public class ConfigurationManager
*/
public static boolean isNormalizePhoneNumber()
{
- return configService.getBoolean(
- "impl.gui.NORMALIZE_PHONE_NUMBER", true);
+ return isNormalizePhoneNumber;
+ }
+
+ /**
+ * Updates the "NORMALIZE_PHONE_NUMBER" property.
+ *
+ * @param isNormalize indicates to the user interface whether all dialed
+ * phone numbers should be normalized
+ */
+ public static void setNormalizePhoneNumber(boolean isNormalize)
+ {
+ isNormalizePhoneNumber = isNormalize;
+
+ configService.setProperty("impl.gui.NORMALIZE_PHONE_NUMBER",
+ Boolean.toString(isNormalize));
+ }
+
+ /**
+ * Returns <code>true</code> if a string with a alphabetical character migth
+ * be considered as a phone number. <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if a string with a alphabetical character migth
+ * be considered as a phone number. <code>false</code> otherwise.
+ */
+ public static boolean acceptPhoneNumberWithAlphaChars()
+ {
+ return acceptPhoneNumberWithAlphaChars;
+ }
+
+ /**
+ * Updates the "ACCEPT_PHONE_NUMBER_WITH_CHARS" property.
+ *
+ * @param accept indicates to the user interface whether a string with
+ * alphabetical characters might be accepted as a phone number.
+ */
+ public static void setAcceptPhoneNumberWithAlphaChars(boolean accept)
+ {
+ acceptPhoneNumberWithAlphaChars = accept;
+
+ configService.setProperty(
+ "impl.gui.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS",
+ Boolean.toString(acceptPhoneNumberWithAlphaChars));
}
/**
@@ -1301,7 +1512,7 @@ public class ConfigurationManager
* Updates the "singleWindowInterface" property through the
* <tt>ConfigurationService</tt>.
*
- * @param singleWindowInterface <code>true</code> to indicate that the
+ * @param isEnabled <code>true</code> to indicate that the
* single window interface is enabled, <tt>false</tt> - otherwise
*/
public static void setSingleWindowInterfaceEnabled(boolean isEnabled)
@@ -1330,7 +1541,7 @@ public class ConfigurationManager
*/
public static void setShowOffline(boolean isShowOffline)
{
- ConfigurationManager.isShowOffline = isShowOffline;
+ ConfigurationUtils.isShowOffline = isShowOffline;
configService.setProperty(
"net.java.sip.communicator.impl.gui.showOffline",
@@ -1346,7 +1557,7 @@ public class ConfigurationManager
*/
public static void setShowCallPanel(boolean isCallPanelShown)
{
- ConfigurationManager.isCallPanelShown = isCallPanelShown;
+ ConfigurationUtils.isCallPanelShown = isCallPanelShown;
configService.setProperty(
"net.java.sip.communicator.impl.gui.showCallPanel",
@@ -1390,6 +1601,16 @@ public class ConfigurationManager
Boolean.toString(isQuitWarningShown));
}
+ /**
+ * Saves the popup handler choice made by the user.
+ *
+ * @param handler the handler which will be used
+ */
+ public static void setPopupHandlerConfig(String handler)
+ {
+ configService.setProperty("systray.POPUP_HANDLER", handler);
+ }
+
/**
* Updates the "lastContactParent" property through the
* <tt>ConfigurationService</tt>.
@@ -1472,7 +1693,7 @@ public class ConfigurationManager
* Updates the "isChatSimpleThemeEnabled" property through the
* <tt>ConfigurationService</tt>.
*
- * @param isVisible indicates if the chat simple theme is enabled
+ * @param isEnabled indicates if the chat simple theme is enabled
*/
public static void setChatSimpleThemeEnabled(boolean isEnabled)
{
@@ -1628,6 +1849,38 @@ public class ConfigurationManager
}
/**
+ * Returns the current language configuration.
+ *
+ * @return the current locale
+ */
+ public static Locale getCurrentLanguage()
+ {
+ String localeId
+ = configService.getString(
+ ResourceManagementService.DEFAULT_LOCALE_CONFIG);
+
+ return
+ (localeId != null)
+ ? ResourceManagementServiceUtils.getLocale(localeId)
+ : Locale.getDefault();
+ }
+
+ /**
+ * Sets the current language configuration.
+ *
+ * @param locale the locale to set
+ */
+ public static void setLanguage(Locale locale)
+ {
+ String language = locale.getLanguage();
+ String country = locale.getCountry();
+
+ configService.setProperty(
+ ResourceManagementService.DEFAULT_LOCALE_CONFIG,
+ (country.length() > 0) ? (language + '_' + country) : language);
+ }
+
+ /**
* Saves a chat room through the <tt>ConfigurationService</tt>.
*
* @param protocolProvider the protocol provider to which the chat room
@@ -2113,6 +2366,121 @@ public class ConfigurationManager
}
/**
+ * Returns the configured client port.
+ *
+ * @return the client port
+ */
+ public static int getClientPort()
+ {
+ return configService.getInt(
+ ProtocolProviderFactory.PREFERRED_CLEAR_PORT_PROPERTY_NAME,
+ 5060);
+ }
+
+ /**
+ * Sets the client port.
+ *
+ * @param port the port to set
+ */
+ public static void setClientPort(int port)
+ {
+ configService.setProperty(
+ ProtocolProviderFactory.PREFERRED_CLEAR_PORT_PROPERTY_NAME,
+ port);
+ }
+
+ /**
+ * Returns the client secure port.
+ *
+ * @return the client secure port
+ */
+ public static int getClientSecurePort()
+ {
+ return configService.getInt(
+ ProtocolProviderFactory.PREFERRED_SECURE_PORT_PROPERTY_NAME,
+ 5061);
+ }
+
+ /**
+ * Sets the client secure port.
+ *
+ * @param port the port to set
+ */
+ public static void setClientSecurePort(int port)
+ {
+ configService.setProperty(
+ ProtocolProviderFactory.PREFERRED_SECURE_PORT_PROPERTY_NAME,
+ port);
+ }
+
+ /**
+ * Returns the list of enabled SSL protocols.
+ *
+ * @return the list of enabled SSL protocols
+ */
+ public static String[] getEnabledSslProtocols()
+ {
+ String enabledSslProtocols = configService
+ .getString("gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS");
+ if(StringUtils.isNullOrEmpty(enabledSslProtocols, true))
+ {
+ SSLSocket temp;
+ try
+ {
+ temp = (SSLSocket) SSLSocketFactory
+ .getDefault().createSocket();
+ return temp.getEnabledProtocols();
+ }
+ catch (IOException e)
+ {
+ logger.error(e);
+ return getAvailableSslProtocols();
+ }
+ }
+ return enabledSslProtocols.split("(,)|(,\\s)");
+ }
+
+ /**
+ * Returns the list of available SSL protocols.
+ *
+ * @return the list of available SSL protocols
+ */
+ public static String[] getAvailableSslProtocols()
+ {
+ SSLSocket temp;
+ try
+ {
+ temp = (SSLSocket) SSLSocketFactory
+ .getDefault().createSocket();
+ return temp.getSupportedProtocols();
+ }
+ catch (IOException e)
+ {
+ logger.error(e);
+ return new String[]{};
+ }
+ }
+
+ /**
+ * Sets the enables SSL protocols list.
+ *
+ * @param enabledProtocols the list of enabled SSL protocols to set
+ */
+ public static void setEnabledSslProtocols(String[] enabledProtocols)
+ {
+ if(enabledProtocols == null || enabledProtocols.length == 0)
+ configService.removeProperty(
+ "gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS");
+ else
+ {
+ String protocols = Arrays.toString(enabledProtocols);
+ configService.setProperty(
+ "gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS",
+ protocols.substring(1, protocols.length() - 1));
+ }
+ }
+
+ /**
* Returns <tt>true</tt> if the account associated with
* <tt>protocolProvider</tt> has at least one video format enabled in it's
* configuration, <tt>false</tt> otherwise.
@@ -2132,14 +2500,14 @@ public class ConfigurationManager
.get(ProtocolProviderFactory.OVERRIDE_ENCODINGS);
if(Boolean.parseBoolean(overrideEncodings))
{
- encodingConfiguration = GuiActivator.getMediaService().
+ encodingConfiguration = UtilActivator.getMediaService().
createEmptyEncodingConfiguration();
encodingConfiguration.loadProperties(accountProperties,
ProtocolProviderFactory.ENCODING_PROP_PREFIX);
}
else
{
- encodingConfiguration = GuiActivator.getMediaService().
+ encodingConfiguration = UtilActivator.getMediaService().
getCurrentEncodingConfiguration();
}
diff --git a/src/net/java/sip/communicator/util/UtilActivator.java b/src/net/java/sip/communicator/util/UtilActivator.java
index 78d6c5e..d139334 100644
--- a/src/net/java/sip/communicator/util/UtilActivator.java
+++ b/src/net/java/sip/communicator/util/UtilActivator.java
@@ -8,6 +8,7 @@ package net.java.sip.communicator.util;
import java.awt.image.*;
import java.net.*;
+import java.util.*;
import javax.imageio.*;
@@ -15,6 +16,7 @@ import net.java.sip.communicator.service.browserlauncher.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.keybindings.*;
import net.java.sip.communicator.service.netaddr.*;
+import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.resources.*;
import org.jitsi.service.configuration.*;
@@ -54,7 +56,9 @@ public class UtilActivator
private static FileAccessService fileAccessService;
- private static BundleContext bundleContext;
+ private static MediaService mediaService;
+
+ static BundleContext bundleContext;
/**
* Network address manager service will inform us for changes in
@@ -259,6 +263,22 @@ public class UtilActivator
}
/**
+ * Returns an instance of the <tt>MediaService</tt> obtained from the
+ * bundle context.
+ * @return an instance of the <tt>MediaService</tt> obtained from the
+ * bundle context
+ */
+ public static MediaService getMediaService()
+ {
+ if (mediaService == null)
+ {
+ mediaService
+ = ServiceUtils.getService(bundleContext, MediaService.class);
+ }
+ return mediaService;
+ }
+
+ /**
* Returns the {@link MediaConfigurationService} instance registered in the
* <tt>BundleContext</tt> of the <tt>UtilActivator</tt>.
*
@@ -270,4 +290,47 @@ public class UtilActivator
return ServiceUtils.getService(bundleContext,
MediaConfigurationService.class);
}
+
+ /**
+ * Returns all <tt>ProtocolProviderFactory</tt>s obtained from the bundle
+ * context.
+ *
+ * @return all <tt>ProtocolProviderFactory</tt>s obtained from the bundle
+ * context
+ */
+ public static Map<Object, ProtocolProviderFactory>
+ getProtocolProviderFactories()
+ {
+ Map<Object, ProtocolProviderFactory> providerFactoriesMap
+ = new Hashtable<Object, ProtocolProviderFactory>();
+
+ ServiceReference[] serRefs = null;
+ try
+ {
+ // get all registered provider factories
+ serRefs
+ = bundleContext.getServiceReferences(
+ ProtocolProviderFactory.class.getName(),
+ null);
+ }
+ catch (InvalidSyntaxException e)
+ {
+ logger.error("LoginManager : " + e);
+ }
+
+ if (serRefs != null)
+ {
+ for (ServiceReference serRef : serRefs)
+ {
+ ProtocolProviderFactory providerFactory
+ = (ProtocolProviderFactory)
+ bundleContext.getService(serRef);
+
+ providerFactoriesMap.put(
+ serRef.getProperty(ProtocolProviderFactory.PROTOCOL),
+ providerFactory);
+ }
+ }
+ return providerFactoriesMap;
+ }
}