changeset 3081:29b1ad0ac76d

* standalone/wxwin/configitem.cpp: Escape newline chars in CDL values for display and in-cell editing. [ Bugzilla 1001144 ] * standalone/wxwin/mainwin.cpp, standalone/wxwin/configtool.cpp: Update copyright strings.
author jld
date Mon, 07 Feb 2011 12:44:34 +0000
parents 5698d1884c8c
children c6285e8d86d2
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/wxwin/configitem.cpp host/tools/configtool/standalone/wxwin/configtool.cpp host/tools/configtool/standalone/wxwin/mainwin.cpp
diffstat 4 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-07  John Dallaway  <john@dallaway.org.uk>
+
+	* standalone/wxwin/configitem.cpp: Escape newline chars in CDL
+	values for display and in-cell editing. [ Bugzilla 1001144 ]
+	* standalone/wxwin/mainwin.cpp, standalone/wxwin/configtool.cpp:
+	Update copyright strings.
+
 2010-09-10  John Dallaway  <john@dallaway.org.uk>
 
 	* standalone/wxwin/configtooldoc.cpp: Allow import/export of
--- a/host/tools/configtool/standalone/wxwin/configitem.cpp
+++ b/host/tools/configtool/standalone/wxwin/configitem.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2006, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -434,6 +434,7 @@ wxString ecConfigItem::GetDisplayValue()
         {
             if (GetCdlValuable())
                 str = StringValue();
+                str.Replace("\n", "\\n"); // escape any newline chars (eg CYGDAT_UITRON_TASK_INITIALIZERS)
         }
         break;
     default:
@@ -610,7 +611,9 @@ bool ecConfigItem::TransferDataFromWindo
         wxASSERT ( GetOptionType() == ecString );
 
         // TODO: do checking
-        doc->SetValue(*this, win->GetValue());
+        wxString str(win->GetValue());
+        str.Replace("\\n", "\n"); // remove escaping of newline chars
+        doc->SetValue(*this, str);
     }
     else if (window->IsKindOf(CLASSINFO(ecDoubleEditorCtrl)))
     {
@@ -1380,6 +1383,7 @@ void ecTextEditorCtrl::OnLeftDClick(wxMo
     ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
     
     wxString initialValue(GetValue());
+    initialValue.Replace("\\n", "\n"); // remove escaping of newline chars
     
     ecEditStringDialog dialog(initialValue, wxGetApp().GetTopWindow(), ecID_EDIT_STRING_DIALOG);
     if (dialog.ShowModal() == wxID_OK)
--- a/host/tools/configtool/standalone/wxwin/configtool.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtool.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -284,7 +284,7 @@ bool ecApp::OnInit()
         wxLog::SetActiveTarget(new wxLogStderr);
 #endif
         wxString msg;
-        msg.Printf(wxT("eCos Configuration Tool (c) Free Software Foundation, Inc., 1998-2009 Version %s, %s"), ecCONFIGURATION_TOOL_VERSION, __DATE__);
+        msg.Printf(wxT("eCos Configuration Tool (c) Free Software Foundation, Inc., 1998-2011 Version %s, %s"), ecCONFIGURATION_TOOL_VERSION, __DATE__);
         wxLogMessage(msg);
         return FALSE;
     }
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -1,7 +1,7 @@
 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
 // -------------------------------------------                              
 // This file is part of the eCos host tools.                                
-// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
@@ -571,7 +571,7 @@ void ecMainFrame::OnAbout(wxCommandEvent
 	int iTclVerMajor, iTclVerMinor, iTclVerPatchLevel;
 	Tcl_GetVersion (&iTclVerMajor, &iTclVerMinor, &iTclVerPatchLevel, NULL);
 	msg.Printf("eCos Configuration Tool %s (%s %s)\n\n"
-		"Copyright (c) Free Software Foundation, Inc. 1998-2009\n\n"
+		"Copyright (c) Free Software Foundation, Inc. 1998-2011\n\n"
 		"Using %s %s and Tcl %d.%d.%d",
 		ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__,
 		wxPlatformInfo::Get().GetPortIdName().c_str(), wxVERSION_NUM_DOT_STRING,