OSDN Git Service

Clarify SDK loading message
authorTor Norbye <tnorbye@google.com>
Wed, 28 Sep 2011 17:30:22 +0000 (10:30 -0700)
committerTor Norbye <tnorbye@google.com>
Wed, 28 Sep 2011 18:52:58 +0000 (11:52 -0700)
When SDKs are still loading there is a "please wait" message in the
status window. It would say "The project target (Android 2.3) ..."
when loading rendering targets, which was a bit confusing. The message
will now say "project target" when loading the target that is the
current project target, and otherwise the "rendering target".

Also change the refresh message to just say "The layout will refresh"
instead of mentioning it by name since when the layout name is
lowercase (as it usually is) the sentence begins with a lowercase
letter which looks a bit wrong (and besides there is no ambiguity
about which layout is going to be reloaded).

Change-Id: I2497ba3a35289e9c3f37021cd8a17983e18146cb

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java

index 8ecf9df..393af70 100644 (file)
@@ -1195,16 +1195,27 @@ public class GraphicalEditorPart extends EditorPart
 
                     // display error is asked.
                     if (displayError) {
+                        String targetName = target.getName();
                         switch (targetLoadStatus) {
                             case LOADING:
-                                displayError("The project target (%1$s) is still loading.\n%2$s will refresh automatically once the process is finished.",
-                                        target.getName(), mEditedFile.getName());
+                                String s;
+                                if (currentSdk.getTarget(getProject()) == target) {
+                                    s = String.format(
+                                            "The project target (%1$s) is still loading.",
+                                            targetName);
+                                } else {
+                                    s = String.format(
+                                            "The rendering target (%1$s) is still loading.",
+                                            targetName);
+                                }
+                                s += "\nThe layout will refresh automatically once the process is finished.";
+                                displayError(s);
 
                                 break;
                             case FAILED: // known failure
                             case LOADED: // success but data isn't loaded?!?!
                                 displayError("The project target (%s) was not properly loaded.",
-                                        target.getName());
+                                        targetName);
                                 break;
                         }
                     }