From 486ffa6d0abfa0b91dc7ab22ee71758b5eecfb88 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 26 Sep 2007 18:57:15 +0000
Subject: [PATCH] Fix for 2306: configure replication encryption on or off in dsreplication and setup-gui

---
 opends/src/quicksetup/org/opends/quicksetup/installer/ui/DataReplicationPanel.java |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/ui/DataReplicationPanel.java b/opends/src/quicksetup/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
index 424c8b5..e7a042b 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
@@ -72,6 +72,7 @@
 
   private JRadioButton rbStandalone;
   private JRadioButton rbReplicated;
+  private JCheckBox cbSecureReplication;
   private JCheckBox cbTopologyExists;
   private JCheckBox cbRemoteServerPortSecure;
   private HashMap<FieldName, JLabel> hmLabels =
@@ -128,6 +129,17 @@
         value = Boolean.FALSE;
       }
     }
+    else if (fieldName == FieldName.REPLICATION_SECURE)
+    {
+      if (cbSecureReplication.isSelected())
+      {
+        value = Boolean.TRUE;
+      }
+      else
+      {
+        value = Boolean.FALSE;
+      }
+    }
     else
     {
       JTextComponent field = getField(fieldName);
@@ -187,18 +199,23 @@
     panel.add(auxPanel, gbc);
     panel.add(cbTopologyExists, gbc);
     gbc.insets = UIFactory.getEmptyInsets();
-    gbc.gridwidth = 3;
+    gbc.gridwidth = 4;
     gbc.weightx = 0.0;
     gbc.insets.left = 0;
     gbc.anchor = GridBagConstraints.WEST;
     auxPanel.add(getLabel(FieldName.REPLICATION_PORT), gbc);
 
-    gbc.gridwidth = GridBagConstraints.RELATIVE;
+    gbc.gridwidth--;
     gbc.insets.left = UIFactory.LEFT_INSET_SECONDARY_FIELD;
     gbc.fill = GridBagConstraints.HORIZONTAL;
     gbc.weightx = 0.0;
     auxPanel.add(getField(FieldName.REPLICATION_PORT), gbc);
 
+    gbc.gridwidth = GridBagConstraints.RELATIVE;
+    gbc.fill = GridBagConstraints.HORIZONTAL;
+    gbc.weightx = 0.0;
+    auxPanel.add(cbSecureReplication, gbc);
+
     gbc.gridwidth = GridBagConstraints.REMAINDER;
     gbc.insets.left = 0;
     gbc.weightx = 1.0;
@@ -482,6 +499,12 @@
       DataReplicationOptions.Type.STANDALONE);
     rbReplicated.setSelected(type !=
       DataReplicationOptions.Type.STANDALONE);
+    cbSecureReplication = UIFactory.makeJCheckBox(
+        INFO_SECURE_REPLICATION_LABEL.get(),
+        INFO_SECURE_REPLICATION_TOOLTIP.get(),
+        UIFactory.TextStyle.SECONDARY_FIELD_VALID);
+    cbSecureReplication.setSelected(
+        defaultUserData.getReplicationOptions().useSecureReplication());
     cbTopologyExists.setSelected(type ==
       DataReplicationOptions.Type.IN_EXISTING_TOPOLOGY);
     cbRemoteServerPortSecure = UIFactory.makeJCheckBox(
@@ -564,6 +587,7 @@
     rbReplicated.addFocusListener(l);
     rbStandalone.addFocusListener(l);
     cbTopologyExists.addFocusListener(l);
+    cbSecureReplication.addFocusListener(l);
 
     lastFocusComponent = rbStandalone;
   }
@@ -619,6 +643,7 @@
     cbTopologyExists.setEnabled(rbReplicated.isSelected());
     getLabel(FieldName.REPLICATION_PORT).setEnabled(rbReplicated.isSelected());
     getField(FieldName.REPLICATION_PORT).setEnabled(rbReplicated.isSelected());
+    cbSecureReplication.setEnabled(rbReplicated.isSelected());
     cbRemoteServerPortSecure.setEnabled(enableFields);
   }
 

--
Gitblit v1.10.0