[dasher: 69/217] Control.xml updated to contain previously hardcoded commands.



commit 36c560d4d1ffc8c131946a8bfde5e311f96c41de
Author: ipomoena <amajorek google com>
Date:   Thu Oct 15 12:42:22 2015 -0700

    Control.xml updated to contain previously hardcoded commands.
    
    Also added default nodes if parsing control.xml fails

 Data/control/control.xml          |   56 +++++++++++++++++++++++++++++++++++-
 Src/DasherCore/ControlManager.cpp |    8 +++++
 2 files changed, 62 insertions(+), 2 deletions(-)
---
diff --git a/Data/control/control.xml b/Data/control/control.xml
index 5c88aff..f98f30b 100644
--- a/Data/control/control.xml
+++ b/Data/control/control.xml
@@ -1,6 +1,58 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <nodes>
-<node name="CTL_MOVE" label="Move" color="-1">
+  <alph/>
+  <node label="Pause" color="241">
+    <pause/>
+    <alph/>
+    <root/>
+  </node>
+  <node label="Stop" color="242">
+    <stop/>
+    <alph/>
+    <root/>
+  </node>
+  <node label="Speak" color="-1">
+    <node label="All" color="-1">
+      <speak what="all"/>
+      <alph/>
+      <root/>
+    </node>
+    <node label="New" color="-1">
+      <speak what="new"/>
+      <alph/>
+      <root/>
+    </node>
+    <node label="Repeat" color="-1">
+      <speak what="repeat"/>
+      <alph/>
+      <root/>
+    </node>
+    <node label="Cancel" color="242">
+      <speak what="cancel"/>
+      <alph/>
+      <root/>
+    </node>
+  </node>
+
+  <node label="Copy" color="-1">
+    <node label="All" color="-1">
+      <copy what="all"/>
+      <alph/>
+      <root/>
+    </node>
+    <node label="New" color="-1">
+      <copy what="new"/>
+      <alph/>
+      <root/>
+    </node>
+    <node label="Repeat" color="-1">
+      <copy what="repeat"/>
+      <alph/>
+      <root/>
+    </node>
+  </node>
+  
+  <node name="CTL_MOVE" label="Move" color="-1">
   <node name="CTL_MOVE_FORWARD" label="&#x2192;" color="-1">
     <node label="&#x25B8;" color="-1">
       <move forward="yes" dist="char"/>
@@ -108,7 +160,7 @@
     </node>
   </node>
 </node>
-<node label="New">
+<node label="New" color="-1">
   <delete forward="yes" dist="file"/>
   <delete forward="no" dist="file"/>
   <alph/>
diff --git a/Src/DasherCore/ControlManager.cpp b/Src/DasherCore/ControlManager.cpp
index bb2d8a0..68828bb 100644
--- a/Src/DasherCore/ControlManager.cpp
+++ b/Src/DasherCore/ControlManager.cpp
@@ -402,9 +402,17 @@ void CControlManager::updateActions() {
   // reimplement if yes 
   // imo with control.xml it isn't.
   GetRootTemplate()->successors.clear();
+
   for (auto pNode : parsedNodes())
     GetRootTemplate()->successors.push_back(pNode);
 
+  // If nothing was read from control.xml, add alphabet and control box
+  if (GetRootTemplate()->successors.empty())
+  {
+    GetRootTemplate()->successors.push_back(NULL);
+    GetRootTemplate()->successors.push_back(GetRootTemplate());
+  }
+
   if (CDasherScreen *pScreen = m_pScreen) {
     //hack to make ChangeScreen do something
     m_pScreen = NULL; //i.e. make it think the screen has changed


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]