This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Configtool 'Run Tests' behaviour and Windows registry usage


This patch clears up some inconsistencies in registry usage in the wxWindows
configtool on Windows hosts. It also resolves an issue with suppression of
the 'Reset Board' dialog box when running tests in a simulator. Finally, it
addresses a problem with saving GDB runes after editing in the platform editor
dialog box.

John Dallaway
eCosCentric Limited

--cut here--

Index: configtool/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.31
diff -u -5 -r1.31 ChangeLog
--- configtool/ChangeLog	10 Feb 2003 16:16:10 -0000	1.31
+++ configtool/ChangeLog	13 Feb 2003 16:09:38 -0000
@@ -1,5 +1,30 @@
+2003-02-13  John Dallaway  <jld@ecoscentric.com>
+
+	* standalone/wxwin/admindlg.cpp,
+	  standalone/wxwin/configtooldoc.cpp,
+	  standalone/wxwin/configtool.cpp,
+	  standalone/wxwin/mainwin.cpp,
+	  standalone/wxwin/appsettings.cpp:
+	Look for all persistent application settings under
+        "HKEY_CURRENT_USER\Software\eCos Configuration Tool\"
+	for consistency.
+
+	* standalone/wxwin/appsettings.cpp:
+	Board 'reset type' is determined at run-time and no longer persistent.
+
+	* standalone/wxwin/configtooldoc.cpp:
+	Determine board reset type by looking for "cyg_test_is_simulator=1"
+	rather than just "cyg_test_is_simulator" since "cyg_test_simulator=0"
+	is also possible.
+
+	* standalone/wxwin/mainwin.cpp:
+	Supress obsolete menu items.
+
+	* standalone/wxwin/platformseditordialog.cpp:
+	Replace LF (rather than CRLF) with ';' when storing GDB commands.
+
 2003-02-10  John Dallaway  <jld@ecoscentric.com>

 	* standalone/wxwin/runtestsdlg.cpp,
 	  standalone/wxwin/runtestsdlg.h:
 	Call the "Reset Board" message box in the primary thread rather than
Index: configtool/standalone/wxwin/admindlg.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/admindlg.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 admindlg.cpp
--- configtool/standalone/wxwin/admindlg.cpp	12 Sep 2001 00:59:18 -0000	1.3
+++ configtool/standalone/wxwin/admindlg.cpp	13 Feb 2003 16:10:29 -0000
@@ -1,9 +1,10 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2003 John Dallaway
 //
 // This program is part of the eCos host tools.
 //
 // 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 the Free
@@ -25,11 +26,11 @@
 // admindlg.cpp :
 //
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
+// Author(s):   julians,jld
 // Contact(s):  julians
 // Date:        2000/09/28
 // Version:     $Id: admindlg.cpp,v 1.6 2001/08/22 16:50:32 julians Exp $
 // Purpose:
 // Description: Implementation file for ecAdminDialog
