OSDN Git Service

SDK Updater: UI polish
authorRaphael <raphael@google.com>
Tue, 20 Oct 2009 21:54:30 +0000 (14:54 -0700)
committerRaphael <raphael@google.com>
Tue, 20 Oct 2009 21:54:30 +0000 (14:54 -0700)
Fixes the following issues:
- Updater says it didnd't install addon and then install it
  (cause: UpdaterData was looking for an ArchiveInfo in a map of Archive)
- Added a label explaining the [*] in the dependency list.
- Added the originating site to the long description in the package chooser.
- Display downloading/installing comments in the result window.
- Fixed app name in dialog when tools are updated.

Change-Id: I075d2eaeb357f33671f7e9e70a906ca48000908d

tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java
tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java
tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java
tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java

index d7c5625..41443ad 100755 (executable)
@@ -397,7 +397,7 @@ public class Archive implements IDescription {
             archiveFile = downloadFile(monitor, forceHttp);\r
             if (archiveFile != null) {\r
                 if (unarchive(osSdkRoot, archiveFile, sdkManager, monitor)) {\r
-                    monitor.setResult("Installed: %1$s", name);\r
+                    monitor.setResult("Installed %1$s", name);\r
                     return true;\r
                 }\r
             }\r
@@ -424,6 +424,7 @@ public class Archive implements IDescription {
             String name = getParentPackage().getShortDescription();\r
             String desc = String.format("Downloading %1$s", name);\r
             monitor.setDescription(desc);\r
+            monitor.setResult(desc);\r
 \r
             String link = getUrl();\r
             if (!link.startsWith("http://")                          //$NON-NLS-1$\r
@@ -611,6 +612,7 @@ public class Archive implements IDescription {
         String pkgName = getParentPackage().getShortDescription();\r
         String pkgDesc = String.format("Installing %1$s", pkgName);\r
         monitor.setDescription(pkgDesc);\r
+        monitor.setResult(pkgDesc);\r
 \r
         // We always unzip in a temp folder which name depends on the package type\r
         // (e.g. addon, tools, etc.) and then move the folder to the destination folder.\r
index a2432f9..8757e66 100755 (executable)
@@ -103,7 +103,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
 \r
         mColumnSource = new TreeColumn(mTreeSources, SWT.NONE);\r
         mColumnSource.setWidth(289);\r
-        mColumnSource.setText("Sources, Packages and Archives");\r
+        mColumnSource.setText("Sites, Packages and Archives");\r
 \r
         mDescriptionContainer = new Group(parent, SWT.NONE);\r
         mDescriptionContainer.setLayout(new GridLayout(1, false));\r
index 087884e..11919a0 100755 (executable)
@@ -267,7 +267,9 @@ final class UpdateChooserDialog extends Dialog {
         // Bottom buttons area\r
 \r
         placeholder = new Label(mDialogShell, SWT.NONE);\r
-        placeholder.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));\r
+        placeholder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));\r
+        placeholder.setText("[*] Something depends on this package");\r
+        placeholder.setEnabled(false);\r
 \r
         // for MacOS, the Cancel button should be left.\r
         if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) {\r
@@ -522,8 +524,11 @@ final class UpdateChooserDialog extends Dialog {
         String license = pNew.getLicense();\r
         if (license != null) {\r
             addSectionTitle("License\n");\r
-            addText(license.trim(), "\n");                                       //$NON-NLS-1$\r
+            addText(license.trim(), "\n\n");                                       //$NON-NLS-1$\r
         }\r
+\r
+        addSectionTitle("Site\n");\r
+        addText(pNew.getParentSource().getShortDescription());\r
     }\r
 \r
     /**\r
index a23ae39..ec55c26 100755 (executable)
@@ -306,7 +306,7 @@ class UpdaterData {
                         }\r
 \r
                         ArchiveInfo adep = ai.getDependsOn();\r
-                        if (adep != null && !installedArchives.contains(adep)) {\r
+                        if (adep != null && !installedArchives.contains(adep.getNewArchive())) {\r
                             // This archive depends on another one that was not installed.\r
                             // Skip it.\r
                             monitor.setResult("Skipping '%1$s'; it depends on '%2$s' which was not installed.",\r
@@ -435,8 +435,8 @@ class UpdaterData {
             public void run() {\r
                 MessageDialog.openInformation(mWindowShell,\r
                         "Android Tools Updated",\r
-                        "The Android SDK tool that you are currently using has been updated. " +\r
-                        "It is recommended that you now close the Android SDK window and re-open it. " +\r
+                        "The Android SDK and AVD Manager that you are currently using has been updated. " +\r
+                        "It is recommended that you now close the manager window and re-open it. " +\r
                         "If you started this window from Eclipse, please check if the Android " +\r
                         "plug-in needs to be updated.");\r
             }\r