diff options
Diffstat (limited to 'OpenFileGUICommand.cpp')
-rw-r--r-- | OpenFileGUICommand.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenFileGUICommand.cpp b/OpenFileGUICommand.cpp index 13751b2..c23a3cf 100644 --- a/OpenFileGUICommand.cpp +++ b/OpenFileGUICommand.cpp @@ -9,17 +9,17 @@ using namespace std; -void OpenFileGUICommand::execute() { - Museum * museum = &this->get_museum(); +OpenFileGUICommand::OpenFileGUICommand(Museum & m, View & v) : museum(m), view(v) {} - ToggleMuseumPauseCommand(*museum).set(true); - this->get_view().dialog_file([](vector<string> files, void * data) -> void { +void OpenFileGUICommand::execute() { + ToggleMuseumPauseCommand(this->museum, true); + this->view.dialog_file([](vector<string> files, void * data) -> void { Museum * museum = static_cast<Museum *>(data); try { - LoadFilesCommand(*museum).execute(files); + LoadFilesCommand(*museum, files).execute(); } catch (Exception & e) { printf("%s\n", e.what()); } - }, museum); + }, &this->museum); } |