diff options
author | Tor Norbye <tnorbye@google.com> | 2012-10-11 08:26:22 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-10-11 08:26:22 -0700 |
commit | 4470f29469124b07887cfb3e064354bd5fcf13f9 (patch) | |
tree | 7a0fccd23409fc728de9efa6f434b5ec38d6cc01 /sdkmanager | |
parent | c62612166a097df2be8851d5daa4bdab087003c6 (diff) | |
download | sdk-4470f29469124b07887cfb3e064354bd5fcf13f9.zip sdk-4470f29469124b07887cfb3e064354bd5fcf13f9.tar.gz sdk-4470f29469124b07887cfb3e064354bd5fcf13f9.tar.bz2 |
Add label to AVD Creation dialog for no emulator images installed
It's pretty easy to end up installing a recent Android platform
without also installing an emulator image such as ARM or x86.
When you create an AVD, and you select that platform, the OK button
is disabled, but it isn't obvious why; there's a Target: label
next to an empty and disabled combo box.
This CL simply sets the text of the combo box to "No system images
installed for this target." (while keeping the combobox disabled) to
hopefully guide the user in the right direction.
Change-Id: I5dcc3e75944440f04e1054be35fe68be41de734f
Diffstat (limited to 'sdkmanager')
-rw-r--r-- | sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java index d788ccd..4006ac6 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java @@ -71,6 +71,7 @@ public class AvdCreationDialog extends GridDialog { private ImageFactory mImageFactory; private ILogger mSdkLog; private AvdInfo mAvdInfo; + private boolean mHaveSystemImage; // A map from manufacturers to their list of devices. private Map<String, List<Device>> mDeviceMap; @@ -668,7 +669,11 @@ public class AvdCreationDialog extends GridDialog { } } - if (systemImages.length == 1) { + mHaveSystemImage = systemImages.length > 0; + if (!mHaveSystemImage) { + mAbi.add("No system images installed for this target."); + mAbi.select(0); + } else if (systemImages.length == 1) { mAbi.select(0); } } @@ -730,7 +735,8 @@ public class AvdCreationDialog extends GridDialog { return; } - if (mTarget.getSelectionIndex() < 0 || mAbi.getSelectionIndex() < 0) { + if (mTarget.getSelectionIndex() < 0 || + !mHaveSystemImage || mAbi.getSelectionIndex() < 0) { setPageValid(false, error, warning); return; } |