logic: Fixed error view related issues
* polished color schemes for error view * fixed error id column not hidden * fixed error count shown correctly in each view * moved storage stats logging to application * fixed indexed flag of errors broken for indexed headers in cdb project * fixed scrolling to active error when errors where not visible before * reverted tictactoe files to no errors
This commit is contained in:
@@ -39,6 +39,11 @@ ViewFactory* ComponentFactory::getViewFactory() const
|
||||
return m_viewFactory;
|
||||
}
|
||||
|
||||
StorageAccess* ComponentFactory::getStorageAccess() const
|
||||
{
|
||||
return m_storageAccess;
|
||||
}
|
||||
|
||||
std::shared_ptr<Component> ComponentFactory::createCodeComponent(ViewLayout* viewLayout)
|
||||
{
|
||||
std::shared_ptr<CodeView> view = m_viewFactory->createCodeView(viewLayout);
|
||||
|
||||
@@ -17,6 +17,7 @@ public:
|
||||
~ComponentFactory();
|
||||
|
||||
ViewFactory* getViewFactory() const;
|
||||
StorageAccess* getStorageAccess() const;
|
||||
|
||||
std::shared_ptr<Component> createCodeComponent(ViewLayout* viewLayout);
|
||||
std::shared_ptr<Component> createErrorComponent(ViewLayout* viewLayout);
|
||||
|
||||
@@ -54,7 +54,7 @@ void ComponentManager::setup(ViewLayout* viewLayout)
|
||||
std::shared_ptr<Component> featureComponent = m_componentFactory->createFeatureComponent();
|
||||
m_components.push_back(featureComponent);
|
||||
|
||||
m_dialogView = m_componentFactory->getViewFactory()->createDialogView(viewLayout);
|
||||
m_dialogView = m_componentFactory->getViewFactory()->createDialogView(viewLayout, m_componentFactory->getStorageAccess());
|
||||
|
||||
std::shared_ptr<TabbedView> tabbedView =
|
||||
m_componentFactory->getViewFactory()->createTabbedView(viewLayout, "Log");
|
||||
|
||||
@@ -90,7 +90,7 @@ void CodeController::handleMessage(MessageActivateAll* message)
|
||||
CodeView* view = getView();
|
||||
view->clear();
|
||||
view->setErrorInfos(errors);
|
||||
view->showCodeSnippets(snippets, std::vector<Id>());
|
||||
view->showCodeSnippets(snippets, std::vector<Id>(), true);
|
||||
|
||||
showContents(message);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ void CodeController::handleMessage(MessageActivateTokens* message)
|
||||
else
|
||||
{
|
||||
m_collection = m_storageAccess->getTokenLocationsForTokenIds(activeTokenIds);
|
||||
view->showCodeSnippets(getSnippetsForActiveTokenLocations(m_collection.get(), declarationId), activeTokenIds);
|
||||
view->showCodeSnippets(getSnippetsForActiveTokenLocations(m_collection.get(), declarationId), activeTokenIds, true);
|
||||
|
||||
size_t fileCount = m_collection->getTokenLocationFileCount();
|
||||
size_t referenceCount = m_collection->getTokenLocationCount();
|
||||
@@ -281,7 +281,7 @@ void CodeController::handleMessage(MessageShowErrors* message)
|
||||
|
||||
view->clear();
|
||||
view->setErrorInfos(errors);
|
||||
view->showCodeSnippets(snippets, std::vector<Id>());
|
||||
view->showCodeSnippets(snippets, std::vector<Id>(), !message->errorId);
|
||||
|
||||
showContents(message);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ void CodeController::handleMessage(MessageSearchFullText* message)
|
||||
view->clear();
|
||||
|
||||
m_collection = m_storageAccess->getFullTextSearchLocations(message->searchTerm, message->caseSensitive);
|
||||
view->showCodeSnippets(getSnippetsForCollection(m_collection, true), std::vector<Id>());
|
||||
view->showCodeSnippets(getSnippetsForCollection(m_collection, true), std::vector<Id>(), true);
|
||||
|
||||
showContents(message);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ void FeatureController::handleMessage(MessageSearch* message)
|
||||
|
||||
case SearchMatch::COMMAND_ERROR:
|
||||
{
|
||||
MessageShowErrors msg(m_storageAccess->getFilteredErrorCount());
|
||||
MessageShowErrors msg(m_storageAccess->getErrorCount());
|
||||
msg.setIsReplayed(message->isReplayed());
|
||||
msg.dispatchImmediately();
|
||||
return;
|
||||
|
||||
@@ -31,13 +31,13 @@ void StatusBarController::handleMessage(MessageClearErrorCount* message)
|
||||
|
||||
void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||
{
|
||||
ErrorCountInfo errorCount = m_storageAccess->getFilteredErrorCount();
|
||||
ErrorCountInfo errorCount = m_storageAccess->getErrorCount();
|
||||
getView()->setErrorCount(errorCount);
|
||||
}
|
||||
|
||||
void StatusBarController::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
getView()->setErrorCount(m_storageAccess->getFilteredErrorCount());
|
||||
getView()->setErrorCount(m_storageAccess->getErrorCount());
|
||||
}
|
||||
|
||||
void StatusBarController::handleMessage(MessageShowErrors* message)
|
||||
|
||||
@@ -33,7 +33,8 @@ public:
|
||||
virtual void setErrorInfos(const std::vector<ErrorInfo>& errorInfos) = 0;
|
||||
virtual bool showsErrors() const = 0;
|
||||
|
||||
virtual void showCodeSnippets(const std::vector<CodeSnippetParams>& snippets, const std::vector<Id>& activeTokenIds) = 0;
|
||||
virtual void showCodeSnippets(
|
||||
const std::vector<CodeSnippetParams>& snippets, const std::vector<Id>& activeTokenIds, bool setupFiles) = 0;
|
||||
virtual void addCodeSnippets(const std::vector<CodeSnippetParams>& snippets, bool insert) = 0;
|
||||
|
||||
virtual void setFileState(const FilePath filePath, FileState state) = 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "component/view/DialogView.h"
|
||||
|
||||
DialogView::DialogView()
|
||||
DialogView::DialogView(StorageAccess* storageAccess)
|
||||
: m_storageAccess(storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
#include "data/ErrorCountInfo.h"
|
||||
|
||||
class StorageAccess;
|
||||
|
||||
class DialogView
|
||||
{
|
||||
public:
|
||||
DialogView();
|
||||
DialogView(StorageAccess* storageAccess);
|
||||
virtual ~DialogView();
|
||||
|
||||
virtual void showProgressDialog(const std::string& title, const std::string& message);
|
||||
@@ -21,6 +23,9 @@ public:
|
||||
|
||||
int confirm(const std::string& message);
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options);
|
||||
|
||||
protected:
|
||||
StorageAccess* m_storageAccess;
|
||||
};
|
||||
|
||||
#endif // DIALOG_VIEW_H
|
||||
|
||||
@@ -14,6 +14,7 @@ class LogView;
|
||||
class RefreshView;
|
||||
class SearchView;
|
||||
class StatusBarView;
|
||||
class StorageAccess;
|
||||
class TabbedView;
|
||||
class UndoRedoView;
|
||||
class ViewLayout;
|
||||
@@ -38,7 +39,7 @@ public:
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<UndoRedoView> createUndoRedoView(ViewLayout* viewLayout) const = 0;
|
||||
|
||||
virtual std::shared_ptr<DialogView> createDialogView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<DialogView> createDialogView(ViewLayout* viewLayout, StorageAccess* storageAccess) const = 0;
|
||||
};
|
||||
|
||||
#endif // VIEW_FACTORY_H
|
||||
|
||||
Reference in New Issue
Block a user