rpcsx/rpcs3/rpcs3qt/settings_dialog.cpp

1990 lines
77 KiB
C++
Raw Normal View History

2020-12-05 13:08:24 +01:00
#include <QButtonGroup>
#include <QDialogButtonBox>
#include <QFontMetrics>
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
#include <QPushButton>
#include <QMessageBox>
#include <QInputDialog>
#include <QDesktopServices>
#include <QColorDialog>
2017-07-14 17:10:38 +02:00
#include <QSpinBox>
2017-09-16 21:09:53 +02:00
#include <QTimer>
2019-08-10 13:24:14 +02:00
#include <QScreen>
2020-02-22 20:42:49 +01:00
#include <QUrl>
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
2020-02-22 20:42:49 +01:00
#include "gui_settings.h"
#include "display_sleep_control.h"
#include "qt_utils.h"
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
#include "settings_dialog.h"
#include "ui_settings_dialog.h"
#include "tooltips.h"
#include "input_dialog.h"
#include "emu_settings_type.h"
#include "render_creator.h"
#include "microphone_creator.h"
2020-02-22 20:42:49 +01:00
#include "Emu/GameInfo.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/title.h"
#include "Crypto/unself.h"
#include <set>
#include <unordered_set>
#include <thread>
#include "util/sysinfo.hpp"
#include "util/asm.hpp"
2018-05-28 13:01:06 +02:00
#ifdef WITH_DISCORD_RPC
2018-06-16 22:56:21 +02:00
#include "_discord_utils.h"
2018-05-28 13:01:06 +02:00
#endif
LOG_CHANNEL(cfg_log, "CFG");
[Qt/Input] Improve pad_settings_dialog a bit (#3611) * Input: further work on remapping Xinput and begin work on remapping DS4 * Input: Improve pad_settings_dialog a bit and begin Remapping for XInput * Input: begin evdev remapping and change all handlers to use cfg::string * Input: finish work on remapping evdev and some more crap * Input: finish work on remapping Xinput and DS4 * Input: add DS4 Colors to DS4 config * Input: Improve DS4 deadzone scaling Jarves made some mistakes, so I'll fix them in the follow up commit * Input: fix Jarves fixes on DS4 deadzone and remove unnecessary usage of toUtf8 * Input: add primitive batterychecks to XInput and DS4 * Input: add mmjoystick remapping * Input: Fix evdev and some Vibration issues * Input: adjust capabilities to fix stick input for games like LoS 2 also fix threshold slider minimum also add ps button to all the handlers * Input: Further evdev work based on danilaml code review and own debugging: Fixed path issue, <= 0 issue, some captures, const, axis with same codes. Adds a map to each device that differentiates negative and positive axis mappings. adjusted rest of the file to tabs (ListDevices and beginning of threadProc) * Input: use 20ms vibration update time for xbox one elite controllers. * Input: Fix return type of Clamp() * Input: Evdev Fix * Input: Evdev Optional GetNextButtonPress presumably better than the other * Input: review changes * Input: evdev: fix wrong index in axis handling move bindpadtodevice down to keep consistency between handlers and not get crazy * Input: evdev: fix expensive add_device in GetNextButtonPress * cleanup * Input: mmjoy: fix type * Input: evdev: final fixes * Input: evdev: exclude unnecessary buttons while mapping Xbox 360 or DS4 * Input: add deadzone preview by passing necessary values in callback use 0.5 of max value for threshold in pad dialog * Input: get rid of all-uppercase variables
2017-11-27 22:31:15 +01:00
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
2017-07-24 02:21:40 +02:00
inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); }
inline QString qsv(std::string_view sv) { return QString(sv.data()); }
2020-12-08 20:22:08 +01:00
extern const std::map<std::string_view, int> g_prx_list;
2020-03-07 18:01:09 +01:00
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, const int& tab_index, QWidget *parent, const GameInfo* game)
: QDialog(parent)
2020-03-07 18:01:09 +01:00
, m_tab_index(tab_index)
, ui(new Ui::settings_dialog)
2020-03-07 20:54:42 +01:00
, m_gui_settings(gui_settings)
, m_emu_settings(emu_settings)
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
{
ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
ui->tab_widget_settings->setUsesScrollButtons(false);
ui->tab_widget_settings->tabBar()->setObjectName("tab_bar_settings");
2020-04-20 23:43:23 +02:00
if (!m_gui_settings->GetValue(gui::m_showDebugTab).toBool())
{
2019-08-15 18:01:19 +02:00
ui->tab_widget_settings->removeTab(9);
2020-04-20 23:43:23 +02:00
m_gui_settings->SetValue(gui::m_showDebugTab, false);
}
if (game)
2017-07-24 02:21:40 +02:00
{
2019-08-15 18:01:19 +02:00
ui->tab_widget_settings->removeTab(8);
ui->buttonBox->button(QDialogButtonBox::StandardButton::Save)->setText(tr("Save custom configuration", "Settings dialog"));
2017-07-24 02:21:40 +02:00
}
// Localized tooltips
2020-03-07 20:54:42 +01:00
const Tooltips tooltips;
// Add description labels
SubscribeDescription(ui->description_cpu);
SubscribeDescription(ui->description_gpu);
SubscribeDescription(ui->description_audio);
SubscribeDescription(ui->description_io);
SubscribeDescription(ui->description_system);
SubscribeDescription(ui->description_network);
2019-08-15 18:01:19 +02:00
SubscribeDescription(ui->description_advanced);
SubscribeDescription(ui->description_emulator);
if (!game)
{
SubscribeDescription(ui->description_gui);
}
SubscribeDescription(ui->description_debug);
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
if (game)
{
2020-03-07 20:54:42 +01:00
m_emu_settings->LoadSettings(game->serial);
setWindowTitle(tr("Settings: [%0] %1", "Settings dialog").arg(qstr(game->serial)).arg(qstr(game->name)));
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
}
else
{
2020-03-07 20:54:42 +01:00
m_emu_settings->LoadSettings();
setWindowTitle(tr("Settings", "Settings dialog"));
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
}
2018-05-28 13:01:06 +02:00
// Discord variables
2020-03-07 20:54:42 +01:00
m_use_discord = m_gui_settings->GetValue(gui::m_richPresence).toBool();
m_discord_state = m_gui_settings->GetValue(gui::m_discordState).toString();
2018-05-28 13:01:06 +02:00
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
// Various connects
const auto apply_configs = [this, use_discord_old = m_use_discord, discord_state_old = m_discord_state](bool do_exit)
{
2020-12-08 20:22:08 +01:00
std::set<std::string> selected;
for (int i = 0; i < ui->lleList->count(); ++i)
{
const auto& item = ui->lleList->item(i);
if (item->checkState() != Qt::CheckState::Unchecked)
{
2020-12-08 20:22:08 +01:00
// suffix indicates forced HLE mode
selected.emplace(sstr(item->text()) + ":hle");
}
}
for (int i = 0; i < ui->hleList->count(); ++i)
{
const auto& item = ui->hleList->item(i);
if (item->checkState() != Qt::CheckState::Unchecked)
{
// suffix indicates forced LLE mode
selected.emplace(sstr(item->text()) + ":lle");
}
}
2020-12-08 20:22:08 +01:00
std::vector<std::string> selected_ls(selected.begin(), selected.end());
2020-03-07 20:54:42 +01:00
m_emu_settings->SaveSelectedLibraries(selected_ls);
m_emu_settings->SaveSettings();
if (do_exit)
{
accept();
}
Q_EMIT EmuSettingsApplied();
2018-05-28 13:01:06 +02:00
2018-06-16 22:56:21 +02:00
// Discord Settings can be saved regardless of WITH_DISCORD_RPC
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::m_richPresence, m_use_discord);
m_gui_settings->SetValue(gui::m_discordState, m_discord_state);
2018-05-28 13:01:06 +02:00
2018-06-16 22:56:21 +02:00
#ifdef WITH_DISCORD_RPC
if (m_use_discord != use_discord_old)
2018-05-28 13:01:06 +02:00
{
2018-06-16 22:56:21 +02:00
if (m_use_discord)
2018-05-28 13:01:06 +02:00
{
2018-06-16 22:56:21 +02:00
discord::initialize();
discord::update_presence(sstr(m_discord_state));
2018-05-28 13:01:06 +02:00
}
else
{
2018-06-16 22:56:21 +02:00
discord::shutdown();
2018-05-28 13:01:06 +02:00
}
}
2018-06-16 22:56:21 +02:00
else if (m_discord_state != discord_state_old && Emu.IsStopped())
{
discord::update_presence(sstr(m_discord_state), "Idle", false);
}
2018-05-28 13:01:06 +02:00
#endif
};
2020-07-01 20:45:40 +02:00
connect(ui->buttonBox, &QDialogButtonBox::clicked, [apply_configs, this](QAbstractButton* button)
{
if (button == ui->buttonBox->button(QDialogButtonBox::Save))
{
apply_configs(true);
}
else if (button == ui->buttonBox->button(QDialogButtonBox::Apply))
{
apply_configs(false);
}
});
2017-10-06 11:10:18 +02:00
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
2017-10-06 11:10:18 +02:00
connect(ui->tab_widget_settings, &QTabWidget::currentChanged, [this]()
2017-10-06 11:10:18 +02:00
{
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
2017-10-06 11:10:18 +02:00
});
// _____ _____ _ _ _______ _
// / ____| __ \| | | | |__ __| | |
// | | | |__) | | | | | | __ _| |__
2021-01-08 20:30:24 +01:00
// | | | ___/| | | | | |/ _` | '_
// | |____| | | |__| | | | (_| | |_) |
// \_____|_| \____/ |_|\__,_|_.__/
// Checkboxes
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->spuCache, emu_settings_type::SPUCache);
SubscribeTooltip(ui->spuCache, tooltips.settings.spu_cache);
m_emu_settings->EnhanceCheckBox(ui->enableScheduler, emu_settings_type::EnableThreadScheduler);
SubscribeTooltip(ui->enableScheduler, tooltips.settings.enable_thread_scheduler);
m_emu_settings->EnhanceCheckBox(ui->lowerSPUThrPrio, emu_settings_type::LowerSPUThreadPrio);
SubscribeTooltip(ui->lowerSPUThrPrio, tooltips.settings.lower_spu_thread_priority);
m_emu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings_type::SPULoopDetection);
SubscribeTooltip(ui->spuLoopDetection, tooltips.settings.spu_loop_detection);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->accurateXFloat, emu_settings_type::AccurateXFloat);
SubscribeTooltip(ui->accurateXFloat, tooltips.settings.accurate_xfloat);
2017-07-24 02:21:40 +02:00
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->spuBlockSize, emu_settings_type::SPUBlockSize);
SubscribeTooltip(ui->gb_spuBlockSize, tooltips.settings.spu_block_size);
m_emu_settings->EnhanceComboBox(ui->preferredSPUThreads, emu_settings_type::PreferredSPUThreads, true);
SubscribeTooltip(ui->gb_spu_threads, tooltips.settings.preferred_spu_threads);
2020-04-17 10:06:58 +02:00
ui->preferredSPUThreads->setItemText(ui->preferredSPUThreads->findData(0), tr("Auto", "Preferred SPU threads"));
2017-07-24 02:21:40 +02:00
if (utils::has_rtm())
{
m_emu_settings->EnhanceComboBox(ui->enableTSX, emu_settings_type::EnableTSX);
SubscribeTooltip(ui->gb_tsx, tooltips.settings.enable_tsx);
static const QString tsx_forced = qstr(fmt::format("%s", tsx_usage::forced));
static const QString tsx_default = qstr(m_emu_settings->GetSettingDefault(emu_settings_type::EnableTSX));
// connect the toogled signal so that the stateChanged signal in EnhanceCheckBox can be prevented
connect(ui->enableTSX, &QComboBox::currentTextChanged, [this](const QString& text)
{
if (text == tsx_forced && !utils::has_mpx() && QMessageBox::No == QMessageBox::critical(this, tr("Haswell/Broadwell TSX Warning"), tr(
R"(
<p style="white-space: nowrap;">
RPCS3 has detected you are using TSX functions on a Haswell or Broadwell CPU.<br>
Intel has deactivated these functions in newer Microcode revisions, since they can lead to unpredicted behaviour.<br>
That means using TSX may break games or even <font color="red"><b>damage</b></font> your data.<br>
We recommend to disable this feature and update your computer BIOS.<br><br>
Do you wish to use TSX anyway?
</p>
)"
), QMessageBox::Yes, QMessageBox::No))
{
// Reset if the messagebox was answered with no. This prevents the currentIndexChanged signal in EnhanceComboBox
ui->enableTSX->setCurrentText(tsx_default);
}
});
}
else
{
ui->enableTSX->setEnabled(false);
ui->enableTSX->setPlaceholderText(tr("Not supported", "Enable TSX"));
SubscribeTooltip(ui->enableTSX, tr("Unfortunately your CPU model does not support this instruction set.", "Enable TSX"));
m_emu_settings->SetSetting(emu_settings_type::EnableTSX, fmt::format("%s", tsx_usage::disabled));
}
// PPU tool tips
SubscribeTooltip(ui->ppu_precise, tooltips.settings.ppu_precise);
SubscribeTooltip(ui->ppu_fast, tooltips.settings.ppu_fast);
SubscribeTooltip(ui->ppu_llvm, tooltips.settings.ppu_llvm);
2020-03-07 20:54:42 +01:00
QButtonGroup *ppu_bg = new QButtonGroup(this);
ppu_bg->addButton(ui->ppu_precise, static_cast<int>(ppu_decoder_type::precise));
ppu_bg->addButton(ui->ppu_fast, static_cast<int>(ppu_decoder_type::fast));
ppu_bg->addButton(ui->ppu_llvm, static_cast<int>(ppu_decoder_type::llvm));
m_emu_settings->EnhanceRadioButton(ppu_bg, emu_settings_type::PPUDecoder);
// SPU tool tips
SubscribeTooltip(ui->spu_precise, tooltips.settings.spu_precise);
SubscribeTooltip(ui->spu_fast, tooltips.settings.spu_fast);
SubscribeTooltip(ui->spu_asmjit, tooltips.settings.spu_asmjit);
SubscribeTooltip(ui->spu_llvm, tooltips.settings.spu_llvm);
2020-03-07 20:54:42 +01:00
QButtonGroup *spu_bg = new QButtonGroup(this);
spu_bg->addButton(ui->spu_precise, static_cast<int>(spu_decoder_type::precise));
spu_bg->addButton(ui->spu_fast, static_cast<int>(spu_decoder_type::fast));
spu_bg->addButton(ui->spu_asmjit, static_cast<int>(spu_decoder_type::asmjit));
spu_bg->addButton(ui->spu_llvm, static_cast<int>(spu_decoder_type::llvm));
m_emu_settings->EnhanceRadioButton(spu_bg, emu_settings_type::SPUDecoder);
connect(ui->spu_llvm, &QAbstractButton::toggled, [this](bool checked)
{
ui->accurateXFloat->setEnabled(checked);
});
connect(ui->spu_fast, &QAbstractButton::toggled, [this](bool checked)
{
ui->accurateXFloat->setEnabled(checked);
});
ui->accurateXFloat->setEnabled(ui->spu_llvm->isChecked() || ui->spu_fast->isChecked());
#ifndef LLVM_AVAILABLE
ui->ppu_llvm->setEnabled(false);
ui->spu_llvm->setEnabled(false);
#endif
// _____ _____ _ _ _______ _
// / ____| __ \| | | | |__ __| | |
// | | __| |__) | | | | | | __ _| |__
2021-01-08 20:30:24 +01:00
// | | |_ | ___/| | | | | |/ _` | '_
// | |__| | | | |__| | | | (_| | |_) |
// \_____|_| \____/ |_|\__,_|_.__/
render_creator* r_creator = m_emu_settings->m_render_creator;
if (!r_creator)
{
2020-09-29 18:26:54 +02:00
fmt::throw_exception("settings_dialog::settings_dialog() render_creator is null");
}
r_creator->update_names(
{
m_emu_settings->GetLocalizedSetting("Vulkan", emu_settings_type::Renderer, static_cast<int>(video_renderer::vulkan)),
m_emu_settings->GetLocalizedSetting("OpenGl", emu_settings_type::Renderer, static_cast<int>(video_renderer::opengl)),
m_emu_settings->GetLocalizedSetting("Null", emu_settings_type::Renderer, static_cast<int>(video_renderer::null))
});
2017-09-19 20:07:04 +02:00
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->renderBox, emu_settings_type::Renderer);
SubscribeTooltip(ui->gb_renderer, tooltips.settings.renderer);
SubscribeTooltip(ui->gb_graphicsAdapter, tooltips.settings.graphics_adapter);
m_emu_settings->EnhanceComboBox(ui->resBox, emu_settings_type::Resolution);
SubscribeTooltip(ui->gb_default_resolution, tooltips.settings.resolution);
// remove unsupported resolutions from the dropdown
const int saved_index = ui->resBox->currentIndex();
bool saved_index_removed = false;
if (game && game->resolution > 0)
{
const std::map<u32, std::string> resolutions
{
{ 1 << 0, fmt::format("%s", video_resolution::_480) },
{ 1 << 1, fmt::format("%s", video_resolution::_576) },
{ 1 << 2, fmt::format("%s", video_resolution::_720) },
{ 1 << 3, fmt::format("%s", video_resolution::_1080) },
// { 1 << 4, fmt::format("%s", video_resolution::_480p_16:9) },
// { 1 << 5, fmt::format("%s", video_resolution::_576p_16:9) },
};
for (int i = ui->resBox->count() - 1; i >= 0; i--)
{
2020-03-07 20:54:42 +01:00
bool has_resolution = false;
for (const auto& res : resolutions)
{
if ((game->resolution & res.first) && res.second == sstr(ui->resBox->itemText(i)))
{
2020-03-07 20:54:42 +01:00
has_resolution = true;
break;
}
}
2020-03-07 20:54:42 +01:00
if (!has_resolution)
{
ui->resBox->removeItem(i);
if (i == saved_index)
{
saved_index_removed = true;
}
}
}
}
for (int i = 0; i < ui->resBox->count(); i++)
{
const QVariantList var_list = ui->resBox->itemData(i).toList();
ensure(var_list.size() == 2 && var_list[0].canConvert<QString>());
if (var_list[0].toString() == "1280x720")
{
// Rename the default resolution for users
ui->resBox->setItemText(i, tr("1280x720 (Recommended)", "Resolution"));
// Set the current selection to the default if the original setting wasn't valid
if (saved_index_removed)
{
ui->resBox->setCurrentIndex(i);
}
break;
}
}
m_emu_settings->EnhanceComboBox(ui->aspectBox, emu_settings_type::AspectRatio);
SubscribeTooltip(ui->gb_aspectRatio, tooltips.settings.aspect_ratio);
m_emu_settings->EnhanceComboBox(ui->frameLimitBox, emu_settings_type::FrameLimit);
SubscribeTooltip(ui->gb_frameLimit, tooltips.settings.frame_limit);
m_emu_settings->EnhanceComboBox(ui->antiAliasing, emu_settings_type::MSAA);
SubscribeTooltip(ui->gb_antiAliasing, tooltips.settings.anti_aliasing);
2019-06-06 12:25:32 +02:00
m_emu_settings->EnhanceComboBox(ui->anisotropicFilterOverride, emu_settings_type::AnisotropicFilterOverride, true);
SubscribeTooltip(ui->gb_anisotropicFilter, tooltips.settings.anisotropic_filter);
// only allow values 0,2,4,8,16
for (int i = ui->anisotropicFilterOverride->count() - 1; i >= 0; i--)
{
switch (int val = ui->anisotropicFilterOverride->itemData(i).toInt())
{
case 0:
ui->anisotropicFilterOverride->setItemText(i, tr("Auto", "Anisotropic filter override"));
break;
case 2:
case 4:
case 8:
case 16:
ui->anisotropicFilterOverride->setItemText(i, tr("%1x", "Anisotropic filter override").arg(val));
break;
default:
ui->anisotropicFilterOverride->removeItem(i);
break;
}
}
2020-11-13 18:03:10 +01:00
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->shaderCompilerThreads, emu_settings_type::ShaderCompilerNumThreads, true);
SubscribeTooltip(ui->gb_shader_compiler_threads, tooltips.settings.shader_compiler_threads);
ui->shaderCompilerThreads->setItemText(ui->shaderCompilerThreads->findData(0), tr("Auto", "Number of Shader Compiler Threads"));
// Checkboxes: main options
m_emu_settings->EnhanceCheckBox(ui->dumpColor, emu_settings_type::WriteColorBuffers);
SubscribeTooltip(ui->dumpColor, tooltips.settings.dump_color);
m_emu_settings->EnhanceCheckBox(ui->vsync, emu_settings_type::VSync);
SubscribeTooltip(ui->vsync, tooltips.settings.vsync);
m_emu_settings->EnhanceCheckBox(ui->stretchToDisplayArea, emu_settings_type::StretchToDisplayArea);
SubscribeTooltip(ui->stretchToDisplayArea, tooltips.settings.stretch_to_display_area);
m_emu_settings->EnhanceCheckBox(ui->disableVertexCache, emu_settings_type::DisableVertexCache);
SubscribeTooltip(ui->disableVertexCache, tooltips.settings.disable_vertex_cache);
m_emu_settings->EnhanceCheckBox(ui->multithreadedRSX, emu_settings_type::MultithreadedRSX);
SubscribeTooltip(ui->multithreadedRSX, tooltips.settings.multithreaded_rsx);
connect(ui->multithreadedRSX, &QCheckBox::clicked, [this](bool checked)
{
ui->disableVertexCache->setEnabled(!checked);
});
ui->disableVertexCache->setEnabled(!ui->multithreadedRSX->isChecked());
2019-06-17 21:59:03 +02:00
m_emu_settings->EnhanceCheckBox(ui->strictModeRendering, emu_settings_type::StrictRenderingMode);
SubscribeTooltip(ui->strictModeRendering, tooltips.settings.strict_rendering_mode);
const auto onStrictRenderingMode = [this](bool checked)
{
ui->gb_resolutionScale->setEnabled(!checked);
ui->gb_minimumScalableDimension->setEnabled(!checked);
ui->gb_anisotropicFilter->setEnabled(!checked);
};
connect(ui->strictModeRendering, &QCheckBox::clicked, this, onStrictRenderingMode);
// Radio buttons
SubscribeTooltip(ui->rb_legacy_recompiler, tooltips.settings.legacy_shader_recompiler);
SubscribeTooltip(ui->rb_async_recompiler, tooltips.settings.async_shader_recompiler);
SubscribeTooltip(ui->rb_async_with_shader_interpreter, tooltips.settings.async_with_shader_interpreter);
SubscribeTooltip(ui->rb_shader_interpreter_only, tooltips.settings.shader_interpreter_only);
QButtonGroup *shader_mode_bg = new QButtonGroup(this);
shader_mode_bg->addButton(ui->rb_legacy_recompiler, static_cast<int>(shader_mode::recompiler));
shader_mode_bg->addButton(ui->rb_async_recompiler, static_cast<int>(shader_mode::async_recompiler));
shader_mode_bg->addButton(ui->rb_async_with_shader_interpreter, static_cast<int>(shader_mode::async_with_interpreter));
shader_mode_bg->addButton(ui->rb_shader_interpreter_only, static_cast<int>(shader_mode::interpreter_only));
m_emu_settings->EnhanceRadioButton(shader_mode_bg, emu_settings_type::ShaderMode);
// Sliders
m_emu_settings->EnhanceSlider(ui->resolutionScale, emu_settings_type::ResolutionScale);
SubscribeTooltip(ui->gb_resolutionScale, tooltips.settings.resolution_scale);
// rename label texts to fit current state of Resolution Scale
const int resolution_scale_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::ResolutionScale));
2020-03-07 20:54:42 +01:00
auto scaled_resolution = [resolution_scale_def](int percentage)
{
2020-03-07 20:54:42 +01:00
if (percentage == resolution_scale_def)
{
return tr("100% (Default)", "Resolution scale");
}
return tr("%1% (%2x%3)", "Resolution scale").arg(percentage).arg(1280 * percentage / 100).arg(720 * percentage / 100);
};
ui->resolutionScale->setPageStep(50);
ui->resolutionScaleMin->setText(QString::number(ui->resolutionScale->minimum()));
2020-04-17 10:06:58 +02:00
ui->resolutionScaleMin->setFixedWidth(gui::utils::get_label_width(QStringLiteral("00")));
ui->resolutionScaleMax->setText(QString::number(ui->resolutionScale->maximum()));
2020-04-17 10:06:58 +02:00
ui->resolutionScaleMax->setFixedWidth(gui::utils::get_label_width(QStringLiteral("0000")));
2020-03-07 20:54:42 +01:00
ui->resolutionScaleVal->setText(scaled_resolution(ui->resolutionScale->value()));
2020-04-17 10:06:58 +02:00
connect(ui->resolutionScale, &QSlider::valueChanged, [scaled_resolution, this](int value)
{
2020-03-07 20:54:42 +01:00
ui->resolutionScaleVal->setText(scaled_resolution(value));
});
2020-03-07 20:54:42 +01:00
connect(ui->resolutionScaleReset, &QAbstractButton::clicked, [resolution_scale_def, this]()
{
2020-03-07 20:54:42 +01:00
ui->resolutionScale->setValue(resolution_scale_def);
});
2020-01-15 17:55:13 +01:00
SnapSlider(ui->resolutionScale, 25);
m_emu_settings->EnhanceSlider(ui->minimumScalableDimension, emu_settings_type::MinimumScalableDimension);
SubscribeTooltip(ui->gb_minimumScalableDimension, tooltips.settings.minimum_scalable_dimension);
// rename label texts to fit current state of Minimum Scalable Dimension
const int minimum_scalable_dimension_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::MinimumScalableDimension));
2020-03-07 20:54:42 +01:00
auto min_scalable_dimension = [minimum_scalable_dimension_def](int dim)
{
2020-03-07 20:54:42 +01:00
if (dim == minimum_scalable_dimension_def)
{
return tr("%1x%1 (Default)", "Minimum scalable dimension").arg(dim);
}
return tr("%1x%1", "Minimum scalable dimension").arg(dim);
};
ui->minimumScalableDimension->setPageStep(64);
ui->minimumScalableDimensionMin->setText(QString::number(ui->minimumScalableDimension->minimum()));
2020-04-17 10:06:58 +02:00
ui->minimumScalableDimensionMin->setFixedWidth(gui::utils::get_label_width(QStringLiteral("00")));
ui->minimumScalableDimensionMax->setText(QString::number(ui->minimumScalableDimension->maximum()));
2020-04-17 10:06:58 +02:00
ui->minimumScalableDimensionMax->setFixedWidth(gui::utils::get_label_width(QStringLiteral("0000")));
2020-03-07 20:54:42 +01:00
ui->minimumScalableDimensionVal->setText(min_scalable_dimension(ui->minimumScalableDimension->value()));
2020-07-01 20:45:40 +02:00
connect(ui->minimumScalableDimension, &QSlider::valueChanged, [min_scalable_dimension, this](int value)
{
2020-03-07 20:54:42 +01:00
ui->minimumScalableDimensionVal->setText(min_scalable_dimension(value));
});
2020-03-07 20:54:42 +01:00
connect(ui->minimumScalableDimensionReset, &QAbstractButton::clicked, [minimum_scalable_dimension_def, this]()
{
2020-03-07 20:54:42 +01:00
ui->minimumScalableDimension->setValue(minimum_scalable_dimension_def);
});
// Remove renderers from the renderer Combobox if not supported
for (const auto& renderer : r_creator->renderers)
{
if (renderer->supported)
{
if (renderer->has_adapters)
{
2020-03-07 20:54:42 +01:00
renderer->old_adapter = qstr(m_emu_settings->GetSetting(renderer->type));
}
continue;
}
for (int i = 0; i < ui->renderBox->count(); i++)
{
if (ui->renderBox->itemText(i) == renderer->name)
{
ui->renderBox->removeItem(i);
break;
}
}
}
2020-03-07 18:01:09 +01:00
m_old_renderer = ui->renderBox->currentText();
2020-07-01 20:45:40 +02:00
auto set_renderer = [r_creator, this](QString text)
{
if (text.isEmpty())
{
return;
}
2020-07-01 20:45:40 +02:00
auto switchTo = [r_creator, text, this](render_creator::render_info renderer)
{
// Reset other adapters to old config
for (const auto& render : r_creator->renderers)
{
if (renderer.name != render->name && render->has_adapters && render->supported)
{
2020-03-07 20:54:42 +01:00
m_emu_settings->SetSetting(render->type, sstr(render->old_adapter));
}
}
// Enable/disable MSAA depending on renderer
ui->antiAliasing->setEnabled(renderer.has_msaa);
ui->antiAliasing->blockSignals(true);
ui->antiAliasing->setCurrentText(renderer.has_msaa ? qstr(m_emu_settings->GetSetting(emu_settings_type::MSAA)) : tr("Disabled", "MSAA"));
ui->antiAliasing->blockSignals(false);
2020-09-29 18:26:54 +02:00
ui->graphicsAdapterBox->clear();
// Fill combobox with placeholder if no adapters needed
if (!renderer.has_adapters)
{
ui->graphicsAdapterBox->clear();
ui->graphicsAdapterBox->setPlaceholderText(tr("Not needed for %0 renderer", "Graphics adapter").arg(text));
return;
}
// Fill combobox
ui->graphicsAdapterBox->clear();
ui->graphicsAdapterBox->addItems(renderer.adapters);
// Reset Adapter to old config
int idx = ui->graphicsAdapterBox->findText(renderer.old_adapter);
2020-03-07 18:01:09 +01:00
if (idx < 0)
{
idx = 0;
if (renderer.old_adapter.isEmpty())
{
rsx_log.warning("%s adapter config empty: setting to default!", sstr(renderer.name));
}
else
{
rsx_log.warning("Last used %s adapter not found: setting to default!", sstr(renderer.name));
}
}
ui->graphicsAdapterBox->setCurrentIndex(idx);
2020-03-07 20:54:42 +01:00
m_emu_settings->SetSetting(renderer.type, sstr(ui->graphicsAdapterBox->currentText()));
};
for (const auto& renderer : r_creator->renderers)
{
2017-09-19 20:07:04 +02:00
if (renderer->name == text)
{
2017-09-19 20:07:04 +02:00
switchTo(*renderer);
ui->graphicsAdapterBox->setEnabled(renderer->has_adapters);
}
}
};
2020-07-01 20:45:40 +02:00
auto set_adapter = [r_creator, this](QString text)
{
if (text.isEmpty())
{
return;
}
// don't set adapter if signal was created by switching render
2020-03-07 18:01:09 +01:00
const QString new_renderer = ui->renderBox->currentText();
if (m_old_renderer != new_renderer)
{
2020-03-07 18:01:09 +01:00
m_old_renderer = new_renderer;
return;
}
for (const auto& render : r_creator->renderers)
{
2020-03-07 18:01:09 +01:00
if (render->name == new_renderer && render->has_adapters && render->adapters.contains(text))
{
2020-03-07 20:54:42 +01:00
m_emu_settings->SetSetting(render->type, sstr(text));
break;
}
}
};
// Init
2020-03-07 20:54:42 +01:00
set_renderer(ui->renderBox->currentText());
set_adapter(ui->graphicsAdapterBox->currentText());
// Events
2020-03-07 20:54:42 +01:00
connect(ui->graphicsAdapterBox, &QComboBox::currentTextChanged, set_adapter);
connect(ui->renderBox, &QComboBox::currentTextChanged, set_renderer);
2020-03-07 20:54:42 +01:00
auto fix_gl_legacy = [=, this](const QString& text)
{
ui->glLegacyBuffers->setEnabled(text == r_creator->OpenGL.name);
};
// Handle connects to disable specific checkboxes that depend on GUI state.
onStrictRenderingMode(ui->strictModeRendering->isChecked());
2020-03-07 20:54:42 +01:00
fix_gl_legacy(ui->renderBox->currentText()); // Init
connect(ui->renderBox, &QComboBox::currentTextChanged, fix_gl_legacy);
// _ _ _______ _
// /\ | (_) |__ __| | |
// / \ _ _ __| |_ ___ | | __ _| |__
2021-01-08 20:30:24 +01:00
// / /\ \| | | |/ _` | |/ _ \ | |/ _` | '_
// / ____ \ |_| | (_| | | (_) | | | (_| | |_) |
// /_/ \_\__,_|\__,_|_|\___/ |_|\__,_|_.__/
2020-03-07 20:54:42 +01:00
auto enable_time_stretching_options = [this](bool enabled)
{
ui->timeStretchingThresholdLabel->setEnabled(enabled);
ui->timeStretchingThreshold->setEnabled(enabled);
};
2018-12-20 23:36:56 +01:00
2020-03-07 20:54:42 +01:00
auto enable_buffering_options = [this, enable_time_stretching_options](bool enabled)
{
ui->audioBufferDuration->setEnabled(enabled);
ui->audioBufferDurationLabel->setEnabled(enabled);
ui->enableTimeStretching->setEnabled(enabled);
2020-03-07 20:54:42 +01:00
enable_time_stretching_options(enabled && ui->enableTimeStretching->isChecked());
};
2018-12-20 23:36:56 +01:00
2020-04-17 10:06:58 +02:00
auto enable_buffering = [this, enable_buffering_options](int index)
{
const QVariantList var_list = ui->audioOutBox->itemData(index).toList();
ensure(var_list.size() == 2 && var_list[0].canConvert<QString>());
const QString text = var_list[0].toString();
const bool enabled = text == "XAudio2" || text == "OpenAL" || text == "FAudio";
ui->enableBuffering->setEnabled(enabled);
2020-03-07 20:54:42 +01:00
enable_buffering_options(enabled && ui->enableBuffering->isChecked());
};
const QString mic_none = m_emu_settings->m_microphone_creator.get_none();
auto change_microphone_type = [mic_none, this](int index)
2018-12-20 23:36:56 +01:00
{
if (index < 0)
2018-12-20 23:36:56 +01:00
{
return;
}
const QVariantList var_list = ui->microphoneBox->itemData(index).toList();
ensure(var_list.size() == 2 && var_list[1].canConvert<int>());
const int handler_id = var_list[1].toInt();
int max = 0;
switch (static_cast<microphone_handler>(handler_id))
2018-12-20 23:36:56 +01:00
{
case microphone_handler::standard:
max = 4;
break;
case microphone_handler::singstar:
max = 2;
break;
case microphone_handler::real_singstar:
case microphone_handler::rocksmith:
max = 1;
break;
case microphone_handler::null:
default:
break;
2018-12-20 23:36:56 +01:00
}
ui->microphone1Box->setEnabled(max > 0);
ui->microphone2Box->setEnabled(max > 1 && ui->microphone1Box->currentText() != mic_none);
ui->microphone3Box->setEnabled(max > 2 && ui->microphone2Box->currentText() != mic_none);
ui->microphone4Box->setEnabled(ui->microphone3Box->isEnabled() && ui->microphone3Box->currentText() != mic_none);
2018-12-20 23:36:56 +01:00
};
2020-07-01 20:45:40 +02:00
auto propagate_used_devices = [mic_none, change_microphone_type, this]()
2018-12-20 23:36:56 +01:00
{
for (u32 index = 0; index < 4; index++)
{
2020-07-01 20:45:40 +02:00
const QString cur_item = m_mics_combo[index]->currentText();
QStringList cur_list = m_emu_settings->m_microphone_creator.get_microphone_list();
2018-12-20 23:36:56 +01:00
for (u32 subindex = 0; subindex < 4; subindex++)
{
2020-07-01 20:45:40 +02:00
if (subindex != index && m_mics_combo[subindex]->currentText() != mic_none)
cur_list.removeOne(m_mics_combo[subindex]->currentText());
2018-12-20 23:36:56 +01:00
}
2020-07-01 20:45:40 +02:00
m_mics_combo[index]->blockSignals(true);
m_mics_combo[index]->clear();
m_mics_combo[index]->addItems(cur_list);
m_mics_combo[index]->setCurrentText(cur_item);
m_mics_combo[index]->blockSignals(false);
2018-12-20 23:36:56 +01:00
}
change_microphone_type(ui->microphoneBox->currentIndex());
2018-12-20 23:36:56 +01:00
};
2019-08-06 19:59:41 +02:00
2020-07-01 20:45:40 +02:00
auto change_microphone_device = [mic_none, propagate_used_devices, this](u32 next_index, QString text)
2018-12-20 23:36:56 +01:00
{
m_emu_settings->SetSetting(emu_settings_type::MicrophoneDevices, m_emu_settings->m_microphone_creator.set_device(next_index, text));
if (next_index < 4 && text == mic_none)
2020-07-01 20:45:40 +02:00
m_mics_combo[next_index]->setCurrentText(mic_none);
2020-03-07 20:54:42 +01:00
propagate_used_devices();
2018-12-20 23:36:56 +01:00
};
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->audioOutBox, emu_settings_type::AudioRenderer);
#ifdef WIN32
SubscribeTooltip(ui->gb_audio_out, tooltips.settings.audio_out);
#else
SubscribeTooltip(ui->gb_audio_out, tooltips.settings.audio_out_linux);
#endif
2020-04-17 10:06:58 +02:00
connect(ui->audioOutBox, QOverload<int>::of(&QComboBox::currentIndexChanged), enable_buffering);
m_emu_settings->EnhanceComboBox(ui->combo_audio_downmix, emu_settings_type::AudioChannels);
SubscribeTooltip(ui->gb_audio_downmix, tooltips.settings.downmix);
// TODO: enable this setting once cellAudioOutConfigure can change downmix on the fly
ui->combo_audio_downmix->removeItem(static_cast<int>(audio_downmix::use_application_settings));
2020-06-01 20:36:45 +02:00
2018-12-20 23:36:56 +01:00
// Microphone Comboboxes
2020-07-01 20:45:40 +02:00
m_mics_combo[0] = ui->microphone1Box;
m_mics_combo[1] = ui->microphone2Box;
m_mics_combo[2] = ui->microphone3Box;
m_mics_combo[3] = ui->microphone4Box;
connect(m_mics_combo[0], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(1, text); });
connect(m_mics_combo[1], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(2, text); });
connect(m_mics_combo[2], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(3, text); });
connect(m_mics_combo[3], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(4, text); });
m_emu_settings->m_microphone_creator.refresh_list();
2020-03-07 20:54:42 +01:00
propagate_used_devices(); // Fills comboboxes list
2018-12-20 23:36:56 +01:00
m_emu_settings->m_microphone_creator.parse_devices(m_emu_settings->GetSetting(emu_settings_type::MicrophoneDevices));
const auto mic_sel_list = m_emu_settings->m_microphone_creator.get_selection_list();
2018-12-20 23:36:56 +01:00
for (s32 index = 3; index >= 0; index--)
{
const auto mic = mic_sel_list[index];
const auto qmic = qstr(mic);
2020-07-01 20:45:40 +02:00
if (mic.empty() || m_mics_combo[index]->findText(qmic) == -1)
2018-12-20 23:36:56 +01:00
{
2020-07-01 20:45:40 +02:00
m_mics_combo[index]->setCurrentText(mic_none);
change_microphone_device(index+1, mic_none); // Ensures the value is set in config
2018-12-20 23:36:56 +01:00
}
else
{
2020-07-01 20:45:40 +02:00
m_mics_combo[index]->setCurrentText(qmic);
}
2018-12-20 23:36:56 +01:00
}
m_emu_settings->EnhanceComboBox(ui->microphoneBox, emu_settings_type::MicrophoneType);
SubscribeTooltip(ui->microphoneBox, tooltips.settings.microphone);
connect(ui->microphoneBox, QOverload<int>::of(&QComboBox::currentIndexChanged), change_microphone_type);
2020-03-07 20:54:42 +01:00
propagate_used_devices(); // Enables/Disables comboboxes and checks values from config for sanity
2018-12-20 23:36:56 +01:00
// Checkboxes
m_emu_settings->EnhanceCheckBox(ui->audioDump, emu_settings_type::DumpToFile);
SubscribeTooltip(ui->audioDump, tooltips.settings.audio_dump);
m_emu_settings->EnhanceCheckBox(ui->convert, emu_settings_type::ConvertTo16Bit);
SubscribeTooltip(ui->convert, tooltips.settings.convert);
m_emu_settings->EnhanceCheckBox(ui->enableBuffering, emu_settings_type::EnableBuffering);
SubscribeTooltip(ui->enableBuffering, tooltips.settings.enable_buffering);
2020-03-07 20:54:42 +01:00
connect(ui->enableBuffering, &QCheckBox::clicked, enable_buffering_options);
m_emu_settings->EnhanceCheckBox(ui->enableTimeStretching, emu_settings_type::EnableTimeStretching);
SubscribeTooltip(ui->enableTimeStretching, tooltips.settings.enable_time_stretching);
2020-03-07 20:54:42 +01:00
connect(ui->enableTimeStretching, &QCheckBox::clicked, enable_time_stretching_options);
2020-04-17 10:06:58 +02:00
enable_buffering(ui->audioOutBox->currentIndex());
// Sliders
EnhanceSlider(emu_settings_type::MasterVolume, ui->masterVolume, ui->masterVolumeLabel, tr("Master: %0 %", "Master volume"));
SubscribeTooltip(ui->master_volume, tooltips.settings.master_volume);
EnhanceSlider(emu_settings_type::AudioBufferDuration, ui->audioBufferDuration, ui->audioBufferDurationLabel, tr("Audio Buffer Duration: %0 ms", "Audio buffer duration"));
SubscribeTooltip(ui->audio_buffer_duration, tooltips.settings.audio_buffer_duration);
EnhanceSlider(emu_settings_type::TimeStretchingThreshold, ui->timeStretchingThreshold, ui->timeStretchingThresholdLabel, tr("Time Stretching Threshold: %0 %", "Time stretching threshold"));
SubscribeTooltip(ui->time_stretching_threshold, tooltips.settings.time_stretching_threshold);
// _____ __ ____ _______ _
// |_ _| / / / __ \ |__ __| | |
// | | / / | | | | | | __ _| |__
2021-01-08 20:30:24 +01:00
// | | / / | | | | | |/ _` | '_
// _| |_ / / | |__| | | | (_| | |_) |
// |_____| /_/ \____/ |_|\__,_|_.__/
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->keyboardHandlerBox, emu_settings_type::KeyboardHandler);
SubscribeTooltip(ui->gb_keyboard_handler, tooltips.settings.keyboard_handler);
m_emu_settings->EnhanceComboBox(ui->mouseHandlerBox, emu_settings_type::MouseHandler);
SubscribeTooltip(ui->gb_mouse_handler, tooltips.settings.mouse_handler);
m_emu_settings->EnhanceComboBox(ui->cameraTypeBox, emu_settings_type::CameraType);
SubscribeTooltip(ui->gb_camera_type, tooltips.settings.camera_type);
m_emu_settings->EnhanceComboBox(ui->cameraBox, emu_settings_type::Camera);
SubscribeTooltip(ui->gb_camera_setting, tooltips.settings.camera);
m_emu_settings->EnhanceComboBox(ui->moveBox, emu_settings_type::Move);
SubscribeTooltip(ui->gb_move_handler, tooltips.settings.move);
// _____ _ _______ _
// / ____| | | |__ __| | |
// | (___ _ _ ___| |_ ___ _ __ ___ | | __ _| |__
2021-01-08 20:30:24 +01:00
// \___ \| | | / __| __/ _ \ '_ ` _ \ | |/ _` | '_
// ____) | |_| \__ \ || __/ | | | | | | | (_| | |_) |
// |_____/ \__, |___/\__\___|_| |_| |_| |_|\__,_|_.__/
// __/ |
// |___/
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->sysLangBox, emu_settings_type::Language, false, false, 0, true);
SubscribeTooltip(ui->gb_sysLang, tooltips.settings.system_language);
2020-10-30 20:54:49 +01:00
m_emu_settings->EnhanceComboBox(ui->console_region, emu_settings_type::LicenseArea, false, false, 0, true);
SubscribeTooltip(ui->gb_console_region, tooltips.settings.license_area);
m_emu_settings->EnhanceComboBox(ui->keyboardType, emu_settings_type::KeyboardType, false, false, 0, true);
SubscribeTooltip(ui->gb_keyboardType, tooltips.settings.keyboard_type);
2019-08-17 16:08:47 +02:00
// Checkboxes
m_emu_settings->EnhanceCheckBox(ui->enableHostRoot, emu_settings_type::EnableHostRoot);
SubscribeTooltip(ui->enableHostRoot, tooltips.settings.enable_host_root);
m_emu_settings->EnhanceCheckBox(ui->enableCacheClearing, emu_settings_type::LimitCacheSize);
SubscribeTooltip(ui->gb_DiskCacheClearing, tooltips.settings.limit_cache_size);
connect(ui->enableCacheClearing, &QCheckBox::stateChanged, ui->maximumCacheSize, &QSlider::setEnabled);
// Date Time Edit Box
m_emu_settings->EnhanceDateTimeEdit(ui->console_time_edit, emu_settings_type::ConsoleTimeOffset, tr("dd MMM yyyy HH:mm"), true, true, 15000);
connect(ui->console_time_reset, &QAbstractButton::clicked, [this]()
{
ui->console_time_edit->setDateTime(QDateTime::currentDateTime());
});
SubscribeTooltip(ui->gb_console_time, tooltips.settings.console_time_offset);
// Sliders
EnhanceSlider(emu_settings_type::MaximumCacheSize, ui->maximumCacheSize, ui->maximumCacheSizeLabel, tr("Maximum size: %0 MB", "Maximum cache size"));
ui->maximumCacheSize->setEnabled(ui->enableCacheClearing->isChecked());
// Radio Buttons
// creating this in ui file keeps scrambling the order...
2020-03-07 20:54:42 +01:00
QButtonGroup *enter_button_assignment_bg = new QButtonGroup(this);
enter_button_assignment_bg->addButton(ui->enterButtonAssignCircle, 0);
enter_button_assignment_bg->addButton(ui->enterButtonAssignCross, 1);
m_emu_settings->EnhanceRadioButton(enter_button_assignment_bg, emu_settings_type::EnterButtonAssignment);
2020-04-06 20:08:02 +02:00
SubscribeTooltip(ui->gb_enterButtonAssignment, tooltips.settings.enter_button_assignment);
// _ _ _ _ _______ _
// | \ | | | | | | |__ __| | |
// | \| | ___| |___ _____ _ __| | __ | | __ _| |__
2021-01-08 20:30:24 +01:00
// | . ` |/ _ \ __\ \ /\ / / _ \| '__| |/ / | |/ _` | '_
// | |\ | __/ |_ \ V V / (_) | | | < | | (_| | |_) |
// |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\ |_|\__,_|_.__/
2020-03-04 14:55:35 +01:00
// Edits
2020-04-17 10:06:58 +02:00
m_emu_settings->EnhanceLineEdit(ui->edit_dns, emu_settings_type::DNSAddress);
SubscribeTooltip(ui->gb_edit_dns, tooltips.settings.dns);
2020-03-04 14:55:35 +01:00
2020-04-17 10:06:58 +02:00
m_emu_settings->EnhanceLineEdit(ui->edit_swaps, emu_settings_type::IpSwapList);
SubscribeTooltip(ui->gb_edit_swaps, tooltips.settings.dns_swap);
2020-03-04 14:55:35 +01:00
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->netStatusBox, emu_settings_type::InternetStatus);
SubscribeTooltip(ui->gb_netStatusBox, tooltips.settings.net_status);
2020-03-04 14:55:35 +01:00
connect(ui->netStatusBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index)
{
ui->edit_dns->setEnabled(index > 0);
});
ui->edit_dns->setEnabled(ui->netStatusBox->currentIndex() > 0);
m_emu_settings->EnhanceComboBox(ui->psnStatusBox, emu_settings_type::PSNStatus);
SubscribeTooltip(ui->gb_psnStatusBox, tooltips.settings.psn_status);
2019-08-15 18:01:19 +02:00
// _ _ _______ _
// /\ | | | | |__ __| | |
// / \ __| |_ ____ _ _ __ ___ ___ __| | | | __ _| |__
2021-01-08 20:30:24 +01:00
// / /\ \ / _` \ \ / / _` | '_ \ / __/ _ \/ _` | | |/ _` | '_
2019-08-15 18:01:19 +02:00
// / ____ \ (_| |\ V / (_| | | | | (_| __/ (_| | | | (_| | |_) |
// /_/ \_\__,_| \_/ \__,_|_| |_|\___\___|\__,_| |_|\__,_|_.__/
// Checkboxes
m_emu_settings->EnhanceCheckBox(ui->debugConsoleMode, emu_settings_type::DebugConsoleMode);
SubscribeTooltip(ui->debugConsoleMode, tooltips.settings.debug_console_mode);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceCheckBox(ui->accurateLLVMdfma, emu_settings_type::AccurateLLVMdfma);
SubscribeTooltip(ui->accurateLLVMdfma, tooltips.settings.accurate_llvm_dfma);
ui->accurateLLVMdfma->setDisabled(utils::has_fma3() || utils::has_fma4());
m_emu_settings->EnhanceCheckBox(ui->AccurateVectorNaN, emu_settings_type::AccurateVectorNaN);
SubscribeTooltip(ui->AccurateVectorNaN, tooltips.settings.accurate_vector_nan);
m_emu_settings->EnhanceCheckBox(ui->silenceAllLogs, emu_settings_type::SilenceAllLogs);
SubscribeTooltip(ui->silenceAllLogs, tooltips.settings.silence_all_logs);
2020-02-01 05:14:26 +01:00
m_emu_settings->EnhanceCheckBox(ui->readColor, emu_settings_type::ReadColorBuffers);
SubscribeTooltip(ui->readColor, tooltips.settings.read_color);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceCheckBox(ui->readDepth, emu_settings_type::ReadDepthBuffer);
SubscribeTooltip(ui->readDepth, tooltips.settings.read_depth);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceCheckBox(ui->dumpDepth, emu_settings_type::WriteDepthBuffer);
SubscribeTooltip(ui->dumpDepth, tooltips.settings.dump_depth);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceCheckBox(ui->disableOnDiskShaderCache, emu_settings_type::DisableOnDiskShaderCache);
SubscribeTooltip(ui->disableOnDiskShaderCache, tooltips.settings.disable_on_disk_shader_cache);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceCheckBox(ui->relaxedZCULL, emu_settings_type::RelaxedZCULL);
SubscribeTooltip(ui->relaxedZCULL, tooltips.settings.relaxed_zcull);
2019-08-15 18:01:19 +02:00
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->maxSPURSThreads, emu_settings_type::MaxSPURSThreads, true);
2020-04-17 10:06:58 +02:00
ui->maxSPURSThreads->setItemText(ui->maxSPURSThreads->findData(6), tr("Unlimited (Default)", "Max SPURS threads"));
SubscribeTooltip(ui->gb_max_spurs_threads, tooltips.settings.max_spurs_threads);
2019-08-15 18:01:19 +02:00
m_emu_settings->EnhanceComboBox(ui->sleepTimersAccuracy, emu_settings_type::SleepTimersAccuracy);
SubscribeTooltip(ui->gb_sleep_timers_accuracy, tooltips.settings.sleep_timers_accuracy);
2019-08-15 18:01:19 +02:00
// Sliders
EnhanceSlider(emu_settings_type::DriverWakeUpDelay, ui->wakeupDelay, ui->wakeupText, tr(reinterpret_cast<const char*>(u8"%0 µs"), "Driver wake up delay"));
SnapSlider(ui->wakeupDelay, 200);
ui->wakeupDelay->setMaximum(7000); // Very large values must be entered with config.yml changes
ui->wakeupDelay->setPageStep(200);
const int wakeup_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::DriverWakeUpDelay));
2020-07-01 20:45:40 +02:00
connect(ui->wakeupReset, &QAbstractButton::clicked, [wakeup_def, this]()
2020-01-08 15:36:15 +01:00
{
2020-03-07 20:54:42 +01:00
ui->wakeupDelay->setValue(wakeup_def);
2020-01-08 15:36:15 +01:00
});
EnhanceSlider(emu_settings_type::VBlankRate, ui->vblank, ui->vblankText, tr("%0 Hz", "VBlank rate"));
2020-01-15 17:55:13 +01:00
SnapSlider(ui->vblank, 30);
ui->vblank->setPageStep(60);
const int vblank_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::VBlankRate));
2020-07-01 20:45:40 +02:00
connect(ui->vblankReset, &QAbstractButton::clicked, [vblank_def, this]()
2019-08-15 18:01:19 +02:00
{
2020-03-07 20:54:42 +01:00
ui->vblank->setValue(vblank_def);
2019-08-15 18:01:19 +02:00
});
EnhanceSlider(emu_settings_type::ClocksScale, ui->clockScale, ui->clockScaleText, tr("%0 %", "Clocks scale"));
2020-01-15 17:55:13 +01:00
SnapSlider(ui->clockScale, 10);
ui->clockScale->setPageStep(50);
2020-04-20 20:22:43 +02:00
const int clocks_scale_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::ClocksScale));
connect(ui->clockScaleReset, &QAbstractButton::clicked, [=, this]()
2019-08-15 18:01:19 +02:00
{
2020-03-07 20:54:42 +01:00
ui->clockScale->setValue(clocks_scale_def);
2019-08-15 18:01:19 +02:00
});
if (!game) // Prevent users from doing dumb things
{
ui->vblank->setDisabled(true);
ui->vblankReset->setDisabled(true);
SubscribeTooltip(ui->gb_vblank, tooltips.settings.disabled_from_global);
2019-08-15 18:01:19 +02:00
ui->clockScale->setDisabled(true);
ui->clockScaleReset->setDisabled(true);
SubscribeTooltip(ui->gb_clockScale, tooltips.settings.disabled_from_global);
2020-01-14 14:42:07 +01:00
ui->wakeupDelay->setDisabled(true);
ui->wakeupReset->setDisabled(true);
SubscribeTooltip(ui->gb_wakeupDelay, tooltips.settings.disabled_from_global);
2019-08-15 18:01:19 +02:00
}
else
{
SubscribeTooltip(ui->gb_vblank, tooltips.settings.vblank_rate);
SubscribeTooltip(ui->gb_clockScale, tooltips.settings.clocks_scale);
SubscribeTooltip(ui->gb_wakeupDelay, tooltips.settings.wake_up_delay);
2019-08-15 18:01:19 +02:00
}
2020-12-08 20:22:08 +01:00
std::vector<std::string> loadedLibs = m_emu_settings->GetLibrariesControl();
std::set<std::string_view> set(loadedLibs.begin(), loadedLibs.end());
2020-12-08 20:22:08 +01:00
for (const auto& lib : g_prx_list)
{
2020-12-08 20:22:08 +01:00
// -1: Override LLE
// 1: Override HLE
// 0: No override
const int res = static_cast<int>(set.count(std::string(lib.first) + ":hle") - set.count(std::string(lib.first) + ":lle"));
const auto list = (lib.second ? ui->hleList : ui->lleList);
QListWidgetItem* item = new QListWidgetItem(qsv(lib.first), list);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag
2020-12-08 20:22:08 +01:00
// If no override selected (res=0), checkbox is unchecked
// Otherwise if the override does not match the default behaviour, checkbox is checked
2020-12-08 20:22:08 +01:00
item->setCheckState(res && res != (lib.second * 2 - 1) ? Qt::Checked : Qt::Unchecked); // AND initialize check state
2020-12-08 20:22:08 +01:00
item->setToolTip(!lib.second ? tooltips.settings.lib_default_lle :
(lib.first.starts_with("libsysutil") ? tr("Do not touch libsysutil libs, development purposes only, will cause game crashes.") : tooltips.settings.lib_default_hle));
2020-12-08 20:22:08 +01:00
list->addItem(item);
}
2020-12-08 20:22:08 +01:00
SubscribeTooltip(ui->lleList, tooltips.settings.lle_list);
SubscribeTooltip(ui->hleList, tooltips.settings.hle_list);
ui->searchBox->setPlaceholderText(tr("Search libraries", "Library search box"));
2020-12-08 20:22:08 +01:00
auto on_lib_state_changed = [this](QString text)
{
2020-03-07 20:54:42 +01:00
const QString search_term = text.toLower();
2020-12-08 20:22:08 +01:00
std::vector<QListWidgetItem*> items, items2;
2020-12-08 20:22:08 +01:00
// Take current items
while (ui->lleList->count())
{
2020-12-08 20:22:08 +01:00
items.push_back(ui->lleList->takeItem(0));
}
while (ui->hleList->count())
{
items2.push_back(ui->hleList->takeItem(0));
}
// sort items: checked items first then alphabetical order
2020-12-08 20:22:08 +01:00
const auto func = [](QListWidgetItem *i1, QListWidgetItem *i2)
{
return (i1->checkState() != i2->checkState()) ? (i1->checkState() > i2->checkState()) : (i1->text() < i2->text());
2020-12-08 20:22:08 +01:00
};
2020-12-08 20:22:08 +01:00
std::sort(items.begin(), items.end(), func);
std::sort(items2.begin(), items2.end(), func);
for (uint i = 0; i < items.size(); i++)
{
ui->lleList->addItem(items[i]);
// only show items filtered for search text
2020-03-07 20:54:42 +01:00
ui->lleList->setRowHidden(i, !items[i]->text().contains(search_term));
}
2020-12-08 20:22:08 +01:00
for (uint i = 0; i < items2.size(); i++)
{
ui->hleList->addItem(items2[i]);
// only show items filtered for search text
ui->hleList->setRowHidden(i, !items2[i]->text().contains(search_term));
}
};
// Sort libs
2020-12-08 20:22:08 +01:00
on_lib_state_changed({});
// Events
2020-12-08 20:22:08 +01:00
connect(ui->searchBox, &QLineEdit::textChanged, on_lib_state_changed);
connect(ui->resetLleList, &QAbstractButton::clicked, [this, on_lib_state_changed]()
{
for (int i = 0; i < ui->lleList->count(); i++)
{
ui->lleList->item(i)->setCheckState(Qt::Unchecked);
}
for (int i = 0; i < ui->hleList->count(); i++)
{
ui->hleList->item(i)->setCheckState(Qt::Unchecked);
}
on_lib_state_changed(ui->searchBox->text());
});
// enable multiselection (there must be a better way)
2020-07-01 20:45:40 +02:00
connect(ui->lleList, &QListWidget::itemChanged, [this](QListWidgetItem* item)
{
for (auto cb : ui->lleList->selectedItems())
{
cb->setCheckState(item->checkState());
}
});
2020-12-08 20:22:08 +01:00
connect(ui->hleList, &QListWidget::itemChanged, [this](QListWidgetItem* item)
{
2020-12-08 20:22:08 +01:00
for (auto cb : ui->hleList->selectedItems())
{
cb->setCheckState(item->checkState());
}
});
// ______ _ _ _______ _
// | ____| | | | | |__ __| | |
// | |__ _ __ ___ _ _| | __ _| |_ ___ _ __ | | __ _| |__
2021-01-08 20:30:24 +01:00
// | __| | '_ ` _ \| | | | |/ _` | __/ _ \| '__| | |/ _` | '_
// | |____| | | | | | |_| | | (_| | || (_) | | | | (_| | |_) |
// |______|_| |_| |_|\__,_|_|\__,_|\__\___/|_| |_|\__,_|_.__/
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->maxLLVMThreads, emu_settings_type::MaxLLVMThreads, true, true, std::thread::hardware_concurrency());
SubscribeTooltip(ui->gb_max_llvm, tooltips.settings.max_llvm_threads);
2020-04-17 10:06:58 +02:00
ui->maxLLVMThreads->setItemText(ui->maxLLVMThreads->findData(0), tr("All (%1)", "Max LLVM threads").arg(std::thread::hardware_concurrency()));
m_emu_settings->EnhanceComboBox(ui->perfOverlayDetailLevel, emu_settings_type::PerfOverlayDetailLevel);
SubscribeTooltip(ui->perf_overlay_detail_level, tooltips.settings.perf_overlay_detail_level);
m_emu_settings->EnhanceComboBox(ui->perfOverlayPosition, emu_settings_type::PerfOverlayPosition);
SubscribeTooltip(ui->perf_overlay_position, tooltips.settings.perf_overlay_position);
// Checkboxes
m_emu_settings->EnhanceCheckBox(ui->exitOnStop, emu_settings_type::ExitRPCS3OnFinish);
SubscribeTooltip(ui->exitOnStop, tooltips.settings.exit_on_stop);
m_emu_settings->EnhanceCheckBox(ui->alwaysStart, emu_settings_type::StartOnBoot);
SubscribeTooltip(ui->alwaysStart, tooltips.settings.start_on_boot);
m_emu_settings->EnhanceCheckBox(ui->startGameFullscreen, emu_settings_type::StartGameFullscreen);
SubscribeTooltip(ui->startGameFullscreen, tooltips.settings.start_game_fullscreen);
m_emu_settings->EnhanceCheckBox(ui->preventDisplaySleep, emu_settings_type::PreventDisplaySleep);
SubscribeTooltip(ui->preventDisplaySleep, tooltips.settings.prevent_display_sleep);
ui->preventDisplaySleep->setEnabled(display_sleep_control_supported());
m_emu_settings->EnhanceCheckBox(ui->showTrophyPopups, emu_settings_type::ShowTrophyPopups);
SubscribeTooltip(ui->showTrophyPopups, tooltips.settings.show_trophy_popups);
m_emu_settings->EnhanceCheckBox(ui->useNativeInterface, emu_settings_type::UseNativeInterface);
SubscribeTooltip(ui->useNativeInterface, tooltips.settings.use_native_interface);
m_emu_settings->EnhanceCheckBox(ui->showShaderCompilationHint, emu_settings_type::ShowShaderCompilationHint);
SubscribeTooltip(ui->showShaderCompilationHint, tooltips.settings.show_shader_compilation_hint);
m_emu_settings->EnhanceCheckBox(ui->perfOverlayCenterX, emu_settings_type::PerfOverlayCenterX);
SubscribeTooltip(ui->perfOverlayCenterX, tooltips.settings.perf_overlay_center_x);
connect(ui->perfOverlayCenterX, &QCheckBox::clicked, [this](bool checked)
{
ui->perfOverlayMarginX->setEnabled(!checked);
});
ui->perfOverlayMarginX->setEnabled(!ui->perfOverlayCenterX->isChecked());
m_emu_settings->EnhanceCheckBox(ui->perfOverlayCenterY, emu_settings_type::PerfOverlayCenterY);
SubscribeTooltip(ui->perfOverlayCenterY, tooltips.settings.perf_overlay_center_y);
connect(ui->perfOverlayCenterY, &QCheckBox::clicked, [this](bool checked)
{
ui->perfOverlayMarginY->setEnabled(!checked);
});
ui->perfOverlayMarginY->setEnabled(!ui->perfOverlayCenterY->isChecked());
m_emu_settings->EnhanceCheckBox(ui->perfOverlayFramerateGraphEnabled, emu_settings_type::PerfOverlayFramerateGraphEnabled);
SubscribeTooltip(ui->perfOverlayFramerateGraphEnabled, tooltips.settings.perf_overlay_framerate_graph_enabled);
m_emu_settings->EnhanceCheckBox(ui->perfOverlayFrametimeGraphEnabled, emu_settings_type::PerfOverlayFrametimeGraphEnabled);
SubscribeTooltip(ui->perfOverlayFrametimeGraphEnabled, tooltips.settings.perf_overlay_frametime_graph_enabled);
m_emu_settings->EnhanceCheckBox(ui->perfOverlayEnabled, emu_settings_type::PerfOverlayEnabled);
SubscribeTooltip(ui->perfOverlayEnabled, tooltips.settings.perf_overlay_enabled);
2020-03-07 20:54:42 +01:00
auto enable_perf_overlay_options = [this](bool enabled)
{
ui->label_detail_level->setEnabled(enabled);
ui->label_update_interval->setEnabled(enabled);
ui->label_font_size->setEnabled(enabled);
ui->label_position->setEnabled(enabled);
ui->label_opacity->setEnabled(enabled);
ui->label_margin_x->setEnabled(enabled);
ui->label_margin_y->setEnabled(enabled);
ui->perfOverlayDetailLevel->setEnabled(enabled);
ui->perfOverlayPosition->setEnabled(enabled);
ui->perfOverlayUpdateInterval->setEnabled(enabled);
ui->perfOverlayFontSize->setEnabled(enabled);
ui->perfOverlayOpacity->setEnabled(enabled);
ui->perfOverlayMarginX->setEnabled(enabled && !ui->perfOverlayCenterX->isChecked());
ui->perfOverlayMarginY->setEnabled(enabled && !ui->perfOverlayCenterY->isChecked());
ui->perfOverlayCenterX->setEnabled(enabled);
ui->perfOverlayCenterY->setEnabled(enabled);
ui->perfOverlayFramerateGraphEnabled->setEnabled(enabled);
ui->perfOverlayFrametimeGraphEnabled->setEnabled(enabled);
};
2020-03-07 20:54:42 +01:00
enable_perf_overlay_options(ui->perfOverlayEnabled->isChecked());
connect(ui->perfOverlayEnabled, &QCheckBox::clicked, enable_perf_overlay_options);
m_emu_settings->EnhanceCheckBox(ui->shaderLoadBgEnabled, emu_settings_type::ShaderLoadBgEnabled);
SubscribeTooltip(ui->shaderLoadBgEnabled, tooltips.settings.shader_load_bg_enabled);
2020-03-07 20:54:42 +01:00
auto enable_shader_loader_options = [this](bool enabled)
{
ui->label_shaderLoadBgDarkening->setEnabled(enabled);
ui->label_shaderLoadBgBlur->setEnabled(enabled);
ui->shaderLoadBgDarkening->setEnabled(enabled);
ui->shaderLoadBgBlur->setEnabled(enabled);
};
2020-03-07 20:54:42 +01:00
enable_shader_loader_options(ui->shaderLoadBgEnabled->isChecked());
connect(ui->shaderLoadBgEnabled, &QCheckBox::clicked, enable_shader_loader_options);
// Sliders
EnhanceSlider(emu_settings_type::PerfOverlayUpdateInterval, ui->perfOverlayUpdateInterval, ui->label_update_interval, tr("Update Interval: %0 ms", "Performance overlay update interval"));
SubscribeTooltip(ui->perf_overlay_update_interval, tooltips.settings.perf_overlay_update_interval);
EnhanceSlider(emu_settings_type::PerfOverlayFontSize, ui->perfOverlayFontSize, ui->label_font_size, tr("Font Size: %0 px", "Performance overlay font size"));
SubscribeTooltip(ui->perf_overlay_font_size, tooltips.settings.perf_overlay_font_size);
EnhanceSlider(emu_settings_type::PerfOverlayOpacity, ui->perfOverlayOpacity, ui->label_opacity, tr("Opacity: %0 %", "Performance overlay opacity"));
SubscribeTooltip(ui->perf_overlay_opacity, tooltips.settings.perf_overlay_opacity);
EnhanceSlider(emu_settings_type::ShaderLoadBgDarkening, ui->shaderLoadBgDarkening, ui->label_shaderLoadBgDarkening, tr("Background darkening: %0 %", "Shader load background darkening"));
SubscribeTooltip(ui->shaderLoadBgDarkening, tooltips.settings.shader_load_bg_darkening);
EnhanceSlider(emu_settings_type::ShaderLoadBgBlur, ui->shaderLoadBgBlur, ui->label_shaderLoadBgBlur, tr("Background blur: %0 %", "Shader load background blur"));
SubscribeTooltip(ui->shaderLoadBgBlur, tooltips.settings.shader_load_bg_blur);
// SpinBoxes
m_emu_settings->EnhanceSpinBox(ui->perfOverlayMarginX, emu_settings_type::PerfOverlayMarginX, "", tr("px", "Performance overlay margin x"));
SubscribeTooltip(ui->perfOverlayMarginX, tooltips.settings.perf_overlay_margin_x);
m_emu_settings->EnhanceSpinBox(ui->perfOverlayMarginY, emu_settings_type::PerfOverlayMarginY, "", tr("px", "Performance overlay margin y"));
SubscribeTooltip(ui->perfOverlayMarginY, tooltips.settings.perf_overlay_margin_y);
// Global settings (gui_settings)
if (!game)
{
2020-09-03 12:43:44 +02:00
SubscribeTooltip(ui->gs_resizeOnBoot_widget, tooltips.settings.resize_on_boot);
SubscribeTooltip(ui->gs_disableMouse, tooltips.settings.disable_mouse);
2020-05-02 16:56:09 +02:00
SubscribeTooltip(ui->gs_disableKbHotkeys, tooltips.settings.disable_kb_hotkeys);
2020-04-14 17:35:31 +02:00
SubscribeTooltip(ui->gs_showMouseInFullscreen, tooltips.settings.show_mouse_in_fullscreen);
2020-09-03 12:43:44 +02:00
SubscribeTooltip(ui->gs_hideMouseOnIdle_widget, tooltips.settings.hide_mouse_on_idle);
2020-03-07 20:54:42 +01:00
ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool());
2020-04-14 17:35:31 +02:00
connect(ui->gs_disableMouse, &QCheckBox::clicked, [this](bool val)
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::gs_disableMouse, val);
});
2020-05-02 16:56:09 +02:00
ui->gs_disableKbHotkeys->setChecked(m_gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool());
connect(ui->gs_disableKbHotkeys, &QCheckBox::clicked, [this](bool val)
{
m_gui_settings->SetValue(gui::gs_disableKbHotkeys, val);
});
2020-04-14 17:35:31 +02:00
ui->gs_showMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_showMouseFs).toBool());
connect(ui->gs_showMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
{
m_gui_settings->SetValue(gui::gs_showMouseFs, val);
});
ui->gs_hideMouseOnIdle->setChecked(m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool());
connect(ui->gs_hideMouseOnIdle, &QCheckBox::clicked, [this](bool checked)
{
m_gui_settings->SetValue(gui::gs_hideMouseIdle, checked);
ui->gs_hideMouseOnIdleTime->setEnabled(checked);
});
ui->gs_hideMouseOnIdleTime->setEnabled(ui->gs_hideMouseOnIdle->checkState() == Qt::CheckState::Checked);
ui->gs_hideMouseOnIdleTime->setValue(m_gui_settings->GetValue(gui::gs_hideMouseIdleTime).toUInt());
connect(ui->gs_hideMouseOnIdleTime, &QSpinBox::editingFinished, [this]()
{
m_gui_settings->SetValue(gui::gs_hideMouseIdleTime, ui->gs_hideMouseOnIdleTime->value());
});
2020-03-07 20:54:42 +01:00
const bool enable_buttons = m_gui_settings->GetValue(gui::gs_resize).toBool();
ui->gs_resizeOnBoot->setChecked(enable_buttons);
ui->gs_width->setEnabled(enable_buttons);
ui->gs_height->setEnabled(enable_buttons);
2020-03-07 20:54:42 +01:00
const QRect screen = QGuiApplication::primaryScreen()->geometry();
const int width = m_gui_settings->GetValue(gui::gs_width).toInt();
const int height = m_gui_settings->GetValue(gui::gs_height).toInt();
ui->gs_width->setValue(std::min(width, screen.width()));
ui->gs_height->setValue(std::min(height, screen.height()));
connect(ui->gs_resizeOnBoot, &QCheckBox::clicked, [=, this](bool val)
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::gs_resize, val);
ui->gs_width->setEnabled(val);
ui->gs_height->setEnabled(val);
});
connect(ui->gs_width, &QSpinBox::editingFinished, [=, this]()
{
2019-08-10 13:24:14 +02:00
ui->gs_width->setValue(std::min(ui->gs_width->value(), QGuiApplication::primaryScreen()->size().width()));
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::gs_width, ui->gs_width->value());
});
connect(ui->gs_height, &QSpinBox::editingFinished, [=, this]()
{
2019-08-10 13:24:14 +02:00
ui->gs_height->setValue(std::min(ui->gs_height->value(), QGuiApplication::primaryScreen()->size().height()));
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::gs_height, ui->gs_height->value());
});
}
else
{
ui->gb_viewport->setEnabled(false);
ui->gb_viewport->setVisible(false);
}
// Game window title builder
const auto get_game_window_title = [this, game](const QString& format)
{
rpcs3::title_format_data title_data;
title_data.format = sstr(format);
title_data.renderer = m_emu_settings->GetSetting(emu_settings_type::Renderer);
title_data.vulkan_adapter = m_emu_settings->GetSetting(emu_settings_type::VulkanAdapter);
title_data.fps = 60.;
if (game)
{
title_data.title = game->name;
title_data.title_id = game->serial;
}
else
{
title_data.title = sstr(tr("My Game", "Game window title"));
title_data.title_id = "ABCD12345";
}
const std::string game_window_title = rpcs3::get_formatted_title(title_data);
if (game_window_title.empty())
{
return QStringLiteral("RPCS3");
}
return qstr(game_window_title);
};
2020-07-01 20:45:40 +02:00
const auto set_game_window_title = [get_game_window_title, this](const std::string& format)
{
const auto game_window_title_format = qstr(format);
const auto game_window_title = get_game_window_title(game_window_title_format);
const auto width = ui->label_game_window_title_format->sizeHint().width();
const auto metrics = ui->label_game_window_title_format->fontMetrics();
const auto elided_text = metrics.elidedText(game_window_title_format, Qt::ElideRight, width);
const auto tooltip = game_window_title_format + QStringLiteral("\n\n") + game_window_title;
ui->label_game_window_title_format->setText(elided_text);
ui->label_game_window_title_format->setToolTip(tooltip);
};
2020-07-01 20:45:40 +02:00
connect(ui->edit_button_game_window_title_format, &QAbstractButton::clicked, [get_game_window_title, set_game_window_title, this]()
{
2020-07-01 20:45:40 +02:00
auto get_game_window_title_label = [get_game_window_title, set_game_window_title, this](const QString& format)
{
const QString game_window_title = get_game_window_title(format);
const std::vector<std::pair<const QString, const QString>> window_title_glossary =
{
{ "%G", tr("GPU Model", "Game window title") },
{ "%C", tr("CPU Model", "Game window title") },
{ "%c", tr("Thread Count", "Game window title") },
{ "%M", tr("System Memory", "Game window title") },
{ "%F", tr("Framerate", "Game window title") },
{ "%R", tr("Renderer", "Game window title") },
{ "%T", tr("Title", "Game window title") },
{ "%t", tr("Title ID", "Game window title") },
{ "%V", tr("RPCS3 Version", "Game window title") }
};
QString glossary;
for (const auto& [format, description] : window_title_glossary)
{
glossary += format + "\t = " + description + "\n";
}
return tr("Glossary:\n\n%0\nPreview:\n\n%1\n", "Game window title").arg(glossary).arg(game_window_title);
};
const std::string game_title_format = m_emu_settings->GetSetting(emu_settings_type::WindowTitleFormat);
QString edited_format = qstr(game_title_format);
input_dialog dlg(-1, edited_format, tr("Game Window Title Format", "Game window title"), get_game_window_title_label(edited_format), "", this);
dlg.resize(width() * .75, dlg.height());
2020-07-01 20:45:40 +02:00
connect(&dlg, &input_dialog::text_changed, [&edited_format, &dlg, get_game_window_title_label](const QString& text)
{
edited_format = text.simplified();
dlg.set_label_text(get_game_window_title_label(edited_format));
});
if (dlg.exec() == QDialog::Accepted)
{
m_emu_settings->SetSetting(emu_settings_type::WindowTitleFormat, sstr(edited_format));
set_game_window_title(m_emu_settings->GetSetting(emu_settings_type::WindowTitleFormat));
}
});
2020-07-01 20:45:40 +02:00
connect(ui->reset_button_game_window_title_format, &QAbstractButton::clicked, [set_game_window_title, this]()
{
const std::string default_game_title_format = m_emu_settings->GetSettingDefault(emu_settings_type::WindowTitleFormat);
m_emu_settings->SetSetting(emu_settings_type::WindowTitleFormat, default_game_title_format);
set_game_window_title(default_game_title_format);
});
// Load and apply the configured game window title format
set_game_window_title(m_emu_settings->GetSetting(emu_settings_type::WindowTitleFormat));
SubscribeTooltip(ui->gb_game_window_title, tooltips.settings.game_window_title_format);
// _____ _ _ _ _______ _
// / ____|| | | || | |__ __| | |
// | | __|| | | || | | | __ _| |__
2021-01-08 20:30:24 +01:00
// | | |_ || | | || | | |/ _` | '_
// | |__| || |__| || | | | (_| | |_) |
// \_____| \____/ |_| |_|\__,_|_.__/
if (!game)
{
// Comboboxes
SubscribeTooltip(ui->combo_configs, tooltips.settings.configs);
SubscribeTooltip(ui->gb_stylesheets, tooltips.settings.stylesheets);
// Checkboxes:
SubscribeTooltip(ui->cb_custom_colors, tooltips.settings.custom_colors);
// Checkboxes: gui options
SubscribeTooltip(ui->cb_show_welcome, tooltips.settings.show_welcome);
SubscribeTooltip(ui->cb_show_exit_game, tooltips.settings.show_exit_game);
2019-01-02 23:59:47 +01:00
SubscribeTooltip(ui->cb_show_boot_game, tooltips.settings.show_boot_game);
SubscribeTooltip(ui->cb_show_pkg_install, tooltips.settings.show_pkg_install);
2019-01-02 23:59:47 +01:00
SubscribeTooltip(ui->cb_show_pup_install, tooltips.settings.show_pup_install);
2019-01-02 23:59:47 +01:00
2020-07-01 20:45:40 +02:00
SubscribeTooltip(ui->gb_updates, tooltips.settings.check_update_start);
2019-09-11 09:55:43 +02:00
SubscribeTooltip(ui->useRichPresence, tooltips.settings.use_rich_presence);
SubscribeTooltip(ui->discordState, tooltips.settings.discord_state);
2018-05-28 13:01:06 +02:00
// Discord:
2018-06-16 22:56:21 +02:00
ui->useRichPresence->setChecked(m_use_discord);
ui->label_discordState->setEnabled(m_use_discord);
ui->discordState->setEnabled(m_use_discord);
ui->discordState->setText(m_discord_state);
2018-05-28 13:01:06 +02:00
connect(ui->useRichPresence, &QCheckBox::clicked, [this](bool checked)
{
ui->discordState->setEnabled(checked);
ui->label_discordState->setEnabled(checked);
2018-06-16 22:56:21 +02:00
m_use_discord = checked;
2018-05-28 13:01:06 +02:00
});
connect(ui->discordState, &QLineEdit::editingFinished, [this]()
{
2018-06-16 22:56:21 +02:00
m_discord_state = ui->discordState->text();
2018-05-28 13:01:06 +02:00
});
// Log and TTY:
SubscribeTooltip(ui->log_limit, tooltips.settings.log_limit);
SubscribeTooltip(ui->tty_limit, tooltips.settings.tty_limit);
2020-03-07 20:54:42 +01:00
ui->spinbox_log_limit->setValue(m_gui_settings->GetValue(gui::l_limit).toInt());
2020-07-01 20:45:40 +02:00
connect(ui->spinbox_log_limit, &QSpinBox::editingFinished, [this]()
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::l_limit, ui->spinbox_log_limit->value());
});
2020-03-07 20:54:42 +01:00
ui->spinbox_tty_limit->setValue(m_gui_settings->GetValue(gui::l_limit_tty).toInt());
2020-07-01 20:45:40 +02:00
connect(ui->spinbox_tty_limit, &QSpinBox::editingFinished, [this]()
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::l_limit_tty, ui->spinbox_tty_limit->value());
});
2017-08-20 19:44:21 +02:00
// colorize preview icons
2020-07-01 20:45:40 +02:00
auto add_colored_icon = [this](QPushButton *button, const QColor& color, const QIcon& icon = QIcon(), const QColor& iconColor = QColor())
{
2017-08-20 19:44:21 +02:00
QLabel* text = new QLabel(button->text());
text->setObjectName("color_button");
text->setAlignment(Qt::AlignCenter);
text->setAttribute(Qt::WA_TransparentForMouseEvents, true);
delete button->layout();
if (icon.isNull())
{
QPixmap pixmap(100, 100);
pixmap.fill(color);
button->setIcon(pixmap);
}
else
{
2018-06-29 05:46:25 +02:00
button->setIcon(gui::utils::get_colorized_icon(icon, iconColor, color, true));
2017-08-20 19:44:21 +02:00
}
button->setText("");
button->setStyleSheet(styleSheet().append("text-align:left;"));
button->setLayout(new QGridLayout);
button->layout()->setContentsMargins(0, 0, 0, 0);
button->layout()->addWidget(text);
};
2020-07-01 20:45:40 +02:00
auto add_colored_icons = [add_colored_icon, this]()
{
2020-03-07 20:54:42 +01:00
add_colored_icon(ui->pb_gl_icon_color, m_gui_settings->GetValue(gui::gl_iconColor).value<QColor>());
add_colored_icon(ui->pb_sd_icon_color, m_gui_settings->GetValue(gui::sd_icon_color).value<QColor>());
add_colored_icon(ui->pb_tr_icon_color, m_gui_settings->GetValue(gui::tr_icon_color).value<QColor>());
2017-08-20 19:44:21 +02:00
};
2020-03-07 20:54:42 +01:00
add_colored_icons();
2017-08-20 19:44:21 +02:00
2020-03-07 20:54:42 +01:00
ui->cb_show_welcome->setChecked(m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
ui->cb_show_exit_game->setChecked(m_gui_settings->GetValue(gui::ib_confirm_exit).toBool());
ui->cb_show_boot_game->setChecked(m_gui_settings->GetValue(gui::ib_confirm_boot).toBool());
ui->cb_show_pkg_install->setChecked(m_gui_settings->GetValue(gui::ib_pkg_success).toBool());
ui->cb_show_pup_install->setChecked(m_gui_settings->GetValue(gui::ib_pup_success).toBool());
const QString updates_yes = tr("Yes", "Updates");
const QString updates_background = tr("Background", "Updates");
const QString updates_no = tr("No", "Updates");
ui->combo_updates->addItem(updates_yes, "true");
ui->combo_updates->addItem(updates_background, "background");
ui->combo_updates->addItem(updates_no, "false");
ui->combo_updates->setCurrentIndex(ui->combo_updates->findData(m_gui_settings->GetValue(gui::m_check_upd_start).toString()));
connect(ui->combo_updates, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [this](int index)
{
m_gui_settings->SetValue(gui::m_check_upd_start, ui->combo_updates->itemData(index));
});
2019-09-11 09:55:43 +02:00
2020-03-07 20:54:42 +01:00
const bool enable_ui_colors = m_gui_settings->GetValue(gui::m_enableUIColors).toBool();
ui->cb_custom_colors->setChecked(enable_ui_colors);
ui->pb_gl_icon_color->setEnabled(enable_ui_colors);
ui->pb_sd_icon_color->setEnabled(enable_ui_colors);
ui->pb_tr_icon_color->setEnabled(enable_ui_colors);
2017-08-16 23:38:18 +02:00
2020-07-01 20:45:40 +02:00
auto apply_gui_options = [this](bool reset = false)
{
2017-08-20 19:44:21 +02:00
if (reset)
{
2020-03-07 18:01:09 +01:00
m_current_stylesheet = gui::Default;
ui->combo_configs->setCurrentIndex(0);
ui->combo_stylesheets->setCurrentIndex(0);
2017-08-20 19:44:21 +02:00
}
// Only attempt to load a config if changes occurred.
2020-03-07 18:01:09 +01:00
if (m_current_gui_config != ui->combo_configs->currentText())
{
OnApplyGuiConfig();
}
2020-03-07 20:54:42 +01:00
if (m_current_stylesheet != m_gui_settings->GetValue(gui::m_currentStylesheet).toString())
{
OnApplyStylesheet();
}
2017-08-20 19:44:21 +02:00
};
2020-07-01 20:45:40 +02:00
connect(ui->buttonBox, &QDialogButtonBox::accepted, [apply_gui_options, this]()
2018-05-28 13:01:06 +02:00
{
2020-03-07 20:54:42 +01:00
apply_gui_options();
2018-05-28 13:01:06 +02:00
});
2017-10-06 11:10:18 +02:00
2020-07-01 20:45:40 +02:00
connect(ui->pb_reset_default, &QAbstractButton::clicked, [apply_gui_options, this]
{
if (QMessageBox::question(this, tr("Reset GUI to default?", "Reset"), tr("This will include your stylesheet as well. Do you wish to proceed?", "Reset"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
{
2020-03-07 20:54:42 +01:00
apply_gui_options(true);
m_gui_settings->Reset(true);
2017-10-07 18:06:36 +02:00
Q_EMIT GuiSettingsSyncRequest(true);
AddGuiConfigs();
AddStylesheets();
2020-03-07 20:54:42 +01:00
apply_gui_options();
}
});
2017-10-06 11:10:18 +02:00
connect(ui->pb_backup_config, &QAbstractButton::clicked, this, &settings_dialog::OnBackupCurrentGuiConfig);
connect(ui->pb_apply_config, &QAbstractButton::clicked, this, &settings_dialog::OnApplyGuiConfig);
connect(ui->pb_apply_stylesheet, &QAbstractButton::clicked, this, &settings_dialog::OnApplyStylesheet);
2017-10-06 11:10:18 +02:00
2020-07-01 20:45:40 +02:00
connect(ui->pb_open_folder, &QAbstractButton::clicked, [this]()
2017-10-06 11:10:18 +02:00
{
2020-03-07 20:54:42 +01:00
QDesktopServices::openUrl(m_gui_settings->GetSettingsDir());
2017-10-06 11:10:18 +02:00
});
2020-07-01 20:45:40 +02:00
connect(ui->cb_show_welcome, &QCheckBox::clicked, [this](bool val)
2017-10-06 11:10:18 +02:00
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::ib_show_welcome, val);
2017-10-06 11:10:18 +02:00
});
2020-07-01 20:45:40 +02:00
connect(ui->cb_show_exit_game, &QCheckBox::clicked, [this](bool val)
2019-01-02 23:59:47 +01:00
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::ib_confirm_exit, val);
2019-01-02 23:59:47 +01:00
});
2020-07-01 20:45:40 +02:00
connect(ui->cb_show_boot_game, &QCheckBox::clicked, [this](bool val)
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::ib_confirm_boot, val);
});
2020-07-01 20:45:40 +02:00
connect(ui->cb_show_pkg_install, &QCheckBox::clicked, [this](bool val)
2019-01-02 23:59:47 +01:00
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::ib_pkg_success, val);
2019-01-02 23:59:47 +01:00
});
2020-07-01 20:45:40 +02:00
connect(ui->cb_show_pup_install, &QCheckBox::clicked, [this](bool val)
2019-01-02 23:59:47 +01:00
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::ib_pup_success, val);
2019-01-02 23:59:47 +01:00
});
2017-10-06 11:10:18 +02:00
2020-07-01 20:45:40 +02:00
connect(ui->cb_custom_colors, &QCheckBox::clicked, [this](bool val)
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::m_enableUIColors, val);
2017-08-16 23:38:18 +02:00
ui->pb_gl_icon_color->setEnabled(val);
ui->pb_sd_icon_color->setEnabled(val);
ui->pb_tr_icon_color->setEnabled(val);
2017-08-20 18:10:02 +02:00
Q_EMIT GuiRepaintRequest();
2017-08-16 23:38:18 +02:00
});
2020-03-07 20:54:42 +01:00
auto color_dialog = [&](const gui_save& color, const QString& title, QPushButton *button)
{
2020-03-07 20:54:42 +01:00
const QColor old_color = m_gui_settings->GetValue(color).value<QColor>();
QColorDialog dlg(old_color, this);
dlg.setWindowTitle(title);
dlg.setOptions(QColorDialog::ShowAlphaChannel);
for (int i = 0; i < dlg.customCount(); i++)
{
2020-03-07 20:54:42 +01:00
dlg.setCustomColor(i, m_gui_settings->GetCustomColor(i));
}
if (dlg.exec() == QColorDialog::Accepted)
{
for (int i = 0; i < dlg.customCount(); i++)
{
2020-03-07 20:54:42 +01:00
m_gui_settings->SetCustomColor(i, dlg.customColor(i));
}
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(color, dlg.selectedColor());
button->setIcon(gui::utils::get_colorized_icon(button->icon(), old_color, dlg.selectedColor(), true));
2017-08-20 18:10:02 +02:00
Q_EMIT GuiRepaintRequest();
}
};
2017-10-06 11:10:18 +02:00
connect(ui->pb_gl_icon_color, &QAbstractButton::clicked, [=, this]()
2017-10-06 11:10:18 +02:00
{
color_dialog(gui::gl_iconColor, tr("Choose gamelist icon color", "Settings: color dialog"), ui->pb_gl_icon_color);
2017-10-06 11:10:18 +02:00
});
connect(ui->pb_sd_icon_color, &QAbstractButton::clicked, [=, this]()
{
color_dialog(gui::sd_icon_color, tr("Choose save manager icon color", "Settings: color dialog"), ui->pb_sd_icon_color);
});
connect(ui->pb_tr_icon_color, &QAbstractButton::clicked, [=, this]()
{
color_dialog(gui::tr_icon_color, tr("Choose trophy manager icon color", "Settings: color dialog"), ui->pb_tr_icon_color);
});
2017-10-06 11:10:18 +02:00
AddGuiConfigs();
AddStylesheets();
}
// _____ _ _______ _
// | __ \ | | |__ __| | |
// | | | | ___| |__ _ _ __ _ | | __ _| |__
2021-01-08 20:30:24 +01:00
// | | | |/ _ \ '_ \| | | |/ _` | | |/ _` | '_
2017-07-24 02:21:40 +02:00
// | |__| | __/ |_) | |_| | (_| | | | (_| | |_) |
// |_____/ \___|_.__/ \__,_|\__, | |_|\__,_|_.__/
// __/ |
// |___/
2017-07-24 02:21:40 +02:00
// Checkboxes: gpu debug options
m_emu_settings->EnhanceCheckBox(ui->glLegacyBuffers, emu_settings_type::LegacyBuffers);
SubscribeTooltip(ui->glLegacyBuffers, tooltips.settings.gl_legacy_buffers);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->forceHighpZ, emu_settings_type::ForceHighpZ);
SubscribeTooltip(ui->forceHighpZ, tooltips.settings.force_high_pz);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->debugOutput, emu_settings_type::DebugOutput);
SubscribeTooltip(ui->debugOutput, tooltips.settings.debug_output);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->debugOverlay, emu_settings_type::DebugOverlay);
SubscribeTooltip(ui->debugOverlay, tooltips.settings.debug_overlay);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->logProg, emu_settings_type::LogShaderPrograms);
SubscribeTooltip(ui->logProg, tooltips.settings.log_shader_programs);
2017-07-24 02:21:40 +02:00
m_emu_settings->EnhanceCheckBox(ui->disableHwOcclusionQueries, emu_settings_type::DisableOcclusionQueries);
SubscribeTooltip(ui->disableHwOcclusionQueries, tooltips.settings.disable_occlusion_queries);
m_emu_settings->EnhanceCheckBox(ui->forceCpuBlitEmulation, emu_settings_type::ForceCPUBlitEmulation);
SubscribeTooltip(ui->forceCpuBlitEmulation, tooltips.settings.force_cpu_blit_emulation);
m_emu_settings->EnhanceCheckBox(ui->disableVulkanMemAllocator, emu_settings_type::DisableVulkanMemAllocator);
SubscribeTooltip(ui->disableVulkanMemAllocator, tooltips.settings.disable_vulkan_mem_allocator);
m_emu_settings->EnhanceCheckBox(ui->disableFIFOReordering, emu_settings_type::DisableFIFOReordering);
SubscribeTooltip(ui->disableFIFOReordering, tooltips.settings.disable_fifo_reordering);
m_emu_settings->EnhanceCheckBox(ui->strictTextureFlushing, emu_settings_type::StrictTextureFlushing);
SubscribeTooltip(ui->strictTextureFlushing, tooltips.settings.strict_texture_flushing);
m_emu_settings->EnhanceCheckBox(ui->DisableNativefp16, emu_settings_type::DisableNativefloat16);
SubscribeTooltip(ui->DisableNativefp16, tooltips.settings.disable_native_fp16);
m_emu_settings->EnhanceCheckBox(ui->Enable3D, emu_settings_type::Enable3D);
SubscribeTooltip(ui->Enable3D, tooltips.settings.enable_3d);
m_emu_settings->EnhanceCheckBox(ui->gpuTextureScaling, emu_settings_type::GPUTextureScaling);
SubscribeTooltip(ui->gpuTextureScaling, tooltips.settings.gpu_texture_scaling);
2018-12-30 16:19:34 +01:00
// Checkboxes: core debug options
m_emu_settings->EnhanceCheckBox(ui->ppuDebug, emu_settings_type::PPUDebug);
SubscribeTooltip(ui->ppuDebug, tooltips.settings.ppu_debug);
m_emu_settings->EnhanceCheckBox(ui->spuDebug, emu_settings_type::SPUDebug);
SubscribeTooltip(ui->spuDebug, tooltips.settings.spu_debug);
m_emu_settings->EnhanceCheckBox(ui->setDAZandFTZ, emu_settings_type::SetDAZandFTZ);
SubscribeTooltip(ui->setDAZandFTZ, tooltips.settings.set_daz_and_ftz);
2018-06-13 13:54:16 +02:00
m_emu_settings->EnhanceCheckBox(ui->accurateGETLLAR, emu_settings_type::AccurateGETLLAR);
SubscribeTooltip(ui->accurateGETLLAR, tooltips.settings.accurate_getllar);
2020-09-02 23:58:29 +02:00
m_emu_settings->EnhanceCheckBox(ui->accurateSpuDMA, emu_settings_type::AccurateSpuDMA);
SubscribeTooltip(ui->accurateSpuDMA, tooltips.settings.accurate_spu_dma);
m_emu_settings->EnhanceCheckBox(ui->accurateClineStores, emu_settings_type::AccurateClineStores);
SubscribeTooltip(ui->accurateClineStores, tooltips.settings.accurate_cache_line_stores);
m_emu_settings->EnhanceCheckBox(ui->accurateRSXAccess, emu_settings_type::AccurateRSXAccess);
2020-02-11 22:36:46 +01:00
SubscribeTooltip(ui->accurateRSXAccess, tooltips.settings.accurate_rsx_access);
m_emu_settings->EnhanceCheckBox(ui->hookStFunc, emu_settings_type::HookStaticFuncs);
SubscribeTooltip(ui->hookStFunc, tooltips.settings.hook_static_functions);
m_emu_settings->EnhanceCheckBox(ui->perfReport, emu_settings_type::PerformanceReport);
SubscribeTooltip(ui->perfReport, tooltips.settings.enable_performance_report);
// Comboboxes
m_emu_settings->EnhanceComboBox(ui->combo_accurate_ppu_128, emu_settings_type::AccuratePPU128Loop, true);
SubscribeTooltip(ui->gb_accurate_ppu_128, tooltips.settings.accurate_ppu_128_loop);
ui->combo_accurate_ppu_128->setItemText(ui->combo_accurate_ppu_128->findData(-1), tr("Always Enabled", "Accurate PPU 128 Reservations"));
ui->combo_accurate_ppu_128->setItemText(ui->combo_accurate_ppu_128->findData(0), tr("Disabled", "Accurate PPU 128 Reservations"));
2017-07-24 02:21:40 +02:00
// Layout fix for High Dpi
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
2017-09-03 19:01:54 +02:00
settings_dialog::~settings_dialog()
{
delete ui;
}
void settings_dialog::EnhanceSlider(emu_settings_type settings_type, QSlider* slider, QLabel* label, const QString& label_text)
{
2020-03-07 20:54:42 +01:00
m_emu_settings->EnhanceSlider(slider, settings_type);
if (slider && label)
{
label->setText(label_text.arg(slider->value()));
connect(slider, &QSlider::valueChanged, [label, label_text](int value)
{
label->setText(label_text.arg(value));
});
}
}
2020-01-15 17:55:13 +01:00
void settings_dialog::SnapSlider(QSlider *slider, int interval)
{
connect(slider, &QSlider::sliderPressed, [this, slider]()
{
2020-03-07 18:01:09 +01:00
m_current_slider = slider;
2020-01-15 17:55:13 +01:00
});
connect(slider, &QSlider::sliderReleased, [this]()
{
2020-03-07 18:01:09 +01:00
m_current_slider = nullptr;
2020-01-15 17:55:13 +01:00
});
connect(slider, &QSlider::valueChanged, [this, slider, interval](int value)
{
2020-03-07 18:01:09 +01:00
if (slider != m_current_slider)
2020-01-15 17:55:13 +01:00
{
return;
}
slider->setValue(utils::rounded_div(value, interval) * interval);
2020-01-15 17:55:13 +01:00
});
}
void settings_dialog::AddGuiConfigs()
{
ui->combo_configs->clear();
ui->combo_configs->addItems(m_gui_settings->GetConfigEntries());
2020-03-07 20:54:42 +01:00
m_current_gui_config = m_gui_settings->GetValue(gui::m_currentConfig).toString();
2020-03-07 18:01:09 +01:00
const int index = ui->combo_configs->findText(m_current_gui_config);
if (index >= 0)
{
ui->combo_configs->setCurrentIndex(index);
}
else
{
cfg_log.warning("Trying to set an invalid config index %d", index);
}
}
void settings_dialog::AddStylesheets()
{
ui->combo_stylesheets->clear();
ui->combo_stylesheets->addItem(tr("None", "Stylesheets"), gui::None);
ui->combo_stylesheets->addItem(tr("Default (Bright)", "Stylesheets"), gui::Default);
2020-03-07 20:54:42 +01:00
for (const QString& entry : m_gui_settings->GetStylesheetEntries())
{
if (entry != gui::Default)
{
ui->combo_stylesheets->addItem(entry, entry);
}
}
2020-03-07 20:54:42 +01:00
m_current_stylesheet = m_gui_settings->GetValue(gui::m_currentStylesheet).toString();
2020-03-07 18:01:09 +01:00
const int index = ui->combo_stylesheets->findData(m_current_stylesheet);
if (index >= 0)
{
ui->combo_stylesheets->setCurrentIndex(index);
}
else
{
2020-03-07 18:01:09 +01:00
cfg_log.warning("Trying to set an invalid stylesheets index: %d (%s)", index, sstr(m_current_stylesheet));
}
}
void settings_dialog::OnBackupCurrentGuiConfig()
{
QInputDialog* dialog = new QInputDialog(this);
dialog->setWindowTitle(tr("Choose a unique name", "Backup GUI config"));
dialog->setLabelText(tr("Configuration Name: ", "Backup GUI config"));
dialog->resize(500, 100);
while (dialog->exec() != QDialog::Rejected)
{
dialog->resize(500, 100);
2020-03-07 18:01:09 +01:00
const QString gui_config_name = dialog->textValue();
if (gui_config_name.isEmpty())
{
QMessageBox::warning(this, tr("Error", "Backup GUI config warning 1"), tr("Name cannot be empty", "Backup GUI config warning 1"));
continue;
}
2020-03-07 18:01:09 +01:00
if (gui_config_name.contains("."))
{
QMessageBox::warning(this, tr("Error", "Backup GUI config warning 2"), tr("Must choose a name with no '.'", "Backup GUI config warning 2"));
continue;
}
2020-03-07 18:01:09 +01:00
if (ui->combo_configs->findText(gui_config_name) != -1)
{
QMessageBox::warning(this, tr("Error", "Backup GUI config warning 3"), tr("Please choose a non-existing name", "Backup GUI config warning 3"));
continue;
}
Q_EMIT GuiSettingsSaveRequest();
2020-03-07 20:54:42 +01:00
m_gui_settings->SaveCurrentConfig(gui_config_name);
2020-03-07 18:01:09 +01:00
ui->combo_configs->addItem(gui_config_name);
ui->combo_configs->setCurrentText(gui_config_name);
m_current_gui_config = gui_config_name;
break;
}
}
void settings_dialog::OnApplyGuiConfig()
{
2018-06-28 01:48:05 +02:00
const QString new_config = ui->combo_configs->currentText();
2020-03-07 18:01:09 +01:00
if (new_config == m_current_gui_config)
2018-06-28 01:48:05 +02:00
{
return;
}
// Backup current window states
Q_EMIT GuiSettingsSaveRequest();
2020-03-07 20:54:42 +01:00
if (!m_gui_settings->ChangeToConfig(new_config))
2018-06-28 01:48:05 +02:00
{
const int new_config_idx = ui->combo_configs->currentIndex();
2020-03-07 18:01:09 +01:00
ui->combo_configs->setCurrentText(m_current_gui_config);
2018-06-28 01:48:05 +02:00
ui->combo_configs->removeItem(new_config_idx);
return;
}
2020-03-07 18:01:09 +01:00
m_current_gui_config = new_config;
2017-10-07 18:06:36 +02:00
Q_EMIT GuiSettingsSyncRequest(true);
}
void settings_dialog::OnApplyStylesheet()
{
2020-03-07 18:01:09 +01:00
m_current_stylesheet = ui->combo_stylesheets->currentData().toString();
2020-03-07 20:54:42 +01:00
m_gui_settings->SetValue(gui::m_currentStylesheet, m_current_stylesheet);
Q_EMIT GuiStylesheetRequest(m_gui_settings->GetCurrentStylesheetPath());
}
2017-07-25 23:29:40 +02:00
int settings_dialog::exec()
{
2017-09-16 21:09:53 +02:00
// singleShot Hack to fix following bug:
// If we use setCurrentIndex now we will miraculously see a resize of the dialog as soon as we
// switch to the cpu tab after conjuring the settings_dialog with another tab opened first.
// Weirdly enough this won't happen if we change the tab order so that anything else is at index 0.
ui->tab_widget_settings->setCurrentIndex(0);
2020-04-20 23:43:23 +02:00
QTimer::singleShot(0, [this]{ ui->tab_widget_settings->setCurrentIndex(m_tab_index); });
// Open a dialog if your config file contained invalid entries
2020-03-07 20:54:42 +01:00
QTimer::singleShot(10, [this] { m_emu_settings->OpenCorrectionDialog(this); });
2017-07-25 23:29:40 +02:00
return QDialog::exec();
}
void settings_dialog::SubscribeDescription(QLabel* description)
{
description->setFixedHeight(description->sizeHint().height());
m_description_labels.append(QPair<QLabel*, QString>(description, description->text()));
}
void settings_dialog::SubscribeTooltip(QObject* object, const QString& tooltip)
{
m_descriptions[object] = tooltip;
object->installEventFilter(this);
}
// Thanks Dolphin
bool settings_dialog::eventFilter(QObject* object, QEvent* event)
{
if (!m_descriptions.contains(object))
{
return QDialog::eventFilter(object, event);
}
2020-03-07 18:01:09 +01:00
if (event->type() == QEvent::Enter || event->type() == QEvent::Leave)
{
2020-03-07 18:01:09 +01:00
const int i = ui->tab_widget_settings->currentIndex();
2020-04-20 23:43:23 +02:00
if (i < m_description_labels.size())
2020-03-07 18:01:09 +01:00
{
2020-04-20 23:43:23 +02:00
QLabel* label = m_description_labels[i].first;
if (label)
{
if (event->type() == QEvent::Enter)
{
label->setText(m_descriptions[object]);
}
else if (event->type() == QEvent::Leave)
{
const QString description = m_description_labels[i].second;
label->setText(description);
}
}
2020-03-07 18:01:09 +01:00
}
}
return QDialog::eventFilter(object, event);
}