hellomotor / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

CR_INST_DONT_SEND_REPORT and CR_INST_ALLOW_ATTACH_MORE_FILES don't work together #192

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I want to be able to have the user attach additional files and add comments to 
a report that is saved rather than sent.

The machines are on isolated private networks without any server or centralized 
control to send them to.

Setting CR_INST_DONT_SEND_REPORT & CR_INST_ALLOW_ATTACH_MORE_FILES acts the 
same as CR_INST_DONT_SEND_REPORT.

Original issue reported on code.google.com by zexspect...@gmail.com on 23 Mar 2013 at 9:16

GoogleCodeExporter commented 9 years ago
It will be useful to have an option to "export" the report and not "send the 
report". This way we can save the report on file, simply.

I don't think that such method exists. Right ?

Thanks

Original comment by k...@polarlights.net on 8 Apr 2013 at 8:19

GoogleCodeExporter commented 9 years ago
You can export the report. Please see this page for more info:
http://crashrpt.sourceforge.net/docs/html/error_report.html

Original comment by zexspect...@gmail.com on 8 Apr 2013 at 8:21

GoogleCodeExporter commented 9 years ago
It looks like that if CR_INST_DONT_SEND_REPORT is set, the UI is not shown at 
all. This is not always desirable, as zexspect notes you cannot attach files 
etc.
In my usecase, the application is deployed to a sneakernet ("behind a 
firewall") with no possibility of sending error reports. What I would like is 
to show the CrashRpt UI, but instead of sending the crash report, just zip it 
to the local disk.
Later on, an IT man will get to collect the reports manually.

Thanks!

Original comment by krikun.d...@gmail.com on 15 Oct 2014 at 7:12

GoogleCodeExporter commented 9 years ago
I agree with krikun's comment. The ability to use the UI without sending is 
required. I modified the code to do just this. If the CR_INST_DONT_SEND_REPORT 
is specified, but not the ZIP flag, then the UI is displayed with an Export 
button.

Here are the changes:
CErrorReportDlg::OnCompleteCollectCrashInfo(): 
-    if(pSender->GetCrashInfo()->m_bSendErrorReport) // If we should send error 
report now
---
+    // If not sending and not storing zip archives automatically, still show 
the gui
+    // to allow the user to manually export.
+    if(pSender->GetCrashInfo()->m_bSendErrorReport || 
!pSender->GetCrashInfo()->m_bStoreZIPArchives) 

CErrorReportDlg::OnInitDialog(): (add at end of method)
    if (!pSender->GetCrashInfo()->m_bSendErrorReport)
    {
      m_btnOk.SetWindowText(pSender->GetLangStr(_T("DetailDlg"), _T("Export")));
      m_linkMoreInfo.ShowWindow(SW_HIDE);
      CString sConsent;
      sConsent.Format(_T("Press the 'Export' button to generate a report zip file. Make note of the export location and attach the report in an e-mail to   %s.  Please include a description of the steps needed to reproduce the error and, if possible, attach the project files."), pSender->GetCrashInfo()->m_sEmailTo);
      m_statConsent.SetWindowText(sConsent);
    }

CErrorReportDlg::OnSendClick(): (add at top of method - copied from 
DetailDlg::Export())
  CErrorReportSender* pSender = CErrorReportSender::GetInstance();
  if (!pSender->GetCrashInfo()->m_bSendErrorReport)
  {
    // This method is called when user clicks the "Export" button
    // Format file name for the output ZIP archive.
    CString sFileName = pSender->GetCrashInfo()->GetReport(0)->GetCrashGUID() + _T(".zip");

    // Display "Save File" dialog.
    CFileDialog dlg(FALSE, _T("*.zip"), sFileName,
      OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT,
      _T("ZIP Files (*.zip)\0*.zip\0All Files (*.*)\0*.*\0\0"), m_hWnd);

    INT_PTR result = dlg.DoModal();
    if (result == IDOK)
    {
      // Determine what destination user chosen
      CString sExportFileName = dlg.m_szFileName;

      // Export crash report assynchronously
      pSender->ExportReport(sExportFileName);

      // Exit the app.
      SendMessage(WM_CLOSE);
    }

    return 0;
  }

Also increased the size of IDC_CONSENT in the IDD_MAINDLG dialog resource.

Original comment by jpdun...@gmail.com on 1 Dec 2014 at 5:55