1207 Commits

Author SHA1 Message Date
Lukas Fleischer
c21137129a Do not unnecessarily refresh in config menu
We don't need to refresh windows every time an unassigned key is
pressed. Add a condition to skip the refresh part if that is the case.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-14 18:23:31 +02:00
Lukas Fleischer
ab4c4dee76 Remove artificial delay when saving data
This doesn't contribute to functionality or usability in any way. Keep
the progress bar option but only show bars as long as the actual save
operation is in progress.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-14 18:23:31 +02:00
Lukas Fleischer
160f12687e Merge branch 'maint' 2011-07-10 19:04:49 +02:00
Lukas Fleischer
34f094312f Honor "TMPDIR" environment variable
Replace all hardcoded paths referring to "/tmp" with a new function that
honors the "TMPDIR" environment variable as well as P_tmpdir and uses
"/tmp" as a fallback.

Thanks-to: Erik Saule <esaule@bmi.osu.edu>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-09 17:52:25 +02:00
Lukas Fleischer
34caa4a426 TODO: Remove send-item TODO entry
Implemented in 309fa84cb7439221c01f8526fcbc67b6004a95d1.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-07 07:06:02 +02:00
Lukas Fleischer
309fa84cb7 Add key binding for pipe-item command
This removes the need of reading the whole data file and find matching
entries if we want to parse appointments in external programs.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-07 07:05:48 +02:00
Lukas Fleischer
9e60084262 Add todo_pipe_item() function
Pipe a serialized todo item to an external process, similar to what
day_pipe_item() does (cf. c3f532d814e555abf67efb136491956428f19965).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-05 16:25:32 +02:00
Lukas Fleischer
c3f532d814 Add day_pipe_item() function
Serializes an appointment or an event, prompts for a shell command and
executes that command in a new process, piping serialized item data to
its stdin.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-05 16:19:17 +02:00
Lukas Fleischer
b0b994896c Add press_any_key() function
Displays "Press any key to continue..." in shell terminal mode and waits
for a key stroke.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-05 16:04:33 +02:00
Lukas Fleischer
2f8a425756 Move endwin() down in wins_prepare_external()
Invoke endwin() *after* calling any other curses functions, such as
refresh(). Calling refresh() after endwin() might restore curses mode
which is a bad thing for a terminal mode initialization routine.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-05 16:04:33 +02:00
Lukas Fleischer
233980622f Refactor wins_launch_external()
* Do window preparation and restoring in separate functions
  wins_prepare_external() and wins_unprepare_external().

* Use fork_exec() and child_wait() instead of system().

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
7982c98be4 Add shell_exec() function
Can be used to execute an external program in a shell.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
7e61b3de06 Add child_wait() function
Can be used to wait for the termination of a child process.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
6e2b00096d Add fork_exec() function
Can be used to execute an external program. Provides the possibility to
optionally create a pipe to the new process.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:36 +02:00
Lukas Fleischer
003431880e Make recur_*_write() public
This allows one to serialize and send recurrent items to arbitrary
output streams.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:35 +02:00
Lukas Fleischer
3076670a76 Refactor out todo item serialization
Add a todo_write() function that allows one to serialize todo items and
write serialized data to an output stream in a fashion similar to
apoint_write() and event_write().

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:15:35 +02:00
Lukas Fleischer
29d71935af doc/manual.txt: Remove note on missing UTF-8 support
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
b3afd7e15f TODO: Remove UTF-8 support from TODO list
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
496f0d98f8 utf8_width() performance improvements
* Sort character width lookup table by character ranges.

* Use binary search instead of linear search for UTF-8 character width
  lookups which will speed up utf8_width() (O(log n) instead of O(n)).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:18 +02:00
Lukas Fleischer
33ce6cd8f8 Avoid segfault in getstr_fixscr()
Avoid a segfault that may occur if getstr_fixscr() changes the scroll
offset to something outside the input boundaries (e.g. if a word that is
only partly visible is killed via backward-kill-word).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:17 +02:00
Lukas Fleischer
e85501e5ef Use constant for maximum UTF-8 character size
Introduce a UTF8_MAXLEN constant instead of using the literal value "6"
at various places.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:09:13 +02:00
Lukas Fleischer
c8029a5a13 Refactor getstring code
* Rename static showstring() function to getstr_print(), rename
  ins_char() to getstr_ins_char() and del_char() to getstr_del_char().

* Refactor out getstring data structure initialization and window
  scrolling routines.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:08:46 +02:00
