Beispiel #1
0
bool Project::SaveXmlFile()
{
    bool ok = m_doc.Save(m_fileName.GetFullPath());
    SetProjectLastModifiedTime(GetFileLastModifiedTime());
    
    wxCommandEvent evt(wxEVT_FILE_SAVED);
    evt.SetString( m_fileName.GetFullPath() );
    EventNotifier::Get()->AddPendingEvent( evt );
    
    return ok;
}
Beispiel #2
0
bool Project::SaveXmlFile()
{
    wxString projectXml;
    wxStringOutputStream sos( &projectXml );
    bool ok = m_doc.Save( sos );
    
    wxFFile file(m_fileName.GetFullPath(), wxT("w+b"));
    if ( !file.IsOpened() ) {
        ok = false;
        
    } else {
        file.Write( projectXml );
        file.Close();
        
    }

    SetProjectLastModifiedTime(GetFileLastModifiedTime());
    EventNotifier::Get()->PostFileSavedEvent( m_fileName.GetFullPath() );
    return ok;
}
Beispiel #3
0
bool Project::Load(const wxString &path)
{
    if ( !m_doc.Load(path) ) {
        return false;
    }

    ConvertToUnixFormat(m_doc.GetRoot());

    // Workaround WX bug: load the plugins data (GetAllPluginsData will strip any trailing whitespaces)
    // and then set them back
    std::map<wxString, wxString> pluginsData;
    GetAllPluginsData(pluginsData);
    SetAllPluginsData(pluginsData, false);

    m_vdCache.clear();

    m_fileName = path;
    m_fileName.MakeAbsolute();
    SetModified(true);
    SetProjectLastModifiedTime(GetFileLastModifiedTime());

    return true;
}