1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

fixed bug with preselection of project/program on new configurations

This commit is contained in:
David Inglis 2002-11-06 16:57:43 +00:00
parent ef48933a8b
commit f41ad5443b
3 changed files with 25 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2002-11-06 David Inglis
* src/.../launch/ui/CMainTab.java
* src/.../launch/ui/ClaunchCOnfigurationTAb.java
fixed problem with preselection of project/program for new configurations
2002-11-04 David Inglis
* src/.../launch/ui/CDebuggerTab.java
* src/.../launch/ui/CMainTab.java

View file

@ -77,7 +77,8 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
catch (CoreException e) {
return null;
}
if (descriptor.getPlatform().equals(platform)) {
String projectPlatform = descriptor.getPlatform();
if (projectPlatform.equals(platform) || projectPlatform.equals("*")) {
return (ICElement) obj;
}
}

View file

@ -354,28 +354,33 @@ public class CMainTab extends CLaunchConfigurationTab {
* Set the program name attributes on the working copy based on the ICElement
*/
protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
String name = null;
IBinary binary = null;
if (cElement instanceof ICProject) {
IBinaryContainer bc = ((ICProject) cElement).getBinaryContainer();
IBinary[] bins = bc.getBinaries();
if (bins.length == 1) {
name = bins[0].getElementName();
binary = bins[0];
}
}
if (name == null) {
name = EMPTY_STRING;
}
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, name);
if (name.length() > 0) {
int index = name.lastIndexOf('.');
if (index > 0) {
name = name.substring(index + 1);
if (binary != null) {
String path;
try {
path = binary.getResource().getProjectRelativePath().toOSString();
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
String name = binary.getElementName();
int index = name.lastIndexOf('.');
if (index > 0) {
name = name.substring(index + 1);
}
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
}
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
catch (CModelException e) {
}
}
}
/**
* @see ILaunchConfigurationTab#getName()
*/