Sure,
1) The "save bug report" button action is dependent on BugReportFile but I believe the online help is outdated:
If you specify a full path, no "save box" is shown, even if the user presses on the "save bug report" button, instead the bug report file is directly written to the specified path.
I've been supplying a full path with filename (in code) yet "save bug report" still comes up with a File dialog, which BTW has only a text filter and doesn't append TXT to an MBR file when saved.
2) I set BugReportFile '%ProgramData%\Company\AppName.mbr' when the App starts. With this if the user clicks 'Save' the default directory is '%ProgramData%\Company' and the file name 'AppName.mbr'. The dialog filter is only 'TXT' but when saved its saved as 'AppName.mbr'.
But this is not a huge issues since I need to change the file name to get it to the correct location.
3) To change the file name and to get a 'Save' to the correct location I use this code:
Code: Select all
case Action of
eaShowBugReport: begin // before assistant
{- Fix for saving Bug Report: see Region for details }
if (Action=eaSaveBugReport) then
exceptIntf.BugReportFile := ExtractFileName(madExcept.MESettings.BugReportFile) + '.txt';
end;
eaSaveBugReport3: begin // after saving
{- Fix for saving Bug Report: see Region for details }
exceptIntf.BugReportFile := madExcept.MESettings.BugReportFile;
end;
end;
This works but since 'CheckAutoSave' sends another eaShowBugReport (without a eaSaveBugReport3 btw) it saves to the wrong location.
4)
The fix is this (repeat):
I hate to but altered source, I don't believe 'DoFireHandlers(0, 1, eaSaveBugReport, exceptIntf, b1);' should be there.
First from fast reading your code if handle=0 there is no eaSaveBugReport3 fired, second there are no Assistants for the same reason.
The alternative is ugly, if I can't change the BugReportFile then I need to implement a VCL SaveAs myself by hooking eaSaveBugReport2.
Like you I'd rather not break stuff..
Will add the rest in a separate post.