diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-05-13 13:10:27 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-13 16:27:43 +0200 |
commit | cdffe556c8fcca034b10cf91f0b05c17d835bc7b (patch) | |
tree | 189cbd59652eee1b2783a8323a7194100c78fd07 /Userland/Libraries/LibGUI/Dialog.h | |
parent | 1f82beded3ae3664265f1ddf6075f64ca5a08cde (diff) | |
download | serenity-cdffe556c8fcca034b10cf91f0b05c17d835bc7b.zip |
LibGUI+Userland: Make Dialog::ExecResult an enum class
Diffstat (limited to 'Userland/Libraries/LibGUI/Dialog.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Dialog.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibGUI/Dialog.h b/Userland/Libraries/LibGUI/Dialog.h index 259e346261..52146c8dc3 100644 --- a/Userland/Libraries/LibGUI/Dialog.h +++ b/Userland/Libraries/LibGUI/Dialog.h @@ -15,12 +15,12 @@ namespace GUI { class Dialog : public Window { C_OBJECT(Dialog) public: - enum ExecResult { - ExecOK = 0, - ExecCancel = 1, - ExecAborted = 2, - ExecYes = 3, - ExecNo = 4, + enum class ExecResult { + OK = 0, + Cancel = 1, + Aborted = 2, + Yes = 3, + No = 4, }; enum ScreenPosition { CenterWithinParent = 0, @@ -40,10 +40,10 @@ public: virtual ~Dialog() override = default; - int exec(); + ExecResult exec(); - int result() const { return m_result; } - void done(int result); + ExecResult result() const { return m_result; } + void done(ExecResult); virtual void event(Core::Event&) override; @@ -54,7 +54,7 @@ protected: private: OwnPtr<Core::EventLoop> m_event_loop; - int m_result { ExecAborted }; + ExecResult m_result { ExecResult::Aborted }; int m_screen_position { CenterWithinParent }; }; |