mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 18:45:08 +00:00

We forgot to persist our actions in the constructor for later reference, whoops. Also use the correct path in the "open" action.
26 lines
597 B
C++
26 lines
597 B
C++
#pragma once
|
|
|
|
#include <AK/Function.h>
|
|
#include <LibGUI/GApplication.h>
|
|
#include <LibGUI/GTextEditor.h>
|
|
#include <LibGUI/GWidget.h>
|
|
#include <LibGUI/GWindow.h>
|
|
|
|
class GTextEditor;
|
|
|
|
class TextEditorWidget final : public GWidget {
|
|
public:
|
|
TextEditorWidget();
|
|
virtual ~TextEditorWidget() override;
|
|
void open_sesame(const String& path);
|
|
|
|
private:
|
|
void set_path(const StringView&);
|
|
|
|
GTextEditor* m_editor { nullptr };
|
|
String m_path;
|
|
RefPtr<GAction> m_new_action;
|
|
RefPtr<GAction> m_open_action;
|
|
RefPtr<GAction> m_save_action;
|
|
RefPtr<GAction> m_save_as_action;
|
|
};
|