1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-21 23:48:08 +00:00

added new script disable-readonly-mode

This commit is contained in:
Patrizio Bekerle 2018-08-05 09:11:18 +02:00
parent 9e13c4042d
commit 8607f65dae
No known key found for this signature in database
GPG key ID: 2E9FFD770DABE838
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import QtQml 2.0
import QOwnNotesTypes 1.0
/**
* This script will disable the read-only mode if a note is double clicked
*/
Script {
/**
* This function is called after a note was double clicked
*
* @param {NoteApi} note - the note object that was clicked
*/
function noteDoubleClickedHook(note) {
// disable the read-only mode
script.triggerMenuAction("actionAllow_note_editing", 1);
// focus the note text edit
mainWindow.focusNoteTextEdit();
}
}

View file

@ -0,0 +1,9 @@
{
"name": "Disable read-only mode",
"identifier": "disable-readonly-mode",
"script": "disable-readonly-mode.qml",
"authors": ["@pbek"],
"version": "1.0.0",
"minAppVersion": "18.08.1",
"description" : "This script will disable the read-only mode if a note is double clicked. The note text edit will also be focused afterwards."
}