"Delete" is only supported from within the Trash issue_3595
authorChristos KK Loverdos <loverdos@gmail.com>
Fri, 19 Apr 2013 14:56:55 +0000 (17:56 +0300)
committerChristos KK Loverdos <loverdos@gmail.com>
Fri, 19 Apr 2013 14:56:55 +0000 (17:56 +0300)
Refs #3595

src/gr/grnet/pithos/web/client/FileContextMenu.java
src/gr/grnet/pithos/web/client/FolderContextMenu.java
src/gr/grnet/pithos/web/client/Helpers.java
src/gr/grnet/pithos/web/client/Pithos.java
src/gr/grnet/pithos/web/client/ToolsMenu.java

index d680b47..13da4d9 100644 (file)
@@ -203,6 +203,11 @@ public class FileContextMenu extends PopupPanel {
         }
         boolean isFolderTreeSelected = selectedTree.equals(app.getFolderTreeView());
         boolean isMysharedSelected = selectedTree.equals(app.getMySharedTreeView());
+
+        Pithos.LOG("FileContextMenu(), selectedFolder=", selectedFolder);
+        Pithos.LOG("FileContextMenu(), isFolderTreeSelected=", isFolderTreeSelected);
+        Pithos.LOG("FileContextMenu(), isMysharedSelected=", isMysharedSelected);
+
         if (selectedFolder != null) {
                    if (!selectedFolder.isInTrash()) {
                        if (canWrite && app.getClipboard().hasFiles() && !isMysharedSelected) {
@@ -230,12 +235,10 @@ public class FileContextMenu extends PopupPanel {
                    else {
                                MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(images.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(app, this, selectedFiles));
                                contextMenu.addItem(restore);
-                   }
-        }
 
-        if (isFolderTreeSelected || isMysharedSelected) {
-                       deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, selectedFiles, MessagePanel.images));
-               contextMenu.addItem(deleteItem);
+                deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, selectedFiles, MessagePanel.images));
+                contextMenu.addItem(deleteItem);
+                   }
         }
 
         if (selectedFolder != null && !selectedFolder.isInTrash()) {
index 5554207..e846655 100644 (file)
@@ -119,10 +119,7 @@ public class FolderContextMenu extends PopupPanel {
                            if (isFolderTreeSelected && !folder.isContainer()) {
                                MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(app, this, folder));
                                contextMenu.addItem(moveToTrash);
-                       
-                               MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, folder, MessagePanel.images));
-                               contextMenu.addItem(delete);
-                       
+
                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(app, this, folder, PropertiesCommand.PROPERTIES)));
                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Share</span>", true, new PropertiesCommand(app, this, folder, PropertiesCommand.PERMISSIONS)));
                            }
@@ -137,18 +134,16 @@ public class FolderContextMenu extends PopupPanel {
                            }
                }
         }
-        else {
-               if (!folder.isTrash()) {
-                       MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(images.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(app, this, folder));
-                       contextMenu.addItem(restore);
+        else if(!folder.isTrash()) {
+            MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(images.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(app, this, folder));
+            contextMenu.addItem(restore);
 
-                       MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, folder, MessagePanel.images));
-                       contextMenu.addItem(delete);
-               }
-               else {
-                       MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Empty Trash</span>", true, new PurgeContainerCommand(app, this, folder));
-                       contextMenu.addItem(emptyTrash);
-               }
+            MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, folder, MessagePanel.images));
+            contextMenu.addItem(delete);
+        }
+        else {
+            MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Empty Trash</span>", true, new PurgeContainerCommand(app, this, folder));
+            contextMenu.addItem(emptyTrash);
         }
                add(contextMenu);
        }
index 5522d77..73705d5 100644 (file)
@@ -87,8 +87,13 @@ public final class Helpers {
 
                 final String body = response.getText();
                 if(body != null && body.trim().length() > 0) {
-                    final String s = body.trim().substring(0, 120);
-                    Pithos.LOG(body, body.length() <= 120 ? "" : " ...");
+                    if(Pithos.IsFullResponseBodyLOGEnabled) {
+                        Pithos.LOG(body);
+                    }
+                    else {
+                        final int LEN = 120;
+                        Pithos.LOG(body.trim().substring(0, LEN), body.length() <= LEN ? "" : " ...");
+                    }
                 }
 
                 final Header[] headers = response.getHeaders();
index 2baeaf6..dfc4359 100644 (file)
@@ -80,6 +80,8 @@ import java.util.*;
 public class Pithos implements EntryPoint, ResizeHandler {
     private static final boolean IsLOGEnabled = true;
     public static final boolean IsDetailedHTTPLOGEnabled = true;
+    public static final boolean IsFullResponseBodyLOGEnabled = true;
+
     public static final Set<String> HTTPHeadersToIgnoreInLOG = new HashSet<String>();
     static {
         HTTPHeadersToIgnoreInLOG.add(Const.HTTP_HEADER_CONNECTION);
@@ -87,6 +89,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
         HTTPHeadersToIgnoreInLOG.add(Const.HTTP_HEADER_KEEP_ALIVE);
         HTTPHeadersToIgnoreInLOG.add(Const.HTTP_HEADER_SERVER);
         HTTPHeadersToIgnoreInLOG.add(Const.HTTP_HEADER_VARY);
+        HTTPHeadersToIgnoreInLOG.add(Const.IF_MODIFIED_SINCE);
     }
 
     public static final Configuration config = GWT.create(Configuration.class);
index 19a21e0..f96e546 100644 (file)
@@ -152,17 +152,6 @@ public class ToolsMenu extends PopupPanel {
                                                contextMenu.addItem(moveToTrash);
                                                empty = false;
                                        }
-                               
-                                       MenuItem delete = null;
-                                       if (files != null && !files.isEmpty()) {
-                                               delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete files</span>", true, new DeleteCommand(app, this, files, MessagePanel.images));
-                                       }
-                                       else if (!folder.isContainer())
-                                               delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete folder</span>", true, new DeleteCommand(app, this, folder, MessagePanel.images));
-                                       if (delete != null) {
-                                               contextMenu.addItem(delete);
-                                               empty = false;
-                                       }
                                    }
                                    if (isFolderTreeSelected || isMysharedTreeSelected) {
                                        if (files != null && files.size() == 1) {
@@ -173,7 +162,7 @@ public class ToolsMenu extends PopupPanel {
                                        }
                                        else if (!folder.isContainer()) {
                                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Folder properties</span>", true, new PropertiesCommand(app, this, folder, PropertiesCommand.PROPERTIES)));
-                                               contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Folder sharing</span>", true, new PropertiesCommand(app, this, folder, PropertiesCommand.PERMISSIONS)));
+                                               contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Share</span>", true, new PropertiesCommand(app, this, folder, PropertiesCommand.PERMISSIONS)));
                                                empty = false;
                                        }
                                    }