mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 23:35:48 +02:00
[261277] patch for make target dialog
This commit is contained in:
parent
0473138b52
commit
a752179168
2 changed files with 44 additions and 18 deletions
|
@ -67,6 +67,7 @@ SettingsBlock.makeSetting.runAllBuilders=Run all project builders
|
||||||
SettingsBlock.makeSetting.sameAsTarget=Same as the Target Name
|
SettingsBlock.makeSetting.sameAsTarget=Same as the Target Name
|
||||||
SettingsBlock.makeCmd.group_label=Build command
|
SettingsBlock.makeCmd.group_label=Build command
|
||||||
SettingsBlock.makeCmd.use_default=Use default
|
SettingsBlock.makeCmd.use_default=Use default
|
||||||
|
SettingsBlock.makeCmd.useBuilderSettings=Use builder settings
|
||||||
SettingsBlock.makeCmd.label=Build command:
|
SettingsBlock.makeCmd.label=Build command:
|
||||||
SettingsBlock.makeLoc.group_label=Build Location
|
SettingsBlock.makeLoc.group_label=Build Location
|
||||||
SettingsBlock.makeDir.label=Build directory:
|
SettingsBlock.makeDir.label=Build directory:
|
||||||
|
@ -139,7 +140,7 @@ MakeTargetDialog.message.targetWithNameExists=Target with that name already exis
|
||||||
MakeTargetDialog.message.mustSpecifyBuildCommand=Must specify a build command
|
MakeTargetDialog.message.mustSpecifyBuildCommand=Must specify a build command
|
||||||
MakeTargetDialog.button.update=Update
|
MakeTargetDialog.button.update=Update
|
||||||
MakeTargetDialog.button.create=Create
|
MakeTargetDialog.button.create=Create
|
||||||
MakeTargetDialog.exception.makeTargetError=Make Target Error
|
MakeTargetDialog.exception.makeTargetError=Internal error, see logs for details
|
||||||
MakeTargetDialog.exception.errorAddingTarget=Error adding target
|
MakeTargetDialog.exception.errorAddingTarget=Error adding target
|
||||||
|
|
||||||
MakeTargetDnD.moving=Moving make targets to
|
MakeTargetDnD.moving=Moving make targets to
|
||||||
|
|
|
@ -58,20 +58,21 @@ public class MakeTargetDialog extends Dialog {
|
||||||
private static final String MAKE_SETTING_STOP_ERROR = SETTING_PREFIX + ".makeSetting.stopOnError"; //$NON-NLS-1$
|
private static final String MAKE_SETTING_STOP_ERROR = SETTING_PREFIX + ".makeSetting.stopOnError"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String MAKE_CMD_GROUP = SETTING_PREFIX + ".makeCmd.group_label"; //$NON-NLS-1$
|
private static final String MAKE_CMD_GROUP = SETTING_PREFIX + ".makeCmd.group_label"; //$NON-NLS-1$
|
||||||
private static final String MAKE_CMD_USE_DEFAULT = SETTING_PREFIX + ".makeCmd.use_default"; //$NON-NLS-1$
|
private static final String MAKE_CMD_USE_BUILDER_SETTINGS = SETTING_PREFIX + ".makeCmd.useBuilderSettings"; //$NON-NLS-1$
|
||||||
private static final String MAKE_CMD_LABEL = SETTING_PREFIX + ".makeCmd.label"; //$NON-NLS-1$
|
private static final String MAKE_CMD_LABEL = SETTING_PREFIX + ".makeCmd.label"; //$NON-NLS-1$
|
||||||
|
|
||||||
Text targetNameText;
|
private Text targetNameText;
|
||||||
Button stopOnErrorButton;
|
private Button stopOnErrorButton;
|
||||||
Button runAllBuildersButton;
|
private Button runAllBuildersButton;
|
||||||
Text commandText;
|
private Text commandText;
|
||||||
Button defButton;
|
private Button defButton;
|
||||||
Text targetText;
|
private Text targetText;
|
||||||
|
|
||||||
IMakeTargetManager fTargetManager;
|
private IMakeTargetManager fTargetManager;
|
||||||
IContainer fContainer;
|
private IContainer fContainer;
|
||||||
|
|
||||||
private IPath buildCommand;
|
private IPath buildCommand;
|
||||||
|
private String defaultBuildCommand;
|
||||||
private boolean isDefaultCommand;
|
private boolean isDefaultCommand;
|
||||||
private boolean isStopOnError;
|
private boolean isStopOnError;
|
||||||
private boolean runAllBuilders = true;
|
private boolean runAllBuilders = true;
|
||||||
|
@ -79,7 +80,7 @@ public class MakeTargetDialog extends Dialog {
|
||||||
private String targetString;
|
private String targetString;
|
||||||
private String targetName;
|
private String targetName;
|
||||||
private String targetBuildID;
|
private String targetBuildID;
|
||||||
protected IMakeTarget fTarget;
|
private IMakeTarget fTarget;
|
||||||
private boolean initializing = true;
|
private boolean initializing = true;
|
||||||
private Button sameAsNameCheck;
|
private Button sameAsNameCheck;
|
||||||
|
|
||||||
|
@ -91,12 +92,23 @@ public class MakeTargetDialog extends Dialog {
|
||||||
private void setStatusLine() {
|
private void setStatusLine() {
|
||||||
fStatusLine.setErrorMessage(null);
|
fStatusLine.setErrorMessage(null);
|
||||||
|
|
||||||
if (targetNameText.getText().trim().equals("")) { //$NON-NLS-1$
|
String newTargetName = targetNameText.getText().trim();
|
||||||
|
if (newTargetName.length()==0) {
|
||||||
fStatusLine.setErrorMessage(
|
fStatusLine.setErrorMessage(
|
||||||
MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyName")); //$NON-NLS-1$
|
MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyName")); //$NON-NLS-1$
|
||||||
} else if (commandText.isEnabled() && commandText.getText().trim().equals("")) { //$NON-NLS-1$
|
} else if (commandText.isEnabled() && commandText.getText().trim().length()==0) {
|
||||||
fStatusLine.setErrorMessage(
|
fStatusLine.setErrorMessage(
|
||||||
MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
|
MakeUIPlugin.getResourceString("MakeTargetDialog.message.mustSpecifyBuildCommand")); //$NON-NLS-1$
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
if (!newTargetName.equals(targetName) && fTargetManager.findTarget(fContainer, newTargetName) != null) {
|
||||||
|
fStatusLine.setErrorMessage(
|
||||||
|
MakeUIPlugin.getResourceString("MakeTargetDialog.message.targetWithNameExists")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
// ignore exception since no update action was initiated by user yet
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +120,11 @@ public class MakeTargetDialog extends Dialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parentShell
|
* This constructor is called on "Edit Make Target" action.
|
||||||
|
*
|
||||||
|
* @param parentShell - shell to display the dialog.
|
||||||
|
* @param target - make target to edit.
|
||||||
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public MakeTargetDialog(Shell parentShell, IMakeTarget target) throws CoreException {
|
public MakeTargetDialog(Shell parentShell, IMakeTarget target) throws CoreException {
|
||||||
this(parentShell, target.getContainer());
|
this(parentShell, target.getContainer());
|
||||||
|
@ -124,7 +140,12 @@ public class MakeTargetDialog extends Dialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parentShell
|
* This constructor is called on "Add Make Target" action and from
|
||||||
|
* the other constructor where some initialized values can be overwritten.
|
||||||
|
*
|
||||||
|
* @param parentShell - shell to display the dialog.
|
||||||
|
* @param container - container where to create the target.
|
||||||
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public MakeTargetDialog(Shell parentShell, IContainer container) throws CoreException {
|
public MakeTargetDialog(Shell parentShell, IContainer container) throws CoreException {
|
||||||
super(parentShell);
|
super(parentShell);
|
||||||
|
@ -139,8 +160,9 @@ public class MakeTargetDialog extends Dialog {
|
||||||
IMakeBuilderInfo buildInfo = MakeCorePlugin.createBuildInfo(container.getProject(),
|
IMakeBuilderInfo buildInfo = MakeCorePlugin.createBuildInfo(container.getProject(),
|
||||||
fTargetManager.getBuilderID(targetBuildID));
|
fTargetManager.getBuilderID(targetBuildID));
|
||||||
isStopOnError = buildInfo.isStopOnError();
|
isStopOnError = buildInfo.isStopOnError();
|
||||||
isDefaultCommand = buildInfo.isDefaultBuildCmd();
|
isDefaultCommand = true;
|
||||||
buildCommand = buildInfo.getBuildCommand();
|
buildCommand = buildInfo.getBuildCommand();
|
||||||
|
defaultBuildCommand = buildCommand.toString();
|
||||||
buildArguments = buildInfo.getBuildArguments();
|
buildArguments = buildInfo.getBuildArguments();
|
||||||
targetString = buildInfo.getIncrementalBuildTarget();
|
targetString = buildInfo.getIncrementalBuildTarget();
|
||||||
|
|
||||||
|
@ -242,11 +264,12 @@ public class MakeTargetDialog extends Dialog {
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
gd.widthHint = convertWidthInCharsToPixels(50);
|
gd.widthHint = convertWidthInCharsToPixels(50);
|
||||||
group.setLayoutData(gd);
|
group.setLayoutData(gd);
|
||||||
defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT));
|
defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_BUILDER_SETTINGS));
|
||||||
defButton.addSelectionListener(new SelectionAdapter() {
|
defButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (defButton.getSelection() == true) {
|
if (defButton.getSelection() == true) {
|
||||||
|
commandText.setText(defaultBuildCommand);
|
||||||
commandText.setEnabled(false);
|
commandText.setEnabled(false);
|
||||||
stopOnErrorButton.setEnabled(true);
|
stopOnErrorButton.setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -439,7 +462,9 @@ public class MakeTargetDialog extends Dialog {
|
||||||
target.setStopOnError(isStopOnError());
|
target.setStopOnError(isStopOnError());
|
||||||
target.setRunAllBuilders(runAllBuilders());
|
target.setRunAllBuilders(runAllBuilders());
|
||||||
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
target.setUseDefaultBuildCmd(useDefaultBuildCmd());
|
||||||
if (!useDefaultBuildCmd()) {
|
if (useDefaultBuildCmd()) {
|
||||||
|
target.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
|
||||||
|
} else {
|
||||||
String bldLine = getBuildLine();
|
String bldLine = getBuildLine();
|
||||||
int start = 0;
|
int start = 0;
|
||||||
int end = -1;
|
int end = -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue