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]

Save eCos configuration before eCos build in configtool


The attached patch prompts the eCos Configuration Tool user to save an eCos configuration before building eCos. Checked in.

John Dallaway
eCosCentric Limited
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.60
diff -u -5 -r1.60 ChangeLog
--- ChangeLog	13 Aug 2003 08:31:58 -0000	1.60
+++ ChangeLog	16 Jan 2004 16:42:48 -0000
@@ -1,5 +1,12 @@
+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
 	use of the cygdrive prefix.
 
Index: standalone/wxwin/configtool.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtool.cpp,v
retrieving revision 1.18
diff -u -5 -r1.18 configtool.cpp
--- standalone/wxwin/configtool.cpp	14 May 2003 12:20:15 -0000	1.18
+++ standalone/wxwin/configtool.cpp	16 Jan 2004 16:42:52 -0000
@@ -1,10 +1,11 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // 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.
 //
 // 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
@@ -1349,21 +1350,31 @@
 
     if (!wxGetApp().GetMainFrame()->GetOutputWindow()->IsShown())
     {
         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"));
         wxString strCmd (wxT("make"));
         if(!strWhat.IsEmpty())
Index: standalone/wxwin/mainwin.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/mainwin.cpp,v
retrieving revision 1.15
diff -u -5 -r1.15 mainwin.cpp
--- standalone/wxwin/mainwin.cpp	24 Apr 2003 11:11:15 -0000	1.15
+++ standalone/wxwin/mainwin.cpp	16 Jan 2004 16:42:56 -0000
@@ -1,10 +1,11 @@
 //####COPYRIGHTBEGIN####
 //
 // ----------------------------------------------------------------------------
 // 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.
 //
 // 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
@@ -549,11 +550,11 @@
 void ecMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 {
 //    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);
 }
 
 void ecMainFrame::OnSize(wxSizeEvent& WXUNUSED(event))
 {

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