aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Bauersachs <ingo@jitsi.org>2013-12-05 21:10:51 +0100
committerIngo Bauersachs <ingo@jitsi.org>2013-12-05 21:10:51 +0100
commit8c44de8fa62ed89b85f823df85bef5c21c763678 (patch)
tree855a1f0b50d7de418e403c5fc4b809972321a5fa
parente5d53660a2922921aa34f989fc480b7444041a83 (diff)
downloadjitsi-8c44de8fa62ed89b85f823df85bef5c21c763678.zip
jitsi-8c44de8fa62ed89b85f823df85bef5c21c763678.tar.gz
jitsi-8c44de8fa62ed89b85f823df85bef5c21c763678.tar.bz2
Store fallback resolver IP also when leaving the config panel
-rw-r--r--src/net/java/sip/communicator/plugin/dnsconfig/ParallelDnsPanel.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/net/java/sip/communicator/plugin/dnsconfig/ParallelDnsPanel.java b/src/net/java/sip/communicator/plugin/dnsconfig/ParallelDnsPanel.java
index ef0d5aa..64a0a4c 100644
--- a/src/net/java/sip/communicator/plugin/dnsconfig/ParallelDnsPanel.java
+++ b/src/net/java/sip/communicator/plugin/dnsconfig/ParallelDnsPanel.java
@@ -12,6 +12,7 @@ import static net.java.sip.communicator.util.NetworkUtils.*;
import java.awt.*;
import java.awt.event.*;
+import java.beans.*;
import java.text.*;
import java.util.*;
@@ -38,7 +39,8 @@ public class ParallelDnsPanel
extends TransparentPanel
implements ActionListener,
ChangeListener,
- FocusListener
+ FocusListener,
+ PropertyChangeListener
{
private static final long serialVersionUID = 4393128042592738855L;
@@ -66,8 +68,8 @@ public class ParallelDnsPanel
{
initServices();
initComponents();
- initBehavior();
loadData();
+ initBehavior();
}
/**
@@ -238,8 +240,7 @@ public class ParallelDnsPanel
chkBackupDnsEnabled.addActionListener(this);
txtBackupResolver.addActionListener(this);
txtBackupResolver.addFocusListener(this);
- txtBackupResolverFallbackIP.addActionListener(this);
- txtBackupResolverFallbackIP.addFocusListener(this);
+ txtBackupResolverFallbackIP.addPropertyChangeListener("value", this);
spnBackupResolverPort.addChangeListener(this);
spnDnsTimeout.addChangeListener(this);
spnDnsRedemption.addChangeListener(this);
@@ -304,13 +305,6 @@ public class ParallelDnsPanel
txtBackupResolver.getText()
);
}
- else if(e.getSource() == txtBackupResolverFallbackIP)
- {
- configService.setProperty(
- PNAME_BACKUP_RESOLVER_FALLBACK_IP,
- txtBackupResolverFallbackIP.getValue().toString()
- );
- }
else if(e.getSource() == spnBackupResolverPort)
{
configService.setProperty(
@@ -335,6 +329,23 @@ public class ParallelDnsPanel
}
/**
+ * Stores the changed UI value in the configuration
+ * @param e An event object required to provide access to the
+ * source UI element
+ */
+ @Override
+ public void propertyChange(PropertyChangeEvent evt)
+ {
+ if(evt.getSource() == txtBackupResolverFallbackIP)
+ {
+ configService.setProperty(
+ PNAME_BACKUP_RESOLVER_FALLBACK_IP,
+ txtBackupResolverFallbackIP.getValue().toString()
+ );
+ }
+ }
+
+ /**
* Creates a formatter for the fallback IP textfield to validate whether
* the entered text is actually an IP address
* @return A formatter accepting only IP addresses in text form