1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 23:05:47 +02:00

Bug in the tab: extension always empty.

This commit is contained in:
Oleg Krasilnikov 2008-03-11 16:29:21 +00:00
parent 3b9d0a9587
commit f26e8c27d3

View file

@ -113,19 +113,25 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
private void typeChanged() { private void typeChanged() {
int n = c1.getSelectionIndex(); int n = c1.getSelectionIndex();
if (n != savedPos) { if (n != savedPos) {
setProjectType(n);
savedPos = n; savedPos = n;
updateData(getResDesc());
}
}
private void setProjectType(int n) {
try { try {
String s = values[n].getId();
if (fCfg instanceof IMultiConfiguration) { if (fCfg instanceof IMultiConfiguration) {
((IMultiConfiguration)fCfg).setBuildProperty(PROPERTY, values[n].getId()); ((IMultiConfiguration)fCfg).setBuildProperty(PROPERTY, s);
} else { } else {
if (fProperties == null) return; if (fProperties == null)
fProperties.setProperty(PROPERTY, values[n].getId()); return;
fProperties.setProperty(PROPERTY, s);
} }
} catch (CoreException ex) { } catch (CoreException ex) {
ManagedBuilderUIPlugin.log(ex); ManagedBuilderUIPlugin.log(ex);
} }
updateData(getResDesc());
}
} }
public void updateData(ICResourceDescription cfgd) { public void updateData(ICResourceDescription cfgd) {
@ -227,6 +233,15 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
protected void performDefaults() { protected void performDefaults() {
fCfg.setArtifactName(fCfg.getManagedProject().getDefaultArtifactName()); fCfg.setArtifactName(fCfg.getManagedProject().getDefaultArtifactName());
fCfg.setArtifactExtension(null); fCfg.setArtifactExtension(null);
// workaround for bad extension setting (always "exe"):
// set wrong project type temporary
// and then set right one back
if (c1.getItemCount() > 1) {
int right = c1.getSelectionIndex();
int wrong = (right == 0) ? 1 : 0;
setProjectType(wrong);
setProjectType(right);
}
if (tTool != null) if (tTool != null)
tTool.setOutputPrefixForPrimaryOutput(null); tTool.setOutputPrefixForPrimaryOutput(null);
else if (fCfg instanceof IMultiConfiguration) else if (fCfg instanceof IMultiConfiguration)
@ -267,6 +282,9 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
Set<String> set = (Set<String>)combo.getData(SSET); Set<String> set = (Set<String>)combo.getData(SSET);
if (field == null || set == null) if (field == null || set == null)
return; return;
canModify = false;
String oldStr = combo.getText();
combo.removeAll(); combo.removeAll();
for (ICConfigurationDescription cf : page.getCfgsEditable()) { for (ICConfigurationDescription cf : page.getCfgsEditable()) {
IConfiguration c = getCfg(cf); IConfiguration c = getCfg(cf);
@ -288,5 +306,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
} }
if (set.size() > 0) if (set.size() > 0)
combo.setItems(set.toArray(new String[set.size()])); combo.setItems(set.toArray(new String[set.size()]));
combo.setText(oldStr);
canModify = true;
} }
} }