HackStudio: Display warning when opening binary files

We now detect and display a warning when we can't render the text of an
opened file.

Closes #5062.
This commit is contained in:
Itamar
2021-03-19 13:06:32 +02:00
committed by Andreas Kling
parent 3cc7b00e24
commit dee0c46c9b
5 changed files with 35 additions and 4 deletions

View File

@@ -42,6 +42,7 @@ public:
}
const String& name() const { return m_name; }
bool could_render_text() const { return m_could_render_text; }
GUI::TextDocument& document() const;
CodeDocument& code_document() const;
@@ -57,6 +58,7 @@ private:
String m_name;
mutable RefPtr<CodeDocument> m_document;
mutable bool m_could_render_text { false };
int m_vertical_scroll_value { 0 };
int m_horizontal_scroll_value { 0 };
};