I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 18d3536f authored by sponge's avatar sponge
Browse files

ConfigClients stopClient stubbed out.

parent 3b80f53b
No related branches found
No related tags found
No related merge requests found
...@@ -95,13 +95,22 @@ public class ConfigClientsHandler extends FormHandler { ...@@ -95,13 +95,22 @@ public class ConfigClientsHandler extends FormHandler {
// value // value
if (_action.startsWith("Stop ")) { if (_action.startsWith("Stop ")) {
String app = _action.substring(5); String app = _action.substring(5);
int appnum = -1;
try { try {
PluginStarter.stopPlugin(_context, app); appnum = Integer.parseInt(app);
addFormNotice(_("Stopped plugin {0}", app)); } catch (NumberFormatException nfe) {}
} catch (Throwable e) { if (appnum >= 0) {
addFormError(_("Error stopping plugin {0}", app) + ": " + e); 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); _log.error("Error stopping plugin " + app, e);
}
} }
return; return;
} }
...@@ -201,6 +210,20 @@ public class ConfigClientsHandler extends FormHandler { ...@@ -201,6 +210,20 @@ public class ConfigClientsHandler extends FormHandler {
return arr[0].trim(); 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) { private void startClient(int i) {
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context); List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
if (i >= clients.size()) { if (i >= clients.size()) {
......
...@@ -109,7 +109,12 @@ public class ConfigClientsHelper extends HelperBase { ...@@ -109,7 +109,12 @@ public class ConfigClientsHelper extends HelperBase {
//"webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName), //"webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName),
false, false,
ca.className + ((ca.args != null) ? " " + ca.args : ""), (""+cur).equals(_edit), 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)) if ("new".equals(_edit))
......
2011-06-01 sponge
* ConfigClients stopClient stubbed out.
2011-06-01 sponge 2011-06-01 sponge
* Re the below, using better way that kytv suggested. * Re the below, using better way that kytv suggested.
There is more than one way to peel a pineapple... There is more than one way to peel a pineapple...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment