From 4e79bce3e237173063c2afd3b3ca739d139ea1f9 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 26 Nov 2013 00:38:00 +0100 Subject: [PATCH] Added notification that chat report has been sent after the user logs in. This will also add a line in the chat log with the report id --- indra/newview/llappviewer.cpp | 8 ++++++++ indra/newview/llcrashlogger.cpp | 8 ++++++++ indra/newview/llcrashlogger.h | 7 ++++--- indra/newview/skins/default/xui/en-us/notifications.xml | 7 +++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6449b376d..8506c2a31 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4694,6 +4694,14 @@ void LLAppViewer::handleLoginComplete() gDebugInfo["MainloopTimeoutState"] = LLAppViewer::instance()->mMainloopTimeout->getState(); } + // After login is complete, check if the crash report has been sent in this session + // If it has, insert a notification + if (LLCrashLogger::sReportID) + { + LLNotificationsUtil::add("CrashReportSent", LLSD().with("REPORT_ID", llformat("%d", LLCrashLogger::sReportID))); + LLCrashLogger::sReportID = 0; + } + mOnLoginCompleted(); writeDebugInfo(); diff --git a/indra/newview/llcrashlogger.cpp b/indra/newview/llcrashlogger.cpp index d79db0fae..73acc5718 100644 --- a/indra/newview/llcrashlogger.cpp +++ b/indra/newview/llcrashlogger.cpp @@ -63,11 +63,17 @@ public: virtual void result(const LLSD& content) { std::string msg = "Crash report successfully sent"; + if (content.has("message")) { msg += ": " + content["message"].asString(); } llinfos << msg << llendl; + + if (content.has("report_id")) + { + LLCrashLogger::sReportID = content["report_id"].asInteger(); + } } virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const @@ -93,6 +99,8 @@ LLCrashLogger::~LLCrashLogger() } +/*static*/ S32 LLCrashLogger::sReportID = 0; + // TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. const int TRIM_SIZE = 128000; const int LINE_SEARCH_DIST = 500; diff --git a/indra/newview/llcrashlogger.h b/indra/newview/llcrashlogger.h index c510acb98..64651ad25 100644 --- a/indra/newview/llcrashlogger.h +++ b/indra/newview/llcrashlogger.h @@ -40,13 +40,14 @@ public: LLCrashLogger(); virtual ~LLCrashLogger(); S32 loadCrashBehaviorSetting(); - bool readDebugFromXML(LLSD& dest, const std::string& filename ); + static S32 sReportID; + bool readDebugFromXML(LLSD& dest, const std::string& filename ); void gatherFiles(); - void mergeLogs( LLSD src_sd ); + void mergeLogs( LLSD src_sd ); virtual void gatherPlatformSpecificFiles() {} bool saveCrashBehaviorSetting(S32 crash_behavior); - bool sendCrashLog(std::string dump_dir); + bool sendCrashLog(std::string dump_dir); LLSD constructPostData(); void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } S32 getCrashBehavior() { return mCrashBehavior; } diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 307424ff0..d57bd5f80 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -9742,4 +9742,11 @@ Do you wish to export anyway? Object successfully exported to: [FILENAME] + +Thank you for submitting the crash report! Report ID is [REPORT_ID] + +