aboutsummaryrefslogtreecommitdiff
path: root/OpenFileGUICommand.cpp
blob: 1ea2c2f1f10a81df3fc706d8864c34ccc3cde745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <vector>
#include <string>

#include "OpenFileGUICommand.h"
#include "Exception.h"
#include "LoadFilesCommand.h"
#include "MuseumPauseCommand.h"
#include "View.h"

using namespace std;

void OpenFileGUICommand::execute() {
	Museum * museum = &this->get_museum();

	MuseumPauseCommand(*museum).set(true);
	this->get_view().dialog_file([](vector<string> files, void * data) -> void {
		Museum * museum = static_cast<Museum *>(data);
		try {
			LoadFilesCommand(*museum).execute(files);
		} catch (Exception & e) {
			printf("%s\n", e.what());
		}
	}, museum);
}