aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add help commandLukas Fleischer2013-07-172-1/+31
| | | | | | | | | This adds a "help" command to the list of available command mode commands. You can currently type "help", followed by a topic like "add". calcurse will then try to open a file named "add.txt" in the documentation directory and display it in an external pager. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add command promptLukas Fleischer2013-07-174-3/+19
| | | | | | | | | | This adds support for vim-style command mode. The command mode can be entered with pressing ":" (by default, the key binding is configurable). Currently, no command is supported. Support for various commands will be added later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add help text files to dist_doc_DATALukas Fleischer2013-07-171-1/+24
| | | | | | | We exported online help texts in commit 906c2fa. Make sure they are actually installed when running `make install`. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add a short format specifier for "%(remaining)"Lukas Fleischer2013-07-171-0/+2
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Allow extended formats for durationsLukas Fleischer2013-07-171-1/+5
| | | | | | | Use print_datediff() to print durations. This allows for using something like "%(duration:%EH:%M)". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* print_datediff(): Actually print a date differenceLukas Fleischer2013-07-171-5/+3
| | | | | | | | | Instead of passing a date and printing the date difference between that date and the current date, pass an actual date difference. This allows for using the function in other places, such as for printing item durations. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add %(remaining) style formattingWilliam Pettersson2013-07-171-0/+83
| | | | | | | | Adds %(remaining) style formatting, with parameter substitution for %d, %H, %M, %S with E and - variables. Signed-off-by: William Pettersson <william.pettersson@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add -l/--limit optionWilliam Pettersson2013-07-163-18/+44
| | | | | | | | Adds the -l/--limit command line option. Limits the number of appointments and/or ToDo items displayed. Signed-off-by: William Pettersson <william.pettersson@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Export online help as text filesLukas Fleischer2013-07-0922-0/+406
| | | | | | | Move the texts of each online help screen to a separate text file. The set of files is supposed to replace the online help screens later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix a couple of translatable stringsLukas Fleischer2013-05-147-28/+28
| | | | | | | | * Remove space before punctuation. * Use "TODO" instead of "ToDo". * Strip some formats to make sure lines are <=80 characters wide. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Support punctual appointments in the UILukas Fleischer2013-05-141-0/+4
| | | | | | | | | Allow for skipping the end date which means that a punctual appointment will be created. Implements FR#25. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* display_item_date(): Support punctual appointmentsLukas Fleischer2013-05-141-2/+3
| | | | | | | | Display appointments having the same starting date as ending date using a specific format that hides the end time ("12:00" instead of "12:00 -> 12:00"). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Refactor display_item_date()Lukas Fleischer2013-05-141-12/+6
| | | | | | | | | | Replace nested case differentiations by initializing every single character for each flag separately and joining all characters afterwards. This makes it much easier to extend the function later. Note that the same approach is already used in display_item(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use a macro to determine the size of arraysLukas Fleischer2013-05-045-15/+14
| | | | | | | | Use following macro instead of "sizeof(x) / sizeof(x[0])" everywhere: #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* recur.c: Refactor/Reformat recur_item_find_occurrence()Lukas Fleischer2013-05-021-17/+13
| | | | | | | Fix a couple of whitespace and line breaks. Bail out early instead of using nested if statements. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* recur_exc_scan(): Do not check time of exceptionsLukas Fleischer2013-04-141-2/+1
| | | | | | | | | | Exceptions do not contain a time field -- do not check time fields which may be uninitialized. Regression introduced in 9907069f442c56c90b67accb2d8fbd046dfce6db. This fixes test/recur-*.sh. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use tabs instead of spaces for indentationLukas Fleischer2013-04-1435-11435/+12019
| | | | | | | | | | | This completes our switch to the Linux kernel coding style. Note that we still use deeply nested constructs at some places which need to be fixed up later. Converted using the `Lindent` script from the Linux kernel code base, along with some manual fixes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Validate date/time when scanning itemsLukas Fleischer2013-02-273-0/+29
| | | | | | | | | | | | | | | | Bail out when reading dates such as "02/30/2013" from the appointments file. These *could* be converted into valid dates but since we never write invalid dates to that file, these indicate a user error. Fixes following test cases: * appointment-009.sh * appointment-012.sh * appointment-016.sh * appointment-019.sh * event-003.sh Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* parse_{date,time}(): Split out date/time validationLukas Fleischer2013-02-272-3/+25
| | | | | | | | Split date/time validation into separate functions check_date() and check_time(). These will be used to validate date/time information when reading items from the appointments file. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add default values for configuration variablesLukas Fleischer2013-02-2750-7/+102
| | | | | | | | | | | Add a small helper script called "test-init.sh" that is sourced in each test case and initializes the CALCURSE and DATA_DIR environment variables. Update the test suite README to point out that setting these environment variables is no longer required. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add a couple of black-box tests for itemsLukas Fleischer2013-02-2755-0/+251
| | | | | | | This introduces five test suite failures which will be fixed in one of the following patches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* date_sec2date_str(): Add missing semicolonLukas Fleischer2013-02-191-1/+1
| | | | | | Regression introduced in a363cb9b9111aed22d105adb0e7a8e9caab9bbe3. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix braces in if-else statementsLukas Fleischer2013-02-1720-132/+172
| | | | | | | | | | From the Linux kernel coding guidelines: Do not unnecessarily use braces where a single statement will do. [...] This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* parse_duration(): Bail out early in final stateLukas Fleischer2013-02-141-6/+4
| | | | | | | Bail out early if we are reading a character while being in a final state. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* ui-day.c: Several minor simplificationsLukas Fleischer2013-02-141-134/+110
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* ui-todo.c: Refactor ui_todo_chg_priority()Lukas Fleischer2013-02-141-19/+10
| | | | | | | Add the new item *before* deleting the old one and get rid of temporary buffers for the item message and note. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Mark todo_get_position() publicLukas Fleischer2013-02-142-1/+2
| | | | | | This is needed in "ui-todo.c" now. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* calendar.c: Rename to "ui-calendar.c"Lukas Fleischer2013-02-1412-126/+126
| | | | | | | | | This unit belongs to the presentation layer -- rename the file accordingly. Also, rename calendar_*() to ui_calendar_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* todo.c: Split out UI-related functionsLukas Fleischer2013-02-146-242/+242
| | | | | | | * Move UI-related functions to "ui-todo.c". * Rename UI-related functions to ui_todo_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* apoint.c: Split out UI-related functionsLukas Fleischer2013-02-145-168/+168
| | | | | | | * Move UI-related functions to "ui-day.c". * Rename UI-related functions to ui_day_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Rename appointment/event-related UI functionsLukas Fleischer2013-02-145-29/+29
| | | | | | | | | * Rename "interaction.c" to "ui-day.c" since it no longer contains todo-related UI functions. * Rename appointment/event-related UI functions to ui_day_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Split out UI functions for todo itemsLukas Fleischer2013-02-145-111/+150
| | | | | | | | | * Move todo-related UI functions from "interaction.c" to a new compilation unit "ui-todo.c". * Rename all todo-related UI functions to todo_ui_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Merge branch 'maint'Lukas Fleischer2013-02-093-1/+18
|\
| * Release 3.1.4v3.1.4Lukas Fleischer2013-02-092-1/+13
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Do not ignore "--datarootdir" in "po/Makefile.in.in"Lukas Fleischer2013-02-051-0/+5
| | | | | | | | | | | | | | | | | | This fixes the "--datarootdir" warning seen with autotools >=2.59c. Note that this is a workaround for a bug in autopoint(1). Inspired by util-linux commit cc3c3fdd29719883605687fc0d11391386ab46c6. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2013-02-0449-63/+81
|\|
| * Update copyright rangesLukas Fleischer2013-02-0448-62/+62
| | | | | | | | | | | | | | Add 2013 to the copyright range for all source and documentation files. Reported-by: Frederic Culot <frederic@culot.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Close key binding window when reassigning the same keyMichael Smith2013-02-041-0/+6
| | | | | | | | | | | | | | | | | | | | This allows for canceling a key reassignment. We cannot use a static key here since every key could potentially be used in a binding. Instead, just cancel if we are trying to reassign a key that has already been used for that action before. Signed-off-by: Michael Smith <crazedpsyc@mail4us.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Do not prompt for a todo after adding an appointmentLukas Fleischer2013-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | We effectively turned the addition of an appointment into a fall through case by deleting the break statement during refactoring. Revert this deletion to skip the second prompt. Regression introduced in f2dca7de3e8b164a4b3af3d58dde2f6776bfbee6. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Release 3.1.3v3.1.3Lukas Fleischer2013-02-022-1/+12
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2013-02-022-5/+8
|\|
| * Properly skip spaces after exception listLukas Fleischer2013-02-011-2/+4
| | | | | | | | | | | | | | Skip whitespace after obtaining the list of exceptions instead of skipping the next character unconditionally. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Skip start time update if prompt is canceledLukas Fleischer2013-02-011-1/+2
| | | | | | | | | | | | See commit 217e66729a249a638863a9cc2ff93b8368cd6094 for details. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
| * Skip duration update if the prompt is canceledLukas Fleischer2013-02-011-2/+2
| | | | | | | | | | | | | | | | | | Do not update an appointment's duration if the user cancels the prompt at day_edit_duration(). Note that day_edit_duration() does not touch the buffer if the prompt was canceled or an invalid value was entered, resulting in the buffer variable being uninitialized in these cases. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | day_process_storage(): Remove redundant parameterLukas Fleischer2013-02-013-10/+9
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Delete TODO fileLukas Fleischer2013-01-301-33/+0
| | | | | | | | | | | | | | This is outdated and has been migrated to the bug tracker which turned out to be a much better way of keeping track of tickets. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Use strncasecmp() for case-insensitive comparisonLukas Fleischer2013-01-303-39/+22
| | | | | | | | | | | | | | Instead of converting everything to upper case and then using strncmp(), use strncasecmp() which does case-insensitive comparison out of the box. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Remove unused function mystrtol()Lukas Fleischer2013-01-302-16/+0
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | custom.c: Fix sidebar configuration help textLukas Fleischer2013-01-301-4/+3
|/ | | | | | | * Use a format string instead of the TOSTRING() macro. * Remove "xgettext:no-c-format" hack and use "%%" instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Use `faketime -f`Lukas Fleischer2012-12-227-7/+11
| | | | | | | | | | | | Use the advanced timestamp specification format for libfaketime. Before using that, some tests failed on 32-bit systems due to integer overflows. It seems like faketime translates absolute dates to relative dates by default. Moreover, libfaketime is not able to handle relative dates that exceed the maximum value of a signed integer. Using "-f" skips the conversion to relative dates. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>