mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-11 11:05:24 +02:00
Preference to Always show Launch Target. Default is auto.
Default behavior is to only show the launch target selector when the active launch descriptor supports multiple targets. Add a pref to always show the launch target selector. Change-Id: I2615ab605be8a6cb706baca7407b265f8b832cf1
This commit is contained in:
parent
151a99ad35
commit
4bada0e6ab
7 changed files with 23 additions and 15 deletions
|
@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin {
|
||||||
|
|
||||||
// Preference ids
|
// Preference ids
|
||||||
public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$
|
public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$
|
||||||
public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$
|
public static final String PREF_ALWAYS_TARGETSELECTOR = "alwaysTargetSelector"; //$NON-NLS-1$
|
||||||
public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$
|
public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$
|
||||||
public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$
|
public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
|
@ -96,10 +96,9 @@ public class LaunchBarControl implements ILaunchBarListener {
|
||||||
configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||||
configSelector.setInput(manager);
|
configSelector.setInput(manager);
|
||||||
|
|
||||||
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR);
|
|
||||||
boolean supportsTargets;
|
boolean supportsTargets;
|
||||||
if (!enabled) {
|
if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) {
|
||||||
supportsTargets = false;
|
supportsTargets = true;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
ILaunchDescriptor desc = manager.getActiveLaunchDescriptor();
|
ILaunchDescriptor desc = manager.getActiveLaunchDescriptor();
|
||||||
|
@ -192,12 +191,18 @@ public class LaunchBarControl implements ILaunchBarListener {
|
||||||
configSelector.setDelayedSelection(descriptor, SELECTION_DELAY);
|
configSelector.setDelayedSelection(descriptor, SELECTION_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean supportsTargets = true;
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
|
boolean supportsTargets;
|
||||||
|
if (store.getBoolean(Activator.PREF_ALWAYS_TARGETSELECTOR)) {
|
||||||
|
supportsTargets = true;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
supportsTargets = descriptor.getType().supportsTargets();
|
supportsTargets = descriptor.getType().supportsTargets();
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
|
supportsTargets = true;
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (supportsTargets) {
|
if (supportsTargets) {
|
||||||
if (targetSelector == null || targetSelector.isDisposed()) {
|
if (targetSelector == null || targetSelector.isDisposed()) {
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class LaunchBarInjector {
|
||||||
boolean enabled = Boolean.parseBoolean(event.getNewValue().toString());
|
boolean enabled = Boolean.parseBoolean(event.getNewValue().toString());
|
||||||
injectIntoAll(enabled);
|
injectIntoAll(enabled);
|
||||||
}
|
}
|
||||||
if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)|| event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) {
|
if (event.getProperty().equals(Activator.PREF_ALWAYS_TARGETSELECTOR)
|
||||||
|
|| event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) {
|
||||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR);
|
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR);
|
||||||
if (enabled){
|
if (enabled){
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize
|
||||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true);
|
store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true);
|
||||||
store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true);
|
store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true);
|
||||||
store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true);
|
store.setDefault(Activator.PREF_ALWAYS_TARGETSELECTOR, false);
|
||||||
store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3);
|
store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,10 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement
|
||||||
@Override
|
@Override
|
||||||
protected void createFieldEditors() {
|
protected void createFieldEditors() {
|
||||||
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent()));
|
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent()));
|
||||||
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent()));
|
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON,
|
||||||
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent()));
|
Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent()));
|
||||||
|
addField(new BooleanFieldEditor(Activator.PREF_ALWAYS_TARGETSELECTOR,
|
||||||
|
Messages.LaunchBarPreferencePage_AlwaysTargetSelector, getFieldEditorParent()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class Messages extends NLS {
|
||||||
public static String LaunchBarListViewer_0;
|
public static String LaunchBarListViewer_0;
|
||||||
public static String LaunchBarPreferencePage_0;
|
public static String LaunchBarPreferencePage_0;
|
||||||
public static String LaunchBarPreferencePage_1;
|
public static String LaunchBarPreferencePage_1;
|
||||||
public static String LaunchBarPreferencePage_EnableTargetSelector;
|
public static String LaunchBarPreferencePage_AlwaysTargetSelector;
|
||||||
public static String LaunchBarPreferencePage_EnableBuildButton;
|
public static String LaunchBarPreferencePage_EnableBuildButton;
|
||||||
public static String LaunchConfigurationEditDialog_0;
|
public static String LaunchConfigurationEditDialog_0;
|
||||||
public static String LaunchConfigurationEditDialog_1;
|
public static String LaunchConfigurationEditDialog_1;
|
||||||
|
|
|
@ -21,7 +21,7 @@ LaunchBarControl_Stop=Stop
|
||||||
LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane
|
LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane
|
||||||
LaunchBarPreferencePage_0=Preferences for the Launch Bar
|
LaunchBarPreferencePage_0=Preferences for the Launch Bar
|
||||||
LaunchBarPreferencePage_1=Enable the Launch Bar
|
LaunchBarPreferencePage_1=Enable the Launch Bar
|
||||||
LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector
|
LaunchBarPreferencePage_AlwaysTargetSelector=Always show the target selector
|
||||||
LaunchBarPreferencePage_EnableBuildButton=Enable the Build button
|
LaunchBarPreferencePage_EnableBuildButton=Enable the Build button
|
||||||
LaunchConfigurationEditDialog_0=Delete
|
LaunchConfigurationEditDialog_0=Delete
|
||||||
LaunchConfigurationEditDialog_1=Duplicate
|
LaunchConfigurationEditDialog_1=Duplicate
|
||||||
|
|
Loading…
Add table
Reference in a new issue