summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-10-08 17:54:40 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-10-08 18:30:57 +0200
commit9d55d71fdd310886cc178a4416a9d743d8f34a03 (patch)
tree4245f7fe41445a1314ab1a6b52f492675f9bac95 /pkg/gui/types
parentcc9a20c4abc850e94352cf04f7484bf0ba381780 (diff)
Add GetItemOperation/SetItemOperation/ClearItemOperation to IStateAccessor
Not used by anything yet; committing this separately in the interest of having smaller independent commits.
Diffstat (limited to 'pkg/gui/types')
-rw-r--r--pkg/gui/types/common.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go
index 80d960eab..f4fde41c7 100644
--- a/pkg/gui/types/common.go
+++ b/pkg/gui/types/common.go
@@ -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 {