void AndroidGUI::onConnected() { if (beforeDisconnect == Status::Offline) emit statusSet(Status::Online); else emit statusSet(beforeDisconnect); }
void Widget::onUserAwayCheck() { #ifdef QTOX_PLATFORM_EXT uint32_t autoAwayTime = Settings::getInstance().getAutoAwayTime() * 60 * 1000; if (ui->statusButton->property("status").toString() == "online") { if (autoAwayTime && Platform::getIdleTime() >= autoAwayTime) { qDebug() << "Widget: auto away activated at" << QTime::currentTime().toString(); emit statusSet(Status::Away); autoAwayActive = true; } } else if (ui->statusButton->property("status").toString() == "away") { if (autoAwayActive && (!autoAwayTime || Platform::getIdleTime() < autoAwayTime)) { qDebug() << "Widget: auto away deactivated at" << QTime::currentTime().toString(); emit statusSet(Status::Online); autoAwayActive = false; } } else if (autoAwayActive) autoAwayActive = false; #endif }
void Widget::onConnected() { ui->statusButton->setEnabled(true); if (beforeDisconnect == Status::Offline) emit statusSet(Status::Online); else emit statusSet(beforeDisconnect); }
bool Widget::event(QEvent * e) { switch(e->type()) { case QEvent::WindowActivate: if (activeChatroomWidget != nullptr) { activeChatroomWidget->resetEventFlags(); activeChatroomWidget->updateStatusLight(); } // http://qt-project.org/faq/answer/how_can_i_detect_a_period_of_no_user_interaction // Detecting global inactivity, like Skype, is possible but not via Qt: // http://stackoverflow.com/a/21905027/1497645 case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::Wheel: case QEvent::KeyPress: case QEvent::KeyRelease: if (autoAwayActive) { qDebug() << "Widget: auto away deactivated"; autoAwayActive = false; emit statusSet(Status::Online); int mins = Settings::getInstance().getAutoAwayTime(); if (mins > 0) idleTimer->start(mins * 1000*60); } default: break; } return QWidget::event(e); }
bool Widget::event(QEvent * e) { switch(e->type()) { case QEvent::WindowActivate: if (activeChatroomWidget != nullptr) { activeChatroomWidget->resetEventFlags(); activeChatroomWidget->updateStatusLight(); } // http://qt-project.org/faq/answer/how_can_i_detect_a_period_of_no_user_interaction // Detecting global inactivity, like Skype, is possible but not via Qt: // http://stackoverflow.com/a/21905027/1497645 case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::Wheel: case QEvent::KeyPress: case QEvent::KeyRelease: if (autoAwayActive && ui->statusButton->property("status").toString() == "away") { // be sure nothing else has changed the status in the meantime qDebug() << "Widget: auto away deactivated at" << QTime::currentTime().toString(); autoAwayActive = false; emit statusSet(Status::Online); } setIdleTimer(Settings::getInstance().getAutoAwayTime()); default: break; } return QWidget::event(e); }
void Core::setStatus(Status status) { TOX_USERSTATUS userstatus; switch (status) { case Status::Online: userstatus = TOX_USERSTATUS_NONE; break; case Status::Away: userstatus = TOX_USERSTATUS_AWAY; break; case Status::Busy: userstatus = TOX_USERSTATUS_BUSY; break; default: userstatus = TOX_USERSTATUS_INVALID; break; } if (tox_set_user_status(tox, userstatus) == 0) { saveConfiguration(); emit statusSet(status); } else { emit failedToSetStatus(status); } }
void Core::setStatus(Status status) { TOX_USER_STATUS userstatus; switch (status) { case Status::Online: userstatus = TOX_USER_STATUS_NONE; break; case Status::Away: userstatus = TOX_USER_STATUS_AWAY; break; case Status::Busy: userstatus = TOX_USER_STATUS_BUSY; break; default: return; break; } tox_self_set_status(tox, userstatus); profile.saveToxSave(); emit statusSet(status); }
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"; emit statusSet(Status::Away); autoAwayActive = true; } idleTimer->stop(); }
void Widget::onDisconnected() { QString stat = ui->statusButton->property("status").toString(); if (stat == "online") beforeDisconnect = Status::Online; else if (stat == "busy") beforeDisconnect = Status::Busy; else if (stat == "away") beforeDisconnect = Status::Away; else beforeDisconnect = Status::Offline; ui->statusButton->setEnabled(false); emit statusSet(Status::Offline); }
void Widget::onDisconnected() { ui->statusButton->setEnabled(false); emit statusSet(Status::Offline); }
void Widget::onConnected() { ui->statusButton->setEnabled(true); emit statusSet(Status::Online); }
void Widget::onDisconnected() { beforeDisconnect = getStatusFromString(ui->statusButton->property("status").toString()); ui->statusButton->setEnabled(false); emit statusSet(Status::Offline); }
void AndroidGUI::onDisconnected() { emit statusSet(Status::Offline); }
void Widget::onDisconnected() { emit statusSet(Status::Offline); }
void Widget::onConnected() { emit statusSet(Status::Online); }