void CMainWindow::OnFileOpen() { Framework::Win32::CFileDialog dialog; const TCHAR* filter = _T("All Supported Files\0*.zip; *.rar; *.psf; *.minipsf; *.psf2; *.minipsf2; *.psfp; *.minipsfp;*") PLAYLIST_EXTENSION _T("\0") PLAYLIST_FILTER ARCHIVE_FILTER PSF_FILTER PSF2_FILTER PSFP_FILTER; dialog.m_OFN.lpstrFilter = filter; if(dialog.SummonOpen(m_hWnd)) { boost::filesystem::path filePath(dialog.GetPath()); std::wstring fileExtension = filePath.extension().wstring(); if(!wcsicmp(fileExtension.c_str(), PLAYLIST_EXTENSION)) { LoadPlaylist(filePath); } else if(!wcsicmp(fileExtension.c_str(), L".rar") || !wcsicmp(fileExtension.c_str(), L".zip")) { LoadArchive(filePath); } else { LoadSingleFile(filePath); } } }
void CCdromSelectionWnd::SelectImage() { Framework::Win32::CFileDialog Dialog; Dialog.m_OFN.lpstrFilter = DISKIMAGE_FILTER; if(Dialog.SummonOpen(m_hWnd) != IDOK) { return; } std::string sPath(string_cast<std::string>(Dialog.GetPath())); m_sImagePath = sPath.c_str(); }
void CMainWindow::OpenELF() { Framework::Win32::CFileDialog d; d.m_OFN.lpstrFilter = _T("ELF Executable Files (*.elf)\0*.elf\0All files (*.*)\0*.*\0"); Enable(FALSE); int nRet = d.SummonOpen(m_hWnd); Enable(TRUE); SetFocus(); if(nRet == 0) return; LoadELF(string_cast<std::string>(d.GetPath()).c_str()); }
void CMainWindow::BootDiskImage() { Framework::Win32::CFileDialog d; d.m_OFN.lpstrFilter = DISKIMAGE_FILTER; Enable(FALSE); int nRet = d.SummonOpen(m_hWnd); Enable(TRUE); SetFocus(); if(nRet == 0) return; CAppConfig::GetInstance().SetPreferenceString(PS2VM_CDROM0PATH, string_cast<std::string>(d.GetPath()).c_str()); BootCDROM(); }