OSDN Git Service

SDK Manager: fix displayed dependencies at installation.
authorRaphael <raphael@google.com>
Sun, 7 Mar 2010 03:09:22 +0000 (19:09 -0800)
committerRaphael <raphael@google.com>
Sun, 7 Mar 2010 03:13:27 +0000 (19:13 -0800)
2 changes:
- No longer display packages already locally installed as dependencies.
- Changed the wording at install time to clearly indicate that
  "installing package X also requires installing Y and Z".

That's just wording but I think it should clear the confusion and
really says what the code is actually going to do, e.g.:
- if X depends on tools r5 and you don't have r5, it will correctly
  state "requires installing missing tools r5"
- if X depends on tools r5 and you have r6 in the repo, it will
  correctly state "requires installing tools r6".

SDK Bug 2418140

Change-Id: I84f8d145d896102410349241ad39eadd09215de8

sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java
sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterLogic.java

index 627c5a0..2f64edd 100755 (executable)
@@ -184,7 +184,8 @@ final class UpdateChooserDialog extends GridDialog {
         mPackageTextGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));\r
         mPackageTextGroup.setLayout(new GridLayout(1, false/*makeColumnsEqual*/));\r
 \r
-        mPackageText = new StyledText(mPackageTextGroup,\r                        SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);\r
+        mPackageText = new StyledText(mPackageTextGroup,\r
+                        SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);\r
         mPackageText.setBackground(\r
                 getParentShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));\r
         mPackageText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));\r
@@ -451,7 +452,7 @@ final class UpdateChooserDialog extends GridDialog {
             addSectionTitle("Dependencies\n");\r
 \r
             if (aDeps != null && aDeps.length > 0) {\r
-                addText("This package depends on:");\r
+                addText("Installing this package also requires installing:");\r
                 for (ArchiveInfo aDep : aDeps) {\r
                     addText(String.format("\n- %1$s",\r
                             aDep.getShortDescription()));\r
index 36f277b..14f3da8 100755 (executable)
@@ -425,7 +425,7 @@ class UpdaterLogic {
                 if (p instanceof ToolPackage) {\r
                     if (((ToolPackage) p).getRevision() >= rev) {\r
                         // We found one already installed.\r
-                        return ai;\r
+                        return null;\r
                     }\r
                 }\r
             }\r
@@ -520,7 +520,7 @@ class UpdaterLogic {
                 if (p instanceof PlatformPackage) {\r
                     if (v.equals(((PlatformPackage) p).getVersion())) {\r
                         // We found one already installed.\r
-                        return ai;\r
+                        return null;\r
                     }\r
                 }\r
             }\r
@@ -623,7 +623,7 @@ class UpdaterLogic {
                 if (p instanceof PlatformPackage) {\r
                     if (((PlatformPackage) p).getVersion().isGreaterOrEqualThan(api)) {\r
                         // We found one already installed.\r
-                        return ai;\r
+                        return null;\r
                     }\r
                 }\r
             }\r