diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java index 9a5d6bbf916782d1193b938daf796fee62d5ffa7..abf1c1c8b331af64dd5815b9d69334d1642589d5 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java @@ -95,13 +95,22 @@ public class ConfigClientsHandler extends FormHandler { // value if (_action.startsWith("Stop ")) { + String app = _action.substring(5); + int appnum = -1; try { - PluginStarter.stopPlugin(_context, app); - addFormNotice(_("Stopped plugin {0}", app)); - } catch (Throwable e) { - addFormError(_("Error stopping plugin {0}", app) + ": " + e); + appnum = Integer.parseInt(app); + } catch (NumberFormatException nfe) {} + if (appnum >= 0) { + stopClient(appnum); + } else { + try { + PluginStarter.stopPlugin(_context, app); + addFormNotice(_("Stopped plugin {0}", app)); + } catch (Throwable e) { + addFormError(_("Error stopping plugin {0}", app) + ": " + e); _log.error("Error stopping plugin " + app, e); + } } return; } @@ -201,6 +210,20 @@ public class ConfigClientsHandler extends FormHandler { return arr[0].trim(); } + // STUB for stopClient, not completed yet. + private void stopClient(int i) { + List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context); + if (i >= clients.size()) { + addFormError(_("Bad client index.")); + return; + } + ClientAppConfig ca = clients.get(i); + // + // What do we do here? + // + addFormNotice(_("Client") + ' ' + _(ca.clientName) + ' ' + _("stopped") + '.'); + } + private void startClient(int i) { List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context); if (i >= clients.size()) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java index 352df72eedd731fce17254b3d9f61378fc01f1ee..a6fe4ee87cab2a4263e7f99dba5416e54415c1f1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java @@ -109,7 +109,12 @@ public class ConfigClientsHelper extends HelperBase { //"webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName), false, ca.className + ((ca.args != null) ? " " + ca.args : ""), (""+cur).equals(_edit), - true, false, false, true, ca.disabled); + true, false, + // Enable this one and comment out the false below once the stub is filled in. + //!ca.disabled && !("webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName)), + false, + + true, ca.disabled); } if ("new".equals(_edit)) diff --git a/history.txt b/history.txt index fbab253210039a1fc13ce468e9a5352b93277cc7..941f5b433ad4437f361bb655b26468f863c0bfe0 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2011-06-01 sponge + * ConfigClients stopClient stubbed out. + 2011-06-01 sponge * Re the below, using better way that kytv suggested. There is more than one way to peel a pineapple...