ui/logic/data: refreshing only source files that have been updated
This change adds the refresh component that allows for refreshing the source code via UI or shortcut. If automatic refreshing is activated via the UI, the code is refreshed anytime the window gets focus. The contents of all the updated source files get removed from Storage, before reparsing them. File dependencies are not respected yet.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include "component/view/RefreshView.h"
|
||||
|
||||
#include "component/controller/RefreshController.h"
|
||||
|
||||
RefreshView::RefreshView(ViewLayout* viewLayout)
|
||||
: View(viewLayout, Vec2i(100, 100))
|
||||
{
|
||||
}
|
||||
|
||||
RefreshView::~RefreshView()
|
||||
{
|
||||
}
|
||||
|
||||
std::string RefreshView::getName() const
|
||||
{
|
||||
return "RefreshView";
|
||||
}
|
||||
|
||||
RefreshController* RefreshView::getController()
|
||||
{
|
||||
return View::getController<RefreshController>();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef REFRESH_VIEW_H
|
||||
#define REFRESH_VIEW_H
|
||||
|
||||
#include "component/view/View.h"
|
||||
|
||||
class RefreshController;
|
||||
|
||||
class RefreshView
|
||||
: public View
|
||||
{
|
||||
public:
|
||||
RefreshView(ViewLayout* viewLayout);
|
||||
virtual ~RefreshView();
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
private:
|
||||
RefreshController* getController();
|
||||
};
|
||||
|
||||
#endif // REFRESH_VIEW_H
|
||||
@@ -6,6 +6,7 @@
|
||||
class CodeView;
|
||||
class GraphView;
|
||||
class MainView;
|
||||
class RefreshView;
|
||||
class SearchView;
|
||||
class StatusBarView;
|
||||
class UndoRedoView;
|
||||
@@ -20,6 +21,7 @@ public:
|
||||
virtual std::shared_ptr<MainView> createMainView() const = 0;
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<RefreshView> createRefreshView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<UndoRedoView> createUndoRedoView(ViewLayout* viewLayout) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user