diff options
Diffstat (limited to 'UError.pas')
| -rw-r--r-- | UError.pas | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -21,7 +21,7 @@ unit UError; interface -uses glib2, gtk2, Classes, ULibc, GTKForms; +uses glib2, gtk2, Classes, SysUtils, ULibc, GTKForms; // Ported from gioerror.h @@ -68,11 +68,13 @@ function G_IO_ERROR: TGQuark; function g_io_error_from_errno(err_no: gint): GIOErrorEnum; +procedure g_set_error_from_exception(Error: PPGError; E: Exception); + procedure ShowError(Parent: TCustomGTKForm; const Text: string; Error: PGError); implementation -uses SysUtils, UCoreUtils, UGnome; +uses UCoreUtils, UGnome; (********************************************************************************************************************************) @@ -115,6 +117,12 @@ end; (********************************************************************************************************************************) +procedure g_set_error_from_exception(Error: PPGError; E: Exception); +begin + g_set_error(Error, G_IO_ERROR, integer(G_IO_ERROR_FAILED), 'Exception raised: %s', PChar(E.Message)); +end; + +(********************************************************************************************************************************) procedure ShowError(Parent: TCustomGTKForm; const Text: string; Error: PGError); var Dialog: PGtkWidget; error_str: PChar; |
