diff options
Diffstat (limited to 'ui/LocationHistory.go')
-rwxr-xr-x | ui/LocationHistory.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/ui/LocationHistory.go b/ui/LocationHistory.go deleted file mode 100755 index a0a6e67..0000000 --- a/ui/LocationHistory.go +++ /dev/null @@ -1,40 +0,0 @@ -package ui - -import ( - // "fmt" - // "sort" - - "github.com/mcuadros/go-octoprint" - // "github.com/Z-Bolt/OctoScreen/uiWidgets" -) - -type byDate []*octoprint.FileInformation - -func (s byDate) Len() int { return len(s) } -func (s byDate) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byDate) Less(i, j int) bool { return s[j].Date.Time.Before(s[i].Date.Time) } - -type locationHistory struct { - locations []octoprint.Location -} - -func (l *locationHistory) current() octoprint.Location { - return l.locations[len(l.locations) - 1] -} - -func (l *locationHistory) goForward(folder string) { - newLocation := string(l.current()) + "/" + folder - l.locations = append(l.locations, octoprint.Location(newLocation)) -} - -func (l *locationHistory) goBack() { - l.locations = l.locations[0 : len(l.locations) - 1] -} - -func (l *locationHistory) isRoot() bool { - if len(l.locations) > 1 { - return false - } else { - return true - } -} |