logic: random fixes and improvements

* added new logos to setup ui
* changed wording in status messages and bundle nodes
* removed ununsed Vector.h
* save NameHierarchy to SearchMatch
* fixed NameHierarchyElement retrieval for name elements without parent
* fixed match weight to score last letters higher
This commit is contained in:
Eberhard Graether
2015-10-06 16:21:03 +02:00
parent 8d3112d5a9
commit 0fba3f5cf9
32 changed files with 107 additions and 98 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ QVariant QtAutocompletionModel::data(const QModelIndex &index, int role) const
switch (index.column())
{
case 0:
return QString::fromStdString(match.fullName);
return QString::fromStdString(match.getFullName());
case 1:
return QString::fromStdString(match.typeName);
case 2:
+10 -10
View File
@@ -395,7 +395,7 @@ void QtSmartSearchBox::onTextEdited(const QString& text)
}
}
if (match.fullName.size() && !m_allowMultipleElements)
if (match.nameHierarchy.size() && !m_allowMultipleElements)
{
clearMatches();
matchesChanged = true;
@@ -403,7 +403,7 @@ void QtSmartSearchBox::onTextEdited(const QString& text)
if (matchesChanged)
{
setEditText(QString::fromStdString(match.fullName));
setEditText(QString::fromStdString(match.getFullName()));
updateElements();
}
else
@@ -411,7 +411,7 @@ void QtSmartSearchBox::onTextEdited(const QString& text)
layoutElements();
}
if (match.fullName.size() || m_elements.size())
if (match.nameHierarchy.size() || m_elements.size())
{
requestAutoCompletions();
}
@@ -442,7 +442,7 @@ void QtSmartSearchBox::onAutocompletionActivated(const SearchMatch& match)
{
addMatchAndUpdate(match);
if (match.fullName.size())
if (match.nameHierarchy.size())
{
search();
}
@@ -512,7 +512,7 @@ void QtSmartSearchBox::moveCursorTo(int target)
void QtSmartSearchBox::addMatch(const SearchMatch& match)
{
if (!match.fullName.size())
if (!match.nameHierarchy.size())
{
return;
}
@@ -522,7 +522,7 @@ void QtSmartSearchBox::addMatch(const SearchMatch& match)
if (completer()->popup()->isVisible())
{
const SearchMatch* mPtr = dynamic_cast<QtAutocompletionList*>(completer())->getSearchMatchAt(0);
if (mPtr && utility::equalsCaseInsensitive(match.fullName, mPtr->fullName))
if (mPtr && utility::equalsCaseInsensitive(match.getFullName(), mPtr->getFullName()))
{
matchPtr = mPtr;
}
@@ -539,7 +539,7 @@ void QtSmartSearchBox::addMatch(const SearchMatch& match)
void QtSmartSearchBox::addMatchAndUpdate(const SearchMatch& match)
{
if (match.fullName.size())
if (match.nameHierarchy.size())
{
m_oldText.clear();
clearLineEdit();
@@ -586,7 +586,7 @@ void QtSmartSearchBox::editElement(QtSearchElement* element)
}
}
std::string name = m_matches[m_cursorIndex].fullName;
std::string name = m_matches[m_cursorIndex].getFullName();
m_matches.erase(m_matches.begin() + m_cursorIndex);
setEditText(QString::fromStdString(name));
@@ -605,7 +605,7 @@ void QtSmartSearchBox::updateElements()
for (const SearchMatch& match : m_matches)
{
std::string name = match.fullName;
std::string name = match.getFullName();
name = utility::replace(name, "&", "&&");
std::shared_ptr<QtSearchElement> element = std::make_shared<QtSearchElement>(QString::fromStdString(name), this);
@@ -739,7 +739,7 @@ std::string QtSmartSearchBox::getSelectedString() const
{
if (m_elements[i]->isChecked())
{
str += m_matches[i].fullName;
str += m_matches[i].getFullName();
}
}
return str;
@@ -45,7 +45,7 @@ Id QtGraphNodeData::getTokenId() const
void QtGraphNodeData::onClick()
{
MessageActivateNodes message;
message.addNode(m_data->getId(), m_data->getType(), m_data->getFullName());
message.addNode(m_data->getId(), m_data->getType(), m_data->getNameHierarchy());
message.dispatch();
}
+1 -2
View File
@@ -36,7 +36,6 @@ QtSettingsWindow::QtSettingsWindow(QWidget *parent, int displacement)
"border: 1px solid lightgray;"
"border-radius: 15px; "
"background: white; "
"background-image: url(:/data/gui/icon/logo_1024_1024.png); "
"}";
m_window->setStyleSheet(frameStyle.c_str());
m_window->setObjectName("SettingWindow");
@@ -106,7 +105,7 @@ void QtSettingsWindow::mouseReleaseEvent(QMouseEvent *event)
void QtSettingsWindow::setupForm()
{
QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo.png");
QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo_blurry.png");
coati_logo.scaleToWidth(400);
QLabel* coatiLogoLabel = new QLabel(m_window);
coatiLogoLabel->setPixmap(coati_logo.pixmap());
+2 -2
View File
@@ -34,7 +34,7 @@ void QtStartScreen::setup()
{
setStyleSheet(utility::getStyleSheet("data/gui/startscreen/startscreen.css").c_str());
QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo_schriftzug.png");
QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo.png");
coati_logo.scaleToWidth(200);
QLabel* coatiLogoLabel = new QLabel(this);
coatiLogoLabel->setPixmap(coati_logo.pixmap());
@@ -58,7 +58,7 @@ void QtStartScreen::setup()
recentProjectsLabel->setObjectName("recentLabel");
int position = 290;
QIcon cpp_icon("data/gui/startscreen/Icon_CPP.png");
QIcon cpp_icon("data/gui/startscreen/icon_cpp.png");
std::vector<FilePath> recentProjects = ApplicationSettings::getInstance()->getRecentProjects();
for (size_t i = 0; i < recentProjects.size() && i < 7; i++)
{