debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java
branchRCL_2_4
changeset 1066 4791b1e2e6ef
parent 1012 a39c7d184f5d
child 1262 f88340f6e139
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java	Tue Mar 02 15:35:01 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/UnifiedLaunchOptionsPage.java	Wed Mar 03 08:25:45 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) {