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:
parent
3b9d0a9587
commit
f26e8c27d3
1 changed files with 30 additions and 10 deletions
|
@ -113,20 +113,26 @@ 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;
|
||||||
try {
|
|
||||||
if (fCfg instanceof IMultiConfiguration) {
|
|
||||||
((IMultiConfiguration)fCfg).setBuildProperty(PROPERTY, values[n].getId());
|
|
||||||
} else {
|
|
||||||
if (fProperties == null) return;
|
|
||||||
fProperties.setProperty(PROPERTY, values[n].getId());
|
|
||||||
}
|
|
||||||
} catch (CoreException ex) {
|
|
||||||
ManagedBuilderUIPlugin.log(ex);
|
|
||||||
}
|
|
||||||
updateData(getResDesc());
|
updateData(getResDesc());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setProjectType(int n) {
|
||||||
|
try {
|
||||||
|
String s = values[n].getId();
|
||||||
|
if (fCfg instanceof IMultiConfiguration) {
|
||||||
|
((IMultiConfiguration)fCfg).setBuildProperty(PROPERTY, s);
|
||||||
|
} else {
|
||||||
|
if (fProperties == null)
|
||||||
|
return;
|
||||||
|
fProperties.setProperty(PROPERTY, s);
|
||||||
|
}
|
||||||
|
} catch (CoreException ex) {
|
||||||
|
ManagedBuilderUIPlugin.log(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void updateData(ICResourceDescription cfgd) {
|
public void updateData(ICResourceDescription cfgd) {
|
||||||
if (cfgd == null) return;
|
if (cfgd == null) return;
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue