Add ScreenSaver.

This commit is contained in:
sunwen
2022-08-18 17:09:16 +08:00
parent 30df175f22
commit 13a29bcc94
16 changed files with 292 additions and 16 deletions

View File

@@ -16,6 +16,11 @@
#include "components/ULineEdit.h"
#include "components/ListBox.h"
namespace
{
const int MINIMUM_LOCKTIME = 30;
}
GeneralForm::GeneralForm(QWidget* aParent)
: QWidget(aParent)
, mLayout(new QVBoxLayout(this))
@@ -86,8 +91,12 @@ GeneralForm::GeneralForm(QWidget* aParent)
connect(lockTime, &QLineEdit::textChanged, [=](const QString& str)
{
//take effect
JsonObject::Instance()->setLockScreenTimeout(str);
Locker::getInstance()->setTimer(JsonObject::Instance()->lockerCount());
int time = str.toInt();
if (MINIMUM_LOCKTIME < time)
{
JsonObject::Instance()->setLockScreenTimeout(str);
Locker::getInstance()->setTimer(str.toInt() * 1000);
}
});