Begin i2p.i2p.zzz.confsplit branch

Code from Jan. 2018, never checked in, probably untested,
definitely incomplete.
This commit is contained in:
zzz
2019-05-10 14:58:41 +00:00
parent d8980d10a4
commit 63b2f29633
7 changed files with 492 additions and 132 deletions

View File

@ -342,23 +342,29 @@ public class ConfigServiceHandler extends FormHandler {
private void browseOnStartup(boolean shouldLaunchBrowser) {
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
boolean found = false;
ClientAppConfig ca = null;
for (int cur = 0; cur < clients.size(); cur++) {
ClientAppConfig ca = clients.get(cur);
if (UrlLauncher.class.getName().equals(ca.className)) {
ClientAppConfig cac = clients.get(cur);
if (UrlLauncher.class.getName().equals(cac.className)) {
ca = cac;
ca.disabled = !shouldLaunchBrowser;
found = true;
break;
}
}
// releases <= 0.6.5 deleted the entry completely
if (shouldLaunchBrowser && !found) {
if (shouldLaunchBrowser && ca == null) {
String url = _context.portMapper().getConsoleURL();
ClientAppConfig ca = new ClientAppConfig(UrlLauncher.class.getName(), "consoleBrowser",
url, 5, false);
clients.add(ca);
ca = new ClientAppConfig(UrlLauncher.class.getName(), "consoleBrowser",
url, 5, false);
}
try {
if (ca != null)
ClientAppConfig.writeClientAppConfig(_context, ca);
addFormNotice(_t("Configuration saved successfully"));
} catch (IOException ioe) {
addFormError(_t("Error saving the configuration (applied but not saved) - please see the error logs"));
addFormError(ioe.getLocalizedMessage());
}
ClientAppConfig.writeClientAppConfig(_context, clients);
}
/**