diff options
| author | Juan Linietsky | 2017-12-14 08:59:46 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-12-14 09:01:27 -0300 |
| commit | f3ad14224e27f2a25196575e3c43ebc792c90894 (patch) | |
| tree | 84e60bc2fafda809f51bd0892e39205da9423068 /editor/progress_dialog.h | |
| parent | aa6772d7abb3ff1ff77b1b658617904bb0af1fbb (diff) | |
| download | godot-f3ad14224e27f2a25196575e3c43ebc792c90894.tar.gz godot-f3ad14224e27f2a25196575e3c43ebc792c90894.tar.zst godot-f3ad14224e27f2a25196575e3c43ebc792c90894.zip | |
Diffstat (limited to 'editor/progress_dialog.h')
| -rw-r--r-- | editor/progress_dialog.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h index 8ac090714..b13ea606b 100644 --- a/editor/progress_dialog.h +++ b/editor/progress_dialog.h @@ -31,6 +31,7 @@ #define PROGRESS_DIALOG_H #include "scene/gui/box_container.h" +#include "scene/gui/button.h" #include "scene/gui/label.h" #include "scene/gui/popup.h" #include "scene/gui/progress_bar.h" @@ -76,6 +77,8 @@ class ProgressDialog : public Popup { ProgressBar *progress; Label *state; }; + HBoxContainer *cancel_hb; + Button *cancel; Map<String, Task> tasks; VBoxContainer *main; @@ -84,13 +87,17 @@ class ProgressDialog : public Popup { static ProgressDialog *singleton; void _popup(); + void _cancel_pressed(); + bool cancelled; + protected: void _notification(int p_what); + static void _bind_methods(); public: static ProgressDialog *get_singleton() { return singleton; } - void add_task(const String &p_task, const String &p_label, int p_steps); - void task_step(const String &p_task, const String &p_state, int p_step = -1, bool p_force_redraw = true); + void add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel = false); + bool task_step(const String &p_task, const String &p_state, int p_step = -1, bool p_force_redraw = true); void end_task(const String &p_task); ProgressDialog(); |
