summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterreporter.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2018-05-18 03:02:44 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2018-05-18 03:02:44 +0300
commit64b3473f4920b0340e731e44342e2599ad46d698 (patch)
treee8f9994d427d5dcce6e3a19432f31f5f86f16f46 /indra/newview/llfloaterreporter.cpp
parent151df9b87b409283d11de7d3b918fd23f9772354 (diff)
parentc70119ebabc4b06e2b0db02aea8c56e01fbc666e (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llfloaterreporter.cpp')
-rw-r--r--indra/newview/llfloaterreporter.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index c0f5e63623..a320bcc6fc 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -164,6 +164,7 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key)
mResourceDatap(new LLResourceData()),
mAvatarNameCacheConnection()
{
+ gIdleCallbacks.addFunction(onIdle, this);
}
// virtual
@@ -224,6 +225,7 @@ LLFloaterReporter::~LLFloaterReporter()
{
mAvatarNameCacheConnection.disconnect();
}
+ gIdleCallbacks.deleteFunction(onIdle, this);
// child views automatically deleted
mObjectID = LLUUID::null;
@@ -241,10 +243,18 @@ LLFloaterReporter::~LLFloaterReporter()
delete mResourceDatap;
}
-// virtual
-void LLFloaterReporter::draw()
+void LLFloaterReporter::onIdle(void* user_data)
{
- LLFloater::draw();
+ LLFloaterReporter* floater_reporter = (LLFloaterReporter*)user_data;
+ if (floater_reporter)
+ {
+ 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();
+ }
+ }
}
void LLFloaterReporter::enableControls(BOOL enable)
@@ -877,8 +887,7 @@ void LLFloaterReporter::onOpen(const LLSD& key)
{
childSetEnabled("send_btn", false);
//Time delay to avoid UI artifacts. MAINT-7067
- doAfterInterval(boost::bind(&LLFloaterReporter::takeNewSnapshot,this), gSavedSettings.getF32("AbuseReportScreenshotDelay"));
-
+ mSnapshotTimer.start();
}
void LLFloaterReporter::onLoadScreenshotDialog(const LLSD& notification, const LLSD& response)
@@ -950,6 +959,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos)
void LLFloaterReporter::onClose(bool app_quitting)
{
+ mSnapshotTimer.stop();
gSavedPerAccountSettings.setBOOL("PreviousScreenshotForReport", app_quitting);
}