mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Update "File" menu to match Windows version
This commit is contained in:
parent
c3dbd2b262
commit
b0dabc6a40
2 changed files with 32 additions and 9 deletions
|
@ -80,6 +80,13 @@ void MainWindow::newFrame()
|
|||
|
||||
void MainWindow::updateMenus()
|
||||
{
|
||||
foreach(QAction * action, saveStateGroup->actions()) {
|
||||
if (g_Config.iCurrentStateSlot == action->data().toInt()) {
|
||||
action->setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(QAction * action, displayRotationGroup->actions()) {
|
||||
if (g_Config.iInternalScreenRotation == action->data().toInt()) {
|
||||
action->setChecked(true);
|
||||
|
@ -165,7 +172,7 @@ void MainWindow::bootDone()
|
|||
}
|
||||
|
||||
/* SIGNALS */
|
||||
void MainWindow::openAct()
|
||||
void MainWindow::loadAct()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(NULL, "Load File", g_Config.currentDirectory.c_str(), "PSP ROMs (*.pbp *.elf *.iso *.cso *.prx)");
|
||||
if (QFile::exists(filename))
|
||||
|
@ -184,6 +191,13 @@ void MainWindow::closeAct()
|
|||
SetGameTitle("");
|
||||
}
|
||||
|
||||
void MainWindow::openmsAct()
|
||||
{
|
||||
QString confighome = getenv("XDG_CONFIG_HOME");
|
||||
QString memorystick = confighome + "/ppsspp/PSP";
|
||||
QDesktopServices::openUrl(QUrl(memorystick));
|
||||
}
|
||||
|
||||
void SaveStateActionFinished(SaveState::Status status, const std::string &message, void *userdata)
|
||||
{
|
||||
// TODO: Improve messaging?
|
||||
|
@ -508,21 +522,28 @@ void MainWindow::createMenus()
|
|||
{
|
||||
// File
|
||||
MenuTree* fileMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&File"));
|
||||
fileMenu->add(new MenuAction(this, SLOT(openAct()), QT_TR_NOOP("&Open..."), QKeySequence::Open))
|
||||
fileMenu->add(new MenuAction(this, SLOT(loadAct()), QT_TR_NOOP("&Load...")))
|
||||
->addEnableState(UISTATE_MENU);
|
||||
fileMenu->add(new MenuAction(this, SLOT(closeAct()), QT_TR_NOOP("&Close"), QKeySequence::Close))
|
||||
->addDisableState(UISTATE_MENU);
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->add(new MenuAction(this, SLOT(qlstateAct()), QT_TR_NOOP("Quickload State"), Qt::Key_F4))
|
||||
fileMenu->add(new MenuAction(this, SLOT(openmsAct()), QT_TR_NOOP("Open &Memory stick")))
|
||||
->addEnableState(UISTATE_MENU);
|
||||
fileMenu->addSeparator();
|
||||
MenuTree* savestateMenu = new MenuTree(this, fileMenu, QT_TR_NOOP("Saves&tate slot"));
|
||||
saveStateGroup = new MenuActionGroup(this, savestateMenu, SLOT(saveStateGroup_triggered(QAction *)),
|
||||
QStringList() << "1" << "2" << "3" << "4" << "5",
|
||||
QList<int>() << 0 << 1 << 2 << 3 << 4);
|
||||
fileMenu->add(new MenuAction(this, SLOT(qlstateAct()), QT_TR_NOOP("L&oad state"), Qt::Key_F4))
|
||||
->addDisableState(UISTATE_MENU);
|
||||
fileMenu->add(new MenuAction(this, SLOT(qsstateAct()), QT_TR_NOOP("Quicksave State"), Qt::Key_F2))
|
||||
fileMenu->add(new MenuAction(this, SLOT(qsstateAct()), QT_TR_NOOP("S&ave state"), Qt::Key_F2))
|
||||
->addDisableState(UISTATE_MENU);
|
||||
fileMenu->add(new MenuAction(this, SLOT(lstateAct()), QT_TR_NOOP("&Load State File...")))
|
||||
fileMenu->add(new MenuAction(this, SLOT(lstateAct()), QT_TR_NOOP("&Load state file...")))
|
||||
->addDisableState(UISTATE_MENU);
|
||||
fileMenu->add(new MenuAction(this, SLOT(sstateAct()), QT_TR_NOOP("&Save State File...")))
|
||||
fileMenu->add(new MenuAction(this, SLOT(sstateAct()), QT_TR_NOOP("&Save state file...")))
|
||||
->addDisableState(UISTATE_MENU);
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->add(new MenuAction(this, SLOT(exitAct()), QT_TR_NOOP("E&xit"), QKeySequence::Quit));
|
||||
fileMenu->add(new MenuAction(this, SLOT(exitAct()), QT_TR_NOOP("E&xit"), Qt::ALT + Qt::Key_F4));
|
||||
|
||||
// Emulation
|
||||
MenuTree* emuMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&Emulation"));
|
||||
|
|
|
@ -68,8 +68,10 @@ public slots:
|
|||
|
||||
private slots:
|
||||
// File
|
||||
void openAct();
|
||||
void loadAct();
|
||||
void closeAct();
|
||||
void openmsAct();
|
||||
void saveStateGroup_triggered(QAction *action) { g_Config.iCurrentStateSlot = action->data().toInt(); }
|
||||
void qlstateAct();
|
||||
void qsstateAct();
|
||||
void lstateAct();
|
||||
|
@ -178,7 +180,7 @@ private:
|
|||
*screenScalingFilterGroup, *textureFilteringGroup,
|
||||
*frameSkippingTypeGroup, *frameSkippingGroup,
|
||||
*renderingModeGroup, *renderingResolutionGroup,
|
||||
*displayRotationGroup;
|
||||
*displayRotationGroup, *saveStateGroup;
|
||||
|
||||
std::queue<MainWindowMsg> msgQueue_;
|
||||
std::mutex msgMutex_;
|
||||
|
|
Loading…
Add table
Reference in a new issue