1 /* 2 * Copyright (C) 2002-2020 by the Widelands Development Team 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 * 18 */ 19 20 #ifndef WL_EDITOR_UI_MENUS_MAIN_MENU_SAVE_MAP_MAKE_DIRECTORY_H 21 #define WL_EDITOR_UI_MENUS_MAIN_MENU_SAVE_MAP_MAKE_DIRECTORY_H 22 23 #include "ui_basic/box.h" 24 #include "ui_basic/button.h" 25 #include "ui_basic/editbox.h" 26 #include "ui_basic/textarea.h" 27 #include "ui_basic/window.h" 28 29 /** 30 * Show a small modal dialog allowing the user to enter 31 * a directory name to be created 32 * 33 */ 34 // TODO(unknown): This should be moved to src/ui, it's not specific to the editor 35 struct MainMenuSaveMapMakeDirectory : public UI::Window { 36 MainMenuSaveMapMakeDirectory(UI::Panel*, char const*); 37 38 void start() override; 39 get_dirnameMainMenuSaveMapMakeDirectory40 char const* get_dirname() { 41 return dirname_.c_str(); 42 } 43 44 private: 45 const int padding_; 46 const int butw_, buth_; 47 std::string dirname_; 48 UI::Box vbox_; 49 UI::Textarea label_; 50 UI::EditBox edit_; 51 UI::Button ok_button_; 52 UI::Button cancel_button_; 53 const std::string illegal_filename_tooltip_; 54 void edit_changed(); 55 void clicked_ok(); 56 }; 57 58 #endif // end of include guard: WL_EDITOR_UI_MENUS_MAIN_MENU_SAVE_MAP_MAKE_DIRECTORY_H 59