1
0
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:
dubslow 2014-11-12 17:17:16 -06:00 committed by Tux3 / Mlkj / !Lev.uXFMLA
parent ccd6cb79db
commit d87cf99d8f
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 5 additions and 3 deletions

View File

@ -138,7 +138,7 @@ void Settings::load()
smileyPack = s.value("smileyPack", ":/smileys/cylgom/emoticons.xml").toString();
customEmojiFont = s.value("customEmojiFont", true).toBool();
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();
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
timestampFormat = s.value("timestampFormat", "hh:mm").toString();

View File

@ -171,6 +171,7 @@ void Widget::init()
ui->statusButton->setEnabled(false);
idleTimer = new QTimer();
idleTimer->setSingleShot(true);
int mins = Settings::getInstance().getAutoAwayTime();
if (mins > 0)
idleTimer->start(mins * 1000*60);
@ -497,6 +498,7 @@ void Widget::onStatusSet(Status status)
{
case Status::Online:
ui->statusButton->setProperty("status" ,"online");
qDebug() << "Widget: something set the status to online";
break;
case Status::Away:
ui->statusButton->setProperty("status" ,"away");
@ -1028,7 +1030,7 @@ bool Widget::event(QEvent * e)
case QEvent::KeyRelease:
if (autoAwayActive)
{
qDebug() << "Widget: auto away deactivated";
qDebug() << "Widget: auto away deactivated at" << QTime::currentTime().toString();
autoAwayActive = false;
emit statusSet(Status::Online);
int mins = Settings::getInstance().getAutoAwayTime();
@ -1047,7 +1049,7 @@ void Widget::onUserAway()
if (Settings::getInstance().getAutoAwayTime() > 0
&& 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);
autoAwayActive = true;
}