Improve `agenda-files' comprehension

This commit is contained in:
Renaud Casenave-Péré 2022-09-04 21:26:12 +02:00
parent f8dfa0df41
commit 9a904ee756
3 changed files with 16 additions and 5 deletions

View file

@ -4,14 +4,18 @@
(set-config-package :sextant/options/options)
(defconfig agenda-files '()
(defconfig agenda-files '("~/Documents/")
:validate ((path) (not (null (probe-file path))))
:get ((index) (nth index agenda-files))
:set ((index path)
(when (validate-agenda-files path)
(loop while (<= (length agenda-files) index)
do (setf agenda-files (append agenda-files '(""))))
(setf (nth index agenda-files) path))))
(let ((path (if (and (uiop:directory-pathname-p (probe-file path))
(not (uiop:directory-pathname-p (parse-namestring path))))
(concatenate 'string path "/")
path)))
(loop while (<= (length agenda-files) index)
do (setf agenda-files (append agenda-files '(""))))
(setf (nth index agenda-files) path)))))
(defconfig undo-history-size 100)
(defconfig recent-files-size 10)

View file

@ -74,6 +74,13 @@ Dialog {
}
}
}
Label {
id: agendaFilesHist
width: parent.width
text: qsTr("Customize directories list in Settings page.")
wrapMode: Text.Wrap
}
}
onAccepted: {

View file

@ -21,7 +21,7 @@ Page {
}
ListTextField {
label: "Agenda files"
label: "Agenda files or directories"
getter: "options:get-agenda-files"
setter: "options:set-agenda-files"
}