diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2023-01-03 23:01:40 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2023-01-03 23:01:40 +0530 |
commit | b5bb3c7a2ad16804ac15c08a157c80f44ecb6aad (patch) | |
tree | a42a280f6bea6683915e5d1d28d625437aa9ea4c /main.go | |
parent | d10d43468bf816fa9d58fab26ab99c1bd01bd635 (diff) |
Implement a hacky way to not let the user crash the app by clicking too many times
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -83,7 +83,12 @@ func onActivate(app *gtk.Application) { var on = false var server *http.Server buttonSwitch.Connect("clicked", func() { - // TODO: validate dir and port + // clicking the button too fast too many times crashes the app + // this disables the button as long as the button is running + // user likely won't notice the button greying out or something + buttonSwitch.SetSensitive(false) + defer buttonSwitch.SetSensitive(true) + port, _ := portInput.GetText() dir := browseButton.GetFilename() if dir == "" { dir = DEFAULT_DIR } |