Resync changes from github repo
This commit is contained in:
parent
e9905c02f6
commit
232e7e726b
@ -2,3 +2,9 @@ boltbrowser
|
|||||||
===========
|
===========
|
||||||
|
|
||||||
A CLI Browser for BoltDB Files
|
A CLI Browser for BoltDB Files
|
||||||
|
|
||||||
|
![Image of About Screen]
|
||||||
|
(http://bullercodeworks.com/boltbrowser/ss2.png)
|
||||||
|
|
||||||
|
![Image of Main Browser]
|
||||||
|
(http://bullercodeworks.com/boltbrowser/ss1.png)
|
||||||
|
@ -3,7 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/br0xen/bolt"
|
"github.com/boltdb/bolt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/br0xen/bolt"
|
"github.com/boltdb/bolt"
|
||||||
"github.com/nsf/termbox-go"
|
"github.com/nsf/termbox-go"
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
@ -16,9 +16,8 @@ const (
|
|||||||
|
|
||||||
func defaultScreensForData(db *BoltDB) []Screen {
|
func defaultScreensForData(db *BoltDB) []Screen {
|
||||||
var view_port ViewPort
|
var view_port ViewPort
|
||||||
var cursor Cursor
|
|
||||||
|
|
||||||
browser_screen := BrowserScreen{db: db, cursor: cursor, view_port: view_port}
|
browser_screen := BrowserScreen{db: db, view_port: view_port}
|
||||||
about_screen := AboutScreen(0)
|
about_screen := AboutScreen(0)
|
||||||
screens := [...]Screen{
|
screens := [...]Screen{
|
||||||
&browser_screen,
|
&browser_screen,
|
||||||
|
@ -44,8 +44,20 @@ func (screen *AboutScreen) drawScreen(style Style) {
|
|||||||
"| |_| || || || | | |_| || | | || || _ | _____| || |___ | | | |",
|
"| |_| || || || | | |_| || | | || || _ | _____| || |___ | | | |",
|
||||||
"|_______||_______||_______||___| |_______||___| |_||_______||__| |__||_______||_______||___| |_|",
|
"|_______||_______||_______||___| |_______||___| |_||_______||__| |__||_______||_______||___| |_|",
|
||||||
}
|
}
|
||||||
|
if width < 100 {
|
||||||
|
template = [...]string{
|
||||||
|
" ____ ____ _ _____ ____ ____ ____ _ _ ____ ___ ____ ",
|
||||||
|
"| _ || || | | || _ || _ | | || | _ | || || || _ | ",
|
||||||
|
"| |_||| _ || | |_ _|| |_||| | || | _ || || || || ___|| _|| | || ",
|
||||||
|
"| ||| | || | | | | || |_|| || | || |||___ | |_ | |_||_ ",
|
||||||
|
"| _ |||_| || |___| | | _ || _ |||_| || ||__ || _|| __ |",
|
||||||
|
"| |_||| || | | | |_||| | | || || _ | __| || |_ | | | |",
|
||||||
|
"|____||____||_____|_| |____||_| |_||____||__| |__||____||___||_| |_|",
|
||||||
|
}
|
||||||
|
}
|
||||||
first_line := template[0]
|
first_line := template[0]
|
||||||
start_x := (width - len(first_line)) / 2
|
start_x := (width - len(first_line)) / 2
|
||||||
|
//start_x := (width - len(first_line)) / 2
|
||||||
start_y := ((height - 2*len(template)) / 2) - 2
|
start_y := ((height - 2*len(template)) / 2) - 2
|
||||||
x_pos := start_x
|
x_pos := start_x
|
||||||
y_pos := start_y
|
y_pos := start_y
|
||||||
@ -97,7 +109,7 @@ func (screen *AboutScreen) drawScreen(style Style) {
|
|||||||
{"?", "this screen"},
|
{"?", "this screen"},
|
||||||
{"q", "quit program"},
|
{"q", "quit program"},
|
||||||
}
|
}
|
||||||
x_pos = start_x + 20
|
x_pos = start_x // + 20
|
||||||
y_pos++
|
y_pos++
|
||||||
|
|
||||||
drawCommandsAtPoint(commands1[:], x_pos, y_pos+1, style)
|
drawCommandsAtPoint(commands1[:], x_pos, y_pos+1, style)
|
||||||
|
@ -2,8 +2,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/br0xen/termbox-util"
|
||||||
"github.com/nsf/termbox-go"
|
"github.com/nsf/termbox-go"
|
||||||
"gogs.bullercodeworks.com/brian/termbox-util"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -16,7 +16,6 @@ type ViewPort struct {
|
|||||||
|
|
||||||
type BrowserScreen struct {
|
type BrowserScreen struct {
|
||||||
db *BoltDB
|
db *BoltDB
|
||||||
cursor Cursor
|
|
||||||
view_port ViewPort
|
view_port ViewPort
|
||||||
queued_command string
|
queued_command string
|
||||||
current_path []string
|
current_path []string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user