1. log::save works with wxGTK
2. wxFile::Create() doesn't create files open for reading any more... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -687,22 +687,19 @@ void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
// retrieve text and save it
|
||||
// -------------------------
|
||||
#ifdef __WXGTK__
|
||||
// @@@@ TODO: no GetNumberOfLines and GetLineText in wxGTK yet
|
||||
wxLogError(_("Sorry, this function is not implemented under GTK"));
|
||||
#else
|
||||
int nLines = m_pTextCtrl->GetNumberOfLines();
|
||||
for ( int nLine = 0; bOk && nLine < nLines; nLine++ ) {
|
||||
bOk = file.Write(m_pTextCtrl->GetLineText(nLine) + wxTextFile::GetEOL());
|
||||
}
|
||||
#endif //GTK
|
||||
|
||||
if ( bOk )
|
||||
bOk = file.Close();
|
||||
|
||||
if ( !bOk ) {
|
||||
wxLogError(_("Can't save log contents to file."));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
wxLogStatus(this, _("Log saved to the file '%s'."), szFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user