Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2009-09-05 11:03:34 -0400
committerKen Ryall2009-09-05 11:03:34 -0400
commitf70f6f0bb71967f95014b82c77254c4f999eed83 (patch)
treef4d1b16a98455e5f48a33e9c071b6e1606f52f89
parent8a663c816d3a07745e2715ba88e62976171531c0 (diff)
downloadorg.eclipse.cdt-f70f6f0bb71967f95014b82c77254c4f999eed83.tar.gz
org.eclipse.cdt-f70f6f0bb71967f95014b82c77254c4f999eed83.tar.xz
org.eclipse.cdt-f70f6f0bb71967f95014b82c77254c4f999eed83.zip
Bug 286359. Select default executable when project first selected.
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java10
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java10
2 files changed, 20 insertions, 0 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
index f3d400981d..50a8880ef3 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
@@ -458,6 +458,7 @@ public class CMainTab extends CLaunchConfigurationTab {
* the specified project.
*/
protected void handleProjectButtonSelected() {
+ String currentProjectName = fProjText.getText();
ICProject project = chooseCProject();
if (project == null) {
return;
@@ -465,6 +466,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());
+ }
+
+ }
}
/**
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 82dec0564f..0b0b6f4e24 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