Skip to content

Commit

Permalink
GView open folder is not working #236
Browse files Browse the repository at this point in the history
  • Loading branch information
rzaharia committed Mar 1, 2024
1 parent 669e5d8 commit 431765c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions GViewCore/src/App/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -572,6 +580,9 @@ bool Instance::OnEvent(Reference<Control> 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))
{
Expand Down
1 change: 1 addition & 0 deletions GViewCore/src/include/Internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ namespace App
bool BuildMainMenus();
bool LoadSettings();
void OpenFile();
void OpenFolder();
void ShowErrors();

Reference<Type::Plugin> IdentifyTypePlugin_FirstMatch(
Expand Down

0 comments on commit 431765c

Please sign in to comment.