Make heading in appointments panel configurable
Add a new configuration variable format.dayheading to set the format of the date displayed at the top of the event and appointment list. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
committed by
Lukas Fleischer
parent
550a2e9379
commit
d56cc7acfe
20
src/custom.c
20
src/custom.c
@@ -531,6 +531,7 @@ enum {
|
||||
FIRST_DAY_OF_WEEK,
|
||||
OUTPUT_DATE_FMT,
|
||||
INPUT_DATE_FMT,
|
||||
DAY_HEADING_FMT,
|
||||
NB_OPTIONS
|
||||
};
|
||||
|
||||
@@ -550,7 +551,8 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
|
||||
"general.progressbar = ",
|
||||
"general.firstdayofweek = ",
|
||||
"format.outputdate = ",
|
||||
"format.inputdate = "
|
||||
"format.inputdate = ",
|
||||
"format.dayheading = "
|
||||
};
|
||||
const char *panel;
|
||||
|
||||
@@ -654,6 +656,14 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
|
||||
datefmt_str[0], datefmt_str[1], datefmt_str[2],
|
||||
datefmt_str[3]);
|
||||
break;
|
||||
case DAY_HEADING_FMT:
|
||||
custom_apply_attr(win, ATTR_HIGHEST);
|
||||
mvwaddstr(win, y, XPOS + strlen(opt[DAY_HEADING_FMT]),
|
||||
conf.day_heading);
|
||||
custom_remove_attr(win, ATTR_HIGHEST);
|
||||
mvwaddstr(win, y + 1, XPOS,
|
||||
_("(Format of the date displayed in the appointments panel)"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (hilt)
|
||||
@@ -752,6 +762,14 @@ static void general_option_edit(int i)
|
||||
if (val != -1)
|
||||
conf.input_datefmt = val;
|
||||
break;
|
||||
case DAY_HEADING_FMT:
|
||||
status_mesg(output_datefmt_str, "");
|
||||
strcpy(buf, conf.day_heading);
|
||||
if (updatestring(win[STA].p, &buf, 0, 1) == 0) {
|
||||
strcpy(conf.day_heading, buf);
|
||||
}
|
||||
status_mesg(number_str, keys);
|
||||
break;
|
||||
}
|
||||
|
||||
mem_free(buf);
|
||||
|
||||
Reference in New Issue
Block a user