diff --git a/Types/MACHO/include/MachO.hpp b/Types/MACHO/include/MachO.hpp index d8749042..e4c26e39 100644 --- a/Types/MACHO/include/MachO.hpp +++ b/Types/MACHO/include/MachO.hpp @@ -532,6 +532,12 @@ namespace Panels namespace Commands { + static constexpr uint32 MACHO_COMMAND_DIGITAL_SIGNATURE = 0; + + static KeyboardControl MACHO_COMMANDS[] = { + { Input::Key::Alt | Input::Key::F8, "DigitalSignature", "Show digital signature", MACHO_COMMAND_DIGITAL_SIGNATURE }, + }; + class CodeSignMagic : public AppCUI::Controls::Window { private: diff --git a/Types/MACHO/src/MachO.cpp b/Types/MACHO/src/MachO.cpp index 2408542c..50b63807 100644 --- a/Types/MACHO/src/MachO.cpp +++ b/Types/MACHO/src/MachO.cpp @@ -255,6 +255,11 @@ extern "C" sect["Priority"] = 1; sect["Description"] = "Mach file executable object (Mach-O) for OSX based systems (including MachO Fat)"; sect["OpCodes.Mask"] = (uint32) GView::Dissasembly::Opcodes::All; - sect["Command.DigitalSignature"] = AppCUI::Input::Key::Alt | AppCUI::Input::Key::F8; + + LocalString<128> buffer; + for (const auto& command : MachO::Commands::MACHO_COMMANDS) { + buffer.SetFormat("Command.%s", command.Caption); + sect[buffer.GetText()] = command.Key; + } } } diff --git a/Types/MAM/include/MAM.hpp b/Types/MAM/include/MAM.hpp index 1afb61dc..b05612e2 100644 --- a/Types/MAM/include/MAM.hpp +++ b/Types/MAM/include/MAM.hpp @@ -4,6 +4,12 @@ namespace GView::Type::MAM { +static constexpr uint32 MAM_COMMAND_DECOMPRESS = 0; + +static KeyboardControl MAM_COMMANDS[] = { + { Input::Key::Shift | Input::Key::F10, "Decompress", "Decompress file", MAM_COMMAND_DECOMPRESS }, +}; + class MAMFile : public TypeInterface { public: diff --git a/Types/MAM/src/MAM.cpp b/Types/MAM/src/MAM.cpp index fb1af361..fddb56d6 100644 --- a/Types/MAM/src/MAM.cpp +++ b/Types/MAM/src/MAM.cpp @@ -61,6 +61,11 @@ extern "C" sect["Extension"] = "pf"; sect["Priority"] = 1; sect["Description"] = "PF file format (*.pf)"; - sect["Command.Decompress"] = AppCUI::Input::Key::Shift | AppCUI::Input::Key::F10; + + LocalString<128> buffer; + for (const auto& command : MAM::MAM_COMMANDS) { + buffer.SetFormat("Command.%s", command.Caption); + sect[buffer.GetText()] = command.Key; + } } }