Skip to content

Commit

Permalink
Connect the new PSML columns dialog to the UI
Browse files Browse the repository at this point in the history
This dialog can be opened via the main menu, or via the "columns"
minibuffer command.
  • Loading branch information
gcla committed Feb 8, 2021
1 parent 3e1fd84 commit 082cc55
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,11 @@ func lastLineMode(app gowid.IApp) {
return nil
}))

MiniBuffer.Register("columns", minibufferFn(func(gowid.IApp, ...string) error {
openEditColumns(app)
return nil
}))

MiniBuffer.Register("menu", minibufferFn(func(gowid.IApp, ...string) error {
openGeneralMenu(app)
return nil
Expand Down Expand Up @@ -2751,6 +2756,14 @@ func Build() (*gowid.App, error) {
generalMenu.Close(app)
reallyClear(app)
},
},
menuutil.SimpleMenuItem{
Txt: "Edit Columns",
Key: gowid.MakeKey('e'),
CB: func(app gowid.IApp, w gowid.IWidget) {
generalMenu.Close(app)
openEditColumns(app)
},
}}...)

if runtime.GOOS != "windows" {
Expand Down Expand Up @@ -2799,7 +2812,7 @@ func Build() (*gowid.App, error) {
menuutil.MakeMenuDivider(),
menuutil.SimpleMenuItem{
Txt: "Found a Bug?",
Key: gowid.MakeKey('B'),
Key: gowid.MakeKey('b'),
CB: func(app gowid.IApp, w gowid.IWidget) {
generalMenu.Close(app)
if !termshark.RunningRemotely() {
Expand All @@ -2810,7 +2823,7 @@ func Build() (*gowid.App, error) {
},
menuutil.SimpleMenuItem{
Txt: "Feature Request?",
Key: gowid.MakeKey('F'),
Key: gowid.MakeKey('f'),
CB: func(app gowid.IApp, w gowid.IWidget) {
generalMenu.Close(app)
if !termshark.RunningRemotely() {
Expand Down Expand Up @@ -3406,6 +3419,8 @@ func Build() (*gowid.App, error) {

buildStreamUi()
buildFilterConvsMenu()
buildNamesMenu(app)
buildFieldsMenu(app)

mainView = appkeys.New(
appkeys.New(
Expand Down Expand Up @@ -3485,6 +3500,8 @@ func Build() (*gowid.App, error) {
conversationMenu,
filterConvsMenu1,
filterConvsMenu2,
colNamesMenu,
colFieldsMenu,
}

menus = append(menus, FilterWidget.Menus()...)
Expand Down

0 comments on commit 082cc55

Please sign in to comment.