void ExploreFrame::OnSaveAsClicked( wxCommandEvent& event ) { wxString savePath; if (m_patchFileName.empty()) savePath = GetModPath(); wxFileDialog fileDlg(this, _("Select destination patch filename"), savePath, m_patchFileName, "*.patchwad", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (fileDlg.ShowModal() == wxID_OK) { m_patchFileName = fileDlg.GetPath(); if (CreatePatch()) { m_fileHistory.AddFileToHistory(m_patchFileName); wxConfigPathChanger pathChanger(wxConfigBase::Get(), "/FileHistory/PatchFiles/"); m_fileHistory.Save(*wxConfigBase::Get()); } } }
char *GetConfigPath (char *fileName) { static char path[MAX_PATH * 2] = { 0 }; if (IsNonInstallMode ()) { GetModPath (path, sizeof (path)); strcat (path, fileName); return path; } if (SUCCEEDED(SHGetFolderPath (NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path))) { strcat (path, "\\TrueCrypt\\"); CreateDirectory (path, NULL); strcat (path, fileName); } else path[0] = 0; return path; }
wxFileName ModsList::GetSelectedProject() { wxString curr_selection = startFrame->lstBx_projects->GetStringSelection(); return GetModPath( curr_selection ); }