Commit graph

48 commits

Author SHA1 Message Date
Felicity Tarnell
684c581b32 Second argument to input_char() is wint_t, not wchar_t. 2014-03-08 12:57:35 +00:00
Felicity Tarnell
0959aad655 Prompt support in macros: $[Text]. 2014-03-08 12:54:05 +00:00
Felicity Tarnell
0bf6dd5766 Escape macro bodies when displaying in help. 2014-03-08 12:31:58 +00:00
Felicity Tarnell
34712e643c New time format: "1h30m7s".
This is fairly flexible, so you could say 10s1h, or even 1h1h1h (which is
equivalent to 3h).  Time parsing is now implemented by a single function, so
there should be no inconsistencies.

The old [[HH:]MM:]SS syntax is still supported, but not used in prompts.
2014-03-08 12:18:22 +00:00
Felicity Tarnell
c0df452c04 Provide error for invalid number in c_set(). 2014-03-08 11:37:52 +00:00
Felicity Tarnell
a5dd2e4ae5 Fix crash on executing unknown command. 2014-03-08 11:31:08 +00:00
Felicity Tarnell
bf84f9a054 Fix memory leak when re-setting variable. 2014-03-08 11:29:01 +00:00
Felicity Tarnell
5739ca900f Remove obsolete comment. 2014-03-08 11:27:06 +00:00
River Tarnell
e8ccd681e3 Don't spin-loop in prompt(). 2014-03-08 01:00:30 +00:00
Felicity Tarnell
f25e283f21 Fix NetBSD and non-ncurses build. Simplify CPPFLAGS. 2014-03-08 00:50:11 +00:00
Felicity Tarnell
003ac6cca4 Always use wide characters. 2014-03-08 00:30:40 +00:00
Felicity Tarnell
d239b1669b Clean up power code. 2014-03-07 23:50:13 +00:00
Felicity Tarnell
524b09511d Code cleanups; no functional changes. 2014-03-07 23:47:31 +00:00
Felicity Tarnell
3440a87ea3 Add macro support.
Replace WGETCH() with input_char(), which works the same except it supports an
input buffer.  Calling input_macro(s) sets the input buffer to 's'.  The input
buffer is returned by input_char() as if it had been typed by the user.

If an error occurs (cmderr()), the input buffer is cleared.
2014-03-07 23:34:06 +00:00
Felicity Tarnell
44b2e4371e Copyright notice for Makefile. 2014-03-07 22:44:57 +00:00
Felicity Tarnell
ba30bffef2 Lots of changes, so make this version D.84.0. 2014-03-07 22:40:18 +00:00
Felicity Tarnell
0b072f4d3a Fix up the sample style a bit. 2014-03-07 22:39:02 +00:00
Felicity Tarnell
fb9ffde209 Fix prompt styling & memory leak in yesno(). 2014-03-07 22:37:43 +00:00
Felicity Tarnell
707812a078 Draw the input prompt in the right place. 2014-03-07 22:24:33 +00:00
Felicity Tarnell
ca908281b4 No need to use kevent64(). 2014-03-07 22:19:07 +00:00
Felicity Tarnell
e8396d70ba Always timeout the poll.
Otherwise, events like the laststatus update and (more importantly) lastsave
don't get run unless there's a running entry.
2014-03-07 22:03:47 +00:00
Felicity Tarnell
0c3b7443d5 Handle multiple input characters at once. 2014-03-07 22:00:47 +00:00
Felicity Tarnell
9a3719817e Fix ^C handling. 2014-03-07 21:58:10 +00:00
Felicity Tarnell
38021971e3 Rework input handling; no functional changes.
Instead of using halfdelay() and relying on GETCH() to return, poll for
input ourselves using select() and only call GETCH() when input is ready.

