summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-10-05Refactor out note deserializationLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-05Add a copy file routineLukas Fleischer
Add io_file_cp() which can be used to copy an existing source file to another location. We will need this for our new hash-based note file names. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-05Add a SHA1 implementationLukas Fleischer
Add an implementation of the SHA1 hash algorithm based on a public domain project by Steve Reid <sreid@sea-to-sky.net>. You can get the original sources from: ftp://ftp.funet.fi/pub/crypt/hash/sha/sha1.c We will need this for several things. File names of note files will be generated based on a hash their content instead of using a random name. Items can be uniquely identified using a hash. In addition to the regular sha1_init(), sha1_update() and sha1_final() operations, our implementation also contains wrappers for hashing a string or a stream. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-05doc/: Add "submitting-patches.txt"Lukas Fleischer
This short paper contains information on how to create and submit patches to calcurse. This used to be on our website - "doc/" seems to be a better place for this, though. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-09-06Merge branch 'maint'Lukas Fleischer
Conflicts: src/io.c
2011-09-06Release 2.9.2v2.9.2Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-09-06Update translationsLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-09-03Add a configure setting to skip "doc/"Lukas Fleischer
This should fix all remaining build issues with documentation generation. Finally. The new "--disable-docs" option should be used to skip documentation completely, whereas "--without-asciidoc" can be used if both manual and man page should not be rebuilt. As a consequence, "--without-asciidoc" can only be combined with "--enable-docs" if ready-made documentation already exists in "doc/". This is true for release tarballs (where we include prebuilt documentation for the sake of portability and simplicity), as well as for Git checkouts where the documentation has already been built earlier. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-09-02Merge branch 'maint'Lukas Fleischer
2011-08-26Rework indentation code in print_notefile()Lukas Fleischer
Do not use snprintf() here as printf() behaviour is undefined if the destination pointer is used as a parameter. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-08-26src/io.c: iCal content line folding correctnessLukas Fleischer
This is a rather invasive change that introduces correct line folding to our iCal parser. From now on, ical_readline() should be used instead of fgets() to read lines from an iCal file as it unfolds lines automatically. We also need to use shared buffers as each ical_readline() invocation eats up the first part of the next line and stores it in the "lstore" buffer. Subsequent ical_readline() invocations copy the contents of this buffer and append continuation lines. We currently use a single buffer pair that is allocated in io_import_data() and pass it to all subroutines. ical_readline_init() needs to be called once for every buffer pair. It reads the first part of the current line and writes to "lstore", clearing the target buffer at the same time. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-31Add configuration option to notify all appointmentsLukas Fleischer
If "notify-all" is enabled, all non-flagged appointments will be notified (instead of flagged ones). This is useful for users that want to be notified of everything. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-31Release 2.9.1v2.9.1Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-31Update translations filesLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-30Merge branch 'maint'Lukas Fleischer
2011-07-30Fix sort order in app_arg()Lukas Fleischer
We used to iterate over the list of regular appointments and the list of recurrent appointments in separate loops, thus leading to recurrent appointments being printed first and regular appointments being printed afterwards, regardless of their start and end times. Merge these loops to coerce precedence of the start time. There's still a fair bit of hackery in here - we will fix that later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Fix configuration file backward compatibilityLukas Fleischer
We kinda broke this in 6377582841118688aee13aff98c9216403582e45. All hail strsep()! Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Fix apoint_get() call in apoint_switch_notify()Lukas Fleischer
We passed the function arguments the wrong way round. This regression was introduced in commit 77ef3fe76e4ce4c9a990e8a5904ad2d83420ca02. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Fix notify_check_repeated()Lukas Fleischer
Remove the "current_time" check from the first if condition. As "greater than" relations (">") have higher precedence than assignments ("=") in C, this caused "real_app_time" to always be one or zero which definitely isn't what we want here. Reading further down, it turns out that we don't even need this comparison here, so we should be fine removing it. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Fix recurrent appointment notificationLukas Fleischer
We probably broke this in 9fab24818a119aef08b9726f6c1cd31d5434ce34. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Update the notification item in *_paste_item()Lukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Update the notification item in day_edit_item()Lukas Fleischer
Ensure the start time as well as the description of the notification appointment are synced after editing it. We use notify_check_next_app()'s force parameter to ensure that the notification item is updated even if only the description was modified. Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29Add "force" parameter to notify_check_next_app()Lukas Fleischer
This allows to force notify_check_next_app() to update the notification appointment, even if start times are equal (e.g. if the item description was changed). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
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>