mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
RESOLVED - bug 237176: XL C/C++ Compiler Preferences page is annoying
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237176
This commit is contained in:
parent
bb8d3bd8a4
commit
31a7ae9a20
3 changed files with 36 additions and 2 deletions
|
@ -22,6 +22,7 @@ public class Messages extends NLS {
|
||||||
public static String XLCompilerPreferencePage_2;
|
public static String XLCompilerPreferencePage_2;
|
||||||
public static String XLCompilerPropertyPage_0;
|
public static String XLCompilerPropertyPage_0;
|
||||||
public static String XLCompilerPropertyPage_1;
|
public static String XLCompilerPropertyPage_1;
|
||||||
|
public static String XLCompilerPropertyPage_2;
|
||||||
public static String XLCSettingsWizardPage_0;
|
public static String XLCSettingsWizardPage_0;
|
||||||
public static String XLCSettingsWizardPage_1;
|
public static String XLCSettingsWizardPage_1;
|
||||||
public static String XLCSettingsWizardPage_2;
|
public static String XLCSettingsWizardPage_2;
|
||||||
|
|
|
@ -16,6 +16,7 @@ XLCompilerPreferencePage_1=Compiler Root Path:
|
||||||
XLCompilerPreferencePage_2=Compiler Version:
|
XLCompilerPreferencePage_2=Compiler Version:
|
||||||
XLCompilerPropertyPage_0=Compiler Root Path:
|
XLCompilerPropertyPage_0=Compiler Root Path:
|
||||||
XLCompilerPropertyPage_1=Compiler Version:
|
XLCompilerPropertyPage_1=Compiler Version:
|
||||||
|
XLCompilerPropertyPage_2=Compiler path does not exist on the local machine.
|
||||||
XLCSettingsWizardPage_0=XL C/C++ Settings
|
XLCSettingsWizardPage_0=XL C/C++ Settings
|
||||||
XLCSettingsWizardPage_1=Compiler Root Path:
|
XLCSettingsWizardPage_1=Compiler Root Path:
|
||||||
XLCSettingsWizardPage_2=Browse...
|
XLCSettingsWizardPage_2=Browse...
|
||||||
|
|
|
@ -19,15 +19,19 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.QualifiedName;
|
import org.eclipse.core.runtime.QualifiedName;
|
||||||
|
import org.eclipse.jface.dialogs.IMessageProvider;
|
||||||
import org.eclipse.jface.preference.DirectoryFieldEditor;
|
import org.eclipse.jface.preference.DirectoryFieldEditor;
|
||||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
import org.eclipse.jface.resource.JFaceResources;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.ui.IWorkbenchPropertyPage;
|
import org.eclipse.ui.IWorkbenchPropertyPage;
|
||||||
|
|
||||||
public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
|
public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
|
||||||
|
|
||||||
|
private String originalMessage;
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
||||||
*/
|
*/
|
||||||
|
@ -35,8 +39,34 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
|
||||||
|
|
||||||
Composite parent = getFieldEditorParent();
|
Composite parent = getFieldEditorParent();
|
||||||
|
|
||||||
fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT,
|
fPathEditor = new DirectoryFieldEditor(PreferenceConstants.P_XL_COMPILER_ROOT, Messages.XLCompilerPropertyPage_0, parent)
|
||||||
Messages.XLCompilerPropertyPage_0, parent);
|
{
|
||||||
|
protected boolean doCheckState()
|
||||||
|
{
|
||||||
|
// always return true, as we don't want to fail cases when compiler is installed remotely
|
||||||
|
// just warn user
|
||||||
|
if (getPage() != null)
|
||||||
|
{
|
||||||
|
if (!super.doCheckState())
|
||||||
|
{
|
||||||
|
getPage().setMessage(Messages.XLCompilerPropertyPage_2, IMessageProvider.WARNING);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getPage().setMessage(originalMessage, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean checkState()
|
||||||
|
{
|
||||||
|
return doCheckState();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
addField(fPathEditor);
|
addField(fPathEditor);
|
||||||
|
|
||||||
IProject project = ((IResource) getElement()).getProject();
|
IProject project = ((IResource) getElement()).getProject();
|
||||||
|
@ -101,6 +131,8 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
|
||||||
*/
|
*/
|
||||||
public XLCompilerPropertyPage() {
|
public XLCompilerPropertyPage() {
|
||||||
super(FieldEditorPreferencePage.FLAT);
|
super(FieldEditorPreferencePage.FLAT);
|
||||||
|
|
||||||
|
originalMessage = getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue