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:
parent
9e13c4042d
commit
8607f65dae
2 changed files with 29 additions and 0 deletions
20
disable-readonly-mode/disable-readonly-mode.qml
Normal file
20
disable-readonly-mode/disable-readonly-mode.qml
Normal 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();
|
||||
}
|
||||
}
|
9
disable-readonly-mode/info.json
Normal file
9
disable-readonly-mode/info.json
Normal 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."
|
||||
}
|
Loading…
Reference in a new issue