HackStudio: Show dialog on build and exit if there are unsaved changes

If the user tries to exit HackStudio, or build the project, when there
are unsaved changes in some of the editors, A Yes/No/Cancel dialog will
be shown.
This commit is contained in:
Itamar 2021-05-01 13:42:07 +03:00 committed by Andreas Kling
commit 329cb134d6
Notes: sideshowbarker 2024-07-18 18:46:05 +09:00
4 changed files with 50 additions and 2 deletions

View file

@ -50,6 +50,12 @@ public:
return *m_locator;
}
enum class ContinueDecision {
No,
Yes
};
ContinueDecision warn_unsaved_changes(const String& prompt);
private:
static String get_full_path_of_serenity_source(const String& file);
Vector<String> selected_file_paths() const;
@ -112,6 +118,7 @@ private:
void build(TerminalWrapper& wrapper);
void hide_action_tabs();
bool any_document_is_dirty() const;
NonnullRefPtrVector<EditorWrapper> m_all_editor_wrappers;
RefPtr<EditorWrapper> m_current_editor_wrapper;