OSDN Git Service

SDK Manager: refresh sources when HTTP/S pref is changed.
authorRaphael <raphael@google.com>
Fri, 6 Nov 2009 23:18:57 +0000 (15:18 -0800)
committerRaphael <raphael@google.com>
Fri, 6 Nov 2009 23:18:57 +0000 (15:18 -0800)
Currently you need to use the Refresh button in the remote page
after you change the HTTP/s setting and many users think
instead they need to close/restart the SDK manager.

Change-Id: Ic291d53459624558910bbc417295df5ddc7b037d

tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java

index fe94d86..7c793e4 100755 (executable)
@@ -21,8 +21,6 @@ import com.android.prefs.AndroidLocation.AndroidLocationException;
 import com.android.sdklib.ISdkLog;\r
 \r
 import org.eclipse.jface.dialogs.MessageDialog;\r
-import org.eclipse.swt.widgets.Display;\r
-import org.eclipse.swt.widgets.Shell;\r
 \r
 import java.io.File;\r
 import java.io.FileInputStream;\r
@@ -248,6 +246,10 @@ public class SettingsController {
         mSettingsPage.retrieveSettings(mProperties);\r
         applySettings();\r
         saveSettings();\r
+\r
+        // In case the HTTP/HTTPS setting change, force sources to be reloaded\r
+        // (this only refreshes sources that the user has already tried to open.)\r
+        mUpdaterData.refreshSources(false /*forceFetching*/);\r
     }\r
 \r
     /**\r