From: Vadim Zeitlin Date: Thu, 7 Jan 1999 16:25:06 +0000 (+0000) Subject: storable objects use _() and wxLogXXX instead of message boxes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/794df945d5331a7ea8e3d44bdccd53c36963957b storable objects use _() and wxLogXXX instead of message boxes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/object.cpp b/src/common/object.cpp index decda33776..0eda4f7880 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -21,12 +21,16 @@ #endif #ifndef WX_PRECOMP -#include "wx/hash.h" -#ifdef wxUSE_SERIAL -#include "wx/objstrm.h" -#include "wx/serbase.h" -#endif -#endif + #include "wx/hash.h" + #ifdef wxUSE_SERIAL + #include "wx/objstrm.h" + #include "wx/serbase.h" + + // for error messages + #include "wx/log.h" + #include "wx/intl.h" + #endif // wxUSE_SERIAL +#endif // WX_PRECOMP #include #include @@ -283,19 +287,17 @@ void wxObject::StoreObject( wxObjectOutputStream& stream ) wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial"); if (!lib) { - wxMessageBox("Can't load wxSerial dynamic library.", "Alert !"); + wxLogError(_("Can't load wxSerial dynamic library.")); return; } if (!m_serialObj) { m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name ); if (!m_serialObj) { - wxString message; - - message.Printf("Can't find the serialization object (%s) for the object %s", - WXSTRINGCAST obj_name, - WXSTRINGCAST GetClassInfo()->GetClassName()); - wxMessageBox(message, "Alert !"); + wxLogError(_("Can't find the serialization object '%s' " + "for the object '%s'."), + obj_name.c_str(), + GetClassInfo()->GetClassName()); return; } m_serialObj->SetObject(this); @@ -313,12 +315,10 @@ void wxObject::LoadObject( wxObjectInputStream& stream ) m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name ); if (!m_serialObj) { - wxString message; - - message.Printf("Can't find the serialization object (%s) for the object %s", - WXSTRINGCAST obj_name, - WXSTRINGCAST GetClassInfo()->GetClassName()); - wxMessageBox(message, "Alert !"); + wxLogError(_("Can't find the serialization object '%s' " + "for the object '%s'."), + obj_name.c_str(), + GetClassInfo()->GetClassName()); return; } m_serialObj->SetObject(this);