This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
aboutui.go
76 lines (63 loc) · 2.31 KB
/
aboutui.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package main
import (
"fmt"
"github.com/jroimartin/gocui"
)
func aboutfunc(g *gocui.Gui) error {
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
fmt.Println(err)
}
maxX, maxY := g.Size()
// About Widget
if aboutwid, err := g.SetView("aboutwid", -1, -1, maxX, maxY-2); err != nil {
if err != gocui.ErrUnknownView {
return err
}
if err := g.SetKeybinding("aboutwid", gocui.KeyArrowLeft, gocui.ModNone, backtoSearch); err != nil {
return err
}
if err := g.SetKeybinding("aboutwid", gocui.KeyEnter, gocui.ModNone, backtoSearch); err != nil {
return err
}
if err := g.SetKeybinding("aboutwid", gocui.KeyHome, gocui.ModNone, backtoSearch); err != nil {
return err
}
if err := g.SetKeybinding("aboutwid", 'q', gocui.ModNone, quit); err != nil {
return err
}
if _, err := g.SetCurrentView("aboutwid"); err != nil {
return err
}
aboutwid.Frame = true
aboutwid.Wrap = true
fmt.Fprint(aboutwid, term_green, "About! ->\n\n", term_res)
fmt.Fprint(aboutwid, term_green+"About Torpar ->\n"+term_res)
abouttptext := `• TorPar is TUI client for Torrent Paradise
• Torrent Paradise is Open-Source DHT Torrent Search Engine
• TorPar is FLOSS and is licensed under GPLv3
• Source code at https://github.com/varbhat/torpar`
fmt.Fprint(aboutwid, abouttptext)
fmt.Fprint(aboutwid, term_green, "\n\nAbout Torrent Paradise Search Engine ->\n", term_res)
abouttpstext := `• Fresh and rich torrent index
• New torrents identified quickly via multiple RSS feeds
• Obscure torrents discovered through DHT
• Seed/Leech counts constantly refreshed
• privacy preserving, not-in-your-face ads
• donate and vote on future features
• Source Code at https://github.com/urbanguacamole/torrent-paradise
• Send suggestions to urban-guacamole (at) protonmail.com
• Want to report a copyright violation? See copyright at https://torrent-paradise.ml/copyright.html`
fmt.Fprint(aboutwid, abouttpstext)
aboutwid.MoveCursor(maxX-1, 0, true)
}
// Help Widget
if abouthelpwid, err := g.SetView("abouthelpwid", -1, maxY-2, maxX, maxY); err != nil {
if err != gocui.ErrUnknownView {
return err
}
abouthelpwid.Frame = true
abouthelpwid.Wrap = true
fmt.Fprintln(abouthelpwid, "Press <enter> / ← to go back to Search , Ctrl-c / (q) to Quit")
}
return nil
}