From 006ec41a8f00600ee787510dbf1809be360b0947 Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Thu, 26 Jan 2012 15:04:39 +0200 Subject: [PATCH] Fixed tools and folder context menus --- src/gr/grnet/pithos/web/client/FolderContextMenu.java | 6 ++++-- src/gr/grnet/pithos/web/client/ToolsMenu.java | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gr/grnet/pithos/web/client/FolderContextMenu.java b/src/gr/grnet/pithos/web/client/FolderContextMenu.java index 4f42d4a..15e9859 100644 --- a/src/gr/grnet/pithos/web/client/FolderContextMenu.java +++ b/src/gr/grnet/pithos/web/client/FolderContextMenu.java @@ -107,8 +107,10 @@ public class FolderContextMenu extends PopupPanel { } } - MenuItem copy = new MenuItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(app, this, folder)); - contextMenu.addItem(copy); + if (!folder.isContainer()) { + MenuItem copy = new MenuItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(app, this, folder)); + contextMenu.addItem(copy); + } if (canWrite) { if (!app.getClipboard().isEmpty()) { diff --git a/src/gr/grnet/pithos/web/client/ToolsMenu.java b/src/gr/grnet/pithos/web/client/ToolsMenu.java index d0719f2..9b12832 100644 --- a/src/gr/grnet/pithos/web/client/ToolsMenu.java +++ b/src/gr/grnet/pithos/web/client/ToolsMenu.java @@ -121,9 +121,10 @@ public class ToolsMenu extends PopupPanel { MenuItem copy = null; if (files != null && !files.isEmpty()) copy = new MenuItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy files", true, new CopyCommand(app, this, files)); - else + else if (!folder.isContainer()) copy = new MenuItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy folder", true, new CopyCommand(app, this, folder)); - contextMenu.addItem(copy); + if (copy != null) + contextMenu.addItem(copy); if (canWrite) { if (!app.getClipboard().isEmpty()) { @@ -173,7 +174,7 @@ public class ToolsMenu extends PopupPanel { if (properties != null) contextMenu.addItem(properties); } - if (files != null) { + if (files != null && !files.isEmpty()) { contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download", true, new Command() { @Override -- 1.7.10.4