1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Bug 286359. Executable not auto-selected

This commit is contained in:
Ken Ryall 2009-09-05 20:03:28 +00:00
parent 1bfc07f36c
commit c0121fbe5f
2 changed files with 20 additions and 0 deletions

View file

@ -458,6 +458,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* the specified project. * the specified project.
*/ */
protected void handleProjectButtonSelected() { protected void handleProjectButtonSelected() {
String currentProjectName = fProjText.getText();
ICProject project = chooseCProject(); ICProject project = chooseCProject();
if (project == null) { if (project == null) {
return; return;
@ -465,6 +466,15 @@ public class CMainTab extends CLaunchConfigurationTab {
String projectName = project.getElementName(); String projectName = project.getElementName();
fProjText.setText(projectName); fProjText.setText(projectName);
if (currentProjectName.length() == 0)
{
// New project selected for the first time, set the program name default too.
IBinary[] bins = getBinaryFiles(project);
if (bins != null && bins.length == 1) {
fProgText.setText(bins[0].getResource().getProjectRelativePath().toOSString());
}
}
} }
/** /**

View file

@ -718,6 +718,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* the specified project. * the specified project.
*/ */
protected void handleProjectButtonSelected() { protected void handleProjectButtonSelected() {
String currentProjectName = fProjText.getText();
ICProject project = chooseCProject(); ICProject project = chooseCProject();
if (project == null) { if (project == null) {
return; return;
@ -725,6 +726,15 @@ public class CMainTab extends CLaunchConfigurationTab {
String projectName = project.getElementName(); String projectName = project.getElementName();
fProjText.setText(projectName); fProjText.setText(projectName);
if (currentProjectName.length() == 0)
{
// New project selected for the first time, set the program name default too.
IBinary[] bins = getBinaryFiles(project);
if (bins != null && bins.length == 1) {
fProgText.setText(bins[0].getResource().getProjectRelativePath().toOSString());
}
}
} }
/** /**