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 2002-11-04 David Inglis
* src/.../launch/ui/CDebuggerTab.java * src/.../launch/ui/CDebuggerTab.java
* src/.../launch/ui/CMainTab.java * src/.../launch/ui/CMainTab.java

View file

@ -77,7 +77,8 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
catch (CoreException e) { catch (CoreException e) {
return null; return null;
} }
if (descriptor.getPlatform().equals(platform)) { String projectPlatform = descriptor.getPlatform();
if (projectPlatform.equals(platform) || projectPlatform.equals("*")) {
return (ICElement) obj; 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 * Set the program name attributes on the working copy based on the ICElement
*/ */
protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) { protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
String name = null; IBinary binary = null;
if (cElement instanceof ICProject) { if (cElement instanceof ICProject) {
IBinaryContainer bc = ((ICProject) cElement).getBinaryContainer(); IBinaryContainer bc = ((ICProject) cElement).getBinaryContainer();
IBinary[] bins = bc.getBinaries(); IBinary[] bins = bc.getBinaries();
if (bins.length == 1) { if (bins.length == 1) {
name = bins[0].getElementName(); binary = bins[0];
} }
} }
if (name == null) {
name = EMPTY_STRING; if (binary != null) {
} String path;
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, name); try {
if (name.length() > 0) { path = binary.getResource().getProjectRelativePath().toOSString();
int index = name.lastIndexOf('.'); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
if (index > 0) { String name = binary.getElementName();
name = name.substring(index + 1); int index = name.lastIndexOf('.');
if (index > 0) {
name = name.substring(index + 1);
}
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
} }
name = getLaunchConfigurationDialog().generateName(name); catch (CModelException e) {
config.rename(name); }
} }
} }
/** /**
* @see ILaunchConfigurationTab#getName() * @see ILaunchConfigurationTab#getName()
*/ */