settings_config_dialog.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /**************************************************************************/
  2. /* settings_config_dialog.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef SETTINGS_CONFIG_DIALOG_H
  31. #define SETTINGS_CONFIG_DIALOG_H
  32. #include "editor/editor_sectioned_inspector.h"
  33. #include "editor_inspector.h"
  34. #include "scene/gui/dialogs.h"
  35. #include "scene/gui/panel_container.h"
  36. #include "scene/gui/rich_text_label.h"
  37. #include "scene/gui/tab_container.h"
  38. #include "scene/gui/texture_rect.h"
  39. #include "scene/gui/tool_button.h"
  40. class EditorSettingsDialog : public AcceptDialog {
  41. GDCLASS(EditorSettingsDialog, AcceptDialog);
  42. bool updating;
  43. TabContainer *tabs;
  44. Control *tab_general;
  45. Control *tab_shortcuts;
  46. LineEdit *search_box;
  47. LineEdit *shortcut_search_box;
  48. SectionedInspector *inspector;
  49. Timer *timer;
  50. UndoRedo *undo_redo;
  51. Tree *shortcuts;
  52. ConfirmationDialog *press_a_key;
  53. Label *press_a_key_label;
  54. Ref<InputEventKey> last_wait_for_key;
  55. String shortcut_configured;
  56. String shortcut_filter;
  57. virtual void cancel_pressed();
  58. virtual void ok_pressed();
  59. void _settings_changed();
  60. void _settings_property_edited(const String &p_name);
  61. void _settings_save();
  62. void _unhandled_input(const Ref<InputEvent> &p_event);
  63. void _notification(int p_what);
  64. void _update_icons();
  65. void _press_a_key_confirm();
  66. void _wait_for_key(const Ref<InputEvent> &p_event);
  67. void _tabs_tab_changed(int p_tab);
  68. void _focus_current_search_box();
  69. void _filter_shortcuts(const String &p_filter);
  70. void _update_shortcuts();
  71. void _shortcut_button_pressed(Object *p_item, int p_column, int p_idx);
  72. static void _undo_redo_callback(void *p_self, const String &p_name);
  73. Label *restart_label;
  74. TextureRect *restart_icon;
  75. PanelContainer *restart_container;
  76. ToolButton *restart_close_button;
  77. void _editor_restart_request();
  78. void _editor_restart();
  79. void _editor_restart_close();
  80. protected:
  81. static void _bind_methods();
  82. public:
  83. void popup_edit_settings();
  84. EditorSettingsDialog();
  85. ~EditorSettingsDialog();
  86. };
  87. #endif // SETTINGS_CONFIG_DIALOG_H