elfenware / badger

Remind yourself to not sit and stare at the screen for too long
GNU General Public License v3.0
54 stars 13 forks source link

Add custom timers #6

Closed dar5hak closed 5 years ago

dar5hak commented 5 years ago

Let the user select the interval at which they wish to see each reminder, while still keeping sane defaults. (See also: #4)

felix91gr commented 5 years ago

How can I help get this implemented? I really need this app (or one akin to it), and having custom timers seems like a substantial improvement for all users.

Tell me where to look, or what plans you have for it, and maybe I can help implementing and testing it.

dar5hak commented 5 years ago

Hey Félix! Thank you for your interest.

Currently, each reminder is represented by an object of the Reminder class. These are initialized in an array in Application.vala.

Calling Reminder.toggle_timer () turns it on or off. The interval is passed to it during construction.

We'll need to add a way to change the interval from outside, and replace the timer with one that uses the newer interval.

In MainGrid.vala, we create the checkboxes that toggle the timers. We'll probably need to replace them with, say, a combo box that has options like "Never", "10 minutes", "20 minutes", and so on. (Just one idea; let me know if you have a better design in mind.)

Lastly, the gschema.xml will need to list the timer settings instead of / in addition to the flags, without breaking the user's previous settings when they update to a newer version.

dar5hak commented 5 years ago

I will try to start a small pull request by tomorrow, but if you have time before that, you can open one too. Then we can collaborate on that branch.

Instead of a combo box, a slider might be a good idea too.

dar5hak commented 5 years ago

@felix91gr This functionality is complete and should work fine if I didn't miss anything.

window-screenshot

If it's not too much to ask, could you check out and build #14 branch and make sure it works correctly? I ask because porting the old user settings (booleans) to new settings (numbers) is a tricky affair and I want to make sure it goes smoothly for everyone.

It should set a Never value to the reminders that were previously unchecked, and set a default duration to the ones that were previously checked.

dar5hak commented 5 years ago

PS. If you choose to build the branch, you will have to kill any existing Badger process before running. You can do that easily with Monitor or Optimizer.

felix91gr commented 5 years ago

Sorry for my late response! I did not realize it earlier, but I'm having a phase of very low energy. I've barely been able to keep up with my other projects ^^'

Thank you though!!! This is awesome :) I really appreciate that you've been pushing this feature forward.

If it's not too much to ask, could you check out and build #14 branch and make sure it works correctly?

Of course. I perfectly understand the pain of the transition to a more general config representation, I've been through that at least a couple of times. Do you have tests set up? Maybe that can help ease your mind :)

Alright, I've installed the dependencies. Will compiling it with the install instructions do? Or should I do it in a different way?

felix91gr commented 5 years ago

Ah, wth, I did it as per the instructions anyways and it worked.

I like the UI, it's very clean :) Maybe it needs a double-check on the horizontal centering? I'm not a designer, but it somehow feels... weighted to the right a little bit :thinking: It might just be me though.

Do you want me to test the transition from booleans -> ints, or just if the timers work correctly?

I have a nitpick, could there be a way to see what exact time has been set? :) Like maybe a mouseover textbox when passing over the sliders... or something like that, that only pops up temporarily (maybe when letting go of the slider?). That would give me peace of mind, but I'm not sure why.

dar5hak commented 5 years ago

Ah man! Sorry I couldn't respond (darned time zones). Thank you so much for your feedback!

Do you have tests set up?

No, I'm pretty new to Vala and don't know much about how automated testing is conventionally done. Will need to research.

I like the UI, it's very clean :)

Thank you! :smiley:

Maybe it needs a double-check on the horizontal centering?

Now that you mention it, yes. I stole the layout idea from elementary OS Power Settings, which honestly looks much better.

I think increasing the window margins will make it look better.

could there be a way to see what exact time has been set?

There's a way, but it shows just a number and not a unit (15 instead of 15 min). I'll implement at least that much.