diff --git a/mythtv/programs/mythfrontend/networkcontrol.cpp b/mythtv/programs/mythfrontend/networkcontrol.cpp
index 904b299..b2f6171 100644
a
|
b
|
void NetworkControl::processNetworkControlCommand(NetworkCommand *nc) |
308 | 308 | result = processHelp(nc); |
309 | 309 | else if (is_abbrev("message", nc->getArg(0))) |
310 | 310 | result = processMessage(nc); |
| 311 | else if (is_abbrev("blockshutdown", nc->getArg(0))) |
| 312 | result = processBlockShutdown(nc); |
311 | 313 | else if ((nc->getArg(0).toLower() == "exit") || (nc->getArg(0).toLower() == "quit")) |
312 | 314 | QCoreApplication::postEvent(this, |
313 | 315 | new NetworkControlCloseEvent(nc->getClient())); |
… |
… |
QString NetworkControl::processHelp(NetworkCommand *nc) |
1175 | 1177 | helpText += |
1176 | 1178 | "message - Displays a simple text message popup\r\n"; |
1177 | 1179 | } |
| 1180 | else if ((is_abbrev("blockshutdown", command))) |
| 1181 | { |
| 1182 | helpText += |
| 1183 | "blockshutdown BOOL - Sets whether frontend blocks backend shutdown\r\n"; |
| 1184 | } |
1178 | 1185 | |
1179 | 1186 | if (!helpText.isEmpty()) |
1180 | 1187 | return helpText; |
… |
… |
QString NetworkControl::processHelp(NetworkCommand *nc) |
1192 | 1199 | "set - Changes\r\n" |
1193 | 1200 | "screenshot - Capture screenshot\r\n" |
1194 | 1201 | "message - Display a simple text message\r\n" |
| 1202 | "blockshutdown - Sets whether frontend blocks backend shutdown\r\n" |
1195 | 1203 | "exit - Exit Network Control\r\n" |
1196 | 1204 | "\r\n" |
1197 | 1205 | "Type 'help COMMANDNAME' for help on any specific command.\r\n"; |
… |
… |
QString NetworkControl::processMessage(NetworkCommand *nc) |
1212 | 1220 | return QString("OK"); |
1213 | 1221 | } |
1214 | 1222 | |
| 1223 | QString NetworkControl::processBlockShutdown(NetworkCommand *nc) |
| 1224 | { |
| 1225 | if (nc->getArgCount() < 2) |
| 1226 | return QString("ERROR: See 'help %1' for usage information") |
| 1227 | .arg(nc->getArg(0)); |
| 1228 | |
| 1229 | bool blockShutdown = (nc->getArg(1).toLower() == "true" || nc->getArg(1) == "1"); |
| 1230 | if (blockShutdown) { |
| 1231 | gCoreContext->BlockShutdown(); |
| 1232 | } else { |
| 1233 | gCoreContext->AllowShutdown(); |
| 1234 | } |
| 1235 | |
| 1236 | return QString("OK"); |
| 1237 | } |
| 1238 | |
1215 | 1239 | void NetworkControl::notifyDataAvailable(void) |
1216 | 1240 | { |
1217 | 1241 | QCoreApplication::postEvent( |
diff --git a/mythtv/programs/mythfrontend/networkcontrol.h b/mythtv/programs/mythfrontend/networkcontrol.h
index ee1742d..4216d25 100644
a
|
b
|
class NetworkControl : public QTcpServer |
125 | 125 | QString processQuery(NetworkCommand *nc); |
126 | 126 | QString processSet(NetworkCommand *nc); |
127 | 127 | QString processMessage(NetworkCommand *nc); |
| 128 | QString processBlockShutdown(NetworkCommand *nc); |
128 | 129 | QString processHelp(NetworkCommand *nc); |
129 | 130 | |
130 | 131 | void notifyDataAvailable(void); |