debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/wizard/LaunchCreationWizard.java
changeset 273 c2533fd23253
parent 212 0e84cf0560e1
child 566 960058f9da89
child 569 369485fbe634
equal deleted inserted replaced
272:897d32e5ad84 273:c2533fd23253
    46 
    46 
    47 	private MainExecutableSelectionWizardPage fBinarySelectionPage;
    47 	private MainExecutableSelectionWizardPage fBinarySelectionPage;
    48 	private LaunchWizardSummaryPage fEmulationSummaryPage;
    48 	private LaunchWizardSummaryPage fEmulationSummaryPage;
    49 	private LaunchCategorySelectionPage fCategorySelectionPage;
    49 	private LaunchCategorySelectionPage fCategorySelectionPage;
    50 	private LaunchWizardSelectionPage fWizardSelectionPage;
    50 	private LaunchWizardSelectionPage fWizardSelectionPage;
       
    51     private BuildOptionsSelectionPage fBuildOptionsSelectionPage;
    51 	private ILaunchConfigurationWorkingCopy launchConfig;
    52 	private ILaunchConfigurationWorkingCopy launchConfig;
    52 	private boolean shouldOpenLaunchDialog;
    53 	private boolean shouldOpenLaunchDialog;
    53 	private IProject project;
    54 	private IProject project;
    54 	private String configurationName;
    55 	private String configurationName;
    55 	private List<AbstractLaunchWizard> wizards = new ArrayList<AbstractLaunchWizard>();
    56 	private List<AbstractLaunchWizard> wizards = new ArrayList<AbstractLaunchWizard>();
    65 
    66 
    66 		// show the binary selection page as only page in main wizard if emulation, 
    67 		// show the binary selection page as only page in main wizard if emulation, 
    67 		// otherwise it will be shown as needed by non-emulation wizards
    68 		// otherwise it will be shown as needed by non-emulation wizards
    68 		if (isEmulation)  {
    69 		if (isEmulation)  {
    69 			fEmulationSummaryPage = new LaunchWizardSummaryPage(configurationName);
    70 			fEmulationSummaryPage = new LaunchWizardSummaryPage(configurationName);
       
    71 			fBuildOptionsSelectionPage = new BuildOptionsSelectionPage();
    70 			Check.checkState(exes.size() > 0);
    72 			Check.checkState(exes.size() > 0);
    71 			IPath emulatorPath = getEmulatorPathFromExePath(exes.get(0));
    73 			IPath emulatorPath = getEmulatorPathFromExePath(exes.get(0));
    72 			fBinarySelectionPage = new MainExecutableSelectionWizardPage(mmps, exes, defaultExecutable, true, emulatorPath, emulatorOnly, fEmulationSummaryPage);
    74 			fBinarySelectionPage = new MainExecutableSelectionWizardPage(mmps, exes, defaultExecutable, true, emulatorPath, emulatorOnly, fEmulationSummaryPage);
    73 		}
    75 		}
    74 		else {
    76 		else {
    81 		if (fBinarySelectionPage != null) {
    83 		if (fBinarySelectionPage != null) {
    82 			try {
    84 			try {
    83 				Pair<IPath, IPath> exeAndMmp = fBinarySelectionPage.getSelectedExeMmpPair();
    85 				Pair<IPath, IPath> exeAndMmp = fBinarySelectionPage.getSelectedExeMmpPair();
    84 				launchConfig = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(LaunchPlugin.EMULATION_LAUNCH_TYPE).newInstance(null, configurationName);
    86 				launchConfig = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(LaunchPlugin.EMULATION_LAUNCH_TYPE).newInstance(null, configurationName);
    85 				SettingsData.setDefaults(launchConfig, SettingsData.LaunchConfig_Emulator, project, exeAndMmp.second, exeAndMmp.first);
    87 				SettingsData.setDefaults(launchConfig, SettingsData.LaunchConfig_Emulator, project, exeAndMmp.second, exeAndMmp.first);
    86 		    	IPath processToLaunchTargetPath = fBinarySelectionPage.getProcessToLaunchTargetPath();	
    88 				fBuildOptionsSelectionPage.updateConfiguration(launchConfig);
       
    89 				IPath processToLaunchTargetPath = fBinarySelectionPage.getProcessToLaunchTargetPath();	
    87 				if (processToLaunchTargetPath != null)
    90 				if (processToLaunchTargetPath != null)
    88 	    			SettingsData.setProcessToLaunch(launchConfig, processToLaunchTargetPath);
    91 	    			SettingsData.setProcessToLaunch(launchConfig, processToLaunchTargetPath);
    89 				shouldOpenLaunchDialog = fEmulationSummaryPage.shouldOpenLaunchConfigurationDialog();
    92 				shouldOpenLaunchDialog = fEmulationSummaryPage.shouldOpenLaunchConfigurationDialog();
    90 			} catch (CoreException e) {
    93 			} catch (CoreException e) {
    91 				LaunchPlugin.log(e);
    94 				LaunchPlugin.log(e);
   106     }
   109     }
   107  
   110  
   108     public void addPages() {
   111     public void addPages() {
   109     	if (fBinarySelectionPage != null) {
   112     	if (fBinarySelectionPage != null) {
   110     		addPage(fBinarySelectionPage);
   113     		addPage(fBinarySelectionPage);
       
   114     		addPage(fBuildOptionsSelectionPage);
   111     		addPage(fEmulationSummaryPage);
   115     		addPage(fEmulationSummaryPage);
   112     	} 
   116     	} 
   113     	else if (fWizardSelectionPage != null) {
   117     	else if (fWizardSelectionPage != null) {
   114             addPage(fCategorySelectionPage);
   118             addPage(fCategorySelectionPage);
   115             addPage(fWizardSelectionPage);
   119             addPage(fWizardSelectionPage);