fixed a couple of problems where the apply button on the launch config dialog would become enabled by mistake.
authorwpaul
Thu, 11 Jun 2009 16:14:53 -0500
changeset 229 ba58b2ff6c3e
parent 214 a32fb2f6b065
child 230 0c429b331dcc
fixed a couple of problems where the apply button on the launch config dialog would become enabled by mistake.
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java
debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ExecutablesTab.java
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java	Mon Jun 08 14:26:06 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java	Thu Jun 11 16:14:53 2009 -0500
@@ -722,10 +722,6 @@
 			setInstallationTab(configuration, project);
 		}
 		
-		if (settingsGroup.equals(LaunchConfig_SysTRK)) {
-			setFileTransferTab(configuration, project);
-		}
-	
 		if (settingsGroup.equals(LaunchConfig_Trace32) ||
 				settingsGroup.equals(LaunchConfig_SophiaSTI))
 		{
@@ -737,6 +733,7 @@
 		if (settingsGroup.equals(LaunchConfig_AppTRK) || settingsGroup.equals(LaunchConfig_SysTRK)) {
 			setTrkMainTab(configuration, project);
 			setTrkDebuggerTab(configuration, project);
+			setFileTransferTab(configuration, project);
 			
 			// TRK Debugging: specify TRK protocol plugin.
 			//
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ExecutablesTab.java	Mon Jun 08 14:26:06 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/ExecutablesTab.java	Thu Jun 11 16:14:53 2009 -0500
@@ -271,20 +271,27 @@
 				programName = AbstractCLaunchDelegate.getProgramName(configuration);
 			} catch (CoreException e) {
 			}
-			boolean resetProgramName = true;
-			// check to see if the current program name is one of the executables to target
-			for (ExeFileToDebug exeFileToDebug : executablesToTarget) {
-				if (exeFileToDebug.getExePath().equalsIgnoreCase(programName)) {
-					resetProgramName = false;
-					break;
+			
+			// only do this when the current program name is not empty.  if it is, we'll be changing it
+			// which causes the apply button to become enabled which is not expected behavior.  this will
+			// be called later if/when they do specify the main program, so we'll make sure then that it's
+			// actually being targeted.
+			if (programName.length() > 0) {
+				boolean resetProgramName = true;
+				// check to see if the current program name is one of the executables to target
+				for (ExeFileToDebug exeFileToDebug : executablesToTarget) {
+					if (exeFileToDebug.getExePath().equalsIgnoreCase(programName)) {
+						resetProgramName = false;
+						break;
+					}
 				}
-			}
-			if (resetProgramName) {
-				// ensure one of the enabled files to target is set as the program name
-				for (ExeFileToDebug exeFileToDebug : executablesToTarget) {
-					if (exeFileToDebug.getEnabled()) {
-						configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, exeFileToDebug.getExePath());
-						break;
+				if (resetProgramName) {
+					// ensure one of the enabled files to target is set as the program name
+					for (ExeFileToDebug exeFileToDebug : executablesToTarget) {
+						if (exeFileToDebug.getEnabled()) {
+							configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, exeFileToDebug.getExePath());
+							break;
+						}
 					}
 				}
 			}