Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unification of the menu of Linux and Windows versions #12817

Merged
merged 8 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("FirstRun", &g_Config.bFirstRun, true),
ConfigSetting("RunCount", &g_Config.iRunCount, 0),
ConfigSetting("Enable Logging", &g_Config.bEnableLogging, true),
ConfigSetting("AutoRun", &g_Config.bAutoRun, true),
ConfigSetting("AutoRun", &g_Config.bAutoRun, false),
unknownbrackets marked this conversation as resolved.
Show resolved Hide resolved
ConfigSetting("Browse", &g_Config.bBrowse, false),
ConfigSetting("IgnoreBadMemAccess", &g_Config.bIgnoreBadMemAccess, true, true),
ConfigSetting("CurrentDirectory", &g_Config.currentDirectory, ""),
Expand Down
18 changes: 4 additions & 14 deletions Qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void MainWindow::createMenus()
{
// File
MenuTree* fileMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&File"));
fileMenu->add(new MenuAction(this, SLOT(loadAct()), QT_TR_NOOP("&Load...")))
fileMenu->add(new MenuAction(this, SLOT(loadAct()), QT_TR_NOOP("&Load..."), QKeySequence::Open))
->addEnableState(UISTATE_MENU);
fileMenu->add(new MenuAction(this, SLOT(closeAct()), QT_TR_NOOP("&Close"), QKeySequence::Close))
->addDisableState(UISTATE_MENU);
Expand All @@ -543,7 +543,7 @@ void MainWindow::createMenus()
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"), Qt::ALT + Qt::Key_F4));
fileMenu->add(new MenuAction(this, SLOT(exitAct()), QT_TR_NOOP("E&xit"), QKeySequence::Quit));

// Emulation
MenuTree* emuMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&Emulation"));
Expand All @@ -569,9 +569,9 @@ void MainWindow::createMenus()
->addDisableState(UISTATE_MENU);
debugMenu->add(new MenuAction(this, SLOT(smapAct()), QT_TR_NOOP("&Save MAP file...")))
->addDisableState(UISTATE_MENU);
debugMenu->add(new MenuAction(this, SLOT(lmapAct()), QT_TR_NOOP("Lo&ad SYM file...")))
debugMenu->add(new MenuAction(this, SLOT(lsymAct()), QT_TR_NOOP("Lo&ad SYM file...")))
->addDisableState(UISTATE_MENU);
debugMenu->add(new MenuAction(this, SLOT(smapAct()), QT_TR_NOOP("Sav&e SYM file...")))
debugMenu->add(new MenuAction(this, SLOT(ssymAct()), QT_TR_NOOP("Sav&e SYM file...")))
->addDisableState(UISTATE_MENU);
debugMenu->add(new MenuAction(this, SLOT(resetTableAct()),QT_TR_NOOP("Reset s&ymbol table")))
->addDisableState(UISTATE_MENU);
Expand All @@ -588,10 +588,6 @@ void MainWindow::createMenus()

// Game settings
MenuTree* gameSettingsMenu = new MenuTree(this, menuBar(), QT_TR_NOOP("&Game settings"));
gameSettingsMenu->add(new MenuAction(this, SLOT(keepOnTopAct()), QT_TR_NOOP("&Keep PPSSPP on top")))
->addEventChecked(&g_Config.bTopMost);
gameSettingsMenu->add(new MenuAction(this, SLOT(pauseWhenNotFocusedAct()), QT_TR_NOOP("&Pause when not focused")))
->addEventChecked(&g_Config.bPauseOnLostFocus);
gameSettingsMenu->add(new MenuAction(this, SLOT(languageAct()), QT_TR_NOOP("La&nguage...")));
gameSettingsMenu->add(new MenuAction(this, SLOT(controlMappingAct()), QT_TR_NOOP("C&ontrol mapping...")));
gameSettingsMenu->add(new MenuAction(this, SLOT(displayLayoutEditorAct()), QT_TR_NOOP("Display layout editor...")));
Expand All @@ -603,12 +599,6 @@ void MainWindow::createMenus()
gameSettingsMenu->add(new MenuAction(this, SLOT(fullscrAct()), QT_TR_NOOP("Fu&llscreen"), QKeySequence::FullScreen))
#endif
->addEventChecked(&g_Config.bFullScreen);
gameSettingsMenu->add(new MenuAction(this, SLOT(VSyncAct()), QT_TR_NOOP("VS&ync")))
->addEventChecked(&g_Config.bVSync);
MenuTree* postprocessingShaderMenu = new MenuTree(this, gameSettingsMenu, QT_TR_NOOP("Postprocessin&g shader"));
postprocessingShaderGroup = new MenuActionGroup(this, postprocessingShaderMenu, SLOT(postprocessingShaderGroup_triggered(QAction *)),
QStringList() << "Off" << "FXAA Antialiasing" << "CRT scanlines" << "Natural Colors" << "Natural Colors (no blur)" << "Vignette" << "Grayscale" << "Bloom" << "Sharpen" << "Inverse Colors" << "Scanlines (CRT)" << "Cartoon" << "4xHQ GLSL" << "AA-Color" << "Spline36 Upscaler" << "5xBR" << "5xBR-lv2" << "Video Smoothing AA" << "Super Sampling AA (Gauss)",
QList<int>() << 0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15 << 16 << 17 << 18);
MenuTree* renderingResolutionMenu = new MenuTree(this, gameSettingsMenu, QT_TR_NOOP("&Rendering resolution"));
renderingResolutionGroup = new MenuActionGroup(this, renderingResolutionMenu, SLOT(renderingResolutionGroup_triggered(QAction *)),
QStringList() << "&Auto" << "&1x" << "&2x" << "&3x" << "&4x" << "&5x" << "&6x" << "&7x" << "&8x" << "&9x" << "1&0x",
Expand Down
51 changes: 38 additions & 13 deletions Qt/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ private slots:
void consoleAct();

// Game settings
void keepOnTopAct() { g_Config.bTopMost = !g_Config.bTopMost; }
void pauseWhenNotFocusedAct() { g_Config.bPauseOnLostFocus = !g_Config.bPauseOnLostFocus; }
void languageAct() { NativeMessageReceived("language screen", ""); }
void controlMappingAct() { NativeMessageReceived("control mapping", ""); }
void displayLayoutEditorAct() { NativeMessageReceived("display layout editor", ""); }
Expand All @@ -110,23 +108,47 @@ private slots:
}
void linearAct() { g_Config.iTexFiltering = (g_Config.iTexFiltering != 0) ? 0 : 3; }

void postprocessingShaderGroup_triggered(QAction *action) { g_Config.sPostShaderName = action->data().toInt(); }
void renderingResolutionGroup_triggered(QAction *action) { g_Config.iInternalResolution = action->data().toInt(); }
void renderingResolutionGroup_triggered(QAction *action) {
g_Config.iInternalResolution = action->data().toInt();
NativeMessageReceived("gpu_resized", "");
if (g_Config.iTexScalingLevel == TEXSCALING_AUTO) {
NativeMessageReceived("gpu_clearCache", "");
}
unknownbrackets marked this conversation as resolved.
Show resolved Hide resolved
}
void windowGroup_triggered(QAction *action) { SetWindowScale(action->data().toInt()); }

void displayLayoutGroup_triggered(QAction *action) {
g_Config.iSmallDisplayZoomType = action->data().toInt();
NativeMessageReceived("gpu_resized", "");
}
void renderingModeGroup_triggered(QAction *action) { g_Config.iRenderingMode = action->data().toInt(); }
void autoframeskipAct() { g_Config.bAutoFrameSkip = !g_Config.bAutoFrameSkip; }
void renderingModeGroup_triggered(QAction *action) {
g_Config.iRenderingMode = action->data().toInt();
g_Config.bAutoFrameSkip = false;
NativeMessageReceived("gpu_resized", "");
}
void autoframeskipAct() {
g_Config.bAutoFrameSkip = !g_Config.bAutoFrameSkip;
if (g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
g_Config.iRenderingMode = FB_BUFFERED_MODE;
NativeMessageReceived("gpu_resized", "");
}
unknownbrackets marked this conversation as resolved.
Show resolved Hide resolved
}
void frameSkippingGroup_triggered(QAction *action) { g_Config.iFrameSkip = action->data().toInt(); }
void frameSkippingTypeGroup_triggered(QAction *action) { g_Config.iFrameSkipType = action->data().toInt(); }
void textureFilteringGroup_triggered(QAction *action) { g_Config.iTexFiltering = action->data().toInt(); }
void screenScalingFilterGroup_triggered(QAction *action) { g_Config.iBufFilter = action->data().toInt(); }
void textureScalingLevelGroup_triggered(QAction *action) { g_Config.iTexScalingLevel = action->data().toInt(); }
void textureScalingTypeGroup_triggered(QAction *action) { g_Config.iTexScalingType = action->data().toInt(); }
void deposterizeAct() { g_Config.bTexDeposterize = !g_Config.bTexDeposterize; }
void textureScalingLevelGroup_triggered(QAction *action) {
g_Config.iTexScalingLevel = action->data().toInt();
NativeMessageReceived("gpu_clearCache", "");
}
void textureScalingTypeGroup_triggered(QAction *action) {
g_Config.iTexScalingType = action->data().toInt();
NativeMessageReceived("gpu_clearCache", "");
}
void deposterizeAct() {
g_Config.bTexDeposterize = !g_Config.bTexDeposterize;
NativeMessageReceived("gpu_clearCache", "");
}
void transformAct() {
g_Config.bHardwareTransform = !g_Config.bHardwareTransform;
NativeMessageReceived("gpu_resized", "");
Expand All @@ -136,7 +158,11 @@ private slots:
void frameskipTypeAct() { g_Config.iFrameSkipType = !g_Config.iFrameSkipType; }

// Sound
void audioAct() { g_Config.bEnableSound = !g_Config.bEnableSound; }
void audioAct() {
g_Config.bEnableSound = !g_Config.bEnableSound;
if (PSP_IsInited() && !IsAudioInitialised())
Audio_Init();
}

// Cheats
void cheatsAct() { g_Config.bEnableCheats = !g_Config.bEnableCheats; }
Expand All @@ -147,8 +173,7 @@ private slots:
g_Config.bShowDebugStats = !g_Config.bShowDebugStats;
NativeMessageReceived("clear jit", "");
}
void VSyncAct() { g_Config.bVSync = !g_Config.bVSync; }
void showFPSAct() { g_Config.iShowFPSCounter = !g_Config.iShowFPSCounter; }
void showFPSAct() { g_Config.iShowFPSCounter = g_Config.iShowFPSCounter ? 0 : 3; } // 3 = both speed and FPS

// Help
void websiteAct();
Expand All @@ -175,7 +200,7 @@ private slots:
CoreState nextState;
GlobalUIState lastUIState;

QActionGroup *windowGroup, *postprocessingShaderGroup,
QActionGroup *windowGroup,
*textureScalingLevelGroup, *textureScalingTypeGroup,
*screenScalingFilterGroup, *textureFilteringGroup,
*frameSkippingTypeGroup, *frameSkippingGroup,
Expand Down