OSDN Git Service

Cherrypick f37031 from master. do not merge.
authorTor Norbye <tnorbye@google.com>
Wed, 28 Sep 2011 17:30:22 +0000 (10:30 -0700)
committerXavier Ducrohet <xav@android.com>
Thu, 29 Sep 2011 21:15:52 +0000 (14:15 -0700)
Clarify SDK loading message

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: I8d6a456c2c8ba5fe539d07eef1f5a017c9b8454a

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;
                         }
                     }