From: Jean-Paul Mari Date: Tue, 31 Oct 2017 06:34:32 +0000 (-0400) Subject: Keybindings UI is displayed based on the option used (--debugger, -- alpine) X-Git-Tag: v2.1.3-R3~5 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/0d612b974ec301926fdc31d9b52dafd23aa6dd95 Keybindings UI is displayed based on the option used (--debugger, -- alpine) --- diff --git a/VS2015/virtualjaguar.vcxproj.user b/VS2015/virtualjaguar.vcxproj.user index a87c88b..57837dc 100644 --- a/VS2015/virtualjaguar.vcxproj.user +++ b/VS2015/virtualjaguar.vcxproj.user @@ -7,7 +7,7 @@ PATH=$(QTDIR)\bin%3b$(PATH) C:\Qt\Qt5.5.1\msvc2015_64 - C:\Projects\quake2\JagCake\Debug\JagCake_Debug.elf --debugger + C:\Projects\quake2\JagCake\Debug\JagCake_Debug.elf WindowsLocalDebugger $(OutDir) diff --git a/docs/vj_ReleaseNotes.txt b/docs/vj_ReleaseNotes.txt index dde40ff..2a73b3b 100644 --- a/docs/vj_ReleaseNotes.txt +++ b/docs/vj_ReleaseNotes.txt @@ -11,6 +11,7 @@ Release 3 (WiP) 7) Added the --es-all, --es-ui, --es-alpine & --es-debugger options to erase specific settings 8) Added a keybindings tab and adapted the configuration dialog tabs -- User can modify the keybindings where appropriate +-- Keybindings UI is displayed based on the option used (--debugger, -- alpine) 9) Fixed a crash, in Release mode, when the HW labels setting is turn on 10) Solved an interference between the HW labels setting and the one used by the debugger -- The setting is now only the reference used diff --git a/src/gui/keybindingstab.cpp b/src/gui/keybindingstab.cpp index dfb0c44..12b7e54 100644 --- a/src/gui/keybindingstab.cpp +++ b/src/gui/keybindingstab.cpp @@ -15,16 +15,16 @@ // 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++) { + // 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); + + // Check if keybinding can be editable + if (KeyBindingsTable[i].KBType != KB_TYPEGENERAL) + { + if (vjs.hardwareTypeAlpine && (KeyBindingsTable[i].KBType & KB_TYPEALPINE)) + { + } + else + { + if (vjs.softTypeDebugger && (KeyBindingsTable[i].KBType & KB_TYPEDEBUGGER)) + { + } + else + { + KeyBindingsTable[i].KBLabel->hide(); + KeyBindingsTable[i].KBLineEdit->hide(); + } + } + } } // Layouts setup diff --git a/src/gui/keybindingstab.h b/src/gui/keybindingstab.h index 78cbeb7..f6ef956 100644 --- a/src/gui/keybindingstab.h +++ b/src/gui/keybindingstab.h @@ -7,6 +7,7 @@ // struct KeyBindings { + size_t KBType; const char *KBNameSetting; const char *KBNameLabel; const char *KBPlaceholderText; @@ -18,6 +19,14 @@ struct KeyBindings // enum +{ + KB_TYPEGENERAL = 0, + KB_TYPEDEBUGGER = 1, + KB_TYPEALPINE = 2 +}; + +// List the keybindings used for the settings +enum { KB_START = 0, KBQUIT = 0,