diff --git a/GViewCore/src/App/Instance.cpp b/GViewCore/src/App/Instance.cpp index c929da1d..2e5b68ee 100644 --- a/GViewCore/src/App/Instance.cpp +++ b/GViewCore/src/App/Instance.cpp @@ -500,6 +500,14 @@ void Instance::OpenFile() ShowErrors(); } } +void Instance::OpenFolder() +{ + auto res = Dialogs::FileDialog::ShowOpenFileWindow("", "GVIEW:IGNORE-EVERYTHING", "."); + if (res.has_value()) { + if (AddFileWindow(res.value(), OpenMethod::BestMatch, "") == false) + ShowErrors(); + } +} void Instance::UpdateCommandBar(AppCUI::Application::CommandBar& commandBar) { auto idx = GENERIC_PLUGINS_CMDID; @@ -572,6 +580,9 @@ bool Instance::OnEvent(Reference control, Event eventType, int ID) case MenuCommands::OPEN_FILE: OpenFile(); return true; + case MenuCommands::OPEN_FOLDER: + OpenFolder(); + return true; } if ((ID >= GENERIC_PLUGINS_CMDID) && (ID < GENERIC_PLUGINS_CMDID + GENERIC_PLUGINS_FRAME * 1000)) { diff --git a/GViewCore/src/include/Internal.hpp b/GViewCore/src/include/Internal.hpp index 43453178..93387926 100644 --- a/GViewCore/src/include/Internal.hpp +++ b/GViewCore/src/include/Internal.hpp @@ -499,6 +499,7 @@ namespace App bool BuildMainMenus(); bool LoadSettings(); void OpenFile(); + void OpenFolder(); void ShowErrors(); Reference IdentifyTypePlugin_FirstMatch(