diff --git a/source/helpers.pas b/source/helpers.pas index cb638f58..61e99b8b 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -2419,8 +2419,8 @@ var m: String; Dialog: TTaskDialog; Btn: TTaskDialogButtonItem; - DialogResult: TModalResult; MsgButton: TMsgDlgBtn; + rx: TRegExpr; procedure AddButton(BtnCaption: String; BtnResult: TModalResult); begin @@ -2439,12 +2439,20 @@ begin end; if Title <> Dialog.Caption then Dialog.Title := Title; - Dialog.Text := Msg; + rx := TRegExpr.Create; + rx.Expression := 'https?\:\/\/\S+'; + Dialog.Text := rx.Replace(Msg, '$0', True); + rx.Free; Dialog.Flags := [tfEnableHyperlinks, tfAllowDialogCancellation]; Dialog.CommonButtons := []; + Dialog.OnHyperlinkClicked := MainForm.TaskDialogHyperLinkClicked; case DlgType of mtWarning: Dialog.MainIcon := tdiWarning; - mtError: Dialog.MainIcon := tdiError; + mtError: begin + Dialog.MainIcon := tdiError; + Dialog.FooterText := 'Find some help on this error'; + Dialog.FooterIcon := tdiInformation; + end; mtInformation: Dialog.MainIcon := tdiInformation; mtConfirmation: Dialog.MainIcon := tdiInformation; else Dialog.MainIcon := tdiNone; diff --git a/source/main.pas b/source/main.pas index dabc25bd..f1e55a0c 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1039,6 +1039,7 @@ type procedure SetProgressPosition(Value: Integer); procedure ProgressStep; procedure SetProgressState(State: TProgressbarState); + procedure TaskDialogHyperLinkClicked(Sender: TObject); end; @@ -10747,6 +10748,14 @@ begin end; +procedure TMainForm.TaskDialogHyperLinkClicked(Sender: TObject); +begin + // Used by hyperlinks in helpers.MessageDialog() + if Sender is TTaskDialog then + ShellExec(TTaskDialog(Sender).URL); +end; + + { TQueryTab }