ConfigClients stopClient stubbed out.

This commit is contained in:
sponge
2011-06-01 03:59:12 +00:00
parent 3b80f53b8e
commit 18d3536ffe
3 changed files with 36 additions and 5 deletions

View File

@ -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()) {