[dasher: 92/217] Removed obsolete parameters for control box configuration.



commit 106081a942783ac4d3fbb1f66047e4583757f4a9
Author: ipomoena <amajorek google com>
Date:   Sat Oct 17 15:05:17 2015 -0700

    Removed obsolete parameters for control box configuration.
    
    Users have much better control over control box content by editing
    control.xml.
    Soon it will be possible to choose from multiple ready made
    control.*.xml files. Similar to choosing color scheme now.
    Removed params:
    BP_CONTROL_MODE_HAS_COPY, BP_CONTROL_MODE_HAS_SPEECH,
    BP_CONTROL_MODE_HAS_HALT, BP_CONTROL_MODE_HAS_EDIT

 Src/DasherCore/Parameters.cpp            |    8 ------
 Src/DasherCore/Parameters.h              |    1 -
 Src/Gtk2/Preferences.cpp                 |    4 ---
 Src/Win32/Widgets/AdvancedPage.cpp       |    1 -
 Src/iPhone/Classes/ActionConfigurator.mm |   36 +++++------------------------
 5 files changed, 7 insertions(+), 43 deletions(-)
---
diff --git a/Src/DasherCore/Parameters.cpp b/Src/DasherCore/Parameters.cpp
index 9dd8ca3..3e6aee1 100644
--- a/Src/DasherCore/Parameters.cpp
+++ b/Src/DasherCore/Parameters.cpp
@@ -50,14 +50,6 @@ const bp_table boolparamtable[] = {
   {BP_COPY_ALL_ON_STOP, "CopyOnStop", false, "Copy all text to clipboard whenever we stop"},
   {BP_SPEAK_ALL_ON_STOP, "SpeakOnStop", false, "Speak all text whenever we stop"},
   {BP_SPEAK_WORDS, "SpeakWords", false, "Speak words as they are written"},
-  {BP_CONTROL_MODE_HAS_HALT, "ControlHasHalt", false, "Force Control Mode to provide a stop action 
(triggering clipboard/speech)"},
-#ifdef TARGET_OS_MAC
-  {BP_CONTROL_MODE_HAS_EDIT, "ControlHasEdit", false, "Provide editing functions in control mode (forward 
&amp; backward movement &amp; deletion)"},
-#else
-  {BP_CONTROL_MODE_HAS_EDIT, "ControlHasEdit", true, "Provide editing functions in control mode (forward 
&amp; backward movement &amp; deletion)"},
-#endif
-  {BP_CONTROL_MODE_HAS_COPY, "ControlHasCopy", true, "Provide copy-to-clipboard actions in Control Mode (if 
platforms supports)"},
-  {BP_CONTROL_MODE_HAS_SPEECH, "ControlHasSpeech", true, "Provide speech actions in Control Mode (if 
platform supports)"},
   {BP_GAME_HELP_DRAW_PATH, "GameDrawPath", true, "When we give help, show the shortest path to the target 
sentence"},
   {BP_TWO_PUSH_RELEASE_TIME, "TwoPushReleaseTime", false, "Use push and release times of single press rather 
than push times of two presses"},
 };
diff --git a/Src/DasherCore/Parameters.h b/Src/DasherCore/Parameters.h
index 7114a48..547ed0b 100644
--- a/Src/DasherCore/Parameters.h
+++ b/Src/DasherCore/Parameters.h
@@ -41,7 +41,6 @@ enum {
   BP_STOP_OUTSIDE, BP_BACKOFF_BUTTON,
   BP_TWOBUTTON_REVERSE, BP_2B_INVERT_DOUBLE, BP_SLOW_START,
   BP_COPY_ALL_ON_STOP, BP_SPEAK_ALL_ON_STOP, BP_SPEAK_WORDS,
-  BP_CONTROL_MODE_HAS_HALT, BP_CONTROL_MODE_HAS_EDIT, BP_CONTROL_MODE_HAS_COPY, BP_CONTROL_MODE_HAS_SPEECH,
   BP_GAME_HELP_DRAW_PATH, BP_TWO_PUSH_RELEASE_TIME,
   END_OF_BPS
 };
diff --git a/Src/Gtk2/Preferences.cpp b/Src/Gtk2/Preferences.cpp
index f905a75..da196c6 100644
--- a/Src/Gtk2/Preferences.cpp
+++ b/Src/Gtk2/Preferences.cpp
@@ -48,10 +48,6 @@ BoolTranslation sBoolTranslationTable[] = {
   {BP_STOP_OUTSIDE, "winpausebutton", NULL},
   {BP_AUTO_SPEEDCONTROL, "adaptivebutton", NULL},
   {BP_LM_ADAPTIVE, "cb_adaptive", NULL},
-  {BP_CONTROL_MODE_HAS_COPY,"control_has_copy",NULL},
-  {BP_CONTROL_MODE_HAS_SPEECH,"control_has_speech",NULL},
-  {BP_CONTROL_MODE_HAS_HALT,"control_has_halt",NULL},
-  {BP_CONTROL_MODE_HAS_EDIT,"control_has_edit",NULL},
   {BP_COPY_ALL_ON_STOP,"copy_all_on_stop",NULL},
   {BP_SPEAK_ALL_ON_STOP,"speak_all_on_stop",NULL},
   {BP_SPEAK_WORDS,"speak_words",NULL}
diff --git a/Src/Win32/Widgets/AdvancedPage.cpp b/Src/Win32/Widgets/AdvancedPage.cpp
index 40f10e9..94ebd0d 100644
--- a/Src/Win32/Widgets/AdvancedPage.cpp
+++ b/Src/Win32/Widgets/AdvancedPage.cpp
@@ -46,7 +46,6 @@ static menuentry menutable[] = {
   {BP_SPEAK_WORDS, IDC_CHECK4},
   {BP_SPEAK_ALL_ON_STOP, IDC_CHECK3},
   {BP_COPY_ALL_ON_STOP, IDC_COPYONSTOP}
-//ACL TODO BP_CONTROL_MODE_HAS_HALT, BP_CONTROL_MODE_HAS_SPEECH, BP_CONTROL_MODE_HAS_COPY - and perhaps 
automatically disable the latter two in direct mode, too?
 };
 
 std::string CAdvancedPage::GetControlText(HWND Dialog, int ControlID) 
diff --git a/Src/iPhone/Classes/ActionConfigurator.mm b/Src/iPhone/Classes/ActionConfigurator.mm
index 6444436..1c73fa7 100644
--- a/Src/iPhone/Classes/ActionConfigurator.mm
+++ b/Src/iPhone/Classes/ActionConfigurator.mm
@@ -11,7 +11,6 @@
 #import "DasherAppDelegate.h"
 #import "DasherUtil.h"
 
-int CONTROL_MODE_BPS[] = {BP_CONTROL_MODE_HAS_COPY, BP_CONTROL_MODE_HAS_SPEECH, BP_CONTROL_MODE_HAS_HALT, 
BP_CONTROL_MODE_HAS_EDIT};
 int OTHER_BPS[] = {BP_COPY_ALL_ON_STOP, BP_SPEAK_ALL_ON_STOP, BP_SPEAK_WORDS};
 
 using Dasher::Settings::GetParameterName;
@@ -84,23 +83,14 @@ using Dasher::Settings::GetParameterName;
     label.backgroundColor = [UIColor clearColor];
     label.text = [self tableView:tableView titleForHeaderInSection:section];
     [header addSubview:label];
-    if (section==0) {
-      UISwitch *sw = [[[UISwitch alloc] initWithFrame:CGRectMake(210.0,10.0,100.0,20.0)] autorelease];
-      //Add 1 For consistency with switches constructed for other params
-      sw.tag=BP_CONTROL_MODE+1;
-      sw.on=[DasherAppDelegate theApp].dasherInterface->GetBoolParameter(BP_CONTROL_MODE);
-      [sw addTarget:self action:@selector(paramSlid:) forControlEvents:UIControlEventValueChanged];
-      [header addSubview:sw];
-    }
   }
   return headers[section];
 }
 
 - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
   switch (section) {
-    case 0: return @"Control Mode";
-    case 1: return @"Triggers";
-    case 2: return @"Actions Menu";
+    case 0: return @"Triggers";
+    case 1: return @"Actions Menu";
   }
 }
 
@@ -110,16 +100,14 @@ using Dasher::Settings::GetParameterName;
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     // Return the number of sections.
-    return 3;
+    return 2;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
   switch (section) {
     case 0:
-      return sizeof(CONTROL_MODE_BPS)/sizeof(CONTROL_MODE_BPS[0]);
-    case 1:
       return sizeof(OTHER_BPS)/sizeof(OTHER_BPS[0]);
-    case 2:
+    case 1:
       return numActions;
   }
 }
