summaryrefslogtreecommitdiffstats
path: root/dozentenmodul
diff options
context:
space:
mode:
authorJonathan Bauer2018-11-27 10:41:51 +0100
committerJonathan Bauer2018-11-27 10:41:51 +0100
commit8fb02a55f8aa2aea2d6933c239b7082896118750 (patch)
tree86ac507f9be0d3b361702b989545cd7c060d58e2 /dozentenmodul
parent[client] Support predefined filters in LDAP editor (diff)
downloadtutor-module-8fb02a55f8aa2aea2d6933c239b7082896118750.tar.gz
tutor-module-8fb02a55f8aa2aea2d6933c239b7082896118750.tar.xz
tutor-module-8fb02a55f8aa2aea2d6933c239b7082896118750.zip
[client] fill new form fields on netshare selection
Diffstat (limited to 'dozentenmodul')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
index 39eaf102..18efe906 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
@@ -70,11 +70,12 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// share from the list is selected: fill bottom form and change "Add" to "Apply"
btnDel.setEnabled(true);
tfSharePath.setText(item.path);
- tfShareName.setText(item.displayname);
+ tfShareName.setText(item.displayname.equals(String.valueOf(EMPTY_MARKER)) ? "" : item.displayname);
tfUsername.setText(item.username);
tfPassword.setText(item.password);
cboNetshareAuth.setSelectedItem(item.auth);
cboNetshareMountPoint.setSelectedItem(Character.valueOf(item.mountpoint.charAt(0)));
+ chkIsPrinter.setSelected(item.mountpoint.equals(PRINTER_MARKER));
btnAdd.setText("Ändern");
}
});
@@ -159,7 +160,6 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// process mount point and printer check box
Character inputMountPoint = cboNetshareMountPoint
.getItemAt(cboNetshareMountPoint.getSelectedIndex());
-
if (!chkIsPrinter.isSelected()) {
if (inputMountPoint == null) {
lblError.setText("Kein Laufwerk angegeben!");
@@ -167,13 +167,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
}
input.mountpoint = String.valueOf(inputMountPoint);
} else {
- if (inputMountPoint == null)
- input.mountpoint = String.valueOf(EMPTY_MARKER);
- else
- if (!inputMountPoint.equals(EMPTY_MARKER))
- input.mountpoint = PRINTER_MARKER;
- else
- input.mountpoint = String.valueOf(inputMountPoint);
+ input.mountpoint = PRINTER_MARKER;
}
// now decide whether to create a new entry or update existing one
@@ -182,7 +176,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// editing existing one, delete it from the internal data
if (!shareList.remove(oldEntry)) {
lblError.setText("Änderung fehlgeschlagen!");
- LOGGER.debug("Failed to remove selected share for replacement: " + oldEntry);
+ LOGGER.error("Failed to remove selected share for replacement: " + oldEntry);
return;
}
tblNetshare.setData(shareList, false);
@@ -262,6 +256,8 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
tfPassword.setText(null);
cboNetshareAuth.setSelectedItem(null);
cboNetshareMountPoint.setSelectedItem(null);
+ chkIsPrinter.setSelected(false);
+ chkShowPass.setSelected(false);
btnAdd.setText("Hinzufügen");
}
public List<NetShare> getState() {