Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
authorstechong
Tue, 14 Sep 2010 14:32:24 -0500
changeset 2003 576284888c71
parent 2002 e9a2c2c218b4
child 2004 b0ce6e39e2d0
Added checkbox "Scan for installable features in SDKs" to Symbian SDK prefs page. It controls whether Carbide dynamically discover and install features from SDKs during startup and rescanning SDKs, and is on by default.
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKUIPreferenceInitializer.java
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/messages.properties
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java	Tue Sep 14 14:24:51 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java	Tue Sep 14 14:32:24 2010 -0500
@@ -24,6 +24,7 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.CellEditor;
@@ -236,6 +237,7 @@
 	private Button deleteButton;
 	private Button propertiesButton;
 	private Button rescanButton;
+	private Button scanPluginsButton;
 	private Label iconLabel;
 	private Label statusLabel;
 
@@ -289,6 +291,9 @@
 	 * @see org.eclipse.jface.preference.PreferencePage#performOk()
 	 */
 	public boolean performOk() {
+		IPreferenceStore prefsStore = SDKUIPlugin.getDefault().getPreferenceStore();
+		prefsStore.setValue(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS, scanPluginsButton.getSelection());
+
 		// Remember which SDK is enabled
 		for (ISymbianSDK sdk : sdkMgr.getSDKList()) {
 			((SymbianSDK)sdk).setEnabled(false);
@@ -312,6 +317,8 @@
 	 */
 	@Override
 	public Control createContents(Composite parent) {
+		IPreferenceStore prefsStore = SDKUIPlugin.getDefault().getPreferenceStore();
+
 		// Set up colors used in this preference page
 		Shell shell = parent.getShell();
 		black = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
@@ -377,7 +384,16 @@
 		statusLabel.setLayoutData(gridData);
 
 		new Label(content, SWT.WRAP); // filler
-		
+
+		// Scan for installable features in SDKs button
+		scanPluginsButton = new Button(content, SWT.CHECK);
+		scanPluginsButton.setToolTipText(Messages.getString("SDKPreferencePage.scanPlugins_ButtonToolTip")); //$NON-NLS-1$
+		scanPluginsButton.setText(Messages.getString("SDKPreferencePage.scanPlugins_Button_Label")); //$NON-NLS-1$
+		scanPluginsButton.setSelection(prefsStore.getBoolean(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS));
+		addButtonListener(scanPluginsButton);
+
+		new Label(content, SWT.WRAP); // filler
+
 		// Rescan button
 		rescanButton = new Button(content, SWT.NONE);
 		rescanButton.setToolTipText(Messages.getString("SDKPreferencePage.Rescan_Button_ToolTip")); //$NON-NLS-1$
@@ -537,7 +553,9 @@
 		addSDKComponentTableItems();
 		sdkListTableViewer.refresh();
 		selectSDKEntry(0);
-		NewPluginChecker.checkForNewlyInstalledPlugins(SDKUIPlugin.getDefault().getWorkbench());
+		if (scanPluginsButton.getSelection()) {
+			NewPluginChecker.checkForNewlyInstalledPlugins(SDKUIPlugin.getDefault().getWorkbench());
+		}
 		rescanButton.setText(Messages.getString("SDKPreferencePage.Rescan_Button_Label")); //$NON-NLS-1$
 		rescanButton.setEnabled(true);
 	}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKUIPreferenceInitializer.java	Tue Sep 14 14:24:51 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKUIPreferenceInitializer.java	Tue Sep 14 14:32:24 2010 -0500
@@ -34,7 +34,7 @@
 		IPreferenceStore store = SDKUIPlugin.getDefault().getPreferenceStore();
 		store.setDefault(SDKUIPreferenceConstants.ENABLE_BSF_SCANNER, false);
 		store.setDefault(SDKUIPreferenceConstants.LISTEN_FOR_DEVICES_XML_CHANGE, true);
-		store.setDefault(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS, false);
+		store.setDefault(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS, true);
 		
 		store.setDefault(SDKUIPreferenceConstants.PLAT_EKA2_WINSCW, true);
 		store.setDefault(SDKUIPreferenceConstants.PLAT_EKA2_GCCE, true);
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/messages.properties	Tue Sep 14 14:24:51 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/messages.properties	Tue Sep 14 14:32:24 2010 -0500
@@ -14,6 +14,8 @@
 SDKPreferencePage.Rescan_Button_Label=Rescan All SDKs
 SDKPreferencePage.Rescan_Button_ToolTip=Rebuilds all SDK entries (same as restarting the IDE).
 SDKPreferencePage.Rescanning_Button_Label=Rescanning...
+SDKPreferencePage.scanPlugins_Button_Label=Scan for installable features in SDKs
+SDKPreferencePage.scanPlugins_ButtonToolTip=Discover installable features found in SDKs and install them dynamically.
 SDKPreferencePage.No_SDKs_Available_Message=No SDKs are available.
 SDKPreferencePage.No_selected_SDK_detected=No selected SDK detected.
 SDKPreferencePage.List_of_Available_SDKs_ToolTip=List of available SDKs.
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java	Tue Sep 14 14:24:51 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java	Tue Sep 14 14:32:24 2010 -0500
@@ -61,7 +61,10 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
-		NewPluginChecker.checkForNewlyInstalledPlugins(getWorkbench());
+		IPreferenceStore prefsStore = SDKUIPlugin.getDefault().getPreferenceStore();
+		if (prefsStore.getBoolean(SDKUIPreferenceConstants.SCAN_FOR_NEW_PLUGINS)) {
+			NewPluginChecker.checkForNewlyInstalledPlugins(getWorkbench());
+		}
 		
 		ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
 		if (HostOS.IS_WIN32){