@@ -143,7 +131,7 @@ using Dasher::Settings::GetParameterName;
     }
   sw.enabled=YES;
   // Configure the cell...
-    if ([indexPath section]==2) {
+    if ([indexPath section]==1) {
       SAction *act = &actions[ [indexPath row] ];
       [sw addTarget:self action:@selector(actionSlid:) forControlEvents:UIControlEventValueChanged];
       cell.textLabel.text = act->dispName;
@@ -154,12 +142,8 @@ using Dasher::Settings::GetParameterName;
     } else {
       CDasherInterfaceBridge *intf=[DasherAppDelegate theApp].dasherInterface;
       int *params;
-      if ([indexPath section]==0) {
-        params=CONTROL_MODE_BPS;
-        sw.enabled = intf->GetBoolParameter(BP_CONTROL_MODE);
-      } else {
-        DASHER_ASSERT([indexPath section]==1);
-        params=OTHER_BPS;
+      DASHER_ASSERT([indexPath section]==0);
+      params=OTHER_BPS;
       }
       int iParameter = params[[indexPath row]];
       [sw addTarget:self action:@selector(paramSlid:) forControlEvents:UIControlEventValueChanged];
@@ -194,12 +178,6 @@ using Dasher::Settings::GetParameterName;
         break;
       }
     }
-    for (int i=0; i<sizeof(CONTROL_MODE_BPS)/sizeof(CONTROL_MODE_BPS[0]); i++) {
-      UITableViewCell *cell=[tv cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
-      UISwitch *sw2=(UISwitch *)[cell.contentView viewWithTag:cell.tag];
-      DASHER_ASSERT([sw2 isKindOfClass:[UISwitch class]]);
-      sw2.enabled=sw.on;
-    }
   }
 }
 


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