changeset 2709:dd813352ed34

* standalone/wxwin/outputwin.cpp, standalone/wxwin/outputwin.h, standalone/wxwin/mainwin.cpp: Migrate save output method from ecMainFrame to ecOutputWindow and manipulate state of associated menu item. Fix from Spencer Oliver. * common/common/build.cxx: Tweak library build rule generation to allow correct use of the CDL make_object command in future.
author jld
date Wed, 31 Dec 2008 16:11:51 +0000
parents d0b26e6a41e4
children 25584f5a3f55
files host/tools/configtool/ChangeLog host/tools/configtool/common/common/build.cxx host/tools/configtool/standalone/wxwin/mainwin.cpp host/tools/configtool/standalone/wxwin/outputwin.cpp host/tools/configtool/standalone/wxwin/outputwin.h
diffstat 5 files changed, 29 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,13 @@
+2008-12-31  John Dallaway  <john@dallaway.org.uk>
+
+	* standalone/wxwin/outputwin.cpp, standalone/wxwin/outputwin.h,
+	  standalone/wxwin/mainwin.cpp:	Migrate save output method from
+	ecMainFrame to ecOutputWindow and manipulate state of associated
+	menu item. Fix from Spencer Oliver.
+
+	* common/common/build.cxx: Tweak library build rule generation to
+	allow correct use of the CDL make_object command in future.
+
 2008-12-30  John Dallaway  <john@dallaway.org.uk>
 
 	* standalone/wxwin/settingsdlg.cpp: Browse all files when selecting
--- a/host/tools/configtool/common/common/build.cxx
+++ b/host/tools/configtool/common/common/build.cxx
@@ -445,8 +445,8 @@ bool generate_makefile (const CdlConfigu
 		fprintf (stream, "OBJECTS := $(OBJECTS:.c=.o.d)\n");
 		fprintf (stream, "OBJECTS := $(OBJECTS:.S=.o.d)\n\n");
 		fprintf (stream, "$(LIBRARY).stamp: $(OBJECTS)\n");
-		fprintf (stream, "\t$(AR) rcs $(PREFIX)/lib/$(@:.stamp=) $(foreach obj,$?,$(dir $(obj))$(OBJECT_PREFIX)_$(notdir $(obj:.o.d=.o)))\n");
-		fprintf (stream, "\t@cat $^ > $(@:.stamp=.deps)\n");
+		fprintf (stream, "\t$(AR) rcs $(PREFIX)/lib/$(@:.stamp=) $(foreach obj,$?,$(if $(obj:%%.o=),$(dir $(obj))$(OBJECT_PREFIX)_$(notdir $(obj:.o.d=.o)),$(obj)))\n");
+		fprintf (stream, "\t@cat $(foreach obj,$^,$(obj:.o=.o.d)) > $(@:.stamp=.deps)\n");
 		fprintf (stream, "\t@touch $@\n\n");
 	}	
 
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -1546,17 +1546,7 @@ void ecMainFrame::OnSaveOutput(wxCommand
     ecOutputWindow* win = GetOutputWindow();
     if (!win)
         return;
-
-    wxFileDialog dialog(this, _("Choose a file for saving the output window contents"),
-        wxT(""), wxT("output.txt"), wxT("*.txt"), wxSAVE|wxOVERWRITE_PROMPT);
-    if (dialog.ShowModal() == wxID_OK)
-    {
-        if (!win->SaveFile(dialog.GetPath()))
-        {
-            wxMessageBox(_("Sorry, there was a problem saving the file."), wxGetApp().GetSettings().GetAppName(),
-                wxICON_EXCLAMATION|wxID_OK);
-        }
-    }
+    win->OnSave(event);
 }
 
 void ecMainFrame::OnUpdateSelectAll(wxUpdateUIEvent& event)
--- a/host/tools/configtool/standalone/wxwin/outputwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/outputwin.cpp
@@ -77,6 +77,7 @@ BEGIN_EVENT_TABLE(ecOutputWindow, wxText
     EVT_MENU(wxID_SELECTALL, ecOutputWindow::OnSelectAll)
     EVT_MENU(wxID_SAVE, ecOutputWindow::OnSave)
     EVT_UPDATE_UI(wxID_CLEAR, ecOutputWindow::OnUpdateClear)
+    EVT_UPDATE_UI(wxID_SAVE, ecOutputWindow::OnUpdateSave)
 END_EVENT_TABLE()
 
 ecOutputWindow::ecOutputWindow(wxWindow* parent, wxWindowID id, const wxPoint& pt,
@@ -129,6 +130,16 @@ void ecOutputWindow::OnSelectAll(wxComma
 
 void ecOutputWindow::OnSave(wxCommandEvent& event)
 {
+    wxFileDialog dialog(this, _("Save output as"),
+        wxT(""), wxT("output.txt"), wxT("*.txt"), wxSAVE|wxOVERWRITE_PROMPT);
+    if (dialog.ShowModal() == wxID_OK)
+    {
+        if (!SaveFile(dialog.GetPath()))
+        {
+            wxMessageBox(_("Error saving output file."), wxGetApp().GetSettings().GetAppName(),
+                wxICON_EXCLAMATION|wxID_OK);
+        }
+    }
 }
 
 void ecOutputWindow::OnUpdateClear(wxUpdateUIEvent& event)
@@ -136,3 +147,7 @@ void ecOutputWindow::OnUpdateClear(wxUpd
     event.Enable(!IsEmpty());
 }
 
+void ecOutputWindow::OnUpdateSave(wxUpdateUIEvent& event)
+{
+    event.Enable(!IsEmpty());
+}
--- a/host/tools/configtool/standalone/wxwin/outputwin.h
+++ b/host/tools/configtool/standalone/wxwin/outputwin.h
@@ -66,6 +66,7 @@ public:
     void OnSelectAll(wxCommandEvent& event);
     void OnSave(wxCommandEvent& event);
     void OnUpdateClear(wxUpdateUIEvent& event);
+    void OnUpdateSave(wxUpdateUIEvent& event);
 
 //// Operations