void ActivityManager::on(TimerManagerListener::Second, uint64_t aTick) noexcept { if (!SETTING(AWAY_IDLE_TIME) || awayMode != AWAY_OFF) { return; } if ((lastActivity + SETTING(AWAY_IDLE_TIME) * 60 * 1000ULL) < aTick) { setAway(AWAY_IDLE); } }
void WPAccount::setOnlineStatus(const Kopete::OnlineStatus &status, const QString &reason) { if (myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline && status.status() == Kopete::OnlineStatus::Online) connect( status ); else if (myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline && status.status() == Kopete::OnlineStatus::Offline) disconnect(); else if (myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline && status.status() == Kopete::OnlineStatus::Away) setAway( true, reason ); }
void KopeteAwayDialog::slotOk() { // Save the text the user typed mLastUserTypedMessage = d->base->txtOneShot->text(); setAway( mExtendedAwayType ); KDialogBase::slotOk(); }
void ActivityManager::updateActivity(time_t aLastActivity) noexcept { if (aLastActivity < lastActivity) { return; } lastActivity = aLastActivity; if (awayMode != AWAY_MANUAL) { setAway(AWAY_OFF); } }
void IRCAccount::setOnlineStatus(const Kopete::OnlineStatus& status, const Kopete::StatusMessage &reason, const OnlineStatusOptions& /*options*/) { if ( status.status() == Kopete::OnlineStatus::Online && myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline ) slotGoOnline(); else if (status.status() == Kopete::OnlineStatus::Online && (myself()->onlineStatus().status() == Kopete::OnlineStatus::Away || myself()->onlineStatus().status() == Kopete::OnlineStatus::Busy) ) setAway( false, reason.message() ); else if ( status.status() == Kopete::OnlineStatus::Offline ) slotGoOffline(); else if ( status.status() == Kopete::OnlineStatus::Away ) slotGoAway( /* reason */ ); else if ( status.status() == Kopete::OnlineStatus::Busy ) slotGoBusy( /* reason */ ); }
void IRCUserContact::newWhoReply( const QString &channel, const QString &user, const QString &host, const QString &server, bool away, const QString &flags, uint hops, const QString &realName ) { if( !mInfo.channels.contains( channel ) ) mInfo.channels.append( channel ); mInfo.userName = user; mInfo.hostName = host; mInfo.serverName = server; mInfo.flags = flags; mInfo.hops = hops; mInfo.realName = realName; setAway(away); updateInfo(); if( isChatting() && ircAccount()->currentCommandSource() == manager() ) { ircAccount()->setCurrentCommandSource(0); } }
String KnitControl::run(char c) { String res = "nop"; bool processed = false; switch (c){ case ' ': processed=true; break; case 'a': // toggle BACK servos case 'A': processed = true; stepsToDo=0; lastStepsToDo=0; res = "Trying to ABORT!"; break; case 'b': // toggle BACK servos case 'B': processed = true; sm->setFB(false,ServoMgr::Toggle); res = "Toggling BACK servos."; break; case 'c': // toggle BACK servos case 'C': processed = true; stepsToDo=0; lastStepsToDo=0; homed = awayed = false; curPos = 0; awayPos = maxSteps; res = "Settings Clearde!"; break; case 'f': // toggle FRONT servos case 'F': processed = true; sm->setFB(true,ServoMgr::Toggle); res = "Toggling FRONT servos."; break; case 'G': case 'g': // just go until we can go no more processed = true; if (homed && awayed){ stepsToDo=-1; lastStepsToDo=0; res = "Going for it!"; } else{ res = "Better HOME and AWAY first..."; } break; case 'h': case 'H': // set the current position as home setHome(); processed = true; res = "Homed!"; break; case 'k': // toggle FRONT servos case 'K': processed = true; sm->setServos2Knit(dir); res = String("Servos set to knit: ") + String(dir ? "LEFT" : "RIGHT"); break; case 'l': case 'L': // take a step left processed = true; setDir(true); res = "Direction: LEFT!"; break; case 'n': // chang to needle mode, i.e. numbers entered refer to needles case 'N': processed = true; needleMode = true; res = "Needle Movement Mode activited!"; break; case 'p': // display curren position case 'P': processed = true; res = "Current Position: " + String(curPos); // NOTE: the string 'Current' is parsed by Processing GUI, do not remove it! break; case 'r': // take one step right case 'R': processed = true; setDir(false); res = "Direction: RIGHT!"; break; case 's': // switch tostep mode: numbers entered refer to steps case 'S': processed = true; needleMode = false; res = "Step Movement Mode activited!"; break; case 't': // toggle TOP servo case 'T': processed = true; sm->toggle(ServoMgr::Top); res = "Toggling TOP servo."; break; case 'v': // Visualize status case 'V': processed = true; res = getStatus(); break; case 'y': case 'Y': // set the current position as home processed = true; if(homed){ setAway(); res = "Awayed!"; } else{ res = "Please Home before setting Away!"; } break; case 'z': // all servos OUT case 'Z': processed = true; for (int i=0;i<ServoMgr::nbServos;i++){ sm->set(i,false); } res = "Servos set to OUT."; break; } if (!processed){ if (c >= '0' && c <= '9'){ int nbSteps = ((c -'0') * 5) + 1; if (needleMode){ moveNeedles(nbSteps); } else{ moveSteps(nbSteps); } } } return res; }
void ActivityManager::on(SettingsManagerListener::Load, SimpleXML&) noexcept { if (SETTING(AWAY)) { setAway(AWAY_MANUAL); } }
/// Aliases inline void setAWAY(double value) {setAway(value);}