Added note folder setting for more transparency

This commit is contained in:
Maboroshy 2017-09-14 22:24:49 +03:00 committed by GitHub
parent 65ce04845e
commit 96abe16fa7
1 changed files with 23 additions and 5 deletions

View File

@ -9,7 +9,6 @@ Script {
return '' return ''
} }
/// TODO Change to platform dependant defaults without checking
function setDefaultPyCommand() { function setDefaultPyCommand() {
if (script.getPersistentVariable('MdNT/pyCommand', '') == '') { if (script.getPersistentVariable('MdNT/pyCommand', '') == '') {
script.setPersistentVariable('MdNT/pyCommand', checkPyCommand()) script.setPersistentVariable('MdNT/pyCommand', checkPyCommand())
@ -18,6 +17,7 @@ Script {
} }
property string scriptDirPath property string scriptDirPath
property string noteFolder
property string inboxFolder property string inboxFolder
property bool scanFolder property bool scanFolder
property bool watchFS property bool watchFS
@ -27,11 +27,19 @@ Script {
property string pandocVersion property string pandocVersion
property variant settingsVariables: [ property variant settingsVariables: [
{
'identifier': 'noteFolder',
'name': 'Note folder path',
'description': 'Full absolute path to note folder to process. You can select "notes.sqlite" file or type the path in.\n' +
"Leave empty for current note folder. Continuous watch mode won't work if empty.",
'type': 'file',
'default': '',
},
{ {
'identifier': 'inboxFolder', 'identifier': 'inboxFolder',
'name': 'Inbox folder name', 'name': 'Inbox folder name',
'description': 'Name of inbox folder located in the root of note folder. It is single for all note folders\n' + 'description': 'Name of inbox folder located in the root of note folder. It is single for all note folders.\n' +
'An empty inbox folder will be created if no exists.', 'An new inbox folder will be created if no exists.',
'type': 'string', 'type': 'string',
'default': 'Inbox', 'default': 'Inbox',
}, },
@ -77,8 +85,9 @@ Script {
] ]
function runInbox() { function runInbox() {
var pyScriptPath = scriptDirPath + script.dirSeparator() + 'inbox.py' var pyScriptPath = scriptDirPath + script.dirSeparator() + 'inbox.py'
var inboxPath = script.currentNoteFolderPath() + script.dirSeparator() + inboxFolder var inboxPath = noteFolder + script.dirSeparator() + inboxFolder
var args = [pyScriptPath, var args = [pyScriptPath,
'--inbox', inboxPath, '--inbox', inboxPath,
@ -103,6 +112,15 @@ Script {
} }
function init() { function init() {
if (noteFolder == '') {
noteFolder = script.currentNoteFolderPath()
watchFS = false
}
else {
noteFolder = noteFolder.replace(script.dirSeparator() + 'notes.sqlite', '')
}
/// Check if set pyCommand can run Python 3 /// Check if set pyCommand can run Python 3
if (script.getPersistentVariable('MdNT/pyCommand', '') != pyCommand) { if (script.getPersistentVariable('MdNT/pyCommand', '') != pyCommand) {
@ -158,4 +176,4 @@ Script {
runInbox() runInbox()
} }
} }
} }