mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Shouldn't use new SWT.Shell()
I noticed that one case in the template engine is creating a dialog that uses it's own instance of SWT Shell (i.e., the code contains "new Shell()". This patch modifies that case to use the display's active shell instead. Change-Id: I253d6540899ce4dfef033924e27e2ddcd62ded19 Signed-off-by: Andrew Eidsness <eclipse@jfront.com> Reviewed-on: https://git.eclipse.org/r/27278 Tested-by: Hudson CI Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
This commit is contained in:
parent
251d54056e
commit
e0682a2412
1 changed files with 11 additions and 6 deletions
|
@ -274,12 +274,17 @@ public class TemplateInputDialog extends Dialog {
|
|||
|
||||
public int popDuplicate() {
|
||||
|
||||
MessageBox mBox = new MessageBox(new Shell(), SWT.ICON_INFORMATION);
|
||||
mBox.setText(TemplatePreferencePage.Message);
|
||||
mBox.setMessage(TemplatePreferencePage.DuplicateEntry);
|
||||
int result = mBox.open();
|
||||
return result;
|
||||
|
||||
final int[] result = new int[]{ 0 };
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MessageBox mBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_INFORMATION);
|
||||
mBox.setText(TemplatePreferencePage.Message);
|
||||
mBox.setMessage(TemplatePreferencePage.DuplicateEntry);
|
||||
result[0] = mBox.open();
|
||||
}
|
||||
});
|
||||
return result[0];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue