aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-08-09 20:32:14 +0200
committerAdrian Kummerlaender2015-08-09 20:32:14 +0200
commita426875daba0cb923435be835f0100fe13a6255a (patch)
treef4c62ca9a365cf7f86af13658378095415ea1d65
parentb911109321dd438ff3a7d389e8c6f17097769286 (diff)
downloadMetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar.gz
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar.bz2
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar.lz
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar.xz
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.tar.zst
MetaTerm-a426875daba0cb923435be835f0100fe13a6255a.zip
Return to normal mode after command evaluation
Requires new `executed` signal in `CommandInput` component to correctly trigger the state change.
-rw-r--r--qml/CommandInput.qml4
-rw-r--r--qml/StateHandler.qml4
-rw-r--r--qml/main.qml2
3 files changed, 10 insertions, 0 deletions
diff --git a/qml/CommandInput.qml b/qml/CommandInput.qml
index e7defbf..5010891 100644
--- a/qml/CommandInput.qml
+++ b/qml/CommandInput.qml
@@ -7,6 +7,8 @@ import "commands.js" as Commands
Item {
id: item
+ signal executed
+
visible: false
Settings {
@@ -62,6 +64,8 @@ Item {
console.log('"' + prefix + '"' + " is not a command prefix");
}
}
+
+ item.executed();
}
}
}
diff --git a/qml/StateHandler.qml b/qml/StateHandler.qml
index 75c5d6b..04215df 100644
--- a/qml/StateHandler.qml
+++ b/qml/StateHandler.qml
@@ -30,6 +30,10 @@ Item {
enterInsertAction.trigger();
}
+ function enterNormalMode() {
+ enterNormalAction.trigger();
+ }
+
states: [
State {
name: "NORMAL"
diff --git a/qml/main.qml b/qml/main.qml
index 3f3b5a9..c04e6dd 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -40,6 +40,8 @@ ApplicationWindow {
Layout.fillWidth: true
height: 20
+
+ onExecuted: state.enterNormalMode()
}
}