2023-03-21 11:57:52 +02:00
|
|
|
package context
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ConfirmationContext struct {
|
|
|
|
*SimpleContext
|
2023-03-23 03:35:07 +02:00
|
|
|
c *ContextCommon
|
2023-03-21 11:57:52 +02:00
|
|
|
|
|
|
|
State ConfirmationContextState
|
|
|
|
}
|
|
|
|
|
|
|
|
type ConfirmationContextState struct {
|
|
|
|
OnConfirm func() error
|
|
|
|
OnClose func() error
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ types.Context = (*ConfirmationContext)(nil)
|
|
|
|
|
|
|
|
func NewConfirmationContext(
|
2023-03-23 03:35:07 +02:00
|
|
|
c *ContextCommon,
|
2023-03-21 11:57:52 +02:00
|
|
|
) *ConfirmationContext {
|
|
|
|
return &ConfirmationContext{
|
|
|
|
c: c,
|
|
|
|
SimpleContext: NewSimpleContext(NewBaseContext(NewBaseContextOpts{
|
|
|
|
View: c.Views().Confirmation,
|
|
|
|
WindowName: "confirmation",
|
|
|
|
Key: CONFIRMATION_CONTEXT_KEY,
|
|
|
|
Kind: types.TEMPORARY_POPUP,
|
|
|
|
Focusable: true,
|
|
|
|
HasUncontrolledBounds: true,
|
2023-03-21 12:01:58 +02:00
|
|
|
})),
|
2023-03-21 11:57:52 +02:00
|
|
|
}
|
|
|
|
}
|