Skip to content

Commit

Permalink
feat:add total hours (#28)
Browse files Browse the repository at this point in the history
* Add version to go.mod

* feat:add total to context menu

* ci: Add Go Modules to build environment

* ci: add quotes to go111module variable

* ci: remove go get for dependancies

* ci: enable rdp

* ci: remove rdp
  • Loading branch information
danstis committed Jun 17, 2021
1 parent 647ef88 commit 85c2188
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ clone_folder: c:\src\github.com\danstis\toggl-taskbar

environment:
GOPATH: c:\gopath
GO111MODULE: "on"

install:
- choco install gitversion.portable -y --version 4.0.0
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ require (
golang.org/x/sys v0.0.0-20190209173611-3b5209105503 // indirect
gopkg.in/resty.v1 v1.11.0
)

go 1.13
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func onReady() {
for _, item := range config.Workspaces {
menuItems[item.ID] = systray.AddMenuItem(fmt.Sprintf("%s: %d:%02d", item.Name, 0, 0), item.Name)
}
menuItems[0] = systray.AddMenuItem(fmt.Sprintf("%s: %d:%02d", "Total", 0, 0), "Total")
systray.AddSeparator()
mQuit := systray.AddMenuItem("Quit", "Quit the app")
go func() {
Expand All @@ -94,6 +95,7 @@ func onReady() {
log.Printf("- Got new total time %d:%02d\n", totalTime.hours, totalTime.minutes)
updateIcon(int(totalTime.hours), config.HighlightThreshold)
systray.SetTooltip(fmt.Sprintf("Toggl time tracker: %d:%02d", totalTime.hours, totalTime.minutes))
menuItems[0].SetTitle(fmt.Sprintf("%s: %d:%02d", "Total", totalTime.hours, totalTime.minutes))
time.Sleep(time.Duration(config.SyncInterval) * time.Minute)
}
}
Expand Down

0 comments on commit 85c2188

Please sign in to comment.