# HG changeset patch # User jld # Date 1230739911 0 # Node ID dd813352ed34230d2fc76d02d5421aa382bc5cc7 # Parent d0b26e6a41e49831d8ca69aed4b624e2e53bdff3 * 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. diff --git a/host/tools/configtool/ChangeLog b/host/tools/configtool/ChangeLog --- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,13 @@ +2008-12-31 John Dallaway + + * 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 * standalone/wxwin/settingsdlg.cpp: Browse all files when selecting diff --git a/host/tools/configtool/common/common/build.cxx b/host/tools/configtool/common/common/build.cxx --- 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"); } diff --git a/host/tools/configtool/standalone/wxwin/mainwin.cpp b/host/tools/configtool/standalone/wxwin/mainwin.cpp --- 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) diff --git a/host/tools/configtool/standalone/wxwin/outputwin.cpp b/host/tools/configtool/standalone/wxwin/outputwin.cpp --- 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()); +} diff --git a/host/tools/configtool/standalone/wxwin/outputwin.h b/host/tools/configtool/standalone/wxwin/outputwin.h --- 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