Advertisement
RandomClear

How to return from "Detailed" dialog

Jul 23rd, 2015
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.70 KB | None | 0 0
  1. // By default, "EurekaLog Detailed" dialog will send bug report and close/restart/terminate application when dialog is closed.
  2. // This can be not an intuitive behaviour when this dialog is shown from another dialog (such as "MS Classic").
  3. // This code can be used to change this behaviour, so closing "EurekaLog Detailed" dialog will revert back to previous dialog.
  4.  
  5. uses
  6.   ETypes,
  7.   EDialog,
  8.   EDialogWinAPIEurekaLogDetailed;
  9.  
  10. type
  11.   // Override dialog class to customize its behaviour
  12.   TEurekaLogDetailedDialog = class(EDialogWinAPIEurekaLogDetailed.TEurekaLogDetailedDialog)
  13.   protected
  14.     function AssignOnCloseData: Boolean; override;
  15.     function GetCanSend: Boolean; override;
  16.     function GetShowTerminateControl: Boolean; override;
  17.     function GetShowAppendDetailsControl: Boolean; override;
  18.   end;
  19.  
  20. { TEurekaLogDetailedDialog }
  21.  
  22. function TEurekaLogDetailedDialog.AssignOnCloseData: Boolean;
  23. begin
  24.   // Switch dialog back to previous dialog type
  25.   Options.ExceptionDialogType := FallbackDialogClass;
  26.   if Options.ExceptionDialogType = edtNone then
  27.     Options.ExceptionDialogType := edtEurekaLog;
  28.   FResponse.SendResult := srRestart;
  29.  
  30.   Result := inherited;
  31. end;
  32.  
  33. // Disable some UI elements in dialog:
  34. function TEurekaLogDetailedDialog.GetCanSend: Boolean;
  35. begin
  36.   Result := False;
  37. end;
  38.  
  39. function TEurekaLogDetailedDialog.GetShowAppendDetailsControl: Boolean;
  40. begin
  41.   Result := False;
  42. end;
  43.  
  44. function TEurekaLogDetailedDialog.GetShowTerminateControl: Boolean;
  45. begin
  46.   Result := False;
  47. end;
  48.  
  49. initialization
  50.   // Register our class to be used by EurekaLog.
  51.   // Be sure to register it as "first" - to override default class
  52.   RegisterDialogClassFirst(TEurekaLogDetailedDialog);
  53. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement