diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java index 117add75dbd..9fb25267168 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java @@ -31,6 +31,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab { private Button show_mng; private Button show_tool; private Button show_exp; + private Button center_dlg; private Button b_0; private Button b_1; @@ -66,6 +67,10 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab { show_exp.setText(UIMessages.getString("PropertyPageDefsTab.10")); //$NON-NLS-1$ show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + center_dlg = new Button(usercomp, SWT.CHECK); + center_dlg.setText(UIMessages.getString("PropertyPageDefsTab.15")); //$NON-NLS-1$ + center_dlg.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + Group saveGrp = new Group(usercomp, SWT.NONE); saveGrp.setText(UIMessages.getString("PropertyPageDefsTab.11")); //$NON-NLS-1$ saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); @@ -105,6 +110,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab { show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG)); show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM)); show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT)); + center_dlg.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOCENTER)); switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) { case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break; @@ -126,6 +132,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab { CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection()); CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection()); CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection()); + CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOCENTER, !center_dlg.getSelection()); int x = 0; if (b_1.getSelection()) x = 1; else if (b_2.getSelection()) x = 2; @@ -144,6 +151,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab { show_mng.setSelection(true); show_tool.setSelection(true); show_exp.setSelection(false); + center_dlg.setSelection(true); b_0.setSelection(true); b_1.setSelection(false); b_2.setSelection(false); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPropertyDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPropertyDialog.java index 9123ed6e7ee..f8a8c27480f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPropertyDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPropertyDialog.java @@ -67,11 +67,13 @@ public abstract class AbstractPropertyDialog extends Dialog { createDialogArea(shell); // center window - Rectangle r1 = shell.getDisplay().getBounds(); - Rectangle r2 = shell.getBounds(); - int x = r1.width / 2 - r2.width / 2; - int y = r1.height / 2 - r2.height / 2; - shell.setBounds(x, y, r2.width, r2.height); + if (!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOCENTER)) { + Rectangle r1 = shell.getDisplay().getBounds(); + Rectangle r2 = shell.getBounds(); + int x = r1.width / 2 - r2.width / 2; + int y = r1.height / 2 - r2.height / 2; + shell.setBounds(x, y, r2.width, r2.height); + } shell.open(); Display display = parent.getDisplay(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java index e1a4b57d735..aeba79a77ee 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CDTPrefUtil.java @@ -26,7 +26,8 @@ public class CDTPrefUtil { public static final String KEY_MULTI = "properties.multi.config.enable"; //$NON-NLS-1$ public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$ public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$ - public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$ + public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$ + public static final String KEY_NOCENTER = "properties.dialog.center.disable"; //$NON-NLS-1$ // string keys public static final String KEY_PREFTC = "wizard.preferred.toolchains"; //$NON-NLS-1$ // integer keys diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties index 6a637770598..d1c86f68760 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties @@ -345,6 +345,7 @@ PropertyPageDefsTab.11=Save property dialog bounds PropertyPageDefsTab.12=Save size and position PropertyPageDefsTab.13=Save size only PropertyPageDefsTab.14=Do not save at all +PropertyPageDefsTab.15=Center dialogs on screen PropertyPageDefsTab.2=Enable multiple configurations setting PropertyPageDefsTab.4=Display "Tool chain editor" tab PropertyPageDefsTab.5=Discovery profiles naming rule