Skip to content

Commit

Permalink
Improvements to termshark's dialogs
Browse files Browse the repository at this point in the history
This change makes the Help dialogs and the new Columns dialog properly
modal. This has the effect of preventing the 'q' key from bringing up
the "quit termshark" dialog while either of these two dialog instances
are open. The former behavior causes a bug because termshark needs to
close the Columns dialog in order to trigger the termination of some
goroutines associated with the dialog's tshark filter validators, and
quitting via 'q' leaves the Columns dialog open. Termshark, by default,
will not terminate unless it has ensured all its goroutines have
stopped (to prevent leaks via behavior that is buggy but that I don't
necesarily detect otherwise).
  • Loading branch information
gcla committed Aug 6, 2021
1 parent 8b3d959 commit 7b1a111
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/blang/semver v3.5.1+incompatible
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gcla/deep v1.0.2
github.com/gcla/gowid v1.2.1-0.20210730201604-e21cc1dff36b
github.com/gcla/gowid v1.2.1-0.20210806031049-f60cd69d4bd7
github.com/gcla/tail v1.0.1-0.20190505190527-650e90873359
github.com/gdamore/tcell v1.3.1-0.20200115030318-bff4943f9a29
github.com/go-test/deep v1.0.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ github.com/gcla/deep v1.0.2 h1:qBOx6eepcOSRYnHJ+f2ih4hP4Vca1YnLtXxp73n5KWI=
github.com/gcla/deep v1.0.2/go.mod h1:evE9pbpSGhItmFoBIk8hPOIC/keKTGYhFl6Le1Av+GE=
github.com/gcla/gowid v1.2.1-0.20210730201604-e21cc1dff36b h1:mIGVx3Kq19ln5E25pwQtxCNmKi6rbrUhOgAtA1Vx+BE=
github.com/gcla/gowid v1.2.1-0.20210730201604-e21cc1dff36b/go.mod h1:jQwZ6fAAnaylA+MkfgXLzjG0mTMStYixffw2jY0qG4k=
github.com/gcla/gowid v1.2.1-0.20210806031049-f60cd69d4bd7 h1:4v2rkKvFsirRgM3C2UMPoxWxwM7Q9hlL/P31oB0YfIQ=
github.com/gcla/gowid v1.2.1-0.20210806031049-f60cd69d4bd7/go.mod h1:jQwZ6fAAnaylA+MkfgXLzjG0mTMStYixffw2jY0qG4k=
github.com/gcla/tail v1.0.1-0.20190505190527-650e90873359 h1:3xEhacR7pIJV8daurdBygptxhzTJeYFqJp1V6SDl+pE=
github.com/gcla/tail v1.0.1-0.20190505190527-650e90873359/go.mod h1:Wn+pZpM98JHSOYkPDtmdvlqmc0OzQGHWOsHB2d28WtQ=
github.com/gcla/tcell v1.1.2-0.20200927150251-decc2045f510 h1:TlEZ0DHOvn0P79nHtkfemw7XFn2h8Lacd6AZpXrPU/o=
Expand Down
1 change: 1 addition & 0 deletions ui/dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func OpenTemplatedDialog(container gowid.ISettableComposite, tmplName string, ap
dialog.Options{
Buttons: dialog.CloseOnly,
NoShadow: true,
Modal: true,
BackgroundStyle: gowid.MakePaletteRef("dialog"),
BorderStyle: gowid.MakePaletteRef("dialog"),
ButtonStyle: gowid.MakePaletteRef("dialog-button"),
Expand Down
2 changes: 2 additions & 0 deletions ui/psmlcols.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ func openEditColumns(app gowid.IApp) {
),
dialog.Options{
Buttons: []dialog.Button{okButton, dialog.Cancel},
Modal: true,
NoShadow: true,
TabToButtons: true,
BackgroundStyle: gowid.MakePaletteRef("dialog"),
BorderStyle: gowid.MakePaletteRef("dialog"),
ButtonStyle: gowid.MakePaletteRef("dialog-button"),
Expand Down

0 comments on commit 7b1a111

Please sign in to comment.