lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Tue, 7 Jun 2016 21:35:10 +0000 (UTC)

branch: master
commit b2deaa1facb8968e64acd1bdde95954e846644f4
Author: Gregory W. Chicares <address@hidden>
Date:   Tue Jun 7 21:34:06 2016 +0000

    Attempt to show name of control in Transferror warnings [433]
    
    See:
      http://lists.nongnu.org/archive/html/lmi/2016-06/msg00034.html
---
 transferor.cpp |   33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

diff --git a/transferor.cpp b/transferor.cpp
index b68c48d..62c7bc2 100644
--- a/transferor.cpp
+++ b/transferor.cpp
@@ -235,10 +235,9 @@ namespace
         return true;
     }
 
-    // TODO ?? Explain why this uses "Yes" and "No" instead of
-    // true and false, or change it to support bool, e.g.
-    //   control.SetValue(numeric_io_cast<bool>(data));
-    //   data = numeric_io_cast<std::string>(control.GetValue());
+    // This uses "Yes" and "No" instead of true and false or 1 and 0,
+    // because the capitalized English words seem clearer for humans
+    // who read the xml files that store the data edited here.
     //
     template<typename T>
     bool TransferBool(transfer_direction td, std::string& data, T& control)
@@ -256,10 +255,8 @@ namespace
             else
                 {
                 warning()
-                    << "Boolean data is unexpectedly numeric"
-// TODO ?? Show the offending control's name (unavailable for now).
-//                    << " for control '" << name() << "'"
-                    << "."
+                    << "Control '" << control.GetLabel() << "':"
+                    << " expected 'Yes' or 'No', but got '" << data << "'."
                     << LMI_FLUSH
                     ;
                 return false;
@@ -298,12 +295,8 @@ namespace
             else
                 {
                 warning()
-                    << "String '"
-                    << data
-                    << "' not found"
-// TODO ?? Show the offending control's name (unavailable for now).
-//                    << " for control '" << name() << "'"
-                    << "."
+                    << "Control '" << control.GetLabel() << "':"
+                    << " invalid entry '" << data << "'."
                     << LMI_FLUSH
                     ;
                 return false;
@@ -338,9 +331,7 @@ namespace
         if(!(wxLB_SINGLE & control.GetWindowStyle()))
             {
             fatal_error()
-                << "CheckListBox"
-// TODO ?? Show the offending control's name (unavailable for now).
-//                << "Control '" << name() << "'"
+                << "CheckListBox '" << control.GetLabel() << "':"
                 << " must be constrained to a single selection."
                 << LMI_FLUSH
                 ;
@@ -358,9 +349,7 @@ namespace
         if(!(wxCB_READONLY & control.GetWindowStyle()))
             {
             fatal_error()
-                << "ComboBox"
-// TODO ?? Show the offending control's name (unavailable for now).
-//                << "Control '" << name() << "'"
+                << "ComboBox '" << control.GetLabel() << "':"
                 << " must be read only."
                 << LMI_FLUSH
                 ;
@@ -422,9 +411,7 @@ namespace
         if(!(wxLB_SINGLE & control.GetWindowStyle()))
             {
             fatal_error()
-                << "ListBox"
-// TODO ?? Show the offending control's name (unavailable for now).
-//                << "Control '" << name() << "'"
+                << "ListBox '" << control.GetLabel() << "':"
                 << " must be constrained to a single selection."
                 << LMI_FLUSH
                 ;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]