1
0
Fork 0

Error-report: feedback from group review

Include command line / launcher options in the detailed report, and
pause the sim when showing an error dialog, in case the report
occurs at an unfortunate time.
This commit is contained in:
James Turner 2021-03-15 14:08:36 +00:00
parent 6e00c47d3d
commit b115c424ce

View file

@ -38,6 +38,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include <Main/locale.hxx> #include <Main/locale.hxx>
#include <Main/options.hxx>
#include <Main/sentryIntegration.hxx> #include <Main/sentryIntegration.hxx>
#include <Scripting/NasalClipboard.hxx> // clipboard access #include <Scripting/NasalClipboard.hxx> // clipboard access
@ -351,7 +352,7 @@ auto ErrorReporter::ErrorReporterPrivate::getAggregateForOccurence(const ErrorRe
if (oc.hasContextKey("primary-aircraft")) { if (oc.hasContextKey("primary-aircraft")) {
const auto fullId = fgGetString("/sim/aircraft-id"); const auto fullId = fgGetString("/sim/aircraft-id");
if (fullId != fgGetString("/sim/aircraft")) { if (fullId != fgGetString("/sim/aircraft")) {
return getAggregate(Aggregation::MainAircraft); return getAggregate(Aggregation::MainAircraft, fullId);
} }
return getAggregate(Aggregation::HangarAircraft, fullId); return getAggregate(Aggregation::HangarAircraft, fullId);
@ -478,6 +479,12 @@ void ErrorReporter::ErrorReporterPrivate::writeReportToStream(const AggregateRep
writeLogToStream(err, os); writeLogToStream(err, os);
os << std::endl; // trailing blank line os << std::endl; // trailing blank line
} }
os << "Command line / launcher / fgfsrc options" << endl;
for (auto o : Options::sharedInstance()->extractOptions()) {
os << "\t" << o << "\n";
}
os << endl;
} }
bool ErrorReporter::ErrorReporterPrivate::dismissReportCommand(const SGPropertyNode* args, SGPropertyNode*) bool ErrorReporter::ErrorReporterPrivate::dismissReportCommand(const SGPropertyNode* args, SGPropertyNode*)
@ -699,6 +706,14 @@ void ErrorReporter::update(double dt)
if (showDialog) { if (showDialog) {
auto gui = globals->get_subsystem<NewGUI>(); auto gui = globals->get_subsystem<NewGUI>();
gui->showDialog("error-report"); gui->showDialog("error-report");
// this needs a bit more thought, disabling for the now
#if 0
// pause the sim when showing the popup
SGPropertyNode_ptr pauseArgs(new SGPropertyNode);
pauseArgs->setBoolValue("force-pause", true);
globals->get_commands()->execute("do_pause", pauseArgs);
#endif
} }
} }