[Esbox-commits] r893 - trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse
lwang at garage.maemo.org
lwang at garage.maemo.org
Sun Oct 26 07:23:28 EET 2008
Author: lwang
Date: 2008-10-26 07:23:25 +0200 (Sun, 26 Oct 2008)
New Revision: 893
Modified:
trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocolType.java
Log:
Fixed the bug that user has to wait for RSE initialization to finish on creating a new launch configuration (including from LaunchShortcut) even before RSE is selected from UI.
Modified: trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocolType.java
===================================================================
--- trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocolType.java 2008-10-24 19:51:28 UTC (rev 892)
+++ trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocolType.java 2008-10-26 05:23:25 UTC (rev 893)
@@ -142,15 +142,16 @@
return hosts;
}
- static public boolean safeWaitForRSEInitialization() {
+ static private boolean safeWaitForRSEInitialization() {
// Make sure RSE initialization (loading of existing hosts) is done.
// This would ensure we get existing RSE connections for
// launch configuration dialog and for launching any RSE based
// launch configuration before any RSE UI is opened by user.
+ // ................... LWang. 10/08/08
+
+ // Note the JobUtils call will display a progress dialog for the job.
+ // And it may block UI thread.
//
- // Note we use JobUtils below to make sure the wait won't block UI thread.
- //
- // ................... LWang. 10/08/08
JobUtils.waitForRunnable(
new IJob() {
public IStatus run(IProgressMonitor monitor) {
@@ -179,6 +180,10 @@
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ /* Make sure RSE connections exist.
+ * TODO: Do the following after we have lazy initialization of LaunchProtocol
+ * for a new launch configuration. .......10/25/08
+ *
IHost[] hosts = getCurrentRSEConnections();
String hostID = null;
@@ -190,6 +195,8 @@
// Otherwise just the first in the list.
if (hostID == null && hosts.length > 0)
hostID = hosts[0].getAliasName();
+ */
+ String hostID = MaemoDefaultRSEConnection.DEFAULT_CONNECTION_ID;
setRSEConnection(configuration, hostID);
@@ -210,6 +217,12 @@
public void interactiveConfigure(
ILaunchConfigurationWorkingCopy configuration) throws CoreException {
+ // First make sure RSE connections exist (also RSE is initialized).
+ if (getCurrentRSEConnections().length == 0)
+ throw new CoreException(new Status(IStatus.ERROR,
+ Activator.getUniqueIdentifier(),
+ "No RSE connection exists. Please define one."));
+
RSEConnectionSelectionDialog dialog = new RSEConnectionSelectionDialog(null);
if (dialog.open() == Window.OK) {
Object[] result = dialog.getResult();
More information about the Esbox-commits
mailing list