diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-12-28 09:55:16 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2019-05-22 01:56:59 -0400 |
commit | 80ce812effec8190bfbb1986dced1b143162a4c8 (patch) | |
tree | 2c1087f0754b5d186273766440a5435c8f947ec9 /src/custom.c | |
parent | 0bb4a59b5fb089062f0eb369d39289ff1ccfc2ba (diff) | |
download | calcurse-80ce812effec8190bfbb1986dced1b143162a4c8.tar.gz calcurse-80ce812effec8190bfbb1986dced1b143162a4c8.zip |
Add configuration variables for multiple days
The number of days displayed in the APP panel has been made
configurable, maximum 21 days, default seven days.
With several days in the APP panel, it may be desirable to "squeeze" the
entries by leaving out the final empty line of each appointment and
lower the number of lines between consecutive days (0, 1, or 2). Both
are made general configuration options. To make a uniform display, an
empty line is added to a day without appointments, if appointments have
an empty line.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/custom.c')
-rw-r--r-- | src/custom.c | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/src/custom.c b/src/custom.c index f3498b8..b5890cd 100644 --- a/src/custom.c +++ b/src/custom.c @@ -528,6 +528,9 @@ enum { DEFAULT_PANEL, CAL_VIEW, TODO_VIEW, + MULTIPLE_DAYS, + DAYSEPARATOR, + EMPTY_APPT_LINE, AUTO_SAVE, AUTO_GC, PERIODIC_SAVE, @@ -552,6 +555,9 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d "appearance.defaultpanel = ", "appearance.calendarview = ", "appearance.todoview = ", + "general.multipledays = ", + "appearance.dayseparator = ", + "appearance.emptyline = ", "general.autosave = ", "general.autogc = ", "general.periodicsave = ", @@ -608,6 +614,30 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d custom_remove_attr(win, ATTR_HIGHEST); mvwaddstr(win, y + 1, XPOS, _("(preferred todo display)")); break; + case DAYSEPARATOR: + custom_apply_attr(win, ATTR_HIGHEST); + mvwprintw(win, y, XPOS + strlen(opt[DAYSEPARATOR]), "%d", + conf.dayseparator); + custom_remove_attr(win, ATTR_HIGHEST); + mvwaddstr(win, y + 1, XPOS, + _("(lines between days in the appointments " + "panel)")); + break; + case EMPTY_APPT_LINE: + print_bool_option_incolor(win, conf.empty_appt_line, y, + XPOS + strlen(opt[EMPTY_APPT_LINE])); + mvwaddstr(win, y + 1, XPOS, + _("(insert an empty line after each appointment)")); + break; + case MULTIPLE_DAYS: + custom_apply_attr(win, ATTR_HIGHEST); + mvwprintw(win, y, XPOS + strlen(opt[MULTIPLE_DAYS]), "%d", + conf.multiple_days); + custom_remove_attr(win, ATTR_HIGHEST); + mvwaddstr(win, y + 1, XPOS, + _("(number of days (1..21) to display in the appointments " + "panel)")); + break; case AUTO_SAVE: print_bool_option_incolor(win, conf.auto_save, y, XPOS + strlen(opt[AUTO_SAVE])); @@ -626,14 +656,15 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d conf.periodic_save); custom_remove_attr(win, ATTR_HIGHEST); mvwaddstr(win, y + 1, XPOS, - _("(if not null, automatically save data every 'periodic_save' " - "minutes)")); + _("(if not null, automatically save data every " + "'periodic_save' minutes)")); break; case SYSTEM_EVENTS: print_bool_option_incolor(win, conf.systemevents, y, XPOS + strlen(opt[SYSTEM_EVENTS])); mvwaddstr(win, y + 1, XPOS, - _("(if YES, system events are turned into appointments (or else deleted))")); + _("(if YES, system events are turned into " + "appointments (or else deleted))")); break; case CONFIRM_QUIT: print_bool_option_incolor(win, conf.confirm_quit, y, @@ -762,6 +793,21 @@ static void general_option_edit(int i) ui_todo_set_view(conf.todo_view); ui_todo_load_items(); break; + case EMPTY_APPT_LINE: + conf.empty_appt_line = !conf.empty_appt_line; + break; + case MULTIPLE_DAYS: + if (conf.multiple_days == 21) + conf.multiple_days = 1; + else + conf.multiple_days++; + break; + case DAYSEPARATOR: + if (conf.dayseparator == 2) + conf.dayseparator = 0; + else + conf.dayseparator++; + break; case HEADING_POS: if (conf.heading_pos == RIGHT) conf.heading_pos = LEFT; |