changeset 1469:99c40a5a125d

* configtool/standalone/wxwin/configtool.cpp: Prompt to save eCos configuration as necessary before building eCos. * configtool/standalone/wxwin/mainwin.cpp: Update copyright notice.
author jld
date Fri, 16 Jan 2004 16:51:15 +0000
parents ded5649bf573
children dc5a2e82613e
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/wxwin/configtool.cpp host/tools/configtool/standalone/wxwin/mainwin.cpp
diffstat 3 files changed, 27 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-16  John Dallaway  <jld@ecoscentric.com>
+
+	* configtool/standalone/wxwin/configtool.cpp: Prompt to save eCos
+	Configuration as necessary before building eCos.
+
+	* configtool/standalone/wxwin/mainwin.cpp: Update copyright notice.
+
 2003-08-13  John Dallaway  <jld@ecoscentric.com>
 
 	* configtool/common/common/build.cxx: More robust implementation for
--- a/host/tools/configtool/standalone/wxwin/configtool.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtool.cpp
@@ -3,6 +3,7 @@
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
 // Copyright (C) 2003 John Dallaway
+// Copyright (C) 2004 eCosCentric Limited
 //
 // This program is part of the eCos host tools.
 //
@@ -1351,17 +1352,27 @@ void ecApp::Build(const wxString &strWha
     {
         wxGetApp().GetMainFrame()->ToggleWindow(ecID_TOGGLE_OUTPUT);
     }
-    if (!pDoc->GetDocumentSaved())
+    if (!pDoc->GetDocumentSaved()) // if document has never been saved
     {
-        pDoc->SaveAs();
+        if (!pDoc->SaveAs())
+            return; // user chose not to save the unsaved document so cannot build eCos
     }
-/*
-    if (pDoc->IsModified() && !wxDirExists(pDoc->GetBuildTree()))
+
+    if (pDoc->IsModified()) // if document has been modified since last save
     {
-        pDoc->SaveAs();
+        if (wxOK == wxMessageBox("Building eCos will save changes to your current eCos configuration.",
+            "Build", wxOK|wxCANCEL|wxICON_EXCLAMATION))
+            pDoc->Save();
+        else
+            return; // user chose not to save changes so cannot build eCos
     }
-*/
-//    if ( !(pDoc->IsModified() || !wxDirExists(pDoc->GetBuildTree())) ) // verify the save worked
+
+    // save an eCos configuration which is already saved but is without a corresponding build tree
+    if (!wxDirExists(pDoc->GetBuildTree()))
+    {
+        pDoc->Save();
+    }
+
     if ( pDoc->GetDocumentSaved() )
     {
         //wxString strCmd (wxT("c:\\bin\\testmake.bat"));
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -3,6 +3,7 @@
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
 // Copyright (C) 2003 John Dallaway
+// Copyright (C) 2004 eCosCentric Limited
 //
 // This program is part of the eCos host tools.
 //
@@ -551,7 +552,7 @@ void ecMainFrame::OnAbout(wxCommandEvent
 //    ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool"));
 //    dialog.ShowModal();
 	wxString msg;
-	msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
+	msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (C) eCosCentric Limited 2004", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
     wxMessageBox(msg, _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
 }