parent
1aacff60a1
commit
cdb0808c22
10
args.go
10
args.go
|
@ -4,12 +4,8 @@ package digitalocean
|
|||
|
||||
import (
|
||||
"go.wit.com/dev/alexflint/arg"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
var NOW *log.LogFlag
|
||||
var INFO *log.LogFlag
|
||||
var POLL *log.LogFlag
|
||||
var argDo ArgsDo
|
||||
|
||||
// This struct can be used with the go-arg package
|
||||
|
@ -19,10 +15,4 @@ type ArgsDo struct {
|
|||
|
||||
func init() {
|
||||
arg.Register(&argDo)
|
||||
full := "go.wit.com/lib/gui/digitalocean"
|
||||
short := "DOgui"
|
||||
|
||||
NOW = log.NewFlag("NOW", true, full, short, "temp debugging stuff")
|
||||
INFO = log.NewFlag("INFO", false, full, short, "normal debugging stuff")
|
||||
INFO = log.NewFlag("POLL", false, full, short, "show droplet status polling")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package digitalocean
|
||||
|
||||
// initializes logging and command line options
|
||||
|
||||
import (
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
var NOW *log.LogFlag
|
||||
var INFO *log.LogFlag
|
||||
var POLL *log.LogFlag
|
||||
|
||||
func init() {
|
||||
full := "go.wit.com/lib/gui/digitalocean"
|
||||
short := "DOgui"
|
||||
|
||||
NOW = log.NewFlag("NOW", true, full, short, "temp debugging stuff")
|
||||
INFO = log.NewFlag("INFO", false, full, short, "normal debugging stuff")
|
||||
POLL = log.NewFlag("POLL", false, full, short, "show droplet status polling")
|
||||
}
|
20
new.go
20
new.go
|
@ -48,9 +48,7 @@ func (d *DigitalOcean) Show() {
|
|||
return
|
||||
}
|
||||
log.Info("digitalocean.Show() window")
|
||||
if d.hidden {
|
||||
d.window.Show()
|
||||
}
|
||||
d.window.Show()
|
||||
d.hidden = false
|
||||
}
|
||||
|
||||
|
@ -59,12 +57,22 @@ func (d *DigitalOcean) Hide() {
|
|||
return
|
||||
}
|
||||
log.Info("digitalocean.Hide() window")
|
||||
if !d.hidden {
|
||||
d.window.Hide()
|
||||
}
|
||||
d.window.Hide()
|
||||
d.hidden = true
|
||||
}
|
||||
|
||||
func (d *DigitalOcean) Toggle() {
|
||||
if !d.Ready() {
|
||||
return
|
||||
}
|
||||
log.Info("digitalocean.Hide() window")
|
||||
if d.hidden {
|
||||
d.Show()
|
||||
} else {
|
||||
d.Hide()
|
||||
}
|
||||
}
|
||||
|
||||
func (d *DigitalOcean) Update() bool {
|
||||
if !d.Ready() {
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue