mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add "Switch UMD" menu point to Linux version
This commit is contained in:
parent
8cce0bc631
commit
bbc6337263
3 changed files with 17 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "base/NativeApp.h"
|
||||
#include "Core/MIPS/MIPSDebugInterface.h"
|
||||
#include "Core/Debugger/SymbolMap.h"
|
||||
#include "Core/HLE/sceUmd.h"
|
||||
#include "Core/SaveState.h"
|
||||
#include "Core/System.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
|
@ -141,7 +142,7 @@ void MainWindow::closeAct()
|
|||
void MainWindow::openmsAct()
|
||||
{
|
||||
QString confighome = getenv("XDG_CONFIG_HOME");
|
||||
QString memorystick = confighome + "/ppsspp/PSP";
|
||||
QString memorystick = confighome + "/ppsspp";
|
||||
QDesktopServices::openUrl(QUrl(memorystick));
|
||||
}
|
||||
|
||||
|
@ -249,6 +250,17 @@ void MainWindow::resetAct()
|
|||
NativeMessageReceived("reset", "");
|
||||
}
|
||||
|
||||
void MainWindow::switchUMDAct()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(NULL, "Switch UMD", g_Config.currentDirectory.c_str(), "PSP ROMs (*.pbp *.elf *.iso *.cso *.prx)");
|
||||
if (QFile::exists(filename))
|
||||
{
|
||||
QFileInfo info(filename);
|
||||
g_Config.currentDirectory = info.absolutePath().toStdString();
|
||||
__UmdReplace(filename.toStdString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::breakonloadAct()
|
||||
{
|
||||
g_Config.bAutoRun = !g_Config.bAutoRun;
|
||||
|
@ -534,6 +546,8 @@ void MainWindow::createMenus()
|
|||
->addEnableState(UISTATE_INGAME);
|
||||
emuMenu->add(new MenuAction(this, SLOT(resetAct()), QT_TR_NOOP("R&eset"), Qt::CTRL + Qt::Key_B))
|
||||
->addEnableState(UISTATE_INGAME);
|
||||
emuMenu->add(new MenuAction(this, SLOT(switchUMDAct()), QT_TR_NOOP("Switch UMD"), Qt::CTRL + Qt::Key_U))
|
||||
->addEnableState(UISTATE_INGAME);
|
||||
MenuTree* displayRotationMenu = new MenuTree(this, emuMenu, QT_TR_NOOP("Display rotation"));
|
||||
displayRotationGroup = new MenuActionGroup(this, displayRotationMenu, SLOT(displayRotationGroup_triggered(QAction *)),
|
||||
QStringList() << "Landscape" << "Portrait" << "Landscape reversed" << "Portrait reversed",
|
||||
|
|
|
@ -95,6 +95,7 @@ private slots:
|
|||
void pauseAct();
|
||||
void stopAct();
|
||||
void resetAct();
|
||||
void switchUMDAct();
|
||||
void displayRotationGroup_triggered(QAction *action) { g_Config.iInternalScreenRotation = action->data().toInt(); }
|
||||
|
||||
// Debug
|
||||
|
|
|
@ -438,7 +438,7 @@ namespace MainWindow {
|
|||
filter[i] = '\0';
|
||||
}
|
||||
|
||||
if (W32Util::BrowseForFileName(true, GetHWND(), L"Switch Umd", 0, ConvertUTF8ToWString(filter).c_str(), L"*.pbp;*.elf;*.iso;*.cso;", fn)) {
|
||||
if (W32Util::BrowseForFileName(true, GetHWND(), L"Switch UMD", 0, ConvertUTF8ToWString(filter).c_str(), L"*.pbp;*.elf;*.iso;*.cso;", fn)) {
|
||||
fn = ReplaceAll(fn, "\\", "/");
|
||||
__UmdReplace(fn);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue