diff options
Diffstat (limited to 'sdk-updates')
6 files changed, 25 insertions, 8 deletions
diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/PlatformComponentsPanel.java b/sdk-updates/src/com/android/tools/idea/updater/configure/PlatformComponentsPanel.java index 48c123dbe2f..2b5a18666f3 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/PlatformComponentsPanel.java +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/PlatformComponentsPanel.java @@ -180,9 +180,11 @@ public class PlatformComponentsPanel { myStates.clear(); } + /** + * After changing whether previews are included, setPackages() must be called again with appropriately filtered packages. + */ public void setIncludePreview(boolean includePreview) { myIncludePreview = includePreview; - updatePlatformItems(); } public void setEnabled(boolean enabled) { diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigPanel.java b/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigPanel.java index a664564fa69..6dcc72bbad3 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigPanel.java +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigPanel.java @@ -199,6 +199,7 @@ public class SdkUpdaterConfigPanel { myChannelLink.setVisible(myHasPreview && !myIncludePreview); myPlatformComponentsPanel.setIncludePreview(includePreview); myToolComponentsPanel.setIncludePreview(includePreview); + loadPackages(mySdkState.getPackages()); } public JComponent getComponent() { diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigurable.java b/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigurable.java index 88821d1ab54..4ec026e8fa8 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigurable.java +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/SdkUpdaterConfigurable.java @@ -23,6 +23,7 @@ import com.android.tools.idea.updater.SdkComponentSource; import com.android.utils.HtmlBuilder; import com.google.common.collect.Lists; import com.intellij.icons.AllIcons; +import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; @@ -46,8 +47,8 @@ import java.util.List; * for the UI? */ public class SdkUpdaterConfigurable implements SearchableConfigurable { - SdkUpdaterConfigPanel myPanel; - boolean myIncludePreview; + private SdkUpdaterConfigPanel myPanel; + private boolean myIncludePreview; @NotNull @Override diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/ToolComponentsPanel.java b/sdk-updates/src/com/android/tools/idea/updater/configure/ToolComponentsPanel.java index ae13f186ba4..4fa47253cae 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/ToolComponentsPanel.java +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/ToolComponentsPanel.java @@ -189,8 +189,10 @@ public class ToolComponentsPanel { myStates.clear(); } + /** + * After changing whether previews are included, setPackages() must be called again with appropriately filtered packages. + */ public void setIncludePreview(boolean includePreview) { myIncludePreview = includePreview; - updateToolsItems(); } } diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.form b/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.form index 8d287cf94ea..ea27f36f1d7 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.form +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.form @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.android.tools.idea.updater.configure.UpdateSitesPanel"> - <grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="0" left="0" bottom="0" right="0"/> <constraints> <xy x="20" y="20" width="604" height="400"/> @@ -52,6 +52,14 @@ </component> </children> </grid> + <component id="5d507" class="javax.swing.JCheckBox" binding="myForceHttp"> + <constraints> + <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Force https://... sources to be fetched using http://..."/> + </properties> + </component> </children> </grid> </form> diff --git a/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.java b/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.java index a8d28f2654c..f67c4070bd9 100644 --- a/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.java +++ b/sdk-updates/src/com/android/tools/idea/updater/configure/UpdateSitesPanel.java @@ -17,13 +17,13 @@ package com.android.tools.idea.updater.configure; import com.android.tools.idea.sdk.SdkState; import com.android.tools.idea.sdk.remote.internal.sources.SdkSources; +import com.android.tools.idea.sdk.remote.internal.updater.SettingsController; import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.ui.AnActionButton; import com.intellij.ui.AnActionButtonRunnable; import com.intellij.ui.AnActionButtonUpdater; import com.intellij.ui.ToolbarDecorator; -import com.intellij.ui.table.JBTable; import com.intellij.ui.table.TableView; import com.intellij.util.ui.AsyncProcessIcon; import org.jetbrains.annotations.NotNull; @@ -39,7 +39,9 @@ public class UpdateSitesPanel { private JPanel mySourcesPanel; private JPanel mySourcesLoadingPanel; private AsyncProcessIcon mySourcesLoadingIcon; + private JCheckBox myForceHttp; private SourcesTableModel mySourcesTableModel; + private static SettingsController ourSettingsController = SettingsController.getInstance(); private void createUIComponents() { mySourcesLoadingIcon = new AsyncProcessIcon("Loading..."); @@ -102,11 +104,12 @@ public class UpdateSitesPanel { } public boolean isModified() { - return mySourcesTableModel.isSourcesModified(); + return mySourcesTableModel.isSourcesModified() || ourSettingsController.getForceHttp() != myForceHttp.isSelected(); } public void reset() { mySourcesTableModel.reset(); + myForceHttp.setSelected(ourSettingsController.getForceHttp()); } public void setSdkState(SdkState state) { @@ -115,6 +118,7 @@ public class UpdateSitesPanel { public void save() { mySourcesTableModel.save(); + ourSettingsController.setForceHttp(myForceHttp.isSelected()); } public void startLoading() { @@ -125,5 +129,4 @@ public class UpdateSitesPanel { mySourcesTableModel.refreshSources(); mySourcesLoadingPanel.setVisible(false); } - } |