mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-05 16:15:25 +02:00
launchbar: fixes in config edit wizard page
- removed code that did nothing - added dispose code to restore lc dialog otherwise if you cancel cannot bring any sort of lc dialog again - added code to have unique lc name as suggestion Change-Id: Ia33abed6019edb097cc775f00cbfea1629e9720b
This commit is contained in:
parent
9401e51001
commit
0fc265dc4e
1 changed files with 18 additions and 6 deletions
|
@ -104,7 +104,7 @@ public class NewLaunchConfigEditPage extends WizardPage {
|
|||
if (name.isEmpty()) {
|
||||
return Messages.NewLaunchConfigEditPage_4;
|
||||
}
|
||||
|
||||
|
||||
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
|
||||
if (manager.isExistingLaunchConfigurationName(name)) {
|
||||
ILaunchConfiguration config = ((LaunchManager) manager).findLaunchConfiguration(name);
|
||||
|
@ -125,20 +125,19 @@ public class NewLaunchConfigEditPage extends WizardPage {
|
|||
return;
|
||||
try {
|
||||
String initialMode = ((NewLaunchConfigWizard) getWizard()).modePage.selectedGroup.getMode();
|
||||
workingCopy = type.newInstance(null, Messages.NewLaunchConfigEditPage_6);
|
||||
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
|
||||
String name = manager.generateLaunchConfigurationName("launchConfiguration"); //$NON-NLS-1$
|
||||
workingCopy = type.newInstance(null, name);
|
||||
tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(workingCopy, initialMode);
|
||||
for (CTabItem item : tabFolder.getItems())
|
||||
item.dispose();
|
||||
LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(launchConfigurationDialog);
|
||||
tabGroup.createTabs(launchConfigurationDialog, initialMode);
|
||||
boolean firstTab = true;
|
||||
|
||||
for (ILaunchConfigurationTab tab : tabGroup.getTabs()) {
|
||||
tab.setLaunchConfigurationDialog(launchConfigurationDialog);
|
||||
tab.createControl(tabFolder);
|
||||
tab.setDefaults(workingCopy);
|
||||
if (firstTab) {
|
||||
firstTab = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Do this after all the tabs have their controls created
|
||||
|
@ -164,6 +163,7 @@ public class NewLaunchConfigEditPage extends WizardPage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
boolean performFinish() {
|
||||
if (workingCopy == null)
|
||||
return false;
|
||||
|
@ -173,6 +173,11 @@ public class NewLaunchConfigEditPage extends WizardPage {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
LaunchConfigurationsDialog.setCurrentlyVisibleLaunchConfigurationDialog(null);
|
||||
}
|
||||
|
||||
public void validateFields() {
|
||||
// page is not complete unless we finish validation successfully
|
||||
setPageComplete(false);
|
||||
|
@ -228,6 +233,13 @@ public class NewLaunchConfigEditPage extends WizardPage {
|
|||
return workingCopy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
|
||||
if (getLaunchConfiguration() == null)
|
||||
return;
|
||||
super.launchConfigurationAdded(configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LaunchGroupExtension getLaunchGroup() {
|
||||
return NewLaunchConfigEditPage.this.getLaunchGroup();
|
||||
|
|
Loading…
Add table
Reference in a new issue