84
87
const std::string& text = edit_.text();
85
88
// Prevent the user from creating nonsense directory names, like e.g. ".." or "...".
86
89
const bool is_legal_filename = FileSystem::is_legal_filename(text);
88
92
const bool has_map_extension =
89
93
boost::iends_with(text, kWidelandsMapExtension) ||
90
94
boost::iends_with(text, kS2MapExtension1) ||
91
95
boost::iends_with(text, kS2MapExtension2);
92
96
ok_button_.set_enabled(is_legal_filename && !has_map_extension);