diff options
| author | Jeff Carr <[email protected]> | 2025-08-17 15:28:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-17 22:57:06 -0500 |
| commit | bd5b16d8755bc9e5f0dc90162bc4724d319c725e (patch) | |
| tree | 4b7f532675d29493f78b8ab41c0bb925158ee768 /doGui.go | |
| parent | edb3e23311b9cd667898e625b07f5dbeb43e30e3 (diff) | |
show drives. remove stupid commit of plugin binary. damnit
Diffstat (limited to 'doGui.go')
| -rw-r--r-- | doGui.go | 38 |
1 files changed, 22 insertions, 16 deletions
@@ -7,10 +7,12 @@ package main import ( "os" + "strings" "time" "go.wit.com/gui" "go.wit.com/lib/gadgets" + "go.wit.com/lib/gui/shell" "go.wit.com/log" ) @@ -41,31 +43,35 @@ func doGui() { func drawWindow(win *gadgets.GenericWindow) { grid := win.Group.RawGrid() - grid.NewLabel("Drives:") - me.dd = grid.NewDropdown() - me.dd.AddText("/dev/blah") + // me.dd.AddText("/dev/blah") me.dd.Custom = func() { - log.Info("todo: changed drive") + fields := strings.Fields(me.dd.String()) + log.Info("changed to", fields) + if len(fields) < 1 { + return + } + me.currentDev = fields[0] + me.parted.SetText("Partition " + me.currentDev) } grid.NextRow() - grid.NewButton("doDrives()", func() { - doDrives() - }) - - grid.NewButton("doDrives2()", func() { - doDrives2() - }) - - grid.NewButton("partition drives", func() { - log.Info("something") + // a button to format or blank a drive + me.parted = grid.NewButton("select drive", func() { + if me.currentDev == "" { + log.Info("You must select a drive first") + return + } + log.Info("check if", me.currentDev, "is in use") + shell.RunVerbose([]string{"parted", me.currentDev, "print"}) }) grid.NextRow() - grid.NewButton("ConfigSave()", func() { - log.Info("todo: make code for this") + grid.NewButton("doDrives()", func() { + doDrives() }) + doDrives2() + } |
