From 038a6c5790883275279ccf4fb158aee641d78ce1 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 25 Oct 2018 21:32:00 +0200 Subject: [pkg] remove vendoring of getlantern/systray after https://github.com/getlantern/systray/commit/5fb0feca3c0677e9fa31e579ff69631f49a379a2 was merged, we don't need to keep using the vendoring of systray. there is some flickering with the stop/start/cancel menu items chening their orderning that still needs to be solved. --- .../github.com/getlantern/systray/example/main.go | 84 ---------------------- 1 file changed, 84 deletions(-) delete mode 100644 vendor/github.com/getlantern/systray/example/main.go (limited to 'vendor/github.com/getlantern/systray/example/main.go') diff --git a/vendor/github.com/getlantern/systray/example/main.go b/vendor/github.com/getlantern/systray/example/main.go deleted file mode 100644 index f889b3c..0000000 --- a/vendor/github.com/getlantern/systray/example/main.go +++ /dev/null @@ -1,84 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "time" - - "github.com/getlantern/systray" - "github.com/getlantern/systray/example/icon" - "github.com/skratchdot/open-golang/open" -) - -func main() { - onExit := func() { - fmt.Println("Starting onExit") - now := time.Now() - ioutil.WriteFile(fmt.Sprintf(`on_exit_%d.txt`, now.UnixNano()), []byte(now.String()), 0644) - fmt.Println("Finished onExit") - } - // Should be called at the very beginning of main(). - systray.Run(onReady, onExit) -} - -func onReady() { - systray.SetIcon(icon.Data) - systray.SetTitle("Awesome App") - systray.SetTooltip("Lantern") - mQuitOrig := systray.AddMenuItem("Quit", "Quit the whole app") - go func() { - <-mQuitOrig.ClickedCh - fmt.Println("Requesting quit") - systray.Quit() - fmt.Println("Finished quitting") - }() - - // We can manipulate the systray in other goroutines - go func() { - systray.SetIcon(icon.Data) - systray.SetTitle("Awesome App") - systray.SetTooltip("Pretty awesome棒棒嗒") - mChange := systray.AddMenuItem("Change Me", "Change Me") - mChecked := systray.AddMenuItem("Unchecked", "Check Me") - mEnabled := systray.AddMenuItem("Enabled", "Enabled") - systray.AddMenuItem("Ignored", "Ignored") - mUrl := systray.AddMenuItem("Open Lantern.org", "my home") - mQuit := systray.AddMenuItem("退出", "Quit the whole app") - systray.AddSeparator() - mToggle := systray.AddMenuItem("Toggle", "Toggle the Quit button") - shown := true - for { - select { - case <-mChange.ClickedCh: - mChange.SetTitle("I've Changed") - case <-mChecked.ClickedCh: - if mChecked.Checked() { - mChecked.Uncheck() - mChecked.SetTitle("Unchecked") - } else { - mChecked.Check() - mChecked.SetTitle("Checked") - } - case <-mEnabled.ClickedCh: - mEnabled.SetTitle("Disabled") - mEnabled.Disable() - case <-mUrl.ClickedCh: - open.Run("https://www.getlantern.org") - case <-mToggle.ClickedCh: - if shown { - mQuitOrig.Hide() - mEnabled.Hide() - shown = false - } else { - mQuitOrig.Show() - mEnabled.Show() - shown = true - } - case <-mQuit.ClickedCh: - systray.Quit() - fmt.Println("Quit2 now...") - return - } - } - }() -} -- cgit v1.2.3