From 491af1cbf0dd973b13bd617eff7fd821fcc28a2b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 11 Feb 2013 15:01:18 -0500 Subject: [PATCH] Remove gAllowIdleAFK (makes the general preferences checkbox functional) --- indra/newview/llappviewer.cpp | 10 ++++------ indra/newview/llappviewer.h | 1 - indra/newview/llviewermenu.cpp | 3 +-- indra/newview/llviewerwindow.cpp | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 76ba4b9cb..ff167bb9c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -243,7 +243,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() F32 gSimFrames; -BOOL gAllowIdleAFK = FALSE; BOOL gAllowTapTapHoldRun = TRUE; BOOL gShowObjectUpdates = FALSE; BOOL gUseQuickTime = TRUE; @@ -397,15 +396,16 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; void idle_afk_check() { + static const LLCachedControl allow_idk_afk("AllowIdleAFK"); // check idle timers static const LLCachedControl afk_timeout("AFKTimeout",0.f); - //if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) + //if (allow_idk_afk && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) // [RLVa:KB] - Checked: 2009-10-19 (RLVa-1.1.0g) | Added: RLVa-1.1.0g #ifdef RLV_EXTENSION_CMD_ALLOWIDLE - if ( (gAllowIdleAFK || gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) && + if ( (allow_idk_afk || gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) && (gAwayTriggerTimer.getElapsedTimeF32() > afk_timeout) && (afk_timeout > 0)) #else - if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > afk_timeout) && (afk_timeout > 0)) + if (allow_idk_afk && (gAwayTriggerTimer.getElapsedTimeF32() > afk_timeout) && (afk_timeout > 0)) #endif // RLV_EXTENSION_CMD_ALLOWIDLE // [/RLVa:KB] { @@ -504,7 +504,6 @@ static void settings_to_globals() gAgent.setHideGroupTitle(gSavedSettings.getBOOL("RenderHideGroupTitle")); gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); - gAllowIdleAFK = gSavedSettings.getBOOL("AllowIdleAFK"); gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); LLWorldMapView::sMapScale = llmax(.1f,gSavedSettings.getF32("MapScale")); @@ -2678,7 +2677,6 @@ void LLAppViewer::cleanupSavedSettings() gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc); - gSavedSettings.setBOOL("AllowIdleAFK", gAllowIdleAFK); gSavedSettings.setBOOL("AllowTapTapHoldRun", gAllowTapTapHoldRun); gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 681cb505d..6facb1266 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -275,7 +275,6 @@ const S32 AGENT_UPDATES_PER_SECOND = 10; extern LLSD gDebugInfo; -extern BOOL gAllowIdleAFK; extern BOOL gAllowTapTapHoldRun; extern BOOL gShowObjectUpdates; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index dde1a5950..f1b2d4aff 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1621,8 +1621,7 @@ void init_debug_avatar_menu(LLMenuGL* menu) { LLMenuGL* sub_menu = new LLMenuGL("Character Tests"); sub_menu->setCanTearOff(TRUE); - sub_menu->addChild(new LLMenuItemToggleGL("Go Away/AFK When Idle", - &gAllowIdleAFK)); + sub_menu->addChild(new LLMenuItemCheckGL("Go Away/AFK When Idle", menu_toggle_control, NULL, menu_check_control, (void*)"AllowIdleAFK")); sub_menu->addChild(new LLMenuItemCallGL("Appearance To XML", &handle_dump_archetype_xml,&enable_dump_archetype_xm)); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c5f44f342..ec152271b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1261,7 +1261,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) else { mActive = FALSE; - if (gAllowIdleAFK) + if (gSavedSettings.getBOOL("AllowIdleAFK")) { gAgent.setAFK(); }