Browse Source

Disable illegal menu options when there are no sockets.

master
Andrius Štikonas 2 years ago
parent
commit
3ba16bef75
1 changed files with 15 additions and 9 deletions
  1. +15
    -9
      consolereader.cpp

+ 15
- 9
consolereader.cpp 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()

Loading…
Cancel
Save