summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gui
diff options
context:
space:
mode:
authorDhandapani <dhandapani@gluster.com>2011-04-18 16:55:38 +0530
committerDhandapani <dhandapani@gluster.com>2011-04-18 17:09:21 +0530
commit07b3a7a7a2ec5a2c50b320a9f54c8d619b2ff107 (patch)
treec93868e247dbe5734aecadc446f527643498dc18 /src/com.gluster.storage.management.gui
parente9a881d2b9660732fb9e08eac70471c1d9827370 (diff)
parent07d0360faefd568aa1bb4bce0d7833dd3a1e9bab (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'src/com.gluster.storage.management.gui')
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java8
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
index 8e63378e..e319dcca 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
@@ -323,11 +323,11 @@ public class CreateVolumePage1 extends WizardPage {
setError("At least one disk must be selected!");
}
- String volumeType = Volume.getVolumeTypeStr((VOLUME_TYPE) ((IStructuredSelection) typeComboViewer
- .getSelection()).getFirstElement());
- if (volumeType.equals(Volume.getVolumeTypeStr(VOLUME_TYPE.DISTRIBUTED_MIRROR)) && (diskCount % 2 != 0)) {
+ VOLUME_TYPE volumeType = (VOLUME_TYPE) ((IStructuredSelection) typeComboViewer
+ .getSelection()).getFirstElement();
+ if (volumeType == VOLUME_TYPE.DISTRIBUTED_MIRROR && diskCount % 2 != 0) {
setError("Mirror type volume requires disks in multiples of two");
- } else if (volumeType.equals(Volume.getVolumeTypeStr(VOLUME_TYPE.DISTRIBUTED_STRIPE)) && (diskCount % 4 != 0)) {
+ } else if (volumeType == VOLUME_TYPE.DISTRIBUTED_STRIPE && diskCount % 4 != 0) {
setError("Stripe type volume requires disks in multiples of four");
}
}
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
index b3f7ca3a..a94ae25a 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
@@ -52,6 +52,7 @@ public class OptionKeyEditingSupport extends EditingSupport {
@SuppressWarnings("unchecked")
@Override
protected void setValue(final Object element, final Object value) {
+ Entry<String, String> oldEntry = (Entry<String, String>)element;
Integer newValue = (Integer)value;
String newKey = allowedKeys[newValue];
@@ -61,7 +62,7 @@ public class OptionKeyEditingSupport extends EditingSupport {
}
// value has changed. set volume option at back-end and update model accordingly
- volume.getOptions().remove("");
+ volume.getOptions().remove(oldEntry.getKey());
volume.setOption(newKey, "");
getViewer().refresh();
}