Fix for Bug 11950 [SDK - Add an SDK get the error dialog stating teh devices.xml is corrupt].
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/BuildPlatformFilterPage.java Fri Aug 27 12:43:33 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/BuildPlatformFilterPage.java Fri Aug 27 14:53:15 2010 -0500
@@ -92,6 +92,14 @@
return super.performOk();
}
+ public boolean performCancel() {
+ if (sbsv2Tab != null) {
+ sbsv2Tab.performCancel();
+ }
+
+ return super.performCancel();
+ }
+
@Override
protected void performApply() {
performOk();
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Fri Aug 27 12:43:33 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Fri Aug 27 14:53:15 2010 -0500
@@ -38,6 +38,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableItem;
@@ -71,8 +72,12 @@
private ICarbideInstalledSDKChangeListener sdkListener = new ICarbideInstalledSDKChangeListener() {
public void installedSdkChanged(SDKChangeEventType eventType) {
- // refresh locally cached SBSv2 data whenever there is any change to SDK list
- refreshLocalSBSCacheData();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ // refresh locally cached SBSv2 data whenever there is any change to SDK list
+ refreshLocalSBSCacheData();
+ }
+ });
}
};
@@ -217,12 +222,11 @@
});
initTable();
- SDKCorePlugin.getSDKManager().addInstalledSdkChangeListener(sdkListener);
+ addListeners();
}
@Override
public void dispose() {
- SDKCorePlugin.getSDKManager().removeInstalledSdkChangeListener(sdkListener);
super.dispose();
}
@@ -240,6 +244,19 @@
}
SBSv2Utils.setSBSv2FilteredConfigs(checkedConfigs.toArray(new String[checkedConfigs.size()]));
+ removeListeners();
+ }
+
+ public void performCancel() {
+ removeListeners();
+ }
+
+ private void addListeners() {
+ SDKCorePlugin.getSDKManager().addInstalledSdkChangeListener(sdkListener);
+ }
+
+ private void removeListeners() {
+ SDKCorePlugin.getSDKManager().removeInstalledSdkChangeListener(sdkListener);
}
private void initTable() {
@@ -284,20 +301,25 @@
}
Collections.sort(sbsAliases);
- buildAliasTableViewer.setInput(sbsAliases);
- customVariantListViewer.setInput(savedVariants);
- // uncheck all configs to init
- buildAliasTableViewer.setAllChecked(false);
-
- for (String config : checkedConfigsFromStore) {
- for (TableItem item : buildAliasTableViewer.getTable().getItems()) {
- if (item.getText().equals(config) && !item.getText().contains(".")) {
- buildAliasTableViewer.setChecked(item.getData(), true);
- break;
+ if (buildAliasTableViewer != null) {
+ buildAliasTableViewer.setInput(sbsAliases);
+ // uncheck all configs to init
+ buildAliasTableViewer.setAllChecked(false);
+
+ for (String config : checkedConfigsFromStore) {
+ for (TableItem item : buildAliasTableViewer.getTable().getItems()) {
+ if (item.getText().equals(config) && !item.getText().contains(".")) {
+ buildAliasTableViewer.setChecked(item.getData(), true);
+ break;
+ }
}
}
}
+
+ if (customVariantListViewer != null) {
+ customVariantListViewer.setInput(savedVariants);
+ }
}
private void refreshLocalSBSCacheData() {