Index: mainwin.cpp =================================================================== RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/mainwin.cpp,v retrieving revision 1.22 diff -u -r1.22 mainwin.cpp --- mainwin.cpp 8 Dec 2008 21:28:55 -0000 1.22 +++ mainwin.cpp 16 Dec 2008 11:31:49 -0000 @@ -1548,17 +1548,7 @@ 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->OnSaveOutput(event); } void ecMainFrame::OnUpdateSelectAll(wxUpdateUIEvent& event) Index: outputwin.cpp =================================================================== RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/outputwin.cpp,v retrieving revision 1.2 diff -u -r1.2 outputwin.cpp --- outputwin.cpp 9 Dec 2008 19:05:35 -0000 1.2 +++ outputwin.cpp 16 Dec 2008 11:37:08 -0000 @@ -75,8 +75,9 @@ EVT_MOUSE_EVENTS(ecOutputWindow::OnMouseEvent) EVT_MENU(wxID_CLEAR, ecOutputWindow::OnClear) EVT_MENU(wxID_SELECTALL, ecOutputWindow::OnSelectAll) - EVT_MENU(wxID_SAVE, ecOutputWindow::OnSave) + EVT_MENU(wxID_SAVE, ecOutputWindow::OnSaveOutput) 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, @@ -97,7 +98,7 @@ m_propertiesMenu->Append(wxID_CLEAR, _("C&lear")); m_propertiesMenu->Append(wxID_SELECTALL, _("Select &All")); m_propertiesMenu->AppendSeparator(); - m_propertiesMenu->Append(wxID_SAVE, _("&Save...")); + m_propertiesMenu->Append(wxID_SAVE, _("&Save Output...")); } ecOutputWindow::~ecOutputWindow() @@ -127,8 +128,18 @@ SetSelection(0, GetLastPosition()); } -void ecOutputWindow::OnSave(wxCommandEvent& event) +void ecOutputWindow::OnSaveOutput(wxCommandEvent& event) { + 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 (!SaveFile(dialog.GetPath())) + { + wxMessageBox(_("Sorry, there was a problem saving the file."), wxGetApp().GetSettings().GetAppName(), + wxICON_EXCLAMATION|wxID_OK); + } + } } void ecOutputWindow::OnUpdateClear(wxUpdateUIEvent& event) @@ -136,3 +147,7 @@ event.Enable(!IsEmpty()); } +void ecOutputWindow::OnUpdateSave(wxUpdateUIEvent& event) +{ + event.Enable(!IsEmpty()); +} Index: outputwin.h =================================================================== RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/outputwin.h,v retrieving revision 1.2 diff -u -r1.2 outputwin.h --- outputwin.h 9 Dec 2008 19:05:35 -0000 1.2 +++ outputwin.h 16 Dec 2008 11:28:13 -0000 @@ -64,8 +64,9 @@ void OnMouseEvent(wxMouseEvent& event); void OnClear(wxCommandEvent& event); void OnSelectAll(wxCommandEvent& event); - void OnSave(wxCommandEvent& event); + void OnSaveOutput(wxCommandEvent& event); void OnUpdateClear(wxUpdateUIEvent& event); + void OnUpdateSave(wxUpdateUIEvent& event); //// Operations