diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/app_settings/settings.xml --- a/indra/newview/app_settings/settings.xml Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/app_settings/settings.xml Wed Sep 14 08:54:07 2011 -0400 @@ -25,7 +25,7 @@ Type S32 Value - 0 + 300 AdminMenu @@ -7116,17 +7116,6 @@ Value 0.0 - QuitAfterSecondsOfAFK - - Comment - The duration allowed after being AFK before quitting. - Persist - 1 - Type - F32 - Value - 0.0 - QuitOnLoginActivated Comment diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/llagent.h --- a/indra/newview/llagent.h Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/llagent.h Wed Sep 14 08:54:07 2011 -0400 @@ -318,7 +318,8 @@ void setAFK(); void clearAFK(); BOOL getAFK() const; - + static const F32 MIN_AFK_TIME; + //-------------------------------------------------------------------- // Run //-------------------------------------------------------------------- diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/llagent.cpp --- a/indra/newview/llagent.cpp Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/llagent.cpp Wed Sep 14 08:54:07 2011 -0400 @@ -107,7 +107,6 @@ const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds - // The agent instance. LLAgent gAgent; @@ -115,6 +114,9 @@ // Statics // +/// minimum time after setting away state before coming back based on movement +const F32 LLAgent::MIN_AFK_TIME = 10.0f; + const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f; std::map LLAgent::sTeleportErrorMessages; @@ -1165,6 +1167,7 @@ { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START); setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP); + LL_INFOS("AFK") << "Setting Away" << LL_ENDL; gAwayTimer.start(); if (gAFKMenu) { @@ -1188,6 +1191,7 @@ { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP); clearControlFlags(AGENT_CONTROL_AWAY); + LL_INFOS("AFK") << "Clearing Away" << LL_ENDL; if (gAFKMenu) { gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway")); diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/llappviewer.cpp --- a/indra/newview/llappviewer.cpp Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/llappviewer.cpp Wed Sep 14 08:54:07 2011 -0400 @@ -247,7 +247,6 @@ //////////////////////////////////////////////////////////// // All from the last globals push... -const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() F32 gSimFrames; @@ -430,8 +429,11 @@ void idle_afk_check() { // check idle timers - if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout"))) - { + F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); + F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); + if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) + { + LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; gAgent.setAFK(); } } @@ -4186,18 +4188,6 @@ } } - // debug setting to quit after N seconds of being AFK - 0 to never do this - F32 qas_afk = gSavedSettings.getF32("QuitAfterSecondsOfAFK"); - if (qas_afk > 0.f) - { - // idle time is more than setting - if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk ) - { - // go ahead and just quit gracefully - LLAppViewer::instance()->requestQuit(); - } - } - // Must wait until both have avatar object and mute list, so poll // here. request_initial_instant_messages(); diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/llviewerjoystick.cpp --- a/indra/newview/llviewerjoystick.cpp Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/llviewerjoystick.cpp Wed Sep 14 08:54:07 2011 -0400 @@ -51,9 +51,6 @@ #define RY_I 5 #define RZ_I 3 -// minimum time after setting away state before coming back -const F32 MIN_AFK_TIME = 2.f; - F32 LLViewerJoystick::sLastDelta[] = {0,0,0,0,0,0,0}; F32 LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0}; @@ -551,7 +548,7 @@ if (!is_zero) { // Clear AFK state if moved beyond the deadzone - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -725,7 +722,7 @@ if (!is_zero) { // Clear AFK state if moved beyond the deadzone - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -941,7 +938,7 @@ } // Clear AFK state if moved beyond the deadzone - if (!is_zero && gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1001,7 +998,7 @@ gAgentCamera.changeCameraToDefault(); } - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } diff -r ffa9260a0b27 -r 5ba1a0163c1d indra/newview/llviewerwindow.cpp --- a/indra/newview/llviewerwindow.cpp Tue Sep 13 14:47:34 2011 -0400 +++ b/indra/newview/llviewerwindow.cpp Wed Sep 14 08:54:07 2011 -0400 @@ -240,8 +240,6 @@ static const U8 NO_FACE = 255; BOOL gQuietSnapshot = FALSE; -const F32 MIN_AFK_TIME = 2.f; // minimum time after setting away state before coming back - static const F32 MIN_DISPLAY_SCALE = 0.75f; std::string LLViewerWindow::sSnapshotBaseName; @@ -1214,7 +1212,7 @@ mWindow->showCursorFromMouseMove(); - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1302,7 +1300,7 @@ // Let the voice chat code check for its PTT key. Note that this never affects event processing. LLVoiceClient::getInstance()->keyDown(key, mask); - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) { gAgent.clearAFK(); } @@ -1352,6 +1350,7 @@ { mActive = FALSE; + // if the user has chosen to go Away automatically after some time, then go Away when minimizing if (gSavedSettings.getS32("AFKTimeout")) { gAgent.setAFK();