My mes file contains:
Code: Select all
AutomaticallySaveBugReport=1
AutoSaveBugReportIfNotSent=1
1) Using SendBugReport
When you send a report without the Full Exception Dialog using 'SendBugReport' the Report is Not Auto-saved on send failure.
If I use the only exposed method 'AutoSaveBugReport' then its saved regardless of the send failure.
For now, since I made source changes, I added an accessible method that can be checked :
Code: Select all
function WasMailSent(const ime: IMEException): Boolean;
begin
Result := (ime as IMEExceptionEx).GetMailWasSent;
end;
Here is an example of sending a report without the use of an Exception Dialog:
Code: Select all
exceptIntf.SendBugReport(Application.MainFormHandle);
if not madExcept.WasMailSent(exceptIntf) then
madExcept.AutoSaveBugReport(exceptIntf.BugReport);
Handled := True;
If you load a Report with 'ImportBugReport' and the user sends it during 'Show', it doesn't get automatically deleted.
In this code I need to know if the Report was Sent, and use 'WasMailSent':
Code: Select all
class procedure TMadMBR.ShowMBR(const BugReport: TFilename; SkipDialog: boolean);
var ime : IMEException;
begin
ime := ImportBugReport(TFile.ReadAllText(BugReport));
ime.AutoShowBugReport := SkipDialog;
ime.SetShowBtnVisible(not ime.AutoShowBugReport);
ime.SetRestartBtnVisible(False);
ime.SetCloseBtnVisible(False);
ime.BugReportFile := ExtractFileName(BugReport) + '.txt';// user may want to save it to another location
ime.Show;
if madExcept.WasMailSent(ime) then
TFile.Delete(BugReport);
end;