forked from I2P_Developers/i2p.i2p
ConfigClients stopClient stubbed out.
This commit is contained in:
@ -95,7 +95,15 @@ 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 {
|
||||||
|
appnum = Integer.parseInt(app);
|
||||||
|
} catch (NumberFormatException nfe) {}
|
||||||
|
if (appnum >= 0) {
|
||||||
|
stopClient(appnum);
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
PluginStarter.stopPlugin(_context, app);
|
PluginStarter.stopPlugin(_context, app);
|
||||||
addFormNotice(_("Stopped plugin {0}", app));
|
addFormNotice(_("Stopped plugin {0}", app));
|
||||||
@ -103,6 +111,7 @@ public class ConfigClientsHandler extends FormHandler {
|
|||||||
addFormError(_("Error stopping plugin {0}", app) + ": " + 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 {
|
|||||||
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 {
|
|||||||
//"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))
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
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...
|
||||||
|
Reference in New Issue
Block a user