summaryrefslogtreecommitdiff
path: root/src/error_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/error_gui.cpp')
-rw-r--r--src/error_gui.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index 7cbe1d95e..381d67a96 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -315,13 +315,6 @@ public:
if (_window_system_initialized) ShowFirstError();
}
- EventState OnKeyPress(WChar key, uint16 keycode) override
- {
- if (keycode != WKC_SPACE) return ES_NOT_HANDLED;
- delete this;
- return ES_HANDLED;
- }
-
/**
* Check whether the currently shown error message was critical or not.
* @return True iff the message was critical.
@@ -424,6 +417,18 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel
}
}
+
+/**
+ * Close active error message window
+ * @return true if a window was closed.
+ */
+bool HideActiveErrorMessage() {
+ ErrmsgWindow *w = (ErrmsgWindow*)FindWindowById(WC_ERRMSG, 0);
+ if (w == nullptr) return false;
+ delete w;
+ return true;
+}
+
/**
* Schedule a list of errors.
* Note: This does not try to display the error now. This is useful if the window system is not yet running.