mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Plugins: show plugins from custom repos when main is not available
This commit is contained in:
+21
-5
@@ -54,6 +54,7 @@ import java.awt.event.*;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URLConnection;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
@@ -778,10 +779,7 @@ public class PluginManagerConfigurableNew
|
||||
Map<String, IdeaPluginDescriptor> allRepositoriesMap = pair.first;
|
||||
Map<String, List<IdeaPluginDescriptor>> customRepositoriesMap = pair.second;
|
||||
|
||||
addGroup(groups, allRepositoriesMap, "Featured", "is_featured_search=true", "sortBy:featured");
|
||||
addGroup(groups, allRepositoriesMap, "New and Updated", "orderBy=update+date", "sortBy:updated");
|
||||
addGroup(groups, allRepositoriesMap, "Top Downloads", "orderBy=downloads", "sortBy:downloads");
|
||||
addGroup(groups, allRepositoriesMap, "Top Rated", "orderBy=rating", "sortBy:rating");
|
||||
initMainRepoGroups(groups, allRepositoriesMap);
|
||||
|
||||
for (String host : UpdateSettings.getInstance().getPluginHosts()) {
|
||||
List<IdeaPluginDescriptor> allDescriptors = customRepositoriesMap.get(host);
|
||||
@@ -828,6 +826,19 @@ public class PluginManagerConfigurableNew
|
||||
return createScrollPane(myTrendingPanel, false);
|
||||
}
|
||||
|
||||
private void initMainRepoGroups(List<PluginsGroup> groups, Map<String, IdeaPluginDescriptor> allRepositoriesMap) throws IOException {
|
||||
try {
|
||||
addGroup(groups, allRepositoriesMap, "Featured", "is_featured_search=true", "sortBy:featured");
|
||||
addGroup(groups, allRepositoriesMap, "New and Updated", "orderBy=update+date", "sortBy:updated");
|
||||
addGroup(groups, allRepositoriesMap, "Top Downloads", "orderBy=downloads", "sortBy:downloads");
|
||||
addGroup(groups, allRepositoriesMap, "Top Rated", "orderBy=rating", "sortBy:rating");
|
||||
}
|
||||
catch (UnknownHostException e) {
|
||||
PluginManagerMain.LOG
|
||||
.info(String.format("Main plugin repository '%s' is not available. Please check your network settings.", e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JComponent createInstalledPanel() {
|
||||
PluginsGroupComponent panel =
|
||||
@@ -1369,7 +1380,12 @@ public class PluginManagerConfigurableNew
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (host == null) {
|
||||
exception = e;
|
||||
if (e instanceof UnknownHostException) {
|
||||
PluginManagerMain.LOG
|
||||
.info(String.format("Main plugin repository '%s' is not available. Please check your network settings.", e.getMessage()));
|
||||
} else {
|
||||
exception = e;
|
||||
}
|
||||
}
|
||||
else {
|
||||
PluginManagerMain.LOG.info(host, e);
|
||||
|
||||
Reference in New Issue
Block a user