Skip to content

Commit afa3da7

Browse files
committed
Corrections
1 parent c677ed1 commit afa3da7

3 files changed

Lines changed: 28 additions & 12 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM.groovy

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ import org.freeplane.plugin.script.proxy.ScriptUtils
1111

1212

1313
class ToM{
14-
14+
15+
// region: properties
16+
1517
static final c = ScriptUtils.c()
1618
static final String tabName = 'Tutorial'
1719

1820
static final Map styles = [
19-
tutorial : 'ToM-Tutorial' ,
20-
ini : 'ToM_' ,
21-
note : 'ToM_note' ,
22-
nextPage : 'ToM_nextPage' ,
23-
newPage : 'ToM_newPage' ,
24-
showMenu : 'ToM_showMenu' ,
25-
toc : 'ToM_TOC' ,
26-
goto : 'ToM_goto' ,
21+
tutorial : 'ToM-Tutorial' ,
22+
ini : 'ToM_' ,
23+
note : 'ToM_note' ,
24+
nextPage : 'ToM_nextPage' ,
25+
newPage : 'ToM_newPage' ,
26+
showMenu : 'ToM_showMenu' ,
27+
toc : 'ToM_TOC' ,
28+
goto : 'ToM_goto' ,
2729
action : 'ToM_menuAction',
2830
groovy : 'ToM_groovy' ,
2931
copyPaste : 'ToM_copy' ,
@@ -32,6 +34,8 @@ class ToM{
3234

3335
static final exeHowIcons = ['emoji-1F507', 'emoji-2328', 'emoji-1F5B1']
3436

37+
// end:
38+
3539
// region: getting tutorial components nodes
3640

3741
def static getNextTutNodes(n, boolean included = false){

Tutorial-o-Matic/src/main/groovy/ToM_actions.groovy

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class ToM_actions{
4141

4242
def static executeAction(infoAccion , how){
4343
waiting = true
44+
def timer = new Timer()
45+
c.statusInfo = " ToM: Executing '${infoAccion.label}' "
4446
switch(how){
4547
case ex.muted :
4648
execute(infoAccion.action)
@@ -52,14 +54,14 @@ class ToM_actions{
5254
def msgDisplayTime = 3000
5355
ToM_ui.showTextMessage("${infoAccion.keyStroke} : ${infoAccion.label}".toString(),msgDisplayTime)
5456
execute(infoAccion.action)
55-
sleep(msgDisplayTime)
56-
waiting = false
57+
timer.runAfter(msgDisplayTime){
58+
waiting = false
59+
}
5760
break // break is here, because if the action has not defined Hotkeys then it should show the menu way
5861
}
5962
case ex.showMenu :
6063
closeMenus(infoAccion.action)
6164
openMenus(infoAccion.action, pausa)
62-
def timer = new Timer()
6365
def espera = (infoAccion.path.size()*2)*pausa
6466
timer.runAfter(espera){
6567
execute(infoAccion.action)
@@ -82,6 +84,15 @@ class ToM_actions{
8284
executeActions(infoAccions , how)
8385
}
8486
}
87+
} else {
88+
if(!waiting){
89+
c.statusInfo = " ToM: Ready!! "
90+
} else {
91+
def timer = new Timer()
92+
timer.runAfter(200){
93+
executeActions(infoAccions , how)
94+
}
95+
}
8596
}
8697
}
8798

Tutorial-o-Matic/src/main/groovy/ToM_ui.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class ToM_ui{
8585
}
8686

8787
def static getHtmlFromNote(nodo){
88+
if(!nodo.note) return null
8889
def noteType = nodo.noteContentType
8990
def html
9091
switch (noteType){

0 commit comments

Comments
 (0)