Implement toggling countdown state.
This commit is contained in:
parent
1b01658732
commit
1246e6d1db
|
@ -64,7 +64,7 @@ void ConsoleReader::run()
|
||||||
(*sockets) [number]->setCountDown(countdown);
|
(*sockets) [number]->setCountDown(countdown);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
(*sockets) [number]->setCountDown(countdown);
|
(*sockets) [number]->toggleCountDown();
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
(*sockets) [number]->tableData();
|
(*sockets) [number]->tableData();
|
||||||
|
|
|
@ -161,6 +161,12 @@ void Socket::setCountDown(uint16_t countdown)
|
||||||
writeSocketData(socketName, remotePassword, timeZone, countdown);
|
writeSocketData(socketName, remotePassword, timeZone, countdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Socket::toggleCountDown()
|
||||||
|
{
|
||||||
|
countdownEnabled=!countdownEnabled;
|
||||||
|
writeSocketData(socketName, remotePassword, timeZone, countdown);
|
||||||
|
}
|
||||||
|
|
||||||
void Socket::writeSocketData(QByteArray socketName, QByteArray remotePassword, QByteArray timeZone, uint16_t countdown)
|
void Socket::writeSocketData(QByteArray socketName, QByteArray remotePassword, QByteArray timeZone, uint16_t countdown)
|
||||||
{
|
{
|
||||||
QByteArray countDown;
|
QByteArray countDown;
|
||||||
|
|
1
socket.h
1
socket.h
|
@ -49,6 +49,7 @@ public:
|
||||||
void changeSocketPassword(QString newPassword);
|
void changeSocketPassword(QString newPassword);
|
||||||
void changeTimezone(int8_t newTimezone);
|
void changeTimezone(int8_t newTimezone);
|
||||||
void setCountDown(uint16_t countdown);
|
void setCountDown(uint16_t countdown);
|
||||||
|
void toggleCountDown();
|
||||||
bool parseReply(QByteArray);
|
bool parseReply(QByteArray);
|
||||||
|
|
||||||
QHostAddress ip;
|
QHostAddress ip;
|
||||||
|
|
Loading…
Reference in New Issue