1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

44 Commits

Author SHA1 Message Date
Chris Cummer
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
58299c2efa
WTF-484 DigitalOcean module (#782)
* WTF-484 DigitalOcean module stubbed out
* WTF-484 Delete droplets via Ctrl-d
* WTF-484 Rebasing off master after a long time away
* WTF-484 Improve DigitalOcean display
* WTF-484 Can shutdown and restart the selected droplet
* WTF-484 Display info about the selected droplet using the ? key
* WTF-484 Display info about the selected droplet using the Return key
* WTF-484 Greatly improve the utils.Truncate function
* WTF-484 Display a droplet's features in the info modal
* WTF-484 Change reboot key from r to b to not conflict with refresh
* WTF-484 Panic if a keyboard control is mapped to the same character more than once
* WTF-484 Colorize droplet status indicator
* WTF-484 Extract view.InfoTable out into a reusable component
2019-12-13 11:33:29 -08:00
Chris Cummer
bf85d4b144
IPInfo styling (#744)
* WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix the colour scheme for IPInfo to match other modules

Now uses standard label and text colours.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-12 20:10:26 -08:00
Chris Cummer
200dbcc03c
WTF-730 Fix missing color key config error (#738)
* WTF-730 Fix missing color key config error

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Add Subheading color formatting to modules

Users can now set a `subheading` color in their config to change the
color of subheadings in widget display.

Defaults to `red`.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix oustanding color issues

Clean up missing color config changes not addressed in earlier commits.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove unused dependency

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Base cleanup

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix a few bugs related to color config changes

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix issues with PagerDuty subheading display

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix bug with Todo list colour rendering

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 11:21:45 -08:00
Omar
e7a42e05b5
chore: adjust ToDo to use ScrollableWidget 2019-10-20 13:10:15 +02:00
Sean Smith
2c1e7fc2c9 Have checkbox config work as intended
Support checkedIcon
Also support uncheckedIcon
Addresses the end of #616
2019-10-02 17:41:04 -04:00
Chris Cummer
bf877f5fa7 Constantize the defaultFocus value for each module 2019-09-22 18:12:29 -07:00
Sean Smith
14e7619075 Renormalize the redraw function
Have all instances take a function
Update the remaining modules to take this into account
Numerous smaller refactors to make some widgets work more or less the same
2019-08-27 21:51:37 -04:00
Sean Smith
264f49fd2c Fix race with HighlightableHelper
GetRect can lead to a race condition
Add a RenderFunc method so that we can call try to
wrap even more of our rendering in the thread safe
`QueueUpdateDraw` method
2019-08-24 22:15:35 -04:00
Chris Cummer
523a0bec2c Remove the need for every module to define a widget.Refresh keyboard control 2019-08-23 21:18:51 -07:00
Chris Cummer
5337656c58 Remove the need for every module to define a widget.ShowHelp keyboard control
This common functionality is moved up to KeyboardWidget. Modules now
include widget.InitializeCommonControls() instead.
2019-08-23 21:18:51 -07:00
Chris Cummer
4e46fff145 Move the utils.go file into the /utils directory 2019-08-05 10:50:12 -07:00
Chris Cummer
dbc047516d Move all components responsible for module composition into /view 2019-08-04 21:42:40 -07:00
Chris Cummer
452e6f20db WTF-510 Add error messaging if the config directories cannot be created 2019-07-20 12:23:19 -07:00
Chris Cummer
b07f3c5e67 Reimpliments the module configuration validation
Now supports displaying errors from multiple widgets.
2019-07-07 16:04:43 -07:00
Chris Cummer
042f602ddb Tabbing to widgets properly sets the IsFocused property. Closes #467 2019-05-25 15:19:18 -07:00
Sean Smith
c4d58ece81 Add a helper function to do highlighting in a uniform way 2019-05-24 22:06:47 -04:00
Kirill Motkov
f0771cd013 Some code improvements
* Some assignments simplified by using assignment operators
* Rewrite switch statement with only one case as if.
* Rewrite if-else chain as a switch statement.
* go fmt `modules/todoist/project.go` file.
2019-05-21 17:29:09 +03:00
Sean Smith
a2f5db7847 Harmonize keyboard controls
Make sure everyone has a refresh option
Have specific ordering:
 - Help
 - Refresh
 - Select next
 - Select prev
 - ...

Add unselect where applicable
2019-05-20 18:45:08 -04:00
Sean Smith
cd35d1e0a3 Re-add command line help 2019-05-11 19:47:59 -04:00
Sean Smith
7f3daaac59 Have keyboard widget manage its own help
Define help with keys
This means that keys and help are automatically in sync
This means that you can't define keys, but forget help
This unfortunately also means that formatting may not be quite as good
2019-05-11 12:15:52 -04:00
Chris Cummer
0b59a3b62f Fix slow render of new item modal in Todo 2019-05-10 08:42:37 -07:00
Sean Smith
018d2af3ae Add a global Redraw method for TextWidget
Partially addresses #429, by centralizing widget drawing
2019-05-10 08:42:37 -07:00
Chris Cummer
4e8c85bc34 Fix line highlighting in HackerNews and Todo modules 2019-05-09 19:27:53 -07:00
Sean Smith
a5f98c138a Move closing region tag to the end of the line
Highlight works by highlighting the entire region that exists
Since current region starts and immediately ends, there is no highlighting
2019-05-09 11:00:19 -04:00
Chris Cummer
2d0706c40b WTF-427 Use new keyboard implementation for widgets. Closes #427 2019-05-06 12:54:07 -07:00
Chris Cummer
a9c5dc3be8 WTF-427 Add KeyboardWidget and switch Todo widget to using it 2019-05-06 12:54:04 -07:00
Sean Smith
14abd422b2 Add default titles, to mimic original behavior
Have the modules set their own titles
If no title is specified, use this title, rather than default to name
2019-04-30 23:38:37 -04:00
Chris Cummer
378cce8726 Re-apply the explicit title rendering for focusable widgets 2019-04-30 09:09:11 -07:00
Sean Smith
17d53ca39a Update title handling so that config based title can be used
There is already default handling of title. Remove instances where people are unknowingly overriding it
For instances where we want to set special things, make sure to use CommonSettings.Title, so people can still override
2019-04-30 07:13:52 -07:00
Sean Smith
5abd701b40 Decouple modules from global config
Rather than referencing wtc.Config, instead pass the global config
Also, look up config for the module early and pass that in sooner, to deal with fewer long paths and get rid of the
ConfigKey variable
2019-04-27 22:26:23 -04:00
Chris Cummer
5445309aa0 WTF-315 Fix race conditions caused by writing to view 2019-04-25 19:39:49 -07:00
Chris Cummer
b7be868798 Fix race conditions caused by writing to view 2019-04-24 23:53:31 -07:00
Chris Cummer
a18625f427 Remove extraneous app.Draw() calls by having app.Draw() in its own routine 2019-04-23 20:33:03 -07:00
Chris Cummer
88fdf9702b WTF-400 Move settings-related functions from util.go into common_settings.go 2019-04-21 21:35:45 -07:00
Chris Cummer
643840e0da WTF-400 Checklist items now have dynamically-settable checkmark icons 2019-04-19 09:08:36 -07:00
Chris Cummer
59f0bc6cfc WTF-400 Partial conversion to new Common settings 2019-04-18 19:02:08 -07:00
Chris Cummer
f09d08bda2 WTF-400 Common settings implemented 2019-04-18 18:22:19 -07:00
Chris Cummer
b50c762dab WTF-400 Move name and configKey values from widget to settings 2019-04-17 17:16:26 -07:00
Chris Cummer
b6d845b734 WTF-400 NewRelic extracted to new config format 2019-04-15 21:01:25 -07:00
Chris Cummer
3db2848169 WTF-400 Bittrex extracted to new config format 2019-04-15 10:05:57 -07:00
Chris Cummer
cf661e7e15 WTF-400 Todo extracted to new config format 2019-04-15 10:05:57 -07:00
Chris Cummer
aa313bdaa4 WTF-389 Log an exception and terminate if widget config is invalid
If, on startup, a widget's positional configuration is invalid (ie:
cannot be displayed onscreen) then terminate the app and inform about
which widget is erroring
2019-04-12 05:29:44 -07:00
Sean Smith
8030380f89 Migrate all modules to their own subfolder
Handles #375
2019-02-18 11:16:34 -05:00