Disable illegal menu options when there are no sockets.

This commit is contained in:
Andrius Štikonas 2018-01-25 00:11:52 +00:00
parent 2980e8fa97
commit 3ba16bef75
1 changed files with 15 additions and 9 deletions

View File

@ -134,15 +134,21 @@ void ConsoleReader::listSockets()
}
std::cout << "a - add unpaired socket (WiFi needed)\n";
std::cout << "A - add unpaired socket (no WiFi needed)\n";
std::cout << "d - update table data\n";
std::cout << "D - resend discovery packet to the current socket\n";
std::cout << "n - change socket name (max 16 characters)\n";
std::cout << "o - set switch off timer\n";
std::cout << "O - enable/disable switch off timer\n";
std::cout << "p - toggle power state (there are also \"on\" and \"off\" commands)\n";
std::cout << "P - change remote password (max 12 characters)\nq - quit\ns - select another socket (default is 1)\n";
std::cout << "t - change timezone" << std::endl;
std::cout << "Enter command: " << std::endl;
if (sockets->size() > 0) {
std::cout << "d - update table data\n";
std::cout << "D - resend discovery packet to the current socket\n";
std::cout << "n - change socket name (max 16 characters)\n";
std::cout << "o - set switch off timer\n";
std::cout << "O - enable/disable switch off timer\n";
std::cout << "p - toggle power state (there are also \"on\" and \"off\" commands)\n";
std::cout << "P - change remote password (max 12 characters)\n";
}
std::cout << "q - quit\n";
if (sockets->size() > 0) {
std::cout << "s - select another socket (default is 1)\n";
std::cout << "t - change timezone" << std::endl;
}
std::cout << "Enter command: " << std::endl;
}
void ConsoleReader::connectSignals()