Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

bool cbWorkspace::SaveAs ( const wxString &  filename ) [virtual]

Save the workspace under a different filename.

Parameters:
filenameThe name of the file to save.
Returns:
True if saving succeeded, false if not.
Note:
If the filename parameter is empty, a file dialog to choose the filename to save will be displayed.

Definition at line 123 of file cbworkspace.cpp.

References Manager::Get(), FileFilters::GetFilterString(), and Save().

Referenced by Save(), and ProjectManager::SaveWorkspaceAs().

{
    wxFileDialog dlg(Manager::Get()->GetAppWindow(),
                     _("Save workspace"),
                     m_Filename.GetPath(),
                     m_Filename.GetFullName(),
                     FileFilters::GetFilterString(_T('.') + FileFilters::WORKSPACE_EXT),
                     wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
    PlaceWindow(&dlg);
    if (dlg.ShowModal() != wxID_OK)
        return false;

    m_Filename = dlg.GetPath();
    if (m_Filename.GetExt() == wxEmptyString)
        m_Filename.SetExt(_T("workspace"));

    if (m_Filename.GetFullName().Matches(DEFAULT_WORKSPACE))
        m_IsDefault = true;
    else
        m_IsDefault = false;

    return Save(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index