-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow bypass (0) and override to None (-1) start/end in DBus AddFact #491
Comments
Hmm. So the gnome shell extension doesn't include any times in the string at all, as far as I can tell. Would that still use "hamster_now()" then Of course the user could enter "10:00 something" but that's not really suggested in the shell extension UI - other places pre-fill the current time there and put the caret after it to indicate that you can change this around, but the shell extension just has a single entry field and even labels this "What are you doing?", and auto-completes only the fact name, not any times. (Technically, you could even argue that one should be able to enter a fact like "10:00 meeting" where the "10:00" is part of the fact name, not a time. But neither does that really matter, nor do I have any idea how that would've behaved previously. I assume it would've parsed it already for a long time.) AddFact-parse-times branch looks like it should work, but I can only test it later. |
Agreed with @jmberg, the typical usage of the extension is to enter only an activity name or activity@category. With the current extension and hamster 2.2.2, it's actually possible to enter a start time via the extension's text input field, but not an end time (it isn't parsed correctly, at least). Also, as @jmberg noted, there's no autocompletion if a start time is used in the input field. I have never used this, I always enter just the current activity, and if I need to fix the start time, I click the "edit" button to start the hamster UI and apply changes there. Admittedly not the perfect workflow, but I've got used to it. |
Ther'es a button for "Add earlier activity", so arguably that's how you should enter something with start/end time :-) I think the AddFact-parse-times branch will actually make that work though, if I'm reading it correctly, I just don't think it's really important in any way. |
And that button simply opens the hamster "add activity" UI, does it not? |
Yes. |
Thanks for the explanations. Looking at the shell-extension code, Alternatively, it would be possible to accept time at the end ("tail" position),
We shall see how to make a transition if there is an interest someday. |
I tested it now, it mostly works, you only forgot
in |
Thanks ! I need to rest... Forced-push to the same branch (3c4c268) |
#490 seemed to fix the shell-extension (projecthamster/hamster-shell-extension#316 (comment)),
but that overrides the parsed fact start_time with
hamster_now
as a default.Here is the 2012 state:
hamster/src/hamster-service
Lines 117 to 121 in 80110af
hamster/src/hamster/lib/stuff.py
Lines 322 to 323 in 80110af
so start and end times were taken from the parse string, and overridden only
if the separately given
start_time
andend_time
were non-zero.This prevents overriding the end_time with None for instance.
Proposition
Use
0
to mean "do not mess around with the parsed fact"(just ignore this argument)
Use
-1
as a special value to mean "replace withNone
"This way the full power of the new parser (including datetimes and relative times parsing)
can be exploited in the shell-extension as well.
For instance one might try this branch:
https://github.com/ederag/hamster/tree/AddFact-parse-times
The text was updated successfully, but these errors were encountered: