Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new scripting command inputDialogGetItem
- Loading branch information
Showing
5 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import QtQml 2.0 | ||
import QOwnNotesTypes 1.0 | ||
|
||
/** | ||
* This example script with input dialogs as custom actions | ||
*/ | ||
Script { | ||
/** | ||
* Initializes the custom actions | ||
*/ | ||
function init() { | ||
script.registerCustomAction("inputDialogGetItem", "Combo box"); | ||
} | ||
|
||
/** | ||
* 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) { | ||
script.log("customActionInvoked - " + identifier); | ||
|
||
switch (identifier) { | ||
// open an input dialog with a select box | ||
case "inputDialogGetItem": | ||
var result = script.inputDialogGetItem( | ||
"combo box", "Please select an item", ["Item 1", "Item 2", "Item 3"]); | ||
script.log(result); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters