mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
Make GWindow::close() so we can override it in GDialog and quit from the internal event loop when the window manager tells us to close ourselves. The dialog will return GDialog::ExecCancel in these situations.
30 lines
528 B
C++
30 lines
528 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GEventLoop.h>
|
|
#include <LibGUI/GWindow.h>
|
|
|
|
class GDialog : public GWindow {
|
|
C_OBJECT(GDialog)
|
|
public:
|
|
enum ExecResult {
|
|
ExecOK = 0,
|
|
ExecCancel = 1,
|
|
ExecAborted = 2
|
|
};
|
|
|
|
virtual ~GDialog() override;
|
|
|
|
int exec();
|
|
|
|
int result() const { return m_result; }
|
|
void done(int result);
|
|
|
|
virtual void close() override;
|
|
|
|
protected:
|
|
explicit GDialog(CObject* parent);
|
|
|
|
private:
|
|
OwnPtr<GEventLoop> m_event_loop;
|
|
int m_result { ExecAborted };
|
|
};
|