diff --git a/footer.go b/footer.go index 24bfe46..cccf153 100644 --- a/footer.go +++ b/footer.go @@ -7,8 +7,6 @@ import ( "github.com/rivo/tview" ) -var verString = "//safebox //version %v" - func footerWindow() *tview.Flex { // The bottom row has some info on where we are. layoutFooter = tview.NewFlex() @@ -44,9 +42,9 @@ func refreshFooter() { SetDynamicColors(true). SetWrap(false) - fmt.Fprintf(versionTextView, verString, VERSION) + versionTextView.SetText(S_FOOTER_COPYRIGHT) // flex - layoutFooter.AddItem(layoutShortcuts, 0, 8, false) - layoutFooter.AddItem(versionTextView, 0, 2, false) + layoutFooter.AddItem(layoutShortcuts, 0, 7, false) + layoutFooter.AddItem(versionTextView, 0, 3, false) } diff --git a/info.go b/info.go index 29f3e8f..0075310 100644 --- a/info.go +++ b/info.go @@ -12,39 +12,6 @@ import ( "github.com/rivo/tview" ) -var infoString = ` -[-:-:-]Version -[darkblue]%v - -[-:-:-]Location: -[darkblue]%v - -[-:-:-]Master Key SHA256: -[darkblue]%v - -[-:-:-]Master Keys Created At: -[darkblue]%v - -[-:-:-]Number of keys with label: -[darkblue]%v - -[-:-:-]System: -[darkblue]%v %v - -` - -var instructionsString = ` -Instructions - -1) Use ArrowKeys [darkred]← ↑ → ↓ [-:-:-]To Select Keys, masks on derived keys will be uncovered when selected. - -2) Press [darkred][-:-:-] on 'Derived Keys' column to export. - -3) Press [darkred][-:-:-] on 'Label' column to set label. - -4) Use [darkred][-:-:-] to focus on different items. -` - func infoWindow() (content *tview.Flex) { layoutInfo = tview.NewFlex() layoutInfo.SetDirection(tview.FlexRow) @@ -76,7 +43,7 @@ func infoMasterKey() *tview.TextView { if masterKey != nil { md := sha256.Sum256(masterKey.masterKey[:]) - fmt.Fprintf(textview, infoString, + fmt.Fprintf(textview, S_INFOBOX_KEYINFO, VERSION, masterKey.path, hexutil.Encode(md[:]), @@ -86,7 +53,7 @@ func infoMasterKey() *tview.TextView { runtime.GOARCH, ) } else { - fmt.Fprintf(textview, infoString, + fmt.Fprintf(textview, S_INFOBOX_KEYINFO, VERSION, "N/A", "N/A", @@ -107,6 +74,6 @@ func infoInstructions() *tview.TextView { textview.SetWordWrap(true) textview.SetBackgroundColor(tcell.ColorBlue) fmt.Fprint(textview, strings.Repeat("\n", 100)) - fmt.Fprint(textview, instructionsString) + fmt.Fprint(textview, S_INFOBOX_INSTRUCTIONS) return textview } diff --git a/literal.go b/strings.go similarity index 70% rename from literal.go rename to strings.go index 7aa9b9f..5613de2 100644 --- a/literal.go +++ b/strings.go @@ -43,3 +43,42 @@ const ( S_MSG_PASSWORD_MISMATCH = "Password mismatch" S_MSG_PASSWORD_CHANGED = "Masterkey Password changed" ) + +const ( + S_INFOBOX_KEYINFO = ` +[-:-:-]Version +[darkblue]%v + +[-:-:-]Location: +[darkblue]%v + +[-:-:-]Master Key SHA256: +[darkblue]%v + +[-:-:-]Master Keys Created At: +[darkblue]%v + +[-:-:-]Number of keys with label: +[darkblue]%v + +[-:-:-]System: +[darkblue]%v %v + +` + + S_INFOBOX_INSTRUCTIONS = ` +Instructions + +1) Use ArrowKeys [darkred]← ↑ → ↓ [-:-:-]To Select Keys, masks on derived keys will be uncovered when selected. + +2) Press [darkred][-:-:-] on 'Derived Keys' column to export. + +3) Press [darkred][-:-:-] on 'Label' column to set label. + +4) Use [darkred][-:-:-] to focus on different items. +` +) + +const ( + S_FOOTER_COPYRIGHT = "//safebox // Copyright (c) 2021 xtaci" +)