Skip to content

Commit

Permalink
Merge pull request #113 from asmorodskyi/new2
Browse files Browse the repository at this point in the history
Add ability to open all visible URLs in browser
  • Loading branch information
grisu48 authored Jul 7, 2023
2 parents 93d1ab7 + 59caa37 commit f0e0a93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions cmd/openqa-revtui/openqa-revtui.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"os/exec"
"os/user"
"strings"
"time"
Expand Down Expand Up @@ -598,6 +599,17 @@ func tui_main(tui *TUI, instance gopenqa.Instance) error {
// Shift through the sorting mechanism
tui.SetSorting((tui.Sorting() + 1) % 2)
tui.Update()
} else if key == 'o' {
for _, job := range tui.Model.jobs {
if !tui.hideJob(job) {
err := exec.Command("xdg-open", job.Link).Start()
if err != nil {
tui.SetStatus(fmt.Sprintf("Error: %s", err))
break
}
}
}
tui.Update()
} else {
tui.Update()
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/openqa-revtui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (tui *TUI) buildHeader(width int) []string {
lines := make([]string, 0)
if tui.header != "" {
lines = append(lines, tui.header)
lines = append(lines, "q:Quit r:Refresh h:Hide/Show jobs m:Toggle RabbitMQ tracker s:Switch sorting Arrows:Move up/down")
lines = append(lines, "q:Quit r:Refresh h:Hide/Show jobs o:Open links m:Toggle RabbitMQ tracker s:Switch sorting Arrows:Move up/down")
}
return lines
}
Expand Down

0 comments on commit f0e0a93

Please sign in to comment.