summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2013-01-16 23:50:03 (GMT)
committer Lisa Stillwell <lisa@renci.org>2013-01-16 23:50:03 (GMT)
commit545f53b39710b2ed243f9aa83a9452f501890c8e (patch)
tree7ce27db7c0c95e8101efe38b565e7c78ee7f80da /idrop-swing
parent687a70e1c30e09d9652fac73165b96646802e7fb (diff)
downloadQCG-Data-545f53b39710b2ed243f9aa83a9452f501890c8e.zip
QCG-Data-545f53b39710b2ed243f9aa83a9452f501890c8e.tar.gz
QCG-Data-545f53b39710b2ed243f9aa83a9452f501890c8e.tar.bz2
[#983] Upload dialog - if dataobject is selected for upload target, its parent is used instead, also Info dialog - sort users combo box for add permissions
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AddPermissionsDialog.java9
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java8
2 files changed, 15 insertions, 2 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AddPermissionsDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AddPermissionsDialog.java
index c40d397..306da4a 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AddPermissionsDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AddPermissionsDialog.java
@@ -6,6 +6,8 @@ package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
@@ -49,6 +51,13 @@ public class AddPermissionsDialog extends javax.swing.JDialog implements ActionL
try {
UserAO userAO = irodsFileSystem.getIRODSAccessObjectFactory().getUserAO(irodsAccount);
users = userAO.findAll();
+ Collections.sort(users, new Comparator<User>() {
+ @Override
+ public int compare(final User object1, final User object2) {
+ return object1.getName().compareTo(object2.getName());
+ }
+ } );
+
for (User user: users) {
cbPermissionsUserName.addItem(user.getNameWithZone());
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
index 2762455..8c08ba5 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
@@ -99,9 +99,13 @@ public class UploadDialog extends javax.swing.JDialog implements ListSelectionLi
try {
IRODSNode selectedNode = (IRODSNode) irodsFileSystemModel.getValueAt(idx, 0);
ifile = irodsFS.getIRODSFileForPath(selectedNode.getFullPath());
- // rule out "/"
+
+ // rule out "/" and choose parent if file is not a directory
String path = ifile.getAbsolutePath();
- if ((ifile.isDirectory()) && (path != null) && (!path.equals("/"))) {
+ if (ifile.isFile()) {
+ path = ifile.getParent();
+ }
+ if ((path != null) && (!path.equals("/"))) {
target = path;
}
} catch (IdropException ex) {