mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-11-14 13:58:07 +00:00
29 lines
801 B
QML
29 lines
801 B
QML
import QtQml 2.0
|
|
|
|
/**
|
|
* This script creates a menu item and a button that adds a "favorite" tag to the current note
|
|
*/
|
|
QtObject {
|
|
/**
|
|
* Initializes the custom action
|
|
*/
|
|
function init() {
|
|
// create the menu entry
|
|
script.registerCustomAction("favoriteNote", "Favorite note", "fav", "bookmark-new");
|
|
}
|
|
|
|
/**
|
|
* This function is invoked when a custom action is triggered
|
|
* in the menu or via button
|
|
*
|
|
* @param identifier string the identifier defined in registerCustomAction
|
|
*/
|
|
function customActionInvoked(identifier) {
|
|
switch (identifier) {
|
|
// add a "favorite" tag to the current note
|
|
case "favoriteNote":
|
|
script.tagCurrentNote("favorite");
|
|
break;
|
|
}
|
|
}
|
|
}
|