Merge branch 'issue_3784' into develop
authorChristos KK Loverdos <loverdos@gmail.com>
Thu, 30 May 2013 09:47:10 +0000 (12:47 +0300)
committerChristos KK Loverdos <loverdos@gmail.com>
Thu, 30 May 2013 09:47:10 +0000 (12:47 +0300)
Refs #3784

src/gr/grnet/pithos/web/client/Const.java
src/gr/grnet/pithos/web/client/Pithos.java
src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java

index 42ef591..21e02bf 100644 (file)
@@ -61,6 +61,7 @@ public final class Const {
     public static final String TXT_SHARE_FOLDER = "Share Folder";
     public static final String TXT_PRIVATE_LINK = "Private Link";
     public static final String TXT_PUBLIC_LINK = "Public Link";
+    public static final String TXT_SHARED_WITH_ME = "Shared with me";
 
     public static final String HTML_NBSP = "&nbsp;";
 
index 1d2ac72..2ce488e 100644 (file)
@@ -287,7 +287,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
     private String userID = null;
 
     /**
-     * Hold mappings from user UUIDs to emails and vice-versa.
+     * Holds mappings from user UUIDs to emails and vice-versa.
      */
     private UserCatalogs userCatalogs = new UserCatalogs();
 
@@ -1302,10 +1302,17 @@ public class Pithos implements EntryPoint, ResizeHandler {
         });
         selectionModels.add(otherSharedTreeSelectionModel);
         otherSharedTreeViewModel = new OtherSharedTreeViewModel(Pithos.this, otherSharedTreeSelectionModel);
+        // #3784 We show it empty...
+        otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
+        trees.insert(otherSharedTreeView, 1);
+
         LOG("Pithos::createOtherSharedTree(), initializing otherSharedTreeViewModel with a callback");
         otherSharedTreeViewModel.initialize(new Command() {
             @Override
             public void execute() {
+                // #3784 ... then remove the empty stuff and add a new view with the populated model
+                trees.remove(otherSharedTreeView);
+
                 otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
                 trees.insert(otherSharedTreeView, 1);
                 treeViews.add(otherSharedTreeView);
index 90b89b3..50ae67a 100644 (file)
@@ -35,6 +35,7 @@
 
 package gr.grnet.pithos.web.client.othersharedtree;
 
+import gr.grnet.pithos.web.client.Const;
 import gr.grnet.pithos.web.client.FolderContextMenu;
 import gr.grnet.pithos.web.client.PithosDisclosurePanel;
 import gr.grnet.pithos.web.client.TreeView;
@@ -156,7 +157,7 @@ public class OtherSharedTreeView extends Composite implements TreeView {
     public OtherSharedTreeView(OtherSharedTreeViewModel viewModel) {
         this.model = viewModel;
         
-        PithosDisclosurePanel panel = new PithosDisclosurePanel((Resources) GWT.create(Resources.class), "Shared with me", false); 
+        PithosDisclosurePanel panel = new PithosDisclosurePanel((Resources) GWT.create(Resources.class), Const.TXT_SHARED_WITH_ME, false);
         /*
          * Create the tree using the model. We use <code>null</code> as the default
          * value of the root node. The default value will be passed to