|
|
|
@ -63,43 +63,16 @@ void setReportEmailFunction (void *emailFunction)
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef NL_OS_WINDOWS
|
|
|
|
|
|
|
|
|
|
// GNU/Linux, do nothing
|
|
|
|
|
|
|
|
|
|
void report ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
// Windows specific version
|
|
|
|
|
|
|
|
|
|
static string Body;
|
|
|
|
|
static string Subject;
|
|
|
|
|
static string AttachedFile;
|
|
|
|
|
|
|
|
|
|
static HWND checkIgnore=NULL;
|
|
|
|
|
static HWND debug=NULL;
|
|
|
|
|
static HWND ignore=NULL;
|
|
|
|
|
static HWND quit=NULL;
|
|
|
|
|
static HWND dialog=NULL;
|
|
|
|
|
|
|
|
|
|
static bool NeedExit;
|
|
|
|
|
static TReportResult Result;
|
|
|
|
|
static bool IgnoreNextTime;
|
|
|
|
|
static bool CanSendMailReport= false;
|
|
|
|
|
|
|
|
|
|
static bool DebugDefaultBehavior, QuitDefaultBehavior;
|
|
|
|
|
|
|
|
|
|
static std::string URL = "FILL_IN_CRASH_REPORT_HOSTNAME_HERE";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void doSendReport()
|
|
|
|
|
{
|
|
|
|
|
std::string filename;
|
|
|
|
|
|
|
|
|
|
filename = "report_";
|
|
|
|
|
filename += NLMISC::toString( time( NULL ) );
|
|
|
|
|
filename += NLMISC::toString( int( time( NULL ) ) );
|
|
|
|
|
filename += ".txt";
|
|
|
|
|
|
|
|
|
|
std::string params;
|
|
|
|
@ -123,8 +96,44 @@ static void doSendReport()
|
|
|
|
|
NLMISC::launchProgram( "crash_report", params );
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Added because NLSMIC::launcProgram needs time to launch
|
|
|
|
|
nlSleep( 2 * 1000 );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef NL_OS_WINDOWS
|
|
|
|
|
|
|
|
|
|
// GNU/Linux, do nothing
|
|
|
|
|
|
|
|
|
|
TReportResult report (const std::string &title, const std::string &header, const std::string &subject, const std::string &body, bool enableCheckIgnore, uint debugButton, bool ignoreButton, sint quitButton, bool sendReportButton, bool &ignoreNextTime, const string &attachedFile)
|
|
|
|
|
{
|
|
|
|
|
Body = addSlashR( body );
|
|
|
|
|
|
|
|
|
|
doSendReport();
|
|
|
|
|
|
|
|
|
|
return ReportQuit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
// Windows specific version
|
|
|
|
|
|
|
|
|
|
static string Subject;
|
|
|
|
|
static string AttachedFile;
|
|
|
|
|
|
|
|
|
|
static HWND checkIgnore=NULL;
|
|
|
|
|
static HWND debug=NULL;
|
|
|
|
|
static HWND ignore=NULL;
|
|
|
|
|
static HWND quit=NULL;
|
|
|
|
|
static HWND dialog=NULL;
|
|
|
|
|
|
|
|
|
|
static bool NeedExit;
|
|
|
|
|
static TReportResult Result;
|
|
|
|
|
static bool IgnoreNextTime;
|
|
|
|
|
static bool CanSendMailReport= false;
|
|
|
|
|
|
|
|
|
|
static bool DebugDefaultBehavior, QuitDefaultBehavior;
|
|
|
|
|
|
|
|
|
|
static void sendEmail()
|
|
|
|
|
{
|
|
|
|
|
if (CanSendMailReport && SendMessage(sendReport, BM_GETCHECK, 0, 0) != BST_CHECKED)
|
|
|
|
|