summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-07-28src/calcurse.h: Whitespace cleanupLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28src/args.c: Mark various constant strings constLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28Remove superfluous buffer variable from version_arg()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28Remove superfluous buffer variable from help_arg()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28TODO: Remove reference to the bugs mailing listLukas Fleischer
Feature requests should go to the misc mailing list, no need to mention the bugs mailing list here. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28Merge branch 'maint'Lukas Fleischer
2011-07-28io.c: Accept resource parameters in iCal importLukas Fleischer
Remove colons from the "SUMMARY:" and "DURATION:" search patterns in ical_read_event() to allow for additional parameters (such as language parameters, cf. RFC 5545). Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-28Invoke vars_init() before importing data with "-i"Lukas Fleischer
We forgot to call vars_init() when importing an item using the "-i" command line argument, which led to the pager configuration variable being unset and hence the pager invocation (triggered to show the log in case there are any errors during import) failing. Fix this by calling vars_init() before io_import_data(). Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-24Use gettext plural featuresLukas Fleischer
Make use of the plural features of gettext to handle plural forms correctly instead of using the plural form even if the singular form should be used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-24Split stats messages in io_import_data()Lukas Fleischer
Use separate format strings for separate values. This is useful in case we want to output similar stats somewhere else and is a preparation for supporting plural forms. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Refactor out note functionsLukas Fleischer
* Add new note_edit() and note_view() helper functions. Use these instead of copy-pasted code in *_note_edit(). * Move all note-related functions (note_edit(), note_view(), note_erase()) to a new source file "note.c". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Add hint to error messages in custom_load_conf()Lukas Fleischer
Include the name of the configuration variable that issued the error in error messages that are thrown while parsing the configuration file. This makes it a lot easier to locate syntactic and semantic errors. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Use map for configuration variable namesLukas Fleischer
Use a map instead of dozens of hardcoded conditionals. This makes configuration variable parsing more dynamic and extensible. Also, reintroduce formatting error messages that we dropped earlier. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Return error status in custom_set_conf()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Rename custom_load_color() to conf_parse_color()Lukas Fleischer
Also, temporarily remove all error messages and return an error status instead. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Declare foreground and background variables globalLukas Fleischer
Removes the need to pass the terminal's default background color round. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Refactor out integer variable parsingLukas Fleischer
Introduce conf_parse_unsigned() and conf_parse_int() similar to conf_parse_bool(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Refactor conf_parse_bool()Lukas Fleischer
* Increase size argument for strncmp() comparisons by one to include the terminating null-character (otherwise "yesfoo" would be parsed as "yes", "nobar" as "no"). * Pass destination address as an additional argument and return success/failure status to allow for better error handling. * Temporarily remove error handling (will be fixed later). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Rename fill_config_var() to conf_parse_bool()Lukas Fleischer
This is a much better name as it implicitly describes that this function parses boolean configuration values only. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-21Refactor out configuration variable settingLukas Fleischer
Move configuration variable assignments to a new function, custom_set_conf(). This improves code readability and allows for setting configuration variables outside the configuration file loading function. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-15Use single-line configuration settings by defaultLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-15Parse single-line configuration variablesLukas Fleischer
Include a fallback branch that accepts multi-line comments as well (backward compatibility). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-15Be stricter when parsing the configuration fileLukas Fleischer
Throw an error message if there is a line that contains an invalid configuration line (e.g. a non-empty line that neither contains a key nor a value). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-15Skip indentation and comments in io_extract_data()Lukas Fleischer
We actually only use this function to parse configuration data. Currently, this probably is the best way to do some common preprocessing. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-15Refactor custom_load_conf()Lukas Fleischer
Read key and value of each configuration setting in one loop cycle to facilitate adjustments of the configuration setting format. Also, this allows us to get rid of all the redundant variable resetting. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-14Do not unnecessarily refresh in config menuLukas Fleischer
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-14Remove artificial delay when saving dataLukas Fleischer
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-10Merge branch 'maint'Lukas Fleischer
2011-07-09Honor "TMPDIR" environment variableLukas Fleischer
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-07TODO: Remove send-item TODO entryLukas Fleischer
Implemented in 309fa84cb7439221c01f8526fcbc67b6004a95d1. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-07Add key binding for pipe-item commandLukas Fleischer
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-05Add todo_pipe_item() functionLukas Fleischer
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-05Add day_pipe_item() functionLukas Fleischer
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-05Add press_any_key() functionLukas Fleischer
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-05Move endwin() down in wins_prepare_external()Lukas Fleischer
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-02Refactor wins_launch_external()Lukas Fleischer
* 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-02Add shell_exec() functionLukas Fleischer
Can be used to execute an external program in a shell. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Add child_wait() functionLukas Fleischer
Can be used to wait for the termination of a child process. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Add fork_exec() functionLukas Fleischer
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-02Make recur_*_write() publicLukas Fleischer
This allows one to serialize and send recurrent items to arbitrary output streams. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Refactor out todo item serializationLukas Fleischer
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-02doc/manual.txt: Remove note on missing UTF-8 supportLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02TODO: Remove UTF-8 support from TODO listLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02utf8_width() performance improvementsLukas Fleischer
* 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-02Avoid segfault in getstr_fixscr()Lukas Fleischer
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-02Use constant for maximum UTF-8 character sizeLukas Fleischer
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-02Refactor getstring codeLukas Fleischer
* 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-02Make display_todo_item() UTF-8 compatibleLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29Make display_item() UTF-8 compatibleLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29Make getstring() UTF-8 compatibleLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>