@@ -358,11 +359,11 @@

 bool ecAdminDialog::FindUserToolsPath()
 {
 #ifdef __WXMSW__
     HKEY hKey;
-    if (ERROR_SUCCESS != RegOpenKeyEx (HKEY_CURRENT_USER, _T("Software\\Red Hat\\eCos\\Configuration Tool\\User Tools"), 0, KEY_READ, &hKey))
+    if (ERROR_SUCCESS != RegOpenKeyEx (HKEY_CURRENT_USER, _T("Software\\eCos Configuration Tool\\Paths\\UserToolsDir"), 0, KEY_READ, &hKey))
         return FALSE;
     
     TCHAR szBuffer [MAX_PATH + 1];
     DWORD dwBufferLength = MAX_PATH + 1;
     LONG lStatus = RegQueryValueEx (hKey, _T("Folder"), NULL, NULL, (LPBYTE) szBuffer, &dwBufferLength);
Index: configtool/standalone/wxwin/appsettings.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/appsettings.cpp,v
retrieving revision 1.6
diff -u -5 -r1.6 appsettings.cpp
--- configtool/standalone/wxwin/appsettings.cpp	25 Jan 2003 23:07:53 -0000	1.6
+++ configtool/standalone/wxwin/appsettings.cpp	13 Feb 2003 16:10:31 -0000
@@ -1,9 +1,10 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2003 John Dallaway
 //
 // This program is part of the eCos host tools.
 //
 // 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 the Free
@@ -25,11 +26,11 @@
 // appsettings.cpp :
 //
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
+// Author(s):   julians, jld
 // Contact(s):  julians
 // Date:        2000/08/29
 // Version:     $Id: appsettings.cpp,v 1.27 2001/12/14 17:34:03 julians Exp $
 // Purpose:
 // Description: Implementation file for the ecSettings
@@ -237,11 +238,11 @@
 }

 // Load config info
 bool ecSettings::LoadConfig()
 {
-    wxConfig config(wxGetApp().GetSettings().GetConfigAppName(), wxT("Red Hat"));
+    wxConfig config(wxGetApp().GetSettings().GetConfigAppName());

     config.Read(_("/Window Status/FrameStatus"), & m_frameStatus);
     config.Read(_("/Window Status/ShowToolBar"), (bool*) & m_showToolBar);
     config.Read(_("/Window Status/ShowSplashScreen"), (bool*) & m_showSplashScreen);
     config.Read(_("/Window Status/ShowConflictsWindow"), (bool*) & m_showConflictsWindow);
@@ -328,11 +329,11 @@

 #ifdef __WXMSW__
     {
         // This should look in HKEY_LOCAL_MACHINE

-        wxConfig config2(wxT("eCos"), wxT("Red Hat"), wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_LOCAL_FILE);
+        wxConfig config2(wxT("eCos"), wxEmptyString, wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_LOCAL_FILE);
 
         wxString versionKey = GetInstallVersionKey();
         wxConfigPathChanger path(& config2, wxString(wxT("/")) + versionKey + wxT("/"));
 
         if (!versionKey.IsEmpty() && config2.Read(wxT("Default Build Tools Path"), & strDefaultBuildToolsPath))
@@ -528,17 +529,17 @@
                 }
             }
         }
     }
     
