Add GetItemOperation/SetItemOperation/ClearItemOperation to IStateAccessor

Not used by anything yet; committing this separately in the interest of having
smaller independent commits.
This commit is contained in:
Stefan Haller
2023-10-08 17:54:40 +02:00
parent cc9a20c4ab
commit 9d55d71fdd
2 changed files with 51 additions and 0 deletions

View File

@@ -265,6 +265,24 @@ type Mutexes struct {
PtyMutex *deadlock.Mutex
}
// A long-running operation associated with an item. For example, we'll show
// that a branch is being pushed from so that there's visual feedback about
// what's happening and so that you can see multiple branches' concurrent
// operations
type ItemOperation int
const (
ItemOperationNone ItemOperation = iota
ItemOperationPushing
ItemOperationPulling
ItemOperationFastForwarding
ItemOperationDeleting
)
type HasUrn interface {
URN() string
}
type IStateAccessor interface {
GetRepoPathStack() *utils.StringStack
GetRepoState() IRepoStateAccessor
@@ -277,6 +295,9 @@ type IStateAccessor interface {
SetShowExtrasWindow(bool)
GetRetainOriginalDir() bool
SetRetainOriginalDir(bool)
GetItemOperation(item HasUrn) ItemOperation
SetItemOperation(item HasUrn, operation ItemOperation)
ClearItemOperation(item HasUrn)
}
type IRepoStateAccessor interface {