Refactor crash/bug reporter system

* The UI dialog is now in Qt. We run qrenderdoc.exe with a very minimal
  startup to display the dialog and send the report.
* The flow has been simplified to have less text and an easier time to
  just click through and send.
* On the first report, the user is gently nudged to enter their email
  address for contact and by default the email is saved for next time.
  They're not nagged more than once about this.
* Optionally the user can select to upload the capture. This is always
  default off, and there is a confirmation dialog making sure the user
  intended to select it.
* After the bug is reported, a unique URL is generated and returned
  which the user can then click back on to see if there's any update. By
  default the UI will also remember the URL and check it every couple
  of days and alert the user in the help menu that there's an update.
This commit is contained in:
baldurk
2017-12-19 12:26:34 +00:00
parent 1e36e73ed9
commit f2e7f8f1a0
25 changed files with 2068 additions and 465 deletions
@@ -385,3 +385,28 @@ SPIRVDisassembler::operator QVariant() const
return map;
}
BugReport::BugReport(const QVariant &var)
{
QVariantMap map = var.toMap();
if(map.contains(lit("ID")))
ID = map[lit("ID")].toString();
if(map.contains(lit("SubmitDate")))
SubmitDate = map[lit("SubmitDate")].toDateTime();
if(map.contains(lit("CheckDate")))
CheckDate = map[lit("CheckDate")].toDateTime();
if(map.contains(lit("UnreadUpdates")))
UnreadUpdates = map[lit("UnreadUpdates")].toBool();
}
BugReport::operator QVariant() const
{
QVariantMap map;
map[lit("ID")] = ID;
map[lit("SubmitDate")] = SubmitDate;
map[lit("CheckDate")] = CheckDate;
map[lit("UnreadUpdates")] = UnreadUpdates;
return map;
}
@@ -59,6 +59,50 @@ struct SPIRVDisassembler
DECLARE_REFLECTION_STRUCT(SPIRVDisassembler);
#define BUGREPORT_URL "https://renderdoc.org/bugreporter"
DOCUMENT("Describes a submitted bug report.");
struct BugReport
{
DOCUMENT("");
BugReport() { UnreadUpdates = false; }
VARIANT_CAST(BugReport);
bool operator==(const BugReport &o) const
{
return ID == o.ID && SubmitDate == o.SubmitDate && CheckDate == o.CheckDate &&
UnreadUpdates == o.UnreadUpdates;
}
bool operator<(const BugReport &o) const
{
if(ID != o.ID)
return ID < o.ID;
if(SubmitDate != o.SubmitDate)
return SubmitDate < o.SubmitDate;
if(CheckDate != o.CheckDate)
return CheckDate < o.CheckDate;
if(UnreadUpdates != o.UnreadUpdates)
return UnreadUpdates < o.UnreadUpdates;
return false;
}
DOCUMENT("The private ID of the bug report.");
rdcstr ID;
DOCUMENT("The original date when this bug was submitted.");
QDateTime SubmitDate;
DOCUMENT("The last date that we checked for updates.");
QDateTime CheckDate;
DOCUMENT("Unread updates to the bug exist");
bool UnreadUpdates = false;
DOCUMENT(R"(Gets the URL for this report.
:return: The URL to the report.
:rtype: ``str``
)");
rdcstr URL() const { return lit(BUGREPORT_URL "/report/%1").arg(QString(ID)); }
};
DECLARE_REFLECTION_STRUCT(BugReport);
#define CONFIG_SETTING_VAL(access, variantType, type, name, defaultValue) \
access: \
type name = defaultValue;
@@ -152,6 +196,16 @@ DECLARE_REFLECTION_STRUCT(SPIRVDisassembler);
\
CONFIG_SETTING_VAL(public, bool, bool, Analytics_ManualCheck, false) \
\
CONFIG_SETTING_VAL(public, bool, bool, CrashReport_EmailNagged, false) \
\
CONFIG_SETTING_VAL(public, bool, bool, CrashReport_ShouldRememberEmail, true) \
\
CONFIG_SETTING_VAL(public, QString, rdcstr, CrashReport_EmailAddress, "") \
\
CONFIG_SETTING_VAL(public, QString, rdcstr, CrashReport_LastOpenedCapture, "") \
\
CONFIG_SETTING(public, QVariantList, rdcarray<BugReport>, CrashReport_ReportedBugs) \
\
CONFIG_SETTING(private, QVariantMap, rdcstrpairs, ConfigSettings) \
\
CONFIG_SETTING(private, QVariantList, rdcarray<RemoteHost>, RemoteHostList)
@@ -460,6 +514,35 @@ For more information about some of these settings that are user-facing see
Defaults to ``False``.
.. data:: CrashReport_EmailNagged
``True`` if the user has been prompted to enter their email address on a crash report. This really
helps find fixes for bugs, so we prompt the user once only if they didn't enter an email. Once the
prompt has happened, regardless of the answer this is set to true and remains there forever.
Defaults to ``False``.
.. data:: CrashReport_ShouldRememberEmail
``True`` if the email address entered in the crash reporter should be remembered for next time. If
no email is entered then nothing happens (any previous saved email is kept).
Defaults to ``True``.
.. data:: CrashReport_EmailAddress
The saved email address for pre-filling out in crash reports.
.. data:: CrashReport_LastOpenedCapture
The last opened capture, to send if any crash is encountered. This is different to the most recent
opened file, because it's set before any processing happens (recent files are only added to the
list when they successfully open), and it's cleared again when the capture is closed.
.. data:: CrashReport_ReportedBugs
A list of :class:`BugReport` detailing previously submitted bugs that we're watching for updates.
)");
class PersistantConfig
{