TUP-16277: ensure if the preference exists (#722)

This commit is contained in:
nrousseau
2016-11-09 18:49:33 +08:00
committed by GGu
parent f7e3ea2260
commit 47cbaac950

View File

@@ -59,10 +59,9 @@ abstract public class DownloadModuleRunnable implements IRunnableWithProgress {
@Override
public void run(final IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor
.convert(
monitor,
Messages.getString("ExternalModulesInstallDialog.downloading2") + " (" + toDownload.size() + ")", toDownload.size() * 10 + 5); //$NON-NLS-1$
SubMonitor subMonitor = SubMonitor.convert(monitor,
Messages.getString("ExternalModulesInstallDialog.downloading2") + " (" + toDownload.size() + ")", //$NON-NLS-1$
toDownload.size() * 10 + 5);
if (checkAndAcceptLicenses(subMonitor)) {
downLoad(subMonitor);
}
@@ -74,10 +73,9 @@ abstract public class DownloadModuleRunnable implements IRunnableWithProgress {
}
private void downLoad(final IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor
.convert(
monitor,
Messages.getString("ExternalModulesInstallDialog.downloading2") + " (" + toDownload.size() + ")", toDownload.size()); //$NON-NLS-1$
SubMonitor subMonitor = SubMonitor.convert(monitor,
Messages.getString("ExternalModulesInstallDialog.downloading2") + " (" + toDownload.size() + ")", //$NON-NLS-1$
toDownload.size());
// TUP-3135 : stop to try to download at the first timeout.
boolean connectionTimeOut = false;
@@ -88,7 +86,8 @@ abstract public class DownloadModuleRunnable implements IRunnableWithProgress {
try {
// check license
boolean isLicenseAccepted = module.isFromCustomNexus()
|| LibManagerUiPlugin.getDefault().getPreferenceStore().getBoolean(module.getLicenseType());
|| (LibManagerUiPlugin.getDefault().getPreferenceStore().contains(module.getLicenseType())
&& LibManagerUiPlugin.getDefault().getPreferenceStore().getBoolean(module.getLicenseType()));
accepted = isLicenseAccepted;
if (!accepted) {
subMonitor.worked(1);
@@ -160,8 +159,8 @@ abstract public class DownloadModuleRunnable implements IRunnableWithProgress {
@Override
public void run() {
AcceptModuleLicensesWizard licensesWizard = new AcceptModuleLicensesWizard(toDownload);
AcceptModuleLicensesWizardDialog wizardDialog = new AcceptModuleLicensesWizardDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell(), licensesWizard, toDownload, monitor);
AcceptModuleLicensesWizardDialog wizardDialog = new AcceptModuleLicensesWizardDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), licensesWizard, toDownload, monitor);
wizardDialog.setPageSize(700, 380);
wizardDialog.create();
if (wizardDialog.open() != Window.OK) {