mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix the issues related to updating the configuration list and conversion target list in different scenarios like after creation of new configuration, removal of selected configuration and after conversion of selected configuration.
This commit is contained in:
parent
6b00781d6f
commit
37139c7f86
1 changed files with 49 additions and 7 deletions
|
@ -290,9 +290,45 @@ public class ManageConfigDialog extends Dialog {
|
|||
String fromId = element.getAttribute("fromId"); //$NON-NLS-1$
|
||||
String toId = element.getAttribute("toId"); //$NON-NLS-1$
|
||||
|
||||
if(convertBuildObject != null )
|
||||
convertBuildObject.convert( getSelectedConfiguration().getToolChain(), fromId, toId, true);
|
||||
if(convertBuildObject != null ) {
|
||||
IConfiguration configuration = (IConfiguration) convertBuildObject.convert( getSelectedConfiguration().getToolChain(), fromId, toId, true);
|
||||
|
||||
// Determine which configuration was selected
|
||||
int configSelectionIndex = currentConfigList.getSelectionIndex();
|
||||
|
||||
// Update the currentConfigList and the existingConfigs variables.
|
||||
String selectedConfigNameAndDescription = currentConfigList.getItem(configSelectionIndex);
|
||||
getExistingConfigs().remove(selectedConfigNameAndDescription);
|
||||
|
||||
// Set the selection to selectedConfiguration.
|
||||
String name = configuration.getName();
|
||||
String description = configuration.getDescription();
|
||||
String nameAndDescription = new String();
|
||||
|
||||
if ( description == null || description.equals("") ) { //$NON-NLS-1$
|
||||
nameAndDescription = name;
|
||||
} else {
|
||||
nameAndDescription = name + "( " + description + " )"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
// Set the selected Configuration to the newConfig
|
||||
setSelectedConfiguration(configuration);
|
||||
getExistingConfigs().put(nameAndDescription, configuration);
|
||||
|
||||
// Update the Configuration combo list that is displayed to the user.
|
||||
currentConfigList.removeAll();
|
||||
currentConfigList.setItems(getConfigurationNamesAndDescriptions());
|
||||
|
||||
currentConfigList.select( currentConfigList.indexOf(nameAndDescription));
|
||||
|
||||
// As the selected configuration has changed after conversion, Update the conversion target list,
|
||||
updateConversionTargets(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the UI lists
|
||||
updateButtons();
|
||||
|
||||
}
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
|
@ -487,15 +523,16 @@ public class ManageConfigDialog extends Dialog {
|
|||
// Get the index of selected configuration & set selection in config list.
|
||||
int configIndex = currentConfigList.indexOf(nameAndDescription);
|
||||
currentConfigList.setSelection(configIndex);
|
||||
|
||||
// As the selected configuration has changed after creation of new configuration,
|
||||
// Update the conversion target list,
|
||||
updateConversionTargets(newConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Update the buttons based on the choices
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
|
||||
protected void handleRenamePressed() {
|
||||
IConfiguration selectedConfig = null;
|
||||
String selectedConfigNameAndDescription = null;
|
||||
|
@ -598,6 +635,11 @@ public class ManageConfigDialog extends Dialog {
|
|||
selectedConfigNameAndDescription);
|
||||
setSelectedConfiguration(selectedConfig);
|
||||
}
|
||||
|
||||
// As the selected configuration has changed after removal of selected configuration,
|
||||
// Update the conversion target list,
|
||||
updateConversionTargets(selectedConfig);
|
||||
|
||||
// Clean up the UI lists
|
||||
updateButtons();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue