--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/StatusDisplay.java Mon Mar 01 15:56:10 2010 -0600
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/StatusDisplay.java Tue Mar 02 09:27:11 2010 -0600
@@ -35,6 +35,8 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
import com.nokia.carbide.remoteconnections.internal.api.IStatusDisplay;
import com.nokia.cpp.internal.api.utils.core.Check;
@@ -75,18 +77,9 @@
@Override
protected String getPopupShellTitle() {
- switch (status.getSeverity()) {
- case IStatus.INFO:
- return "Information";
- case IStatus.WARNING:
- return "Warning";
- case IStatus.ERROR:
- return "Error";
- };
- Check.checkState(false);
- return null;
+ return getTitleString(status);
}
-
+
@Override
protected Image getPopupShellImage(int maximumHeight) {
switch (status.getSeverity()) {
@@ -102,6 +95,8 @@
}
}
+ private static final int MODAL_MASK = SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL;
+
private boolean clicked;
private boolean closed;
@@ -134,14 +129,68 @@
action.run();
}
- protected void doDisplayStatus(Display display, String prompt, IStatus status) {
- NotificationPopup popup = new NotificationPopup(display, status, prompt);
- popup.open();
- popup.getShell().addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- StatusDisplay.this.closed = true;
+ private Shell getModalShell(Display display) {
+ Shell[] shells = display.getShells();
+ for (int i = shells.length - 1; i >= 0; i--) {
+ Shell shell = shells[i];
+ if ((shell.getStyle() & MODAL_MASK) != 0) {
+ return shell;
}
- });
+ }
+ return null;
}
+ protected void doDisplayStatus(Display display, String prompt, IStatus status) {
+ Shell modalShell = getModalShell(display);
+ if (modalShell == null) {
+ NotificationPopup popup = new NotificationPopup(display, status, prompt);
+ popup.open();
+ popup.getShell().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ StatusDisplay.this.closed = true;
+ }
+ });
+ }
+ else {
+ int style = SWT.YES | SWT.NO;
+ switch (status.getSeverity()) {
+ case IStatus.INFO:
+ style |= SWT.ICON_INFORMATION;
+ break;
+ case IStatus.WARNING:
+ style |= SWT.ICON_WARNING;
+ break;
+ case IStatus.ERROR:
+ style |= SWT.ICON_ERROR;
+ break;
+ default:
+ Check.checkState(false);
+ };
+
+ MessageBox messageBox = new MessageBox(modalShell, style);
+ messageBox.setText(getTitleString(status));
+ StringBuilder sb = new StringBuilder();
+ sb.append(status.getMessage());
+ sb.append("\n");
+ sb.append(prompt);
+ messageBox.setMessage(sb.toString());
+ int open = messageBox.open();
+ closed = true;
+ clicked = open == SWT.YES;
+ }
+ }
+
+ private String getTitleString(IStatus status) {
+ switch (status.getSeverity()) {
+ case IStatus.INFO:
+ return "Information";
+ case IStatus.WARNING:
+ return "Warning";
+ case IStatus.ERROR:
+ return "Error";
+ };
+ Check.checkState(false);
+ return null;
+ }
+
}
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java Mon Mar 01 15:56:10 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessDialog.java Tue Mar 02 09:27:11 2010 -0600
@@ -216,9 +216,8 @@
sisLabel.setData(UID, "DebugRunProcessDialog.sisLabel"); //$NON-NLS-1$
sisFile = new Combo(composite, SWT.READ_ONLY);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(sisLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(sisFile);
sisFile.setToolTipText(Messages.getString("DebugRunProcessDialog.SISQueryTip")); //$NON-NLS-1$
- sisFile.add("None"); //$NON-NLS-1$
sisFile.setData(UID, "DebugRunProcessDialog.sisFile"); //$NON-NLS-1$
sisFile.addSelectionListener(new SelectionAdapter() {
@@ -228,18 +227,7 @@
}
});
- ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
- for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
- IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();
- sisFile.add(sisPath.toOSString());
- }
-
- // select the first sis file if any, otherwise select none
- if (sisFile.getItemCount() > 1) {
- sisFile.select(1);
- } else {
- sisFile.select(0);
- }
+ updateSisFileCombo(cpi);
// listen for events so we can detect if they click on the link below and add new sis info.
CoreModel.getDefault().getProjectDescriptionManager().addCProjectDescriptionListener(this, CProjectDescriptionEvent.APPLIED);
@@ -278,6 +266,9 @@
validate();
}
});
+ String sisPath = data.getSisPath();
+ if (sisPath != null)
+ sisEdit.setText(sisPath);
sisEdit.setData(UID, "DebugRunProcessDialog.sisEdit"); //$NON-NLS-1$
sisBrowse = new Button(composite, SWT.NONE);
@@ -304,6 +295,25 @@
sisBrowse.setData(UID, "DebugRunProcessDialog.sisBrowse"); //$NON-NLS-1$
}
}
+
+
+ private void updateSisFileCombo(ICarbideProjectInfo cpi) {
+ sisFile.add(Messages.getString("DebugRunProcessDialog.NoneItem")); //$NON-NLS-1$
+
+ ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
+ for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
+ IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();
+ sisFile.add(sisPath.toOSString());
+ }
+
+ // select the first sis file if any, otherwise select none
+ if (sisFile.getItemCount() > 1) {
+ sisFile.select(1);
+ } else {
+ sisFile.select(0);
+ }
+ updateSisFile();
+ }
/**
@@ -345,20 +355,7 @@
if (cpi != null) {
sisFile.removeAll();
- sisFile.add(Messages.getString("DebugRunProcessDialog.NoneItem")); //$NON-NLS-1$
-
- ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
- for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
- IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();
- sisFile.add(sisPath.toOSString());
- }
-
- // select the first sis file if any, otherwise select none
- if (sisFile.getItemCount() > 1) {
- sisFile.select(1);
- } else {
- sisFile.select(0);
- }
+ updateSisFileCombo(cpi);
}
}
}
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessSection.java Mon Mar 01 15:56:10 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/DebugRunProcessSection.java Tue Mar 02 09:27:11 2010 -0600
@@ -58,8 +58,8 @@
else if (data.getDefaultExecutable() != null)
data.setExeSelectionPath(data.getDefaultExecutable());
ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(data.getProject());
+ data.setInstallPackage(!data.isSysTRKConnection());
if (cpi != null) {
- data.setInstallPackage(!data.isSysTRKConnection());
ICarbideBuildConfiguration config = cpi.getDefaultConfiguration();
for (ISISBuilderInfo info : config.getSISBuilderInfoList()) {
IPath sisPath = info.getSigningType() == ISISBuilderInfo.DONT_SIGN ? info.getUnsignedSISFullPath() : info.getSignedSISFullPath();