SDK Updater: fix install of new packages from remote page.
This commit is contained in:
@@ -241,7 +241,7 @@ public class LocalPackagesPage extends Composite implements ISdkListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onUpdateInstalledPackage() {
|
private void onUpdateInstalledPackage() {
|
||||||
mUpdaterData.updateAll(null /*selectedArchives*/);
|
mUpdaterData.updateOrInstallAll(null /*selectedArchives*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDeleteSelected() {
|
private void onDeleteSelected() {
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mUpdaterData != null) {
|
if (mUpdaterData != null) {
|
||||||
mUpdaterData.updateAll(archives);
|
mUpdaterData.updateOrInstallAll(archives);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -314,13 +314,24 @@ class UpdaterData {
|
|||||||
* This can be null, in which case a list of remote archive is fetched from all
|
* This can be null, in which case a list of remote archive is fetched from all
|
||||||
* available sources.
|
* available sources.
|
||||||
*/
|
*/
|
||||||
public void updateAll(Collection<Archive> selectedArchives) {
|
public void updateOrInstallAll(Collection<Archive> selectedArchives) {
|
||||||
if (selectedArchives == null) {
|
if (selectedArchives == null) {
|
||||||
refreshSources(true);
|
refreshSources(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Map<Archive, Archive> updates = findUpdates(selectedArchives);
|
final Map<Archive, Archive> updates = findUpdates(selectedArchives);
|
||||||
|
|
||||||
|
if (selectedArchives != null) {
|
||||||
|
// Not only we want to perform updates but we also want to install the
|
||||||
|
// selected archives. If they do not match an update, list them anyway
|
||||||
|
// except they map themselves to null (no "old" archive)
|
||||||
|
for (Archive a : selectedArchives) {
|
||||||
|
if (!updates.containsValue(a)) {
|
||||||
|
updates.put(a, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpdateChooserDialog dialog = new UpdateChooserDialog(this, updates);
|
UpdateChooserDialog dialog = new UpdateChooserDialog(this, updates);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user