On Darwin, use kqueue instead of select.  This allows us to receive IOKit
notifications directly to the main thread, instead of having a separate
thread dedicated to that.  We also no longer link to CoreFoundation.
2014-03-07 21:54:26 +00:00
Felicity Tarnell
9676c88378 Add .gitignore. 2014-03-07 20:21:09 +00:00
Felicity Tarnell
a1a3b576a0 OS X: Remove CoreFoundation; use kqueue() directly. 2014-03-07 20:20:20 +00:00
Felicity Tarnell
50d9efdac9 Cleanups; add 'make depend'. 2014-03-07 19:18:20 +00:00
Felicity Tarnell
332fdba0bd Source refactoring; no functional changes. 2014-03-07 17:43:41 +00:00
Felicity Tarnell
b174130c91 T.83.6: Incorrect memory allocation in configuration parser. 2014-03-07 16:11:23 +00:00
Felicity Tarnell
af2b5dc45c T.83.5: Fix 'M'erge giving bogus time when a marked entry is running. 2014-03-06 16:21:40 +00:00
Felicity Tarnell
4ba7155d78 T.83.4: Handle auto_non_billable in entry_new(). 2014-03-05 16:32:04 +00:00
Felicity Tarnell
4cdd1caf46 T.83.3: Handle auto_non_billable in kaddold(). 2014-03-05 16:20:40 +00:00
Felicity Tarnell
81c1f680ae T.83.2: Need -lm for round(). 2014-03-05 16:09:02 +00:00
Felicity Tarnell
197adb654a T.83.1: Fix non-Darwin build; fix WIDE build. 2014-03-05 16:04:57 +00:00
Felicity Tarnell
3560996263 T.83.0: remove 'mark-interrupt' command
There's no point having both 'interrupt' and 'mark-interrupt', as it only
ever makes sense to use one or the other depending on the current timer
state.  Merge them into a single command (interrupt), and for compatibility
bind both 'R' and 'r' to that command.
2014-03-05 15:55:06 +00:00
Felicity Tarnell
d9223f4603 T.82.0: 'set bill_increment' command. 2014-03-05 15:43:20 +00:00
Felicity Tarnell
66c12e8e73 Calculate version string from configure.ac at compile time.
Also bump version from T.1.0-80 to T.81.0, as the leading 1.0 was useless.
2014-03-05 15:28:24 +00:00
Felicity Tarnell
5db1e9cdbb Properly handle quoted strings in command parser. 2014-03-05 15:20:53 +00:00
Felicity Tarnell
7a0aca347e auto_non_billable config option
If this is set to a string, then any new entry that contains this string will
be marked as efl_nonbillable=1 automatically.
2014-03-05 15:02:26 +00:00
Felicity Tarnell
62762f7590 Optionally show billable time in daily header. 2014-03-05 14:49:25 +00:00
Felicity Tarnell
30ddd07b20 Add billable flag.
For backward-compatibility, this is actually a non-billable flag, so all
existing entries will be considered billable.  The flag is 'n', the UI
flag is 'B', the toggle function is "billable" and the default key binding is
'b'.

For now, this isn't useful for anything.
2014-03-05 14:42:53 +00:00
Felicity Tarnell
c1af94f57f Fix warnings. 2014-03-05 14:28:37 +00:00
Felicity Tarnell
038fbfdd18 OS X: Handle power events sensibly.
Currently, if the computer goes to sleep and wakes up later, TTS will count
all the time spent asleep against the currently running entry (if any).  If
(like me) your computer being asleep means you aren't working, this probably
means you just forgot to stop the time, and now you need to somehow calculate
(or guess) how much time to subtract.

With this change, TTS will instead prompt on wake-up whether to remove the
time spent sleeping from the current entry.
2014-03-05 14:17:54 +00:00
Felicity Tarnell
6a76613798 New version scheme: this is T.1.0-79. 2014-01-30 18:12:44 +00:00
Felicity Tarnell
f4fe5eb0da Add travis-ci config. 2014-01-30 18:03:12 +00:00
Felicity Tarnell
fc22ce88b2 Fix separate builddir build. 2014-01-30 18:01:28 +00:00
Felicity Tarnell
5d9a5f2794 Ditch version.h; update copyright. 2014-01-06 09:55:45 +00:00
Felicity Tarnell
aea9191844 Initial import. 2014-01-06 09:52:34 +00:00