X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/3178ae580a3fe97d6a1167b4346d209f04e9b7e3..fa0552fe1f5dc7862e24073423aeed15f9fe4ffe:/hotline/ui.go?ds=sidebyside diff --git a/hotline/ui.go b/hotline/ui.go index 6eba011..8b0a8c5 100644 --- a/hotline/ui.go +++ b/hotline/ui.go @@ -145,6 +145,7 @@ func (ui *UI) renderSettingsForm() *tview.Flex { return err == nil }, nil) settingsForm.AddInputField("Tracker", ui.HLClient.pref.Tracker, 0, nil, nil) + settingsForm.AddCheckbox("Enable Terminal Bell", ui.HLClient.pref.EnableBell, nil) settingsForm.AddButton("Save", func() { usernameInput := settingsForm.GetFormItem(0).(*tview.InputField).GetText() if len(usernameInput) == 0 { @@ -154,6 +155,7 @@ func (ui *UI) renderSettingsForm() *tview.Flex { iconStr = settingsForm.GetFormItem(1).(*tview.InputField).GetText() ui.HLClient.pref.IconID, _ = strconv.Atoi(iconStr) ui.HLClient.pref.Tracker = settingsForm.GetFormItem(2).(*tview.InputField).GetText() + ui.HLClient.pref.EnableBell = settingsForm.GetFormItem(3).(*tview.Checkbox).IsChecked() out, err := yaml.Marshal(&ui.HLClient.pref) if err != nil { @@ -208,11 +210,12 @@ func (ui *UI) joinServer(addr, login, password string) error { buf := make([]byte, len(scanner.Bytes())) copy(buf, scanner.Bytes()) - t, _, err := ReadTransaction(buf) + var t Transaction + _, err := t.Write(buf) if err != nil { break } - if err := ui.HLClient.HandleTransaction(t); err != nil { + if err := ui.HLClient.HandleTransaction(&t); err != nil { ui.HLClient.Logger.Errorw("Error handling transaction", "err", err) } }