Keybindings UI is displayed based on the option used (--debugger, -- alpine)
authorJean-Paul Mari <djipi.mari@gmail.com>
Tue, 31 Oct 2017 06:34:32 +0000 (02:34 -0400)
committerJean-Paul Mari <djipi.mari@gmail.com>
Tue, 31 Oct 2017 06:34:32 +0000 (02:34 -0400)
VS2015/virtualjaguar.vcxproj.user
docs/vj_ReleaseNotes.txt
src/gui/keybindingstab.cpp
src/gui/keybindingstab.h

index a87c88b..57837dc 100644 (file)
@@ -7,7 +7,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>\r
     <QTDIR>C:\Qt\Qt5.5.1\msvc2015_64</QTDIR>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>\r
     <QTDIR>C:\Qt\Qt5.5.1\msvc2015_64</QTDIR>\r
-    <LocalDebuggerCommandArguments>C:\Projects\quake2\JagCake\Debug\JagCake_Debug.elf --debugger</LocalDebuggerCommandArguments>\r
+    <LocalDebuggerCommandArguments>C:\Projects\quake2\JagCake\Debug\JagCake_Debug.elf</LocalDebuggerCommandArguments>\r
     <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\r
     <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>\r
   </PropertyGroup>\r
     <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\r
     <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>\r
   </PropertyGroup>\r
index dde40ff..2a73b3b 100644 (file)
@@ -11,6 +11,7 @@ Release 3 (WiP)
 7) Added the --es-all, --es-ui, --es-alpine & --es-debugger options to erase specific settings\r
 8) Added a keybindings tab and adapted the configuration dialog tabs\r
 -- User can modify the keybindings where appropriate\r
 7) Added the --es-all, --es-ui, --es-alpine & --es-debugger options to erase specific settings\r
 8) Added a keybindings tab and adapted the configuration dialog tabs\r
 -- User can modify the keybindings where appropriate\r
+-- Keybindings UI is displayed based on the option used (--debugger, -- alpine)\r
 9) Fixed a crash, in Release mode, when the HW labels setting is turn on\r
 10) Solved an interference between the HW labels setting and the one used by the debugger\r
 -- The setting is now only the reference used\r
 9) Fixed a crash, in Release mode, when the HW labels setting is turn on\r
 10) Solved an interference between the HW labels setting and the one used by the debugger\r
 -- The setting is now only the reference used\r
index dfb0c44..12b7e54 100644 (file)
 
 //
 KeyBindings KeyBindingsTable[KB_END] = {
 
 //
 KeyBindings KeyBindingsTable[KB_END] = {
-                                                                                       {       "KB_Quit", "Quit", "Quit keybinding", "Ctrl+Q", NULL, NULL      },
-                                                                                       {       "KB_PickFile", "Pick file", "Pick file keybinding", "Ctrl+I", NULL, NULL        },
-                                                                                       {       "KB_Configure", "Configure", "Configure keybinding", "Ctrl+C", NULL, NULL       },
-                                                                                       {       "KB_EmuStatus", "Emulator Status", "Emulator status keybinding", "Ctrl+S", NULL, NULL   },
-                                                                                       {       "KB_Pause", "Pause", "Pause keybinding", "Esc", NULL, NULL      },
-                                                                                       {       "KB_FrameAdvance", "Frame Advance", "Frame advance keybinding", "F7", NULL, NULL        },
-                                                                                       {       "KB_Restart", "Restart", "Restart keybinding", "Ctrl+Shift+F5", NULL, NULL      },
-                                                                                       {       "KB_StepInto", "Step Into", "Step into keybinding", "F11", NULL, NULL   },
-                                                                                       {       "KB_StepOver", "Step Over", "Step over kebinding", "F10", NULL, NULL    },
-                                                                                       {       "KB_FullScreen", "Full Screen", "Full screen kebinding", "F9", NULL, NULL       }
+                                                                                       { KB_TYPEGENERAL, "KB_Quit", "Quit", "Quit keybinding", "Ctrl+Q", NULL, NULL    },
+                                                                                       { KB_TYPEGENERAL, "KB_PickFile", "Pick file", "Pick file keybinding", "Ctrl+I", NULL, NULL      },
+                                                                                       { KB_TYPEGENERAL, "KB_Configure", "Configure", "Configure keybinding", "Ctrl+C", NULL, NULL     },
+                                                                                       { KB_TYPEGENERAL, "KB_EmuStatus", "Emulator Status", "Emulator status keybinding", "Ctrl+S", NULL, NULL },
+                                                                                       { KB_TYPEGENERAL, "KB_Pause", "Pause", "Pause keybinding", "Esc", NULL, NULL    },
+                                                                                       { KB_TYPEGENERAL, "KB_FrameAdvance", "Frame Advance", "Frame advance keybinding", "F7", NULL, NULL },
+                                                                                       { KB_TYPEDEBUGGER, "KB_Restart", "Restart", "Restart keybinding", "Ctrl+Shift+F5", NULL, NULL   },
+                                                                                       { KB_TYPEDEBUGGER, "KB_StepInto", "Step Into", "Step into keybinding", "F11", NULL, NULL        },
+                                                                                       { KB_TYPEDEBUGGER, "KB_StepOver", "Step Over", "Step over kebinding", "F10", NULL, NULL },
+                                                                                       { KB_TYPEGENERAL, "KB_FullScreen", "Full Screen", "Full screen kebinding", "F9", NULL, NULL     }
                                                                                };
 
 
                                                                                };
 
 
