From 301eea2962d202b7750a1e75c9a0847f95e309cd Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 20 Oct 2009 14:54:30 -0700 Subject: [PATCH] SDK Updater: UI polish 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 --- .../com/android/sdklib/internal/repository/Archive.java | 4 +++- .../sdkuilib/internal/repository/RemotePackagesPage.java | 2 +- .../internal/repository/UpdateChooserDialog.java | 9 +++++++-- .../sdkuilib/internal/repository/UpdaterData.java | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java index d7c562587..41443add3 100755 --- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java +++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java @@ -397,7 +397,7 @@ public class Archive implements IDescription { archiveFile = downloadFile(monitor, forceHttp); if (archiveFile != null) { if (unarchive(osSdkRoot, archiveFile, sdkManager, monitor)) { - monitor.setResult("Installed: %1$s", name); + monitor.setResult("Installed %1$s", name); return true; } } @@ -424,6 +424,7 @@ public class Archive implements IDescription { String name = getParentPackage().getShortDescription(); String desc = String.format("Downloading %1$s", name); monitor.setDescription(desc); + monitor.setResult(desc); String link = getUrl(); if (!link.startsWith("http://") //$NON-NLS-1$ @@ -611,6 +612,7 @@ public class Archive implements IDescription { String pkgName = getParentPackage().getShortDescription(); String pkgDesc = String.format("Installing %1$s", pkgName); monitor.setDescription(pkgDesc); + monitor.setResult(pkgDesc); // We always unzip in a temp folder which name depends on the package type // (e.g. addon, tools, etc.) and then move the folder to the destination folder. diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java index a2432f9ec..8757e668d 100755 --- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java +++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java @@ -103,7 +103,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener { mColumnSource = new TreeColumn(mTreeSources, SWT.NONE); mColumnSource.setWidth(289); - mColumnSource.setText("Sources, Packages and Archives"); + mColumnSource.setText("Sites, Packages and Archives"); mDescriptionContainer = new Group(parent, SWT.NONE); mDescriptionContainer.setLayout(new GridLayout(1, false)); diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java index 087884e43..11919a0bc 100755 --- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java +++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdateChooserDialog.java @@ -267,7 +267,9 @@ final class UpdateChooserDialog extends Dialog { // Bottom buttons area placeholder = new Label(mDialogShell, SWT.NONE); - placeholder.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1)); + placeholder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); + placeholder.setText("[*] Something depends on this package"); + placeholder.setEnabled(false); // for MacOS, the Cancel button should be left. if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) { @@ -522,8 +524,11 @@ final class UpdateChooserDialog extends Dialog { String license = pNew.getLicense(); if (license != null) { addSectionTitle("License\n"); - addText(license.trim(), "\n"); //$NON-NLS-1$ + addText(license.trim(), "\n\n"); //$NON-NLS-1$ } + + addSectionTitle("Site\n"); + addText(pNew.getParentSource().getShortDescription()); } /** diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java index a23ae3983..ec55c2688 100755 --- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java +++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java @@ -306,7 +306,7 @@ class UpdaterData { } ArchiveInfo adep = ai.getDependsOn(); - if (adep != null && !installedArchives.contains(adep)) { + if (adep != null && !installedArchives.contains(adep.getNewArchive())) { // This archive depends on another one that was not installed. // Skip it. monitor.setResult("Skipping '%1$s'; it depends on '%2$s' which was not installed.", @@ -435,8 +435,8 @@ class UpdaterData { public void run() { MessageDialog.openInformation(mWindowShell, "Android Tools Updated", - "The Android SDK tool that you are currently using has been updated. " + - "It is recommended that you now close the Android SDK window and re-open it. " + + "The Android SDK and AVD Manager that you are currently using has been updated. " + + "It is recommended that you now close the manager window and re-open it. " + "If you started this window from Eclipse, please check if the Android " + "plug-in needs to be updated."); }