-    // Load current repository from eCos/Common/Repository/Folder
+    // Load current repository from eCos Configuration Tool/Paths/RepositoryDir
     {
-        wxConfig eCosConfig(wxT("eCos"), wxT("Red Hat"), wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_LOCAL_FILE);
-        wxConfigPathChanger path(& config, wxT("/Common/Repository/"));
+        wxConfig eCosConfig(wxT("eCos Configuration Tool"), wxEmptyString, wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_LOCAL_FILE);
+        wxConfigPathChanger path(& config, wxT("/Repository/"));
         
         //if (!eCosConfig.Read(wxT("Folder"), & m_strRepository))
-        if (!eCosConfig.Read(wxT("/Common/Repository/Folder"), & m_strRepository))
+        if (!eCosConfig.Read(wxT("/Paths/RepositoryDir"), & m_strRepository))
         {
 #ifdef __WXMSW__
             // If we can't find the current folder, look for clues in the registry.
             wxArrayString arstr;
             switch (GetRepositoryRegistryClues(arstr, wxT("eCos")))
@@ -585,11 +586,11 @@
 }

 // Save config info
 bool ecSettings::SaveConfig()
 {
-    wxConfig config(wxGetApp().GetSettings().GetConfigAppName(), wxT("Red Hat"));
+    wxConfig config(wxGetApp().GetSettings().GetConfigAppName());

     config.Write(_("/Files/LastFile"), m_lastFilename);
     
     config.Write(_("/Window Status/FrameStatus"), (long) m_frameStatus);
     config.Write(_("/Window Status/ShowToolBar"), m_showToolBar);
@@ -645,22 +646,20 @@

     // Package dialog settings
     config.Write(_("/Packages/OmitHardwarePackages"), m_omitHardwarePackages);
     config.Write(_("/Packages/MatchPackageNamesExactly"), m_matchPackageNamesExactly);
 
-    // Save current repository to eCos/Common/Repository/Folder
+    // Save current repository to eCos Configuration Tool/Paths/RepositoryDir
     // UNLESS it was overridden by ECOS_REPOSITORY
     {
-        wxConfig eCosConfig(wxT("eCos"), wxT("Red Hat"));
-        
         wxString envVarValue = wxGetenv(wxT("ECOS_REPOSITORY"));
         if (m_strRepository == envVarValue)
         {
             // Don't override the value in the local settings
         }
         else
-            eCosConfig.Write(wxT("/Common/Repository/Folder"), m_strRepository);
+            config.Write(wxT("/Paths/RepositoryDir"), m_strRepository);
     }
     
     // Run tests settings
     m_runTestsSettings.SaveConfig(config);
 
@@ -786,11 +785,11 @@
 
 #ifndef MAX_PATH
 #define MAX_PATH 1024
 #endif

-    wxString strKey = wxT("SOFTWARE\\Red Hat\\eCos");
+    wxString strKey = wxT("SOFTWARE\\eCos");
     wxString strVersionKey = wxT("");
     wxString rc = wxT("");
     wxChar pszBuffer [MAX_PATH + 1];
     HKEY hKey;
     
@@ -873,11 +872,12 @@
     config.Read(_("/Run Tests/Serial"), (bool*) & m_bSerial);
     config.Read(_("/Run Tests/Port"), & m_strPort);
     config.Read(_("/Run Tests/Baud"), & m_nBaud);
     config.Read(_("/Run Tests/LocalTCPIPHost"), & m_strLocalTCPIPHost);
     config.Read(_("/Run Tests/LocalTCPIPPort"), & m_nLocalTCPIPPort);
-    config.Read(_("/Run Tests/ResetType"), & m_nReset);
+//  Reset type is determined at run-time for standalone configtool
+//    config.Read(_("/Run Tests/ResetType"), & m_nReset);
     config.Read(_("/Run Tests/ResetString"), & m_strReset);
     config.Read(_("/Run Tests/ResourceHost"), & m_strResourceHost);
     config.Read(_("/Run Tests/ResourcePort"), & m_nResourcePort);
     config.Read(_("/Run Tests/RemoteHost"), & m_strRemoteHost);
     config.Read(_("/Run Tests/RemotePort"), & m_nRemotePort);
Index: configtool/standalone/wxwin/configtool.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtool.cpp,v
retrieving revision 1.11
diff -u -5 -r1.11 configtool.cpp
--- configtool/standalone/wxwin/configtool.cpp	3 Feb 2003 15:42:56 -0000	1.11
+++ configtool/standalone/wxwin/configtool.cpp	13 Feb 2003 16:10:42 -0000
@@ -767,11 +767,11 @@
     }
 
     m_settings.SaveConfig();
 
     {
-        wxConfig config(wxGetApp().GetSettings().GetConfigAppName(), wxT("Red Hat"));
+        wxConfig config(wxGetApp().GetSettings().GetConfigAppName());
         if (config.HasGroup(wxT("FileHistory")))
             config.DeleteGroup(wxT("FileHistory"));
 	config.SetPath(wxT("FileHistory/"));
         m_docManager->FileHistorySave(config);
     }
Index: configtool/standalone/wxwin/configtooldoc.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtooldoc.cpp,v
retrieving revision 1.12
diff -u -5 -r1.12 configtooldoc.cpp
--- configtool/standalone/wxwin/configtooldoc.cpp	5 Feb 2003 13:53:21 -0000	1.12
+++ configtool/standalone/wxwin/configtooldoc.cpp	13 Feb 2003 16:10:55 -0000
@@ -1,9 +1,10 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2003 John Dallaway
 //
 // This program is part of the eCos host tools.
 //
 // 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 the Free
@@ -25,12 +26,12 @@
 // configtooldoc.cpp :
 //
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
-// Contact(s):  julians
+// Author(s):   julians, jld
+// Contact(s):  julians, jld
 // Date:        2000/10/05
 // Version:     $Id: configtooldoc.cpp,v 1.43 2002/02/13 13:58:18 julians Exp $
 // Purpose:
 // Description: Implementation file for the ecConfigToolDoc class
 // Requires:
@@ -1185,11 +1186,11 @@

 wxString ecConfigToolDoc::GetDefaultHardware ()
 {
 #ifdef __WXMSW__
     // get the greatest eCos version subkey
-    wxConfig config(wxT("eCos"), wxT("Red Hat"), wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE);
+    wxConfig config(wxT("eCos"), wxEmptyString, wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE);
 
     wxString versionKey(wxT(""));
     wxString key(wxT(""));
     long index;
     bool bMore = config.GetFirstGroup(key, index);
@@ -2266,11 +2267,11 @@
     }

     const CeCosTestPlatform * etPlatform = CeCosTestPlatform::Get(strTarget);
     wxASSERT (NULL != etPlatform);
 
-    if (-1 != wxString (etPlatform->GdbCmds ()).Find (wxT("cyg_test_is_simulator")))
+    if (-1 != wxString (etPlatform->GdbCmds ()).Find (wxT("cyg_test_is_simulator=1")))
     {   // if a simulator target, disable 'reset hardware' message box
         wxGetApp().GetSettings().GetRunTestsSettings().m_nReset = RESET_NONE ;
     }
 
     // TODO: I think the remote controls was something that wasn't quite implemented in the MFC tool.
Index: configtool/standalone/wxwin/mainwin.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/mainwin.cpp,v
retrieving revision 1.9
diff -u -5 -r1.9 mainwin.cpp
--- configtool/standalone/wxwin/mainwin.cpp	3 Feb 2003 15:42:56 -0000	1.9
+++ configtool/standalone/wxwin/mainwin.cpp	13 Feb 2003 16:11:07 -0000
@@ -281,11 +281,11 @@
 
     // A history of files visited. Use this menu.
     wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
     // Load file history
     {
-        wxConfig config(wxGetApp().GetSettings().GetConfigAppName(), wxT("Red Hat"));
+        wxConfig config(wxGetApp().GetSettings().GetConfigAppName());
 	config.SetPath(wxT("FileHistory/"));
         wxGetApp().GetDocManager()->FileHistoryLoad(config);
     }
     
     // Edit menu
@@ -369,12 +369,12 @@
     webMenu->Append(ecID_REDHAT_WEB_ECOS, _("&eCos Product Page"), _("Opens the eCos product page"));
     webMenu->Append(ecID_REDHAT_WEB_NET_RELEASE, _("eCos &Net Release Page"), _("Opens the eCos net release page"));
     webMenu->AppendSeparator();
     webMenu->Append(ecID_REDHAT_WEB_UITRON, _("&ITRON"), _("Opens the ITRON specification page"));

-    helpMenu->Append(ecID_REDHAT_WEB, _("&Red Hat on the Web"), webMenu);
-    helpMenu->AppendSeparator();
+//    helpMenu->Append(ecID_REDHAT_WEB, _("&Red Hat on the Web"), webMenu);
+//    helpMenu->AppendSeparator();
     helpMenu->Append(ecID_REPOSITORY_INFO, _("Repository &Information...\tCtrl+I"), _("Displays information about the current repository"));
     helpMenu->Append(wxID_ABOUT, _("&About the Configuration Tool..."), _("Displays program information, version and copyright"));
     
     wxMenuBar *menuBar = new wxMenuBar();
     menuBar->Append(fileMenu, _("&File"));
Index: configtool/standalone/wxwin/platformeditordlg.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/platformeditordlg.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 platformeditordlg.cpp
--- configtool/standalone/wxwin/platformeditordlg.cpp	5 Feb 2003 13:53:22 -0000	1.3
+++ configtool/standalone/wxwin/platformeditordlg.cpp	13 Feb 2003 16:11:07 -0000
@@ -1,9 +1,10 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2003 John Dallaway
 //
 // This program is part of the eCos host tools.
 //
 // 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 the Free
@@ -25,11 +26,11 @@
 // platformsdlg.cpp :
 //
 //===========================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):   julians
+// Author(s):   julians, jld
 // Contact(s):  julians
 // Date:        2000/09/06
 // Version:     $Id: platformeditordlg.cpp,v 1.4 2001/07/05 10:42:16 julians Exp $
 // Purpose:
 // Description: Implementation file for the ecPlatformEditorDialog
@@ -70,15 +71,15 @@

 #ifdef __WXMSW__
 #include "wx/msw/winundef.h"
 #endif
 
-#ifdef __WXMSW__
-static const wxChar* g_NewLineToReplace = wxT("\r\n");
-#else
+//#ifdef __WXMSW__
+//static const wxChar* g_NewLineToReplace = wxT("\r\n");
+//#else
 static const wxChar* g_NewLineToReplace = wxT("\n");
-#endif
+//#endif
 
 BEGIN_EVENT_TABLE(ecPlatformEditorDialog, ecDialog)
     EVT_BUTTON(wxID_OK, ecPlatformEditorDialog::OnOK)
     EVT_BUTTON(wxID_CANCEL, ecPlatformEditorDialog::OnCancel)
     EVT_COMBOBOX(ecID_MODIFY_PLATFORM_PREFIX, ecPlatformEditorDialog::OnChangeNewPlatformPrefix)
Index: ecostest/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/ChangeLog,v
retrieving revision 1.13
diff -u -5 -r1.13 ChangeLog
--- ecostest/ChangeLog	5 Feb 2003 13:39:25 -0000	1.13
+++ ecostest/ChangeLog	13 Feb 2003 16:11:32 -0000
@@ -1,5 +1,12 @@
+2003-02-13  John Dallaway  <jld@ecoscentric.com>
+
+	* common/eCosTestPlatform.cpp:
+	Look for all persistent application settings under
+        "HKEY_CURRENT_USER\Software\eCos Configuration Tool\"
+	for consistency.
+
 2003-02-05  John Dallaway  <jld@ecoscentric.com>

 	* common/eCosTest.cpp (CygPath): Get the cygdrive prefix from
 	the registry.
 
Index: ecostest/common/eCosTestPlatform.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestPlatform.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 eCosTestPlatform.cpp
--- ecostest/common/eCosTestPlatform.cpp	20 Jan 2003 14:54:34 -0000	1.3
+++ ecostest/common/eCosTestPlatform.cpp	13 Feb 2003 16:11:38 -0000
@@ -1,9 +1,10 @@
 //####COPYRIGHTBEGIN####
 //                                                                          
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2003 John Dallaway
 //
 // This program is part of the eCos host tools.
 //
 // 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 the Free 
@@ -150,16 +151,16 @@
   srand( (unsigned)time( NULL ) );

 #ifdef _WIN32

   // get target info from the registry
-  String strPlatformsKey = _T("Software\\Red Hat\\eCos\\");
-  strPlatformsKey += GetGreatestSubkey (_T("Software\\Red Hat\\eCos"));
-  strPlatformsKey += _T("\\Platforms");
+  String strPlatformsKey = _T("Software\\eCos Configuration Tool\\Platforms");
+//  strPlatformsKey += GetGreatestSubkey (_T("Software\\eCos"));
+//  strPlatformsKey += _T("\\Platforms");

   HKEY hKey;
-  bool rc=ERROR_SUCCESS==RegOpenKeyEx (HKEY_LOCAL_MACHINE, strPlatformsKey, 0L, KEY_READ, &hKey);
+  bool rc=ERROR_SUCCESS==RegOpenKeyEx (HKEY_CURRENT_USER, strPlatformsKey, 0L, KEY_READ, &hKey);
   DWORD dwSubKeys=0;
   if(rc){
     // Found the given key.
     // Subkeys' names are the target image names:
     // Subkeys's values are:
@@ -234,15 +235,15 @@
 bool CeCosTestPlatform::Save()
 {
   const String strDir(CeCosTestUtils::HomeFile(_T(".eCosPlatforms")));
 #ifdef _WIN32
   if(!CeCosTestUtils::Exists(strDir)){
-    String strPlatformsKey = _T("Software\\Red Hat\\eCos\\");
-    strPlatformsKey += GetGreatestSubkey (_T("Software\\Red Hat\\eCos"));
-    strPlatformsKey += _T("\\Platforms");
+    String strPlatformsKey = _T("Software\\eCos Configuration Tool\\Platforms");
+//    strPlatformsKey += GetGreatestSubkey (_T("Software\\eCos"));
+//    strPlatformsKey += _T("\\Platforms");
 
-    return SaveToRegistry(HKEY_LOCAL_MACHINE,strPlatformsKey);
+    return SaveToRegistry(HKEY_CURRENT_USER,strPlatformsKey);
   }
 #endif
   return SaveToDir(strDir);
 }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]