#include #include #include "OpenFileGUICommand.h" #include "Exception.h" #include "LoadFilesCommand.h" #include "ToggleMuseumPauseCommand.h" #include "View.h" using namespace std; OpenFileGUICommand::OpenFileGUICommand(Museum & m, View & v) : museum(m), view(v) {} void OpenFileGUICommand::execute() { ToggleMuseumPauseCommand(this->museum, true); this->view.dialog_file([](vector files, void * data) -> void { Museum * museum = static_cast(data); try { LoadFilesCommand(*museum, files).execute(); } catch (Exception & e) { printf("%s\n", e.what()); } }, &this->museum); }