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.
This commit is contained in:
Felicity Tarnell 2014-03-05 15:55:06 +00:00
parent d9223f4603
commit 3560996263
4 changed files with 41 additions and 32 deletions

25
README
View file

@ -1,10 +1,10 @@
RT/TTS - Time-tracking software
===============================
TTS - Time-tracking software
============================
RT/TTS is a simple, text-based (curses) time-tracking application. For more
TTS is a simple, text-based (curses) time-tracking application. For more
details, see the website at <http://loreley.flyingparchment.org.uk/~felicity/pages/tts>.
RT/TTS has been tested on FreeBSD, NetBSD, Solaris, Cygwin and Linux, with the
TTS has been tested on FreeBSD, NetBSD, Solaris, Cygwin and Linux, with the
following caveats:
- Wide character support does not work with Unicode using Solaris
@ -19,6 +19,21 @@ TTS uses autoconf and can be built as follows:
$ make
# make install
After starting with 'rttts', type '?' for help.
After starting with 'tts', type '?' for help.
### Quick start:
* Press 'a' to add a new entry, and enter its name. The timer starts running.
* Press space to toggle the timer on and off.
* Press 'A' to add an entry and have TTS prompt for its initial time.
* Press 'd' to delete an entry, and 'u' to undelete it.
* Press 'e' to edit an entry's description, or '\' to edit its time.
* Press '+' to add time to an entry or '-' to remove time.
* Press '?' for more help, and look at the sample .ttsrc.
* When you're working on something and something else comes up, press 'r' to
start the interrupt timer. When you're done with the other thing, press 'r'
again to assign the interrupt time to a new entry.
### Contact
Send questions/comments/bugs/patches to <felicity@loreley.flyingparchment.org.uk>.

18
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for RT/TTS T.82.0.
# Generated by GNU Autoconf 2.69 for RT/TTS T.83.0.
#
# Report bugs to <felicity@loreley.flyingparchment.org.uk>.
#
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='RT/TTS'
PACKAGE_TARNAME='rt-tts'
PACKAGE_VERSION='T.82.0'
PACKAGE_STRING='RT/TTS T.82.0'
PACKAGE_VERSION='T.83.0'
PACKAGE_STRING='RT/TTS T.83.0'
PACKAGE_BUGREPORT='felicity@loreley.flyingparchment.org.uk'
PACKAGE_URL=''
@ -1232,7 +1232,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures RT/TTS T.82.0 to adapt to many kinds of systems.
\`configure' configures RT/TTS T.83.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1293,7 +1293,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of RT/TTS T.82.0:";;
short | recursive ) echo "Configuration of RT/TTS T.83.0:";;
esac
cat <<\_ACEOF
@ -1380,7 +1380,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
RT/TTS configure T.82.0
RT/TTS configure T.83.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1749,7 +1749,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by RT/TTS $as_me T.82.0, which was
It was created by RT/TTS $as_me T.83.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -4720,7 +4720,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by RT/TTS $as_me T.82.0, which was
This file was extended by RT/TTS $as_me T.83.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -4782,7 +4782,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
RT/TTS config.status T.82.0
RT/TTS config.status T.83.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View file

@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([RT/TTS], [T.82.0], [felicity@loreley.flyingparchment.org.uk])
AC_INIT([RT/TTS], [T.83.0], [felicity@loreley.flyingparchment.org.uk])
AC_CONFIG_SRCDIR([tts.c])
AC_CONFIG_HEADERS([config.h])

28
tts.c
View file

@ -250,7 +250,6 @@ static void ksync(void);
static void kexec(void);
static void kmerge(void);
static void kint(void);
static void kmarkint(void);
typedef struct function {
const WCHAR *fn_name;
@ -283,7 +282,6 @@ static function_t funcs[] = {
{ WIDE("execute"), kexec, WIDE("execute a configuration command") },
{ WIDE("merge"), kmerge, WIDE("merge marked entries into current entry") },
{ WIDE("interrupt"), kint, WIDE("split current entry into new entry")},
{ WIDE("mark-interrupt"), kmarkint, WIDE("start interrupt timer for current entry")}
};
typedef struct tkey {
@ -679,7 +677,7 @@ char rcfile[PATH_MAX + 1];
bind_key(WIDE("<DOWN>"), WIDE("next"));
bind_key(WIDE(":"), WIDE("execute"));
bind_key(WIDE("M"), WIDE("merge"));
bind_key(WIDE("r"), WIDE("mark-interrupt"));
bind_key(WIDE("r"), WIDE("interrupt"));
bind_key(WIDE("R"), WIDE("interrupt"));
/*
@ -1426,6 +1424,16 @@ time_t duration;
entry_t *en;
WCHAR *name;
if (!itime) {
if (!running) {
drawstatus(WIDE("No running entry."));
return;
}
itime = time(NULL);
return;
}
if (!running) {
drawstatus(WIDE("No running entry."));
return;
@ -1462,20 +1470,6 @@ WCHAR *name;
free(name);
}
void
kmarkint()
{
if (itime) {
kint();
} else {
if (!running) {
drawstatus(WIDE("No running entry."));
return;
}
itime = time(NULL);
}
}
void
ksearch()
{