@@ -43,10 +43,30 @@ KeyBindingsTab::KeyBindingsTab(QWidget * parent/*= 0*/): QWidget(parent)
        // Initialisation for each layout line
        for (i = 0; i < NBKEYBINDINGS; i++)
        {
        // Initialisation for each layout line
        for (i = 0; i < NBKEYBINDINGS; i++)
        {
+               // Prepare the keybinding line
                layout1->addWidget(KeyBindingsTable[i].KBLabel = new QLabel(KeyBindingsTable[i].KBNameLabel));
                layout2->addWidget(KeyBindingsTable[i].KBLineEdit = new QLineEdit(""));
                KeyBindingsTable[i].KBLineEdit->setMaxLength(30);
                KeyBindingsTable[i].KBLineEdit->setPlaceholderText(KeyBindingsTable[i].KBPlaceholderText);
                layout1->addWidget(KeyBindingsTable[i].KBLabel = new QLabel(KeyBindingsTable[i].KBNameLabel));
                layout2->addWidget(KeyBindingsTable[i].KBLineEdit = new QLineEdit(""));
                KeyBindingsTable[i].KBLineEdit->setMaxLength(30);
                KeyBindingsTable[i].KBLineEdit->setPlaceholderText(KeyBindingsTable[i].KBPlaceholderText);
+
+               // Check if keybinding can be editable
+               if (KeyBindingsTable[i].KBType != KB_TYPEGENERAL)
+               {
+                       if (vjs.hardwareTypeAlpine && (KeyBindingsTable[i].KBType & KB_TYPEALPINE))
+                       {
+                       }
+                       else\r
+                       {\r
+                               if (vjs.softTypeDebugger && (KeyBindingsTable[i].KBType & KB_TYPEDEBUGGER))\r
+                               {\r
+                               }\r
+                               else\r
+                               {\r
+                                       KeyBindingsTable[i].KBLabel->hide();
+                                       KeyBindingsTable[i].KBLineEdit->hide();\r
+                               }\r
+                       }
+               }
        }
 
        // Layouts setup
        }
 
        // Layouts setup
index 78cbeb7..f6ef956 100644 (file)
@@ -7,6 +7,7 @@
 //\r
 struct KeyBindings\r
 {\r
 //\r
 struct KeyBindings\r
 {\r
+       size_t KBType;\r
        const char *KBNameSetting;\r
        const char *KBNameLabel;\r
        const char *KBPlaceholderText;\r
        const char *KBNameSetting;\r
        const char *KBNameLabel;\r
        const char *KBPlaceholderText;\r
@@ -18,6 +19,14 @@ struct KeyBindings
 \r
 // \r
 enum\r
 \r
 // \r
 enum\r
+{\r
+       KB_TYPEGENERAL = 0,\r
+       KB_TYPEDEBUGGER = 1,\r
+       KB_TYPEALPINE = 2\r
+};\r
+\r
+// List the keybindings used for the settings\r
+enum\r
 {\r
        KB_START = 0,\r
        KBQUIT = 0,\r
 {\r
        KB_START = 0,\r
        KBQUIT = 0,\r