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:
Eberhard Graether
2015-02-03 14:27:39 +01:00
parent e17341fc43
commit 1690479b0e
52 changed files with 1145 additions and 92 deletions
@@ -0,0 +1,35 @@
#include "component/controller/RefreshController.h"
#include "component/view/RefreshView.h"
RefreshController::RefreshController()
: m_autoRefreshEnabled(false)
{
}
RefreshController::~RefreshController()
{
}
void RefreshController::handleMessage(MessageAutoRefreshChanged* message)
{
m_autoRefreshEnabled = message->enabled;
}
void RefreshController::handleMessage(MessageRefresh* message)
{
getView()->refreshView();
}
void RefreshController::handleMessage(MessageWindowFocus* message)
{
if (m_autoRefreshEnabled)
{
MessageRefresh().dispatch();
}
}
RefreshView* RefreshController::getView()
{
return Controller::getView<RefreshView>();
}