From 1ec8599cd89db078bf4d5cad22baefa6c21a5e3f Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Thu, 14 May 2020 20:43:26 +0200 Subject: [PATCH] Fixed navigation after widgets update --- src/osdep/gui/Navigation.cpp | 7 +++---- src/osdep/gui/PanelCPU.cpp | 13 +++++++++++++ src/osdep/gui/PanelChipset.cpp | 8 ++++++++ src/osdep/gui/PanelCustom.cpp | 8 ++++++++ src/osdep/gui/PanelDisplay.cpp | 18 ++++++++++++++---- src/osdep/gui/PanelFloppy.cpp | 1 + src/osdep/gui/PanelHD.cpp | 1 + src/osdep/gui/PanelQuickstart.cpp | 1 + src/osdep/gui/PanelSound.cpp | 2 ++ 9 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/osdep/gui/Navigation.cpp b/src/osdep/gui/Navigation.cpp index 08a7666c..a28508d0 100644 --- a/src/osdep/gui/Navigation.cpp +++ b/src/osdep/gui/Navigation.cpp @@ -273,11 +273,10 @@ static NavigationMap navMap[] = // PanelMisc // active move left move right move up move down - {"StatusLine", "Miscellaneous", "RetroArchQuit", "cboScrolllock", "HideIdle"}, - {"HideIdle", "Miscellaneous", "RetroArchMenu", "StatusLine", "ShowGUI"}, - {"ShowGUI", "Miscellaneous", "RetroArchReset", "HideIdle", "BSDSocket"}, + {"StatusLine", "Miscellaneous", "RetroArchQuit", "cboScrolllock", "ShowGUI"}, + {"ShowGUI", "Miscellaneous", "RetroArchMenu", "StatusLine", "BSDSocket"}, {"RetroArchQuit", "StatusLine", "Miscellaneous", "KeyForQuit", "RetroArchMenu"}, - {"RetroArchMenu", "HideIdle", "Miscellaneous", "RetroArchQuit", "RetroArchReset"}, + {"RetroArchMenu", "ShowGUI", "Miscellaneous", "RetroArchQuit", "RetroArchReset"}, {"RetroArchReset", "ShowGUI", "Miscellaneous", "RetroArchMenu", "BSDSocket"}, {"BSDSocket", "Miscellaneous", "Miscellaneous", "ShowGUI", "MasterWP"}, diff --git a/src/osdep/gui/PanelCPU.cpp b/src/osdep/gui/PanelCPU.cpp index c02bea44..26e52660 100644 --- a/src/osdep/gui/PanelCPU.cpp +++ b/src/osdep/gui/PanelCPU.cpp @@ -226,14 +226,19 @@ void InitPanelCPU(const struct _ConfigCategory& category) fpuActionListener = new FPUActionListener(); optCPU68000 = new gcn::RadioButton("68000", "radiocpugroup"); + optCPU68000->setId("68000"); optCPU68000->addActionListener(cpuButtonActionListener); optCPU68010 = new gcn::RadioButton("68010", "radiocpugroup"); + optCPU68010->setId("68010"); optCPU68010->addActionListener(cpuButtonActionListener); optCPU68020 = new gcn::RadioButton("68020", "radiocpugroup"); + optCPU68020->setId("68020"); optCPU68020->addActionListener(cpuButtonActionListener); optCPU68030 = new gcn::RadioButton("68030", "radiocpugroup"); + optCPU68030->setId("68030"); optCPU68030->addActionListener(cpuButtonActionListener); optCPU68040 = new gcn::RadioButton("68040", "radiocpugroup"); + optCPU68040->setId("68040"); optCPU68040->addActionListener(cpuButtonActionListener); chk24Bit = new gcn::CheckBox("24-bit addressing", true); @@ -271,12 +276,15 @@ void InitPanelCPU(const struct _ConfigCategory& category) optFPUnone->addActionListener(fpuButtonActionListener); optFPU68881 = new gcn::RadioButton("68881", "radiofpugroup"); + optFPU68881->setId("68881"); optFPU68881->addActionListener(fpuButtonActionListener); optFPU68882 = new gcn::RadioButton("68882", "radiofpugroup"); + optFPU68882->setId("68882"); optFPU68882->addActionListener(fpuButtonActionListener); optFPUinternal = new gcn::RadioButton("CPU internal", "radiofpugroup"); + optFPUinternal->setId("CPU internal"); optFPUinternal->addActionListener(fpuButtonActionListener); chkFPUstrict = new gcn::CheckBox("More compatible", true); @@ -304,18 +312,23 @@ void InitPanelCPU(const struct _ConfigCategory& category) cpuSpeedButtonActionListener = new CPUSpeedButtonActionListener(); opt7Mhz = new gcn::RadioButton("7 Mhz", "radiocpuspeedgroup"); + opt7Mhz->setId("7 Mhz"); opt7Mhz->addActionListener(cpuSpeedButtonActionListener); opt14Mhz = new gcn::RadioButton("14 Mhz", "radiocpuspeedgroup"); + opt14Mhz->setId("14 Mhz"); opt14Mhz->addActionListener(cpuSpeedButtonActionListener); opt28Mhz = new gcn::RadioButton("25 Mhz", "radiocpuspeedgroup"); + opt28Mhz->setId("25 Mhz"); opt28Mhz->addActionListener(cpuSpeedButtonActionListener); optFastest = new gcn::RadioButton("Fastest", "radiocpuspeedgroup"); + optFastest->setId("Fastest"); optFastest->addActionListener(cpuSpeedButtonActionListener); optTurbo = new gcn::RadioButton("Turbo", "radiocpuspeedgroup"); + optTurbo->setId("Turbo"); optTurbo->addActionListener(cpuSpeedButtonActionListener); grpCPUSpeed = new gcn::Window("CPU Speed"); diff --git a/src/osdep/gui/PanelChipset.cpp b/src/osdep/gui/PanelChipset.cpp index 52e8233c..5bd30bff 100644 --- a/src/osdep/gui/PanelChipset.cpp +++ b/src/osdep/gui/PanelChipset.cpp @@ -201,18 +201,23 @@ void InitPanelChipset(const struct _ConfigCategory& category) ntscButtonActionListener = new NTSCButtonActionListener(); optOCS = new gcn::RadioButton("OCS", "radiochipsetgroup"); + optOCS->setId("OCS"); optOCS->addActionListener(chipsetButtonActionListener); optECSAgnus = new gcn::RadioButton("ECS Agnus", "radiochipsetgroup"); + optECSAgnus->setId("ECS Agnus"); optECSAgnus->addActionListener(chipsetButtonActionListener); optECS = new gcn::RadioButton("Full ECS", "radiochipsetgroup"); + optECS->setId("Full ECS"); optECS->addActionListener(chipsetButtonActionListener); optAGA = new gcn::RadioButton("AGA", "radiochipsetgroup"); + optAGA->setId("AGA"); optAGA->addActionListener(chipsetButtonActionListener); chkNTSC = new gcn::CheckBox("NTSC"); + chkNTSC->setId("NTSC"); chkNTSC->addActionListener(ntscButtonActionListener); lblChipset = new gcn::Label("Extra:"); @@ -247,6 +252,7 @@ void InitPanelChipset(const struct _ConfigCategory& category) optBlitNormal->addActionListener(blitterButtonActionListener); optBlitImmed = new gcn::RadioButton("Immediate", "radiocblittergroup"); + optBlitImmed->setId("Immediate"); optBlitImmed->addActionListener(blitterButtonActionListener); optBlitWait = new gcn::RadioButton("Wait for blit.", "radiocblittergroup"); @@ -267,6 +273,7 @@ void InitPanelChipset(const struct _ConfigCategory& category) fastCopperActionListener = new FastCopperActionListener(); chkFastCopper = new gcn::CheckBox("Fast copper"); + chkFastCopper->setId("Fast copper"); chkFastCopper->addActionListener(fastCopperActionListener); grpCopper = new gcn::Window("Copper"); @@ -286,6 +293,7 @@ void InitPanelChipset(const struct _ConfigCategory& category) optCollNone->addActionListener(collisionButtonActionListener); optCollSprites = new gcn::RadioButton("Sprites only", "radioccollisiongroup"); + optCollSprites->setId("Sprites only"); optCollSprites->addActionListener(collisionButtonActionListener); optCollPlayfield = new gcn::RadioButton("Sprites and Sprites vs. Playfield", "radioccollisiongroup"); diff --git a/src/osdep/gui/PanelCustom.cpp b/src/osdep/gui/PanelCustom.cpp index 02bb950b..c901b642 100644 --- a/src/osdep/gui/PanelCustom.cpp +++ b/src/osdep/gui/PanelCustom.cpp @@ -345,21 +345,29 @@ void InitPanelCustom(const struct _ConfigCategory& category) grpActionListener = new GroupActionListener(); optPort0 = new gcn::RadioButton("0: Mouse", "radioportgroup"); + optPort0->setId("0: Mouse"); optPort0->addActionListener(grpActionListener); optPort1 = new gcn::RadioButton("1: Joystick", "radioportgroup"); + optPort1->setId("1: Joystick"); optPort1->addActionListener(grpActionListener); optPort2 = new gcn::RadioButton("2: Parallel 1", "radioportgroup"); + optPort2->setId("2: Parallel 1"); optPort2->addActionListener(grpActionListener); optPort3 = new gcn::RadioButton("3: Parallel 2", "radioportgroup"); + optPort3->setId("3: Parallel 2"); optPort3->addActionListener(grpActionListener); optMultiNone = new gcn::RadioButton("None", "radiomultigroup"); + optMultiNone->setId("None"); optMultiNone->addActionListener(grpActionListener); optMultiSelect = new gcn::RadioButton("HotKey", "radiomultigroup"); + optMultiSelect->setId("HotKey"); optMultiSelect->addActionListener(grpActionListener); // optMultiLeft = new gcn::RadioButton("Left Trigger", "radiomultigroup"); + // optMultiLeft->setId("Left Trigger"); // optMultiLeft->addActionListener(grpActionListener); // optMultiRight = new gcn::RadioButton("Right Trigger", "radiomultigroup"); + // optMultiRight->setId("Right Trigger"); // optMultiRight->addActionListener(grpActionListener); chkAnalogRemap = new gcn::CheckBox("Remap DPad to left axis"); diff --git a/src/osdep/gui/PanelDisplay.cpp b/src/osdep/gui/PanelDisplay.cpp index 035520bb..f56640da 100644 --- a/src/osdep/gui/PanelDisplay.cpp +++ b/src/osdep/gui/PanelDisplay.cpp @@ -47,17 +47,17 @@ public: { if (actionEvent.getSource() == sldAmigaWidth) { - if (changed_prefs.gfx_monitor.gfx_size.width != amigawidth_values[int(sldAmigaWidth->getValue())]) + if (changed_prefs.gfx_monitor.gfx_size.width != amigawidth_values[static_cast(sldAmigaWidth->getValue())]) { - changed_prefs.gfx_monitor.gfx_size.width = amigawidth_values[int(sldAmigaWidth->getValue())]; + changed_prefs.gfx_monitor.gfx_size.width = amigawidth_values[static_cast(sldAmigaWidth->getValue())]; RefreshPanelDisplay(); } } else if (actionEvent.getSource() == sldAmigaHeight) { - if (changed_prefs.gfx_monitor.gfx_size.height != amigaheight_values[int(sldAmigaHeight->getValue())]) + if (changed_prefs.gfx_monitor.gfx_size.height != amigaheight_values[static_cast(sldAmigaHeight->getValue())]) { - changed_prefs.gfx_monitor.gfx_size.height = amigaheight_values[int(sldAmigaHeight->getValue())]; + changed_prefs.gfx_monitor.gfx_size.height = amigaheight_values[static_cast(sldAmigaHeight->getValue())]; RefreshPanelDisplay(); } } @@ -160,8 +160,10 @@ void InitPanelDisplay(const struct _ConfigCategory& category) lblAmigaHeightInfo = new gcn::Label("200"); chkHorizontal = new gcn::CheckBox("Horizontal"); + chkHorizontal->setId("Horizontal"); chkHorizontal->addActionListener(amigaScreenActionListener); chkVertical = new gcn::CheckBox("Vertical"); + chkVertical->setId("Vertical"); chkVertical->addActionListener(amigaScreenActionListener); chkAspect = new gcn::CheckBox("Correct Aspect Ratio"); @@ -169,9 +171,11 @@ void InitPanelDisplay(const struct _ConfigCategory& category) chkAspect->addActionListener(amigaScreenActionListener); chkFrameskip = new gcn::CheckBox("Frameskip"); + chkFrameskip->setId("Frameskip"); chkFrameskip->addActionListener(amigaScreenActionListener); chkFullscreen = new gcn::CheckBox("Fullscreen"); + chkFullscreen->setId("Fullscreen"); chkFullscreen->addActionListener(amigaScreenActionListener); grpAmigaScreen = new gcn::Window("Amiga Screen"); @@ -209,12 +213,15 @@ void InitPanelDisplay(const struct _ConfigCategory& category) scalingMethodActionListener = new ScalingMethodActionListener(); optAuto = new gcn::RadioButton("Auto", "radioscalingmethodgroup"); + optAuto->setId("Auto"); optAuto->addActionListener(scalingMethodActionListener); optNearest = new gcn::RadioButton("Nearest Neighbor (pixelated)", "radioscalingmethodgroup"); + optNearest->setId("Nearest Neighbor (pixelated)"); optNearest->addActionListener(scalingMethodActionListener); optLinear = new gcn::RadioButton("Linear (smooth)", "radioscalingmethodgroup"); + optLinear->setId("Linear (smooth)"); optLinear->addActionListener(scalingMethodActionListener); grpScalingMethod = new gcn::Window("Scaling method"); @@ -232,12 +239,15 @@ void InitPanelDisplay(const struct _ConfigCategory& category) lineModeActionListener = new LineModeActionListener(); optSingle = new gcn::RadioButton("Single", "linemodegroup"); + optSingle->setId("Single"); optSingle->addActionListener(lineModeActionListener); optDouble = new gcn::RadioButton("Double", "linemodegroup"); + optDouble->setId("Double"); optDouble->addActionListener(lineModeActionListener); optScanlines = new gcn::RadioButton("Scanlines", "linemodegroup"); + optScanlines->setId("Scanlines"); optScanlines->addActionListener(lineModeActionListener); grpLineMode = new gcn::Window("Line mode"); diff --git a/src/osdep/gui/PanelFloppy.cpp b/src/osdep/gui/PanelFloppy.cpp index c2b63637..69fa7c74 100644 --- a/src/osdep/gui/PanelFloppy.cpp +++ b/src/osdep/gui/PanelFloppy.cpp @@ -386,6 +386,7 @@ void InitPanelFloppy(const struct _ConfigCategory& category) char tmp[20]; snprintf(tmp, 20, "DF%d:", i); chkDFx[i] = new gcn::CheckBox(tmp); + chkDFx[i]->setId(tmp); chkDFx[i]->addActionListener(dfxCheckActionListener); cboDFxType[i] = new gcn::DropDown(&driveTypeList); diff --git a/src/osdep/gui/PanelHD.cpp b/src/osdep/gui/PanelHD.cpp index 121ec0ff..865ee0ee 100644 --- a/src/osdep/gui/PanelHD.cpp +++ b/src/osdep/gui/PanelHD.cpp @@ -413,6 +413,7 @@ void InitPanelHD(const struct _ConfigCategory& category) chkHDReadOnly->addActionListener(genericActionListener); chkCD = new gcn::CheckBox("CD drive"); + chkCD->setId("CD drive"); chkCD->addActionListener(cdCheckActionListener); cmdCDEject = new gcn::Button("Eject"); diff --git a/src/osdep/gui/PanelQuickstart.cpp b/src/osdep/gui/PanelQuickstart.cpp index c76b46ab..a4a0f022 100644 --- a/src/osdep/gui/PanelQuickstart.cpp +++ b/src/osdep/gui/PanelQuickstart.cpp @@ -697,6 +697,7 @@ void InitPanelQuickstart(const struct _ConfigCategory& category) char tmp[20]; snprintf(tmp, 20, "DF%d:", i); chkDFx[i] = new gcn::CheckBox(tmp); + chkDFx[i]->setId(tmp); chkDFx[i]->addActionListener(dfxCheckActionListener); snprintf(tmp, 20, "qsDF%d", i); chkDFx[i]->setId(tmp); diff --git a/src/osdep/gui/PanelSound.cpp b/src/osdep/gui/PanelSound.cpp index 5240cbf8..2feba6cb 100644 --- a/src/osdep/gui/PanelSound.cpp +++ b/src/osdep/gui/PanelSound.cpp @@ -275,9 +275,11 @@ void InitPanelSound(const struct _ConfigCategory& category) cboFrequency->addActionListener(soundActionListener); optMono = new gcn::RadioButton("Mono", "radiosoundmodegroup"); + optMono->setId("Mono"); optMono->addActionListener(soundActionListener); optStereo = new gcn::RadioButton("Stereo", "radiosoundmodegroup"); + optStereo->setId("Stereo"); optStereo->addActionListener(soundActionListener); grpMode = new gcn::Window("Mode");