Lukas Fleischer
c4246779ff Make display_todo_item() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02 10:08:46 +02:00
Lukas Fleischer
c8a745fe23 Make display_item() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 18:48:47 +02:00
Lukas Fleischer
39d2671495 Make getstring() UTF-8 compatible
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
edc20ba443 Split line editing functions into separate file
Move getstring() related stuff into a separate file as a first step on
our way to UTF-8 support for line editing helpers.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
271457b7a4 Add basic UTF-8 helper functions
Add utf8_width() and utf8_strwidth() which can be used to calculate the
display width of a single character or a string, respectively. A lookup
table is used to spot double width characters, as well as composing
characters. There currently isn't any code to deal with ambigious
characters.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
7f5fc0c62f src/calcurse.h: Add UTF-8 related macros
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:43:44 +02:00
Lukas Fleischer
470f05cd38 Enable arrow key navigation by default
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:40:38 +02:00
Lukas Fleischer
585ed53748 doc/manual.txt: Document backward-kill-word
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:40:31 +02:00
Lukas Fleischer
0827e00247 Handle resize properly in the sidebar config menu
There used to be no resize handler in custom_sidebar_config() which
resulted in a messed up screen if the terminal was resized during
sidebar configuration. Doing a simple wins_reset() if the terminal was
resized works around this problem.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29 15:21:05 +02:00
Lukas Fleischer
bc2bead505 Do not try to display items with negative width
Don't display anything rather than segfault if the appointment panel
becomes too small (e.g. during a terminal resize).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:28:21 +02:00
Lukas Fleischer
6c6c7d5ec0 Always work with new window dimensions on resize
This one came up after improving resizing behaviour in commit
fec37db06bbbdff79bc9816046a76e0b29e173b4. We used to use outdated width
and height values at various places without noticing it due to the
resize algorithm being called several times on every resize.

This patch ensures we retrieve the new window dimensions *before* doing
any layout calculations.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:27:52 +02:00
Lukas Fleischer
fec37db06b Avoid redundant redraws on resize
Use a global flag to record whether the terminal was resized instead of
redrawing everything each time a KEY_RESIZE is read.

Add some additional checks to help_write_pad() as invalid actions may be
passed now due to using signals instead of virtual key presses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:22:43 +02:00
Lukas Fleischer
6636232bc7 doc/Makefile.am: Fix "--without-asciidoc"
Do not try to distribute man page and manual files if documentation
generation is disabled.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
9c3a8a5a49 src/llist.c: Use stable insertion algorithm
Ensure the relative order of elements with equal keys is maintained when
inserting into a sorted list.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
b2645847a0 Fix whitespace issues
Strip trailing whitespaces in all source files.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-09 21:37:22 +02:00
Lukas Fleischer
4e6e3a9c97 src/utils.c: Make bell() static
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-07 09:33:50 +02:00
Lukas Fleischer
3cd5c1d738 Release 2.9.0.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:48:24 +02:00
Lukas Fleischer
ee369c596f build-aux/git-version-gen: Ignore timestamps.
Do not declare the working tree dirty if only a timestamp has changed.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:46:34 +02:00
Lukas Fleischer
c61a63a46d Add version information to distribution tarball.
We somehow forgot this when adding Git version string support in commit
c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
f3e3020104 README: Add missing translators.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
79deaaac35 Translation updates from Transifex.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:07 +02:00
Lukas Fleischer
6d2b7bd497 .tx/config: Add EOL character to the last line.
Be a little more consistent here.

Also, transifex-client will automatically add a newline character to the
last line of its config file unless it is already there.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-18 20:37:03 +02:00
Lukas Fleischer
0f03e80d03 Add missing llist header files to "_SOURCES".
We forgot to add those to the "_SOURCES" variable in commit
0eb1da8dd7fa3ae9d95e12df6058fb41a5ec1c11 and
d668963e2056027526374098efe2869a0d389b92. Spotted by `make distcheck`.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-17 10:16:32 +02:00
Lukas Fleischer
35ade5bf96 Add iCalendar keywords TODO entry.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 07:52:47 +02:00
Lukas Fleischer
38865b8e48 Update copyright notices in source files, documentation and "COPYING".
* Update copyright dates (use 2004-2011 as date range everywhere).

* Change copyright holder from "Frederic Culot" to "calcurse Development
  Team".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 07:26:05 +02:00
Lukas Fleischer
c9db3b7db7 TODO overhaul.
* Use AsciiDoc style formatting.

* Fix some wording. Use "we" instead of "I" and "us" instead of "me".

* Update mail addresses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:27 +02:00
Lukas Fleischer
bd0be4237c README overhaul.
* Use AsciiDoc style formatting.

* Remove outdated information on the "ChangeLog" file (removed that in
  commit b9fa5bdbb17f507ba756fe38a14d5993e522bb6c).

* Replace references to language specific manual files by
  "doc/manual.html".

* Update author roles.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:05 +02:00
Lukas Fleischer
79353a625c Ignore daemon lock file if the daemon process died.
Do this in a fashion similar to what was done in commit
6ff95238766656c5ea9d5c65c35d3aef93499f60.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00