diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterreporter.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llfloaterreporter.h | 3 |
2 files changed, 14 insertions, 10 deletions
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 3a3660bb31..a320bcc6fc 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -162,9 +162,9 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key) mPosition(), mCopyrightWarningSeen( FALSE ), mResourceDatap(new LLResourceData()), - mAvatarNameCacheConnection(), - mSnapshotTimer() + mAvatarNameCacheConnection() { + gIdleCallbacks.addFunction(onIdle, this); } // virtual @@ -225,6 +225,7 @@ LLFloaterReporter::~LLFloaterReporter() { mAvatarNameCacheConnection.disconnect(); } + gIdleCallbacks.deleteFunction(onIdle, this); // child views automatically deleted mObjectID = LLUUID::null; @@ -242,15 +243,17 @@ LLFloaterReporter::~LLFloaterReporter() delete mResourceDatap; } -// virtual -void LLFloaterReporter::draw() +void LLFloaterReporter::onIdle(void* user_data) { - LLFloater::draw(); - static LLCachedControl<F32> screenshot_delay(gSavedSettings, "AbuseReportScreenshotDelay"); - if (mSnapshotTimer.getStarted() && mSnapshotTimer.getElapsedTimeF32() > screenshot_delay) + LLFloaterReporter* floater_reporter = (LLFloaterReporter*)user_data; + if (floater_reporter) { - mSnapshotTimer.stop(); - takeNewSnapshot(); + static LLCachedControl<F32> screenshot_delay(gSavedSettings, "AbuseReportScreenshotDelay"); + if (floater_reporter->mSnapshotTimer.getStarted() && floater_reporter->mSnapshotTimer.getElapsedTimeF32() > screenshot_delay) + { + floater_reporter->mSnapshotTimer.stop(); + floater_reporter->takeNewSnapshot(); + } } } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index f5ba63ce7f..d9ecb9f4ea 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -83,7 +83,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); - virtual void draw(); + + static void onIdle(void* user_data); void setReportType(EReportType type) { mReportType = type; } |