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:
parent
ef48933a8b
commit
f41ad5443b
3 changed files with 25 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -354,19 +354,21 @@ 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) {
|
||||
|
||||
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);
|
||||
|
@ -374,8 +376,11 @@ public class CMainTab extends CLaunchConfigurationTab {
|
|||
name = getLaunchConfigurationDialog().generateName(name);
|
||||
config.rename(name);
|
||||
}
|
||||
catch (CModelException e) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @see ILaunchConfigurationTab#getName()
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue