# HG changeset patch # User dadubrow # Date 1267626445 21600 # Node ID 856622c7b2035f587053fb297c4966f4049dad12 # Parent 5d70f98a074606639346fefc724e6728e39b1ce3 10809 - generating warning for missing sis file or missing exe diff -r 5d70f98a0746 -r 856622c7b203 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Tue Mar 02 15:31:42 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Wed Mar 03 08:27:25 2010 -0600 @@ -355,7 +355,7 @@ return null; } - private IPath getExePath() { + public IPath getExePath() { // if attach, doesn't matter so return first exe if (exeSelection.equals(EExeSelection.ATTACH_TO_PROCESS)) return exes.isEmpty() ? Path.EMPTY : exes.get(0); diff -r 5d70f98a0746 -r 856622c7b203 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java Tue Mar 02 15:31:42 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java Wed Mar 03 08:27:25 2010 -0600 @@ -17,6 +17,7 @@ package com.nokia.cdt.internal.debug.launch.newwizard; +import java.io.File; import java.text.MessageFormat; import java.util.ArrayList; @@ -31,6 +32,7 @@ import com.nokia.cdt.internal.debug.launch.LaunchPlugin; import com.nokia.cdt.internal.debug.launch.newwizard.IWizardSection.ISectionChangeListener; +import com.nokia.cdt.internal.debug.launch.newwizard.LaunchWizardData.EExeSelection; import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; /** @@ -126,6 +128,13 @@ status.getMessage())); severity = Math.max(severity, status.getSeverity()); } + if (severity == IStatus.OK) { + IStatus status = getStatus(); + if (!status.isOK()) { + builder.append(status.getMessage()); + severity = status.getSeverity(); + } + } if (severity != 0 || builder.length() > 0) { // error from one or more sections pageStatus = new Status(severity, LaunchPlugin.PLUGIN_ID, builder.toString()); @@ -138,7 +147,7 @@ if (pageStatus != null && !pageStatus.isOK()) { setMessage(pageStatus.getMessage(), severityToMsgType(pageStatus.getSeverity())); - setPageComplete(false); + setPageComplete(pageStatus.getSeverity() < IStatus.ERROR); } } @@ -155,15 +164,30 @@ } } - /* - private String getSeverityTag(int severity) { - if (severity == IStatus.OK || severity == IStatus.INFO || severity == IStatus.CANCEL) - return ""; - if (severity == IStatus.WARNING) - return "warning"; - return "error"; + protected IStatus getStatus() { + return checkBuildProducts(); } - */ + + private IStatus checkBuildProducts() { + if (!data.isCurrentBuildBeforeLaunch()) { + // check sis files + String sisPath = data.getSisPath(); + if (data.isInstallPackage() && + sisPath != null && !new File(sisPath).exists()) { + return new Status(IStatus.WARNING, LaunchPlugin.PLUGIN_ID, + Messages.getString("UnifiedLaunchOptionsPage.SISFileMissingWarning")); //$NON-NLS-1$ + } + // check launch file + if (data.getExeSelection().equals(EExeSelection.USE_PROJECT_EXECUTABLE) && + !data.getExePath().toFile().exists()) { + return new Status(IStatus.WARNING, LaunchPlugin.PLUGIN_ID, + Messages.getString("UnifiedLaunchOptionsPage.ExeFileMissingWarning")); //$NON-NLS-1$ + + } + } + + return Status.OK_STATUS; + } public void initializeSettings() { for (IWizardSection section : sections) { diff -r 5d70f98a0746 -r 856622c7b203 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/messages.properties --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/messages.properties Tue Mar 02 15:31:42 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/messages.properties Wed Mar 03 08:27:25 2010 -0600 @@ -75,5 +75,7 @@ OtherSettingsSection.Title=Other settings OtherSettingsSection.WorkspaceLabel=\ (workspace setting) UnifiedLaunchOptionsPage.Desc=Configure the connection and process to launch. +UnifiedLaunchOptionsPage.ExeFileMissingWarning=Executable file does not exist. Without building, launch may fail. +UnifiedLaunchOptionsPage.SISFileMissingWarning=Install file does not exist. Without building, launch may fail. UnifiedLaunchOptionsPage.Title=Configure Launch Settings UnifiedLaunchOptionsPage.TitleText=Configure launch configuration