Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'launch/org.eclipse.cdt.launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index 82dec0564f0..0b0b6f4e240 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -612,6 +612,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* the specified project.
*/
protected void handleProjectButtonSelected() {
+ String currentProjectName = fProjText.getText();
ICProject project = chooseCProject();
if (project == null) {
return;
@@ -619,6 +620,15 @@ public class CMainTab extends CLaunchConfigurationTab {
String projectName = project.getElementName();
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());
+ }
+
+ }
}
/**

Back to the top