summaryrefslogtreecommitdiff
path: root/structs.go
blob: f7a05d1353c899431e3ad877a1b6f6ea99079ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0

package main

import (
	"go.wit.com/dev/alexflint/arg"
	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
	"go.wit.com/lib/protobuf/forgepb"
	"go.wit.com/lib/protobuf/gitpb"
)

var me *mainType

func (b *mainType) Disable() {
	b.mainbox.Disable()
}

func (b *mainType) Enable() {
	b.mainbox.Enable()
}

// this app's variables
type mainType struct {
	pp         *arg.Parser    // for parsing the command line args.  Yay to alexf lint!
	forge      *forgepb.Forge // for holding the forge protobuf files
	myGui      *gui.Node      // the gui toolkit handle
	found      *gitpb.Repos   // stores the list of repos to process things on
	foundPaths []string       // stores gopaths to act on (when doing go-clone)
	configSave bool           // if the config file should be saved after finishing
	urlbase    string         // base URL

	// our view of the repositories
	// patchWin *patchesWindow

	mainWindow *gadgets.BasicWindow

	// the main box. enable/disable this
	mainbox *gui.Node

	// the window from the /lib/gui/gowit package
	// lw *gadgets.BasicWindow

	// #### Sorting options for the repolist
	// autoHidePerfect  *gui.Node
	// autoHideReadOnly *gui.Node

	// checkbox for --dry-run
	autoDryRun *gui.Node

	// checkbox to enable intermittent scanning
	// if checked, it will check all your repos for changes
	autoScanReposCB *gui.Node

	goSrcPwd  *gadgets.OneLiner // what is being used as primary directory for your work
	gitAuthor *gadgets.OneLiner // ENV GIT_AUTHOR NAME and EMAIL
	forgeMode *gui.Node         // is the user in 'master', 'devel' or 'user' branches

	// these hold the branches that the user can switch all
	// the repositories to them
	newBranch       *gui.Node // deprecate?
	setBranchB      *gui.Node // deprecate?
	reposWinB       *gui.Node // button that opens the repos window
	repoAllB        *gui.Node // "all" repos button
	repoDirtyB      *gui.Node // "dirty" repos button
	repoDevelMergeB *gui.Node // "merge to devel" repos button
	repoWritableB   *gui.Node // "what repos are writable" repos button
	demoB           *gui.Node // opens the demo
	modeReleaseW    *gui.Node // opens the release window
	modePatchW      *gui.Node // opens the patch window
	modeUserW       *gui.Node // opens the user/hack window

	argvCheckoutUser   bool // shared between the GUI and the command line tools
	argvCheckoutDevel  bool // shared between the GUI and the command line tools
	argvCheckoutMaster bool // shared between the GUI and the command line tools
}