summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-09-15 15:43:03 +0000
committerFrederic Culot <calcurse@culot.org>2006-09-15 15:43:03 +0000
commitcb4a5d511b031425c75a066d9b07c0158ca3820d (patch)
tree69c025c0c2ec1cb91f7d20e67841afce7c02fe23
parentebcc972941cf0ef0bbd30b0b649df3f7b1e99b95 (diff)
downloadcalcurse-cb4a5d511b031425c75a066d9b07c0158ca3820d.tar.gz
calcurse-cb4a5d511b031425c75a066d9b07c0158ca3820d.zip
save_cal() updated to save notify-bar user settings
-rwxr-xr-xsrc/io.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index d16c62c..071b173 100755
--- a/src/io.c
+++ b/src/io.c
@@ -1,4 +1,4 @@
-/* $calcurse: io.c,v 1.6 2006/09/12 15:04:16 culot Exp $ */
+/* $calcurse: io.c,v 1.7 2006/09/15 15:43:03 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -25,6 +25,7 @@
*/
#include <ncurses.h>
+#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -190,6 +191,30 @@ save_cal(bool auto_save, bool confirm_quit,
"\n# This is the layout of the calendar (1 to 4) :\n");
fprintf(data_file, "layout=\n");
fprintf(data_file, "%d\n", layout);
+
+ // notify-bar user settings
+ pthread_mutex_lock(&nbar->mutex);
+ fprintf(data_file,
+ "\n# If this option is set to yes, notify-bar will be displayed :\n");
+ fprintf(data_file, "notify-bar_show=\n");
+ fprintf(data_file, "%s\n", (nbar->show) ? "yes" : "no");
+
+ fprintf(data_file,
+ "\n# Format of the date to be displayed inside notify-bar :\n");
+ fprintf(data_file, "notify-bar_date=\n");
+ fprintf(data_file, "%s\n", nbar->datefmt);
+
+ fprintf(data_file,
+ "\n# Format of the time to be displayed inside notify-bar :\n");
+ fprintf(data_file, "notify-bar_clock=\n");
+ fprintf(data_file, "%s\n", nbar->timefmt);
+
+ fprintf(data_file,
+ "\n# Warn user if he has an appointment within next 'notify-bar_warning' seconds :\n");
+ fprintf(data_file, "notify-bar_warning=\n");
+ fprintf(data_file, "%d\n", nbar->cntdwn);
+ pthread_mutex_unlock(&nbar->mutex);
+
fclose(data_file);
}