Author: jflesch
Date: 2007-08-13 17:25:13 +0000 (Mon, 13 Aug 2007)
New Revision: 14655

Modified:
   trunk/apps/Thaw/src/thaw/plugins/index/Index.java
   trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
Log:
Use another icon for the index who can't be downloaded

Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2007-08-13 17:07:49 UTC 
(rev 14654)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2007-08-13 17:25:13 UTC 
(rev 14655)
@@ -83,6 +83,7 @@
        private Config config;

        private boolean isNew;
+       private boolean successful = true;


        /**
@@ -900,6 +901,7 @@
                                get.deleteObserver(this);

                                if (get.isSuccessful()) {
+                                       successful = true;

                                        String key = get.getFileKey();

@@ -949,6 +951,8 @@
                                        } else
                                                Logger.error(this, "No path 
specified in transfer ?!");
                                } else { /* if not successful */
+                                       successful = false;
+
                                        indexTree.removeUpdatingIndex(this);
                                }
                        }
@@ -1950,4 +1954,9 @@
                        Logger.error(this, "Can't set the category because : 
"+e.toString());
                }
        }
+
+
+       public boolean downloadSuccessful() {
+               return successful;
+       }
 }

Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java       2007-08-13 
17:07:49 UTC (rev 14654)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java       2007-08-13 
17:25:13 UTC (rev 14655)
@@ -770,11 +770,14 @@
                                                
setBackgroundSelectionColor(IndexTree.LOADING_SELECTION_COLOR);
                                        }

-                                       if (index.isModifiable()) {
-                                               setLeafIcon(IconBox.minIndex);
-                                       } else {
-                                               
setLeafIcon(IconBox.minIndexReadOnly);
-                                       }
+                                       if (index.downloadSuccessful()) {
+                                               if (index.isModifiable()) {
+                                                       
setLeafIcon(IconBox.minIndex);
+                                               } else {
+                                                       
setLeafIcon(IconBox.minIndexReadOnly);
+                                               }
+                                       } else
+                                               setLeafIcon(IconBox.minStop);

                                        if (index.isObsolete()) {
                                                
setTextNonSelectionColor(Color.RED);


Reply via email to