mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
minor tweaks to autoaway, one new debug message
This commit is contained in:
parent
ccd6cb79db
commit
d87cf99d8f
@ -138,7 +138,7 @@ void Settings::load()
|
|||||||
smileyPack = s.value("smileyPack", ":/smileys/cylgom/emoticons.xml").toString();
|
smileyPack = s.value("smileyPack", ":/smileys/cylgom/emoticons.xml").toString();
|
||||||
customEmojiFont = s.value("customEmojiFont", true).toBool();
|
customEmojiFont = s.value("customEmojiFont", true).toBool();
|
||||||
emojiFontFamily = s.value("emojiFontFamily", "DejaVu Sans").toString();
|
emojiFontFamily = s.value("emojiFontFamily", "DejaVu Sans").toString();
|
||||||
emojiFontPointSize = s.value("emojiFontPointSize", QApplication::font().pointSize()).toInt();
|
emojiFontPointSize = s.value("emojiFontPointSize", 12).toInt();
|
||||||
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
|
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
|
||||||
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
|
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
|
||||||
timestampFormat = s.value("timestampFormat", "hh:mm").toString();
|
timestampFormat = s.value("timestampFormat", "hh:mm").toString();
|
||||||
|
@ -171,6 +171,7 @@ void Widget::init()
|
|||||||
ui->statusButton->setEnabled(false);
|
ui->statusButton->setEnabled(false);
|
||||||
|
|
||||||
idleTimer = new QTimer();
|
idleTimer = new QTimer();
|
||||||
|
idleTimer->setSingleShot(true);
|
||||||
int mins = Settings::getInstance().getAutoAwayTime();
|
int mins = Settings::getInstance().getAutoAwayTime();
|
||||||
if (mins > 0)
|
if (mins > 0)
|
||||||
idleTimer->start(mins * 1000*60);
|
idleTimer->start(mins * 1000*60);
|
||||||
@ -497,6 +498,7 @@ void Widget::onStatusSet(Status status)
|
|||||||
{
|
{
|
||||||
case Status::Online:
|
case Status::Online:
|
||||||
ui->statusButton->setProperty("status" ,"online");
|
ui->statusButton->setProperty("status" ,"online");
|
||||||
|
qDebug() << "Widget: something set the status to online";
|
||||||
break;
|
break;
|
||||||
case Status::Away:
|
case Status::Away:
|
||||||
ui->statusButton->setProperty("status" ,"away");
|
ui->statusButton->setProperty("status" ,"away");
|
||||||
@ -1028,7 +1030,7 @@ bool Widget::event(QEvent * e)
|
|||||||
case QEvent::KeyRelease:
|
case QEvent::KeyRelease:
|
||||||
if (autoAwayActive)
|
if (autoAwayActive)
|
||||||
{
|
{
|
||||||
qDebug() << "Widget: auto away deactivated";
|
qDebug() << "Widget: auto away deactivated at" << QTime::currentTime().toString();
|
||||||
autoAwayActive = false;
|
autoAwayActive = false;
|
||||||
emit statusSet(Status::Online);
|
emit statusSet(Status::Online);
|
||||||
int mins = Settings::getInstance().getAutoAwayTime();
|
int mins = Settings::getInstance().getAutoAwayTime();
|
||||||
@ -1047,7 +1049,7 @@ void Widget::onUserAway()
|
|||||||
if (Settings::getInstance().getAutoAwayTime() > 0
|
if (Settings::getInstance().getAutoAwayTime() > 0
|
||||||
&& ui->statusButton->property("status").toString() == "online") // leave user-set statuses in place
|
&& ui->statusButton->property("status").toString() == "online") // leave user-set statuses in place
|
||||||
{
|
{
|
||||||
qDebug() << "Widget: auto away activated";
|
qDebug() << "Widget: auto away activated" << QTime::currentTime().toString();
|
||||||
emit statusSet(Status::Away);
|
emit statusSet(Status::Away);
|
||||||
autoAwayActive = true;
|
autoAwayActive = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user