logic: More fixes for release

* Fixed crash on undoing aggregation edge
* Avoid mutex locking in logging classes when logging is disabled
* Readded dark color scheme
* Fixed font size of type label in autocompletion list
* Fixed text drawing in autocompletion list
* Only give camelcase score when no noletter score was given
* Added MessageShowErrors to undo stack
* Select error line in table when undoing MessageShowErrors
* Notify user about new Plugin in description of From Visual Studio project setup
* Fixed row height of Project File Location label in project setup
This commit is contained in:
Eberhard Graether
2016-10-14 00:45:37 +02:00
parent 2dc9995cc1
commit 30d222b7db
19 changed files with 626 additions and 137 deletions
+413
View File
@@ -0,0 +1,413 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<search>
<background>#272728</background>
<button>
<normal>#777777</normal>
<hover>#555555</hover>
<press>#444444</press>
<disabled>#333333</disabled>
<icon>white</icon>
</button>
<field>
<text>#F7F7F7</text>
<background>#777777</background>
<highlight>#555555</highlight>
</field>
<popup>
<text>#F7F7F7</text>
<by_text>#A0A0A0</by_text>
<background>#272728</background>
<highlight>#555555</highlight>
</popup>
<query>
<none>
<normal></normal>
<hover></hover>
</none>
<command>
<normal></normal>
<hover></hover>
</command>
<operator>
<normal></normal>
<hover></hover>
</operator>
<fulltext>
<normal></normal>
<hover></hover>
</fulltext>
</query>
<query>
<none>
<normal>
<fill>#2F2F2F</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>black</fill>
<text>#F7F7F7</text>
</hover>
</none>
<command>
<normal>
<fill>#406D4D</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#4E855E</fill>
<text>#F7F7F7</text>
</hover>
</command>
<operator>
<normal>
<fill>#7D2724</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#8C2B29</fill>
<text>#F7F7F7</text>
</hover>
</operator>
<fulltext>
<normal>
<fill>#207EA8</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#006D93</fill>
<text>#F7F7F7</text>
</hover>
</fulltext>
</query>
</search>
<code>
<background>#272728</background>
<file>
<background>#777777</background>
<title>
<text>#F7F7F7</text>
<normal>#777777</normal>
<hover>#555555</hover>
<press>#444444</press>
<icon>white</icon>
</title>
<ref_count>
<text>#F7F7F7</text>
<background>#272728</background>
</ref_count>
</file>
<snippet>
<background>#272728</background>
<title>
<text>#A0A0A0</text>
<background>transparent</background>
<hover>#2F2F2F</hover>
</title>
<line_number>
<text>#F7F7F7</text>
<inactive_text>#A0A0A0</inactive_text>
<background>#272728</background>
<marker>#969696</marker>
</line_number>
<syntax>
<normal>#F7F7F7</normal>
<directive>#1F9C62</directive>
<keyword>#1F9C62</keyword>
<type>#D95233</type>
<comment>#A0A0A4</comment>
<number>#CC3463</number>
<quotation>#9368AD</quotation>
<function>#D69C36</function>
</syntax>
<selection>
<text>white</text>
<background>#777777</background>
</selection>
<annotation>
<token>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#F7F7F7</border>
<fill>transparent</fill>
</focus>
<active>
<border>transparent</border>
<fill>#F7F7F7</fill>
<text>#272728</text>
</active>
</token>
<local_symbol>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#A0A0A0</border>
<fill>#969696</fill>
<text>#191919</text>
</focus>
<active>
<border>transparent</border>
<fill>#969696</fill>
<text>#272728</text>
</active>
</local_symbol>
<scope>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
</scope>
<error>
<normal>
<border>transparent</border>
<fill>#A0FF0000</fill>
<text>#000000</text>
</normal>
<focus>
<fill>#FFFF0000</fill>
</focus>
</error>
<fulltext>
<normal>
<fill>#207EA8</fill>
<text>#F7F7F7</text>
</normal>
<focus>
<border>#006D93</border>
<fill>#134B63</fill>
</focus>
</fulltext>
</annotation>
</snippet>
</code>
<graph>
<background>#272728</background>
<node>
<default>
<fill>
<normal>#4D4D4D</normal>
</fill>
<border>
<normal>#C3C3C3</normal>
</border>
<text>
<normal>#F7F7F7</normal>
</text>
<icon>
<normal>#F7F7F7</normal>
</icon>
<hatching>
<normal>#272728</normal>
</hatching>
</default>
<type>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
</type>
<builtin_type>
<like>type</like>
</builtin_type>
<class>
<like>type</like>
</class>
<interface>
<like>type</like>
</interface>
<struct>
<like>type</like>
</struct>
<enum>
<like>type</like>
</enum>
<typedef>
<like>type</like>
</typedef>
<template_parameter_type>
<like>type</like>
</template_parameter_type>
<type_parameter>
<like>type</like>
</type_parameter>
<function>
<fill>
<normal>#7A681F</normal>
<focus>#9C8528</focus>
</fill>
<border>
<normal>transparent</normal>
<focus>#C3C3C3</focus>
</border>
</function>
<method>
<like>function</like>
</method>
<global_variable>
<fill>
<normal>#21516B</normal>
<focus>#2A6484</focus>
</fill>
<border>
<normal>transparent</normal>
<focus>#C3C3C3</focus>
</border>
</global_variable>
<field>
<like>global_variable</like>
</field>
<enum_constant>
<like>global_variable</like>>
</enum_constant>
<undefined>
<like>type</like>
</undefined>
<namespace>
<fill>
<normal>#78282D</normal>
</fill>
<border>
<normal>#80C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
</namespace>
<package>
<like>namespace</like>
</package>
<file>
<fill>
<normal>#1B564E</normal>
<focus>#247368</focus>
</fill>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
</file>
<macro>
<like>file</like>
</macro>
<access>
<fill>
<normal>#272728</normal>
</fill>
</access>
<bundle>
<fill>
<normal>#272728</normal>
</fill>
<border>
<normal>#80C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
</bundle>
<count_number>
<fill>
<normal>#272728</normal>
</fill>
<border>
<normal>#C3C3C3</normal>
</border>
<text>
<normal>#F7F7F7</normal>
</text>
</count_number>
</node>
<edge>
<default>
<normal>#797979</normal>
</default>
<override>
<normal>#CC5E89</normal>
</override>
<call>
<normal>#9C8528</normal>
</call>
<use>
<normal>#2A6484</normal>
</use>
<template_argument>
<normal>#C1305D</normal>
</template_argument>
<type_argument>
<like>template_argument</like>
</type_argument>
<template_default_argument>
<like>template_argument</like>
</template_default_argument>
<template_specialization>
<like>template_argument</like>
</template_specialization>
<template_member_specialization>
<like>template_argument</like>
</template_member_specialization>
<include>
<normal>#247368</normal>
</include>
<macro_use>
<normal>#247368</normal>
</macro_use>
<aggregation>
<normal>#3D3D3D</normal>
<focus>#4D4D4D</focus>
</aggregation>
</edge>
</graph>
<error>
<background>#272728</background>
<table>white</table>
<text>
<normal>white</normal>
<active>black</active>
</text>
<table_line_1>
<normal>darkgrey</normal>
<active>#969696</active>
</table_line_1>
<table_line_2>
<normal>#343434</normal>
<active>#969696</active>
</table_line_2>
</error>
<tab>
<background>#272728</background>
<active>white</active>
<hover>#878787</hover>
<text>#878787</text>
</tab>
</config>
+57 -57
View File
@@ -1,57 +1,57 @@
Token.cpp ERROR: Location Id was not referenced by this Token.
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
Edge.cpp ERROR: Nodes are not plain copies.
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token
NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
TextAccess.cpp ERROR: Could not open file path/to/test.h
TextAccess.cpp WARNING: Index 'firstLine' has to be lower or equal index 'lastLine', is 3 > 2
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
TextAccess.cpp WARNING: Line numbers start with one, is 0
TextAccess.cpp WARNING: Line numbers start with one, is 0
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 2:3 2:1
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 4:1 1:10
Token.cpp ERROR: Location Id was not referenced by this Token.
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
Edge.cpp ERROR: Nodes are not plain copies.
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage2
INFO: handle TestMessage2
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: send TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
INFO: handle TestMessage
NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token
NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
TextAccess.cpp ERROR: Could not open file path/to/test.h
TextAccess.cpp WARNING: Index 'firstLine' has to be lower or equal index 'lastLine', is 3 > 2
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
TextAccess.cpp WARNING: Line numbers start with one, is 0
TextAccess.cpp WARNING: Line numbers start with one, is 0
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 2:3 2:1
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 4:1 1:10
+23
View File
@@ -13,6 +13,10 @@
#include "settings/ApplicationSettings.h"
#include "utility/AppPath.h"
#include "utility/commandline/CommandLineParser.h"
#include "utility/logging/ConsoleLogger.h"
#include "utility/logging/FileLogger.h"
#include "utility/logging/logging.h"
#include "utility/logging/LogManager.h"
#include "utility/ResourcePaths.h"
#include "utility/ScopedFunctor.h"
#include "utility/UserPaths.h"
@@ -20,6 +24,21 @@
#include "utility/Version.h"
#include "version.h"
void setupLogging()
{
LogManager::createInstance();
LogManager* logManager = LogManager::getInstance().get();
std::shared_ptr<ConsoleLogger> consoleLogger = std::make_shared<ConsoleLogger>();
consoleLogger->setLogLevel(Logger::LOG_WARNINGS | Logger::LOG_ERRORS);
logManager->addLogger(consoleLogger);
std::shared_ptr<FileLogger> fileLogger = std::make_shared<FileLogger>();
fileLogger->setLogDirectory(UserPaths::getLogPath());
fileLogger->setLogLevel(Logger::LOG_ALL);
logManager->addLogger(fileLogger);
}
void prefillJavaRuntimePath()
{
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
@@ -92,6 +111,8 @@ int main(int argc, char *argv[])
setupApp(argc, argv);
setupLogging();
Application::createInstance(version, nullptr, nullptr);
ScopedFunctor f([](){
Application::destroyInstance();
@@ -130,6 +151,8 @@ int main(int argc, char *argv[])
setupApp(argc, argv);
setupLogging();
qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
QtViewFactory viewFactory;
+1 -17
View File
@@ -1,7 +1,5 @@
#include "Application.h"
#include "utility/logging/ConsoleLogger.h"
#include "utility/logging/FileLogger.h"
#include "utility/logging/logging.h"
#include "utility/logging/LogManager.h"
#include "utility/messaging/MessageQueue.h"
@@ -76,21 +74,7 @@ void Application::loadSettings()
settings->load(FilePath(UserPaths::getAppSettingsPath()));
LogManager* logManager = LogManager::getInstance().get();
if (!settings->getLoggingEnabled())
{
logManager->clearLoggers();
}
else if (!logManager->getLoggerCount())
{
std::shared_ptr<ConsoleLogger> consoleLogger = std::make_shared<ConsoleLogger>();
consoleLogger->setLogLevel(Logger::LOG_WARNINGS | Logger::LOG_ERRORS);
logManager->addLogger(consoleLogger);
std::shared_ptr<FileLogger> fileLogger = std::make_shared<FileLogger>();
fileLogger->setLogDirectory(UserPaths::getLogPath());
fileLogger->setLogLevel(Logger::LOG_ALL);
logManager->addLogger(fileLogger);
}
logManager->setLoggingEnabled(settings->getLoggingEnabled());
loadStyle(settings->getColorSchemePath());
}
@@ -42,6 +42,10 @@ void ErrorController::handleMessage(MessageShowErrors* message)
{
if (message->errorId)
{
if (message->isReplayed())
{
getView()->setErrorId(message->errorId);
}
return;
}
@@ -7,6 +7,7 @@
#include "utility/messaging/type/MessageActivateTokens.h"
#include "utility/messaging/type/MessageChangeFileView.h"
#include "utility/messaging/type/MessageColorSchemeTest.h"
#include "utility/messaging/type/MessageFlushUpdates.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/messaging/type/MessageShowErrors.h"
#include "utility/messaging/type/MessageStatus.h"
@@ -138,8 +139,9 @@ void FeatureController::handleMessage(MessageSearch* message)
case SearchMatch::COMMAND_ERROR:
{
MessageShowErrors msg(m_storageAccess->getErrorCount());
msg.setIsReplayed(message->isReplayed());
msg.dispatchImmediately();
msg.setIsReplayed(true);
msg.dispatch();
MessageFlushUpdates().dispatch();
return;
}
@@ -235,6 +235,18 @@ void UndoRedoController::handleMessage(MessageSearchFullText* message)
processCommand(command);
}
void UndoRedoController::handleMessage(MessageShowErrors* message)
{
if (sameMessageTypeAsLast(message) &&
static_cast<MessageShowErrors*>(lastMessage())->errorId == message->errorId)
{
return;
}
Command command(std::make_shared<MessageShowErrors>(*message), Command::ORDER_ACTIVATE);
processCommand(command);
}
void UndoRedoController::handleMessage(MessageShowScope* message)
{
Command command(std::make_shared<MessageShowScope>(*message), Command::ORDER_VIEW);
@@ -347,6 +359,11 @@ void UndoRedoController::replayCommands(std::list<Command>::iterator it)
void UndoRedoController::processCommand(Command command)
{
if (command.message->isReplayed())
{
return;
}
if (command.order != Command::ORDER_ACTIVATE && m_iterator == m_list.begin())
{
return;
@@ -357,40 +374,37 @@ void UndoRedoController::processCommand(Command command)
command.order = Command::ORDER_ADAPT;
}
if (!command.message->isReplayed())
if (command.order == Command::ORDER_ACTIVATE)
{
if (command.order == Command::ORDER_ACTIVATE)
m_iterator = m_list.erase(m_iterator, m_list.end());
}
else if (command.order == Command::ORDER_ADAPT)
{
std::list<Command>::iterator end = m_iterator;
while (end != m_list.end())
{
m_iterator = m_list.erase(m_iterator, m_list.end());
}
else if (command.order == Command::ORDER_ADAPT)
{
std::list<Command>::iterator end = m_iterator;
while (end != m_list.end())
if (end->order == Command::ORDER_ACTIVATE)
{
if (end->order == Command::ORDER_ACTIVATE)
{
break;
}
std::advance(end, 1);
break;
}
m_iterator = m_list.erase(m_iterator, end);
std::advance(end, 1);
}
m_list.insert(m_iterator, command);
m_iterator = m_list.erase(m_iterator, end);
}
if (command.order != Command::ORDER_VIEW)
m_list.insert(m_iterator, command);
if (command.order != Command::ORDER_VIEW)
{
if (m_list.begin() != std::prev(m_iterator))
{
if (m_list.begin() != std::prev(m_iterator))
{
getView()->setUndoButtonEnabled(true);
}
getView()->setUndoButtonEnabled(true);
}
if (m_list.end() == m_iterator)
{
getView()->setRedoButtonEnabled(false);
}
if (m_list.end() == m_iterator)
{
getView()->setRedoButtonEnabled(false);
}
}
}
@@ -20,6 +20,7 @@
#include "utility/messaging/type/MessageScrollCode.h"
#include "utility/messaging/type/MessageSearch.h"
#include "utility/messaging/type/MessageSearchFullText.h"
#include "utility/messaging/type/MessageShowErrors.h"
#include "utility/messaging/type/MessageShowScope.h"
#include "utility/messaging/type/MessageUndo.h"
@@ -45,6 +46,7 @@ class UndoRedoController
, public MessageListener<MessageScrollCode>
, public MessageListener<MessageSearch>
, public MessageListener<MessageSearchFullText>
, public MessageListener<MessageShowErrors>
, public MessageListener<MessageShowScope>
, public MessageListener<MessageUndo>
{
@@ -88,6 +90,7 @@ private:
virtual void handleMessage(MessageScrollCode* message);
virtual void handleMessage(MessageSearch* message);
virtual void handleMessage(MessageSearchFullText* message);
virtual void handleMessage(MessageShowErrors* message);
virtual void handleMessage(MessageShowScope* message);
virtual void handleMessage(MessageUndo* message);
+1
View File
@@ -18,6 +18,7 @@ public:
virtual void clear() = 0;
virtual void addError(const StorageError& error) = 0;
virtual void setErrorId(Id errorId) = 0;
};
#endif // ERROR_VIEW_H
+7 -8
View File
@@ -389,8 +389,14 @@ int SearchIndex::score(const std::string& text, const std::vector<size_t>& indic
size_t index = indices[i];
// after no letter
bool prevIsNoLetter = (index == 0 || noLetters.find(text[index - 1]) != noLetters.end());
if (prevIsNoLetter)
{
noLetterScore += noLetterBonus;
}
// camel case
if (isupper(text[index]))
else if (isupper(text[index]))
{
bool prevIsLower = (index > 0 && islower(text[index - 1]));
bool nextIsLower = (index + 1 == text.size() || islower(text[index + 1]));
@@ -400,13 +406,6 @@ int SearchIndex::score(const std::string& text, const std::vector<size_t>& indic
camelCaseScore += camelCaseBonus;
}
}
// after no letter
bool prevIsNoLetter = (index == 0 || noLetters.find(text[index - 1]) != noLetters.end());
if (prevIsNoLetter)
{
noLetterScore += noLetterBonus;
}
}
int leadingStartScore = std::max(int(indices[0]) * delayedStartBonus, minDelayedStartBonus);
+24 -7
View File
@@ -4,9 +4,8 @@
#include "utility/logging/LogMessage.h"
std::shared_ptr<LogManager> LogManager::getInstance()
std::shared_ptr<LogManager> LogManager::createInstance()
{
std::lock_guard<std::mutex> lockGuard(s_instanceMutex);
if (s_instance.use_count() == 0)
{
s_instance = std::shared_ptr<LogManager>(new LogManager());
@@ -14,9 +13,13 @@ std::shared_ptr<LogManager> LogManager::getInstance()
return s_instance;
}
std::shared_ptr<LogManager> LogManager::getInstance()
{
return s_instance;
}
void LogManager::destroyInstance()
{
std::lock_guard<std::mutex> lockGuard(s_instanceMutex);
s_instance.reset();
}
@@ -24,6 +27,11 @@ LogManager::~LogManager()
{
}
void LogManager::setLoggingEnabled(bool enabled)
{
m_loggingEnabled = enabled;
}
void LogManager::addLogger(std::shared_ptr<Logger> logger)
{
m_logManagerImplementation.addLogger(logger);
@@ -56,7 +64,10 @@ void LogManager::logInfo(
const unsigned int line
)
{
m_logManagerImplementation.logInfo(message, file, function, line);
if (m_loggingEnabled)
{
m_logManagerImplementation.logInfo(message, file, function, line);
}
}
void LogManager::logWarning(
@@ -66,7 +77,10 @@ void LogManager::logWarning(
const unsigned int line
)
{
m_logManagerImplementation.logWarning(message, file, function, line);
if (m_loggingEnabled)
{
m_logManagerImplementation.logWarning(message, file, function, line);
}
}
void LogManager::logError(
@@ -76,12 +90,15 @@ void LogManager::logError(
const unsigned int line
)
{
m_logManagerImplementation.logError(message, file, function, line);
if (m_loggingEnabled)
{
m_logManagerImplementation.logError(message, file, function, line);
}
}
std::shared_ptr<LogManager> LogManager::s_instance;
std::mutex LogManager::s_instanceMutex;
LogManager::LogManager()
: m_loggingEnabled(false)
{
}
+4 -2
View File
@@ -2,7 +2,6 @@
#define LOG_MANAGER_H
#include <memory>
#include <mutex>
#include "utility/logging/Logger.h"
#include "utility/logging/LogManagerImplementation.h"
@@ -10,11 +9,14 @@
class LogManager
{
public:
static std::shared_ptr<LogManager> createInstance();
static std::shared_ptr<LogManager> getInstance();
static void destroyInstance();
~LogManager();
void setLoggingEnabled(bool enabled);
void addLogger(std::shared_ptr<Logger> logger);
void removeLogger(std::shared_ptr<Logger> logger);
void removeLoggersByType(const std::string& type);
@@ -42,13 +44,13 @@ public:
private:
static std::shared_ptr<LogManager> s_instance;
static std::mutex s_instanceMutex;
LogManager();
LogManager(const LogManager&);
void operator=(const LogManager&);
LogManagerImplementation m_logManagerImplementation;
bool m_loggingEnabled;
};
#endif // LOG_MANAGER_H
@@ -17,7 +17,10 @@ public:
, fromNameHierarchy(fromName)
, toNameHierarchy(toName)
{
setKeepContent(true);
if (!isAggregation())
{
setKeepContent(true);
}
}
static const std::string getStaticType()
@@ -270,7 +270,10 @@ std::string SolutionParserVisualStudio::getButtonText() const
std::string SolutionParserVisualStudio::getDescription() const
{
return "Create a new project from an existing Visual Studio Solution file. <b>Unstable!</b>";
return "Create a new project from an existing Visual Studio Solution file. "
"<b>Unstable: Please install our new <a href=\"https://coati.io/documentation/index.html#VisualStudio\">Visual "
"Studio plugin</a> and use the \"Create CDB\" menu option, then continue with project setup from "
"Compilation Database.</b>";
}
std::string SolutionParserVisualStudio::getIconPath() const
@@ -125,7 +125,6 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
"----------------------------------------------------------------------------------------------------"
"----------------------------------------------------------------------------------------------------"
) / 500.0f;
painter->drawText(option.rect.adjusted(charWidth + 2, -1, 0, 0), Qt::AlignLeft, name);
QString highlightName(name.size(), ' ');
@@ -136,11 +135,12 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
{
int idx = indices[i].toInt();
QRect rect = option.rect.adjusted(charWidth * (idx + 1) + 1, 2, 0, -1);
rect.setWidth(charWidth + 2);
QRect rect = option.rect.adjusted(charWidth * (idx + 1) + 2, 2, 0, -1);
rect.setWidth(charWidth + 1);
painter->fillRect(rect, color);
highlightName[idx] = name.at(idx);
name[idx] = ' ';
}
}
else
@@ -150,6 +150,8 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
painter->fillRect(rect, color);
}
painter->drawText(option.rect.adjusted(charWidth + 2, -1, 0, 0), Qt::AlignLeft, name);
painter->save();
QPen highlightPen = painter->pen();
highlightPen.setColor(textColor);
@@ -160,12 +162,8 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
if (type.size())
{
QFont font = painter->font();
if (font.pointSize() > 0)
{
QFont typeFont = font;
typeFont.setPointSize(ApplicationSettings::getInstance()->getFontSize() - 4);
painter->setFont(typeFont);
}
font.setPixelSize(ApplicationSettings::getInstance()->getFontSize() - 4);
painter->setFont(font);
QPen typePen = painter->pen();
typePen.setColor(scheme->getColor("search/popup/by_text").c_str());
+18 -2
View File
@@ -24,6 +24,8 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
, m_clearFunctor(std::bind(&QtErrorView::doClear, this))
, m_refreshFunctor(std::bind(&QtErrorView::doRefreshView, this))
, m_addErrorFunctor(std::bind(&QtErrorView::doAddError, this, std::placeholders::_1))
, m_setErrorIdFunctor(std::bind(&QtErrorView::doSetErrorId, this, std::placeholders::_1))
, m_ignoreNextSelection(false)
{
}
@@ -76,7 +78,7 @@ void QtErrorView::initView()
connect(m_table->selectionModel(), &QItemSelectionModel::currentRowChanged,
[=](const QModelIndex& index, const QModelIndex& previousIndex)
{
if (index.isValid())
if (index.isValid() && !m_ignoreNextSelection)
{
if (m_model->item(index.row(), COLUMN::FILE) == nullptr)
{
@@ -85,6 +87,8 @@ void QtErrorView::initView()
MessageShowErrors(m_model->item(index.row(), COLUMN::ID)->text().toUInt()).dispatch();
}
m_ignoreNextSelection = false;
});
layout->addWidget(m_table);
@@ -120,8 +124,9 @@ void QtErrorView::addError(const StorageError& error)
m_addErrorFunctor(error);
}
void QtErrorView::clickedInEmptySpace()
void QtErrorView::setErrorId(Id errorId)
{
m_setErrorIdFunctor(errorId);
}
void QtErrorView::doRefreshView()
@@ -151,6 +156,17 @@ void QtErrorView::doAddError(const StorageError& error)
addErrorToTable(error);
}
void QtErrorView::doSetErrorId(Id errorId)
{
QList<QStandardItem*> items = m_model->findItems(QString::number(errorId), Qt::MatchExactly, COLUMN::ID);
if (items.size() == 1)
{
m_ignoreNextSelection = true;
m_table->selectRow(items.at(0)->row());
}
}
void QtErrorView::setStyleSheet() const
{
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
+5 -3
View File
@@ -30,9 +30,7 @@ public:
// ErrorView implementation
virtual void clear();
virtual void addError(const StorageError& error);
private slots:
void clickedInEmptySpace();
virtual void setErrorId(Id errorId);
private:
enum COLUMN {
@@ -47,6 +45,7 @@ private:
void doRefreshView();
void doClear();
void doAddError(const StorageError& error);
void doSetErrorId(Id errorId);
void setStyleSheet() const;
@@ -58,6 +57,7 @@ private:
QtThreadedFunctor<void> m_clearFunctor;
QtThreadedFunctor<void> m_refreshFunctor;
QtThreadedFunctor<const StorageError&> m_addErrorFunctor;
QtThreadedFunctor<Id> m_setErrorIdFunctor;
QCheckBox* m_showErrors;
QCheckBox* m_showFatals;
@@ -69,6 +69,8 @@ private:
std::vector<StorageError> m_errors;
QPalette* m_palette;
bool m_ignoreNextSelection;
};
#endif // QT_ERROR_VIEW_H
@@ -137,7 +137,8 @@ void QtProjectWizzardContentData::addNameAndLocation(QGridLayout* layout, int& r
m_projectFileLocation->setPickDirectory(true);
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
layout->setRowMinimumHeight(row, 30);
row++;
}
+6 -2
View File
@@ -18,8 +18,12 @@ TestSuiteFixture::~TestSuiteFixture()
bool TestSuiteFixture::setUpWorld()
{
LogManager::getInstance()->addLogger(std::make_shared<PlainFileLogger>("data/log/test_log.txt"));
LogManager::getInstance()->addLogger(std::make_shared<FileLogger>());
LogManager* logManager = LogManager::createInstance().get();
logManager->setLoggingEnabled(true);
logManager->addLogger(std::make_shared<PlainFileLogger>("data/log/test_log.txt"));
logManager->addLogger(std::make_shared<FileLogger>());
ApplicationSettings::getInstance()->load(FilePath("data/TestSettings.xml"));
return true;