summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/common.go
diff options
context:
space:
mode:
authorMoritz Haase <Moritz.Haase@bmw.de>2022-03-30 08:48:29 +0200
committerJesse Duffield <jessedduffield@gmail.com>2022-03-30 20:13:43 +1100
commit8fb2acc2244ae0364fa20288bfcf70deed3ae974 (patch)
tree02c132565c7b87bf54f895fbc0d815efce867cd1 /pkg/gui/types/common.go
parentf2fb6453a13d7e609bb8456843e208e8e3e7901a (diff)
pkg/gui: Rename IPopupHandler::Ask() to Confirm()
Follow the JavaScript naming scheme for user interaction (alert, prompt, confirm) as discussed in #1832.
Diffstat (limited to 'pkg/gui/types/common.go')
-rw-r--r--pkg/gui/types/common.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go
index cbe1cd959..277732a34 100644
--- a/pkg/gui/types/common.go
+++ b/pkg/gui/types/common.go
@@ -48,13 +48,18 @@ type IGuiCommon interface {
}
type IPopupHandler interface {
+ // Shows a popup with a (localized) "Error" caption and the given error message (in red).
+ //
+ // This is a convenience wrapper around Alert().
ErrorMsg(message string) error
Error(err error) error
// Shows a notification popup with the given title and message to the user.
//
- // This is a convenience wrapper around Ask(), thus the popup can be closed using both 'Enter' and 'ESC'.
+ // This is a convenience wrapper around Confirm(), thus the popup can be closed using both 'Enter' and 'ESC'.
Alert(title string, message string) error
- Ask(opts AskOpts) error
+ // Shows a popup asking the user for confirmation.
+ Confirm(opts ConfirmOpts) error
+ // Shows a popup prompting the user for input.
Prompt(opts PromptOpts) error
WithLoaderPanel(message string, f func() error) error
WithWaitingStatus(message string, f func() error) error
@@ -85,7 +90,7 @@ type CreatePopupPanelOpts struct {
Mask bool
}
-type AskOpts struct {
+type ConfirmOpts struct {
Title string
Prompt string
HandleConfirm func() error