summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/GDialog.cpp7
-rw-r--r--Libraries/LibGUI/GDialog.h2
-rw-r--r--Libraries/LibGUI/GWindow.h2
3 files changed, 10 insertions, 1 deletions
diff --git a/Libraries/LibGUI/GDialog.cpp b/Libraries/LibGUI/GDialog.cpp
index 7438e41b2e..eaa3359f39 100644
--- a/Libraries/LibGUI/GDialog.cpp
+++ b/Libraries/LibGUI/GDialog.cpp
@@ -40,3 +40,10 @@ void GDialog::done(int result)
dbgprintf("%s: quit event loop with result %d\n", class_name(), result);
m_event_loop->quit(result);
}
+
+void GDialog::close()
+{
+ GWindow::close();
+ m_event_loop->quit(ExecCancel);
+}
+
diff --git a/Libraries/LibGUI/GDialog.h b/Libraries/LibGUI/GDialog.h
index a0e9a2cb46..6b3bbb7f04 100644
--- a/Libraries/LibGUI/GDialog.h
+++ b/Libraries/LibGUI/GDialog.h
@@ -19,6 +19,8 @@ public:
int result() const { return m_result; }
void done(int result);
+ virtual void close() override;
+
protected:
explicit GDialog(CObject* parent);
diff --git a/Libraries/LibGUI/GWindow.h b/Libraries/LibGUI/GWindow.h
index e8b50ed13a..a0ec5f8542 100644
--- a/Libraries/LibGUI/GWindow.h
+++ b/Libraries/LibGUI/GWindow.h
@@ -82,7 +82,7 @@ public:
void show();
void hide();
- void close();
+ virtual void close();
void move_to_front();
void start_wm_resize();