aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/config.c b/src/config.c
index c6914f5..4e0f7db 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2017 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,8 @@
#include <ctype.h>
#include <unistd.h>
+#include <string.h>
+#include <strings.h>
#include "calcurse.h"
@@ -109,6 +111,7 @@ static const struct confvar confmap[] = {
{"format.inputdate", config_parse_input_datefmt, config_serialize_input_datefmt, NULL},
{"format.notifydate", CONFIG_HANDLER_STR(nbar.datefmt)},
{"format.notifytime", CONFIG_HANDLER_STR(nbar.timefmt)},
+ {"format.appointmenttime", CONFIG_HANDLER_STR(conf.timefmt)},
{"format.outputdate", config_parse_output_datefmt, config_serialize_output_datefmt, NULL},
{"format.dayheading", CONFIG_HANDLER_STR(conf.day_heading)},
{"general.autogc", CONFIG_HANDLER_BOOL(conf.auto_gc)},
@@ -119,7 +122,6 @@ static const struct confvar confmap[] = {
{"general.multipledays", CONFIG_HANDLER_BOOL(conf.multiple_days)},
{"general.periodicsave", CONFIG_HANDLER_UNSIGNED(conf.periodic_save)},
{"general.systemevents", CONFIG_HANDLER_BOOL(conf.systemevents)},
- {"general.systemdialogs", CONFIG_HANDLER_BOOL(conf.system_dialogs)},
{"notification.command", CONFIG_HANDLER_STR(nbar.cmd)},
{"notification.notifyall", config_parse_notifyall, config_serialize_notifyall, NULL},
{"notification.warning", CONFIG_HANDLER_INT(nbar.cntdwn)}
@@ -261,14 +263,16 @@ static int config_parse_default_panel(void *dummy, const char *val)
static int config_parse_first_day_of_week(void *dummy, const char *val)
{
- if (!strcmp(val, "monday"))
- ui_calendar_set_first_day_of_week(MONDAY);
- else if (!strcmp(val, "sunday"))
- ui_calendar_set_first_day_of_week(SUNDAY);
- else
- return 0;
+ int i;
- return 1;
+ for (i = 0; i < WEEKINDAYS; i++) {
+ if(!strcasecmp(val, get_wday_default_string(i))) {
+ ui_calendar_set_first_day_of_week(i);
+ return 1;
+ }
+ }
+
+ return 0;
}
static int config_parse_color_theme(void *dummy, const char *val)
@@ -468,10 +472,9 @@ static int config_serialize_default_panel(char **buf, void *dummy)
static int config_serialize_first_day_of_week(char **buf, void *dummy)
{
- if (ui_calendar_week_begins_on_monday())
- *buf = mem_strdup("monday");
- else
- *buf = mem_strdup("sunday");
+ *buf = mem_strdup(get_wday_default_string(ui_calendar_get_wday_start()));
+ /* now stores string with uppercase first letter, changing to lower */
+ **buf = tolower(**buf);
return 1;
}
@@ -615,7 +618,8 @@ config_file_walk(config_fn_walk_cb_t fn_cb,
* Backwards compatibility for removed configuration options:
* ignored on load, omitted on save.
*/
- if (strcmp(key, "general.progressbar") == 0)
+ if (strcmp(key, "general.progressbar") == 0 ||
+ strcmp(key, "general.systemdialogs") == 0)
continue;
if (value && (*value == '\0' || *value == '\n')) {