1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Patch from Vmir -

PR 64368: [Scanner Config] Explain diff between Delete and Remove in
Discovered Path Container - Remove changed to Disable, Restore changed to
Enable, annotation (removed) changed to (disabled).
PR 65121: [Scanner Config] Importing 1.2.1 project does not update
properties - Discovered Paths container is now automatically created when
SC discovery is enabled for the first time for the legacy project
This commit is contained in:
David Inglis 2004-06-22 12:43:49 +00:00
parent 0c2b43cb02
commit 090013eb81
4 changed files with 34 additions and 19 deletions

View file

@ -211,10 +211,11 @@ ManageScannerConfigDialogCommon.discoveredGroup.selected.label=Selected:
ManageScannerConfigDialogCommon.discoveredGroup.removed.label=Removed:
ManageScannerConfigDialogCommon.discoveredGroup.buttons.up.label=Up
ManageScannerConfigDialogCommon.discoveredGroup.buttons.down.label=Down
ManageScannerConfigDialogCommon.discoveredGroup.buttons.remove.label=Remove
ManageScannerConfigDialogCommon.discoveredGroup.buttons.restore.label=Restore
ManageScannerConfigDialogCommon.discoveredGroup.buttons.disable.label=Disable
ManageScannerConfigDialogCommon.discoveredGroup.buttons.enable.label=Enable
ManageScannerConfigDialogCommon.discoveredGroup.buttons.delete.label=Delete
ManageScannerConfigDialogCommon.discoveredGroup.buttons.deleteAll.label=Delete all
ManageScannerConfigDialogCommon.discoveredGroup.annotation.disabled=disabled
# --- ManageDefinedSymbolsDialog dialog ---
ManageDefinedSymbolsDialog.title=Manage defined symbols

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.make.internal.ui.scannerconfig;
import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.internal.ui.dialogs.cpaths.CPathEntryMessages;
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
@ -37,6 +38,9 @@ public class DiscoveredElementLabelProvider extends LabelProvider implements ICo
private ImageDescriptor fRemovedIncludeIcon, fRemovedMacroIcon;
private ImageDescriptorRegistry fRegistry;
private final String DISABLED_LABEL = MakeUIPlugin.
getResourceString("ManageScannerConfigDialogCommon.discoveredGroup.annotation.disabled");//$NON-NLS-1$
public DiscoveredElementLabelProvider() {
fRegistry = CUIPlugin.getImageDescriptorRegistry();
fIncludeIcon = CPluginImages.DESC_OBJS_INCLUDES_FOLDER;
@ -98,12 +102,20 @@ public class DiscoveredElementLabelProvider extends LabelProvider implements ICo
case DiscoveredElement.CONTAINER:
case DiscoveredElement.INCLUDE_PATH:
case DiscoveredElement.SYMBOL_DEFINITION:
return elem.getEntry() + (elem.isRemoved() ? " (removed)" : "");
return elem.getEntry() + (elem.isRemoved() ? addAnnotation(DISABLED_LABEL) : ""); //$NON-NLS-1$
}
}
return super.getText(element);
}
/**
* @param annotation
* @return
*/
private String addAnnotation(String annotation) {
return " (" + annotation + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/

View file

@ -60,8 +60,8 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
private static final String DISC_COMMON_PREFIX = "ManageScannerConfigDialogCommon"; //$NON-NLS-1$
private static final String UP = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.up.label"; //$NON-NLS-1$
private static final String DOWN = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.down.label"; //$NON-NLS-1$
private static final String REMOVE = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.remove.label"; //$NON-NLS-1$
private static final String RESTORE = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.restore.label"; //$NON-NLS-1$
private static final String DISABLE = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.disable.label"; //$NON-NLS-1$
private static final String ENABLE = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.enable.label"; //$NON-NLS-1$
private static final String DELETE = DISC_COMMON_PREFIX + ".discoveredGroup.buttons.delete.label"; //$NON-NLS-1$
private static final String CONTAINER_LABEL = PREFIX + ".title"; //$NON-NLS-1$
@ -70,16 +70,16 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
private final int IDX_UP = 0;
private final int IDX_DOWN = 1;
private final int IDX_REMOVE = 2;
private final int IDX_RESTORE = 3;
private final int IDX_ENABLE = 2;
private final int IDX_DISABLE = 3;
private final int IDX_DELETE = 5;
private static final int DISC_UP = 0;
private static final int DISC_DOWN = 1;
private static final int DO_REMOVE = 0;
private static final int DO_RESTORE = 1;
private static final int DO_DISABLE = 0;
private static final int DO_ENABLE = 1;
private ICProject fCProject;
private IContainerEntry fPathEntry;
@ -97,8 +97,8 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
String[] buttonLabels = new String[]{
/* IDX_UP */ MakeUIPlugin.getResourceString(UP),
/* IDX_DOWN */ MakeUIPlugin.getResourceString(DOWN),
/* IDX_REMOVE */MakeUIPlugin.getResourceString(REMOVE),
/* IDX_RESTORE */MakeUIPlugin.getResourceString(RESTORE),
/* IDX_ENABLE */MakeUIPlugin.getResourceString(ENABLE),
/* IDX_DISABLE */MakeUIPlugin.getResourceString(DISABLE),
null,
/* IDX_DELETE */MakeUIPlugin.getResourceString(DELETE),
};
@ -386,13 +386,13 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
/* move entry down */
dirty |= moveDown();
break;
case IDX_REMOVE:
case IDX_DISABLE:
/* remove */
dirty |= removeRestoreEntry(DO_REMOVE);
dirty |= enableDisableEntry(DO_DISABLE);
break;
case IDX_RESTORE:
case IDX_ENABLE:
/* restore */
dirty |= removeRestoreEntry(DO_RESTORE);
dirty |= enableDisableEntry(DO_ENABLE);
break;
case IDX_DELETE:
/* delete */
@ -466,9 +466,9 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
*
* @param remove
*/
private boolean removeRestoreEntry(int action) {
private boolean enableDisableEntry(int action) {
boolean rc = false;
boolean remove = (action == DO_REMOVE);
boolean remove = (action == DO_DISABLE);
List selElements = fDiscoveredContainerList.getSelectedElements();
for (int i = selElements.size() - 1; i >= 0; --i) {
DiscoveredElement elem = (DiscoveredElement) selElements.get(i);
@ -546,8 +546,8 @@ public class DiscoveredPathContainerPage extends WizardPage implements ICPathCon
List selElements = fDiscoveredContainerList.getSelectedElements();
fDiscoveredContainerList.enableButton(IDX_UP, canMoveUpDown(selElements, DISC_UP));
fDiscoveredContainerList.enableButton(IDX_DOWN, canMoveUpDown(selElements, DISC_DOWN));
fDiscoveredContainerList.enableButton(IDX_REMOVE, canRemoveRestore(selElements));
fDiscoveredContainerList.enableButton(IDX_RESTORE, canRemoveRestore(selElements));
fDiscoveredContainerList.enableButton(IDX_DISABLE, canRemoveRestore(selElements));
fDiscoveredContainerList.enableButton(IDX_ENABLE, canRemoveRestore(selElements));
fDiscoveredContainerList.enableButton(IDX_DELETE, canDelete(selElements));
}
/**

View file

@ -159,12 +159,14 @@ public class DiscoveryOptionsBlock extends AbstractCOptionPage {
if (needsSCNature) {
ScannerConfigNature.addScannerConfigNature(getContainer().getProject());
needsSCNature = false;
fCreatePathContainer = true;
}
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID);
if (fCreatePathContainer) {
createDiscoveredPathContainer(project, monitor);
// create a new discovered scanner config store
MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
fCreatePathContainer = false;
}
} else {
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(fPrefs, ScannerConfigBuilder.BUILDER_ID, false);