ui & logic: fixes for release

* smaller indexing progress dialog with bar in the middle instead of golden ratio
* set default code snippet expand range to 3
* no minimum height for project file location element in project setup wizard
* move aggregation and inheritance edges to front when hovered or active
* push parent nodes of active nodes to back to make edges to the active child visible
* properly quit application when window is closed while confirm box is open
* properly quit application when window is closed while indexing
* only count top level nodes for count on bundle nodes
* give noLetterScore to index 0 in search index scoring

bug id = 121
This commit is contained in:
Eberhard Graether
2016-10-11 15:38:44 +02:00
parent 86f652d221
commit f6ae1afdb2
16 changed files with 93 additions and 44 deletions
+15 -8
View File
@@ -14,11 +14,13 @@
QtDialogView::QtDialogView(QtMainWindow* mainWindow)
: m_mainWindow(mainWindow)
, m_windowStack(this)
, m_resultReady(false)
{
}
QtDialogView::~QtDialogView()
{
m_resultReady = true;
}
void QtDialogView::showProgressDialog(const std::string& title, const std::string& message)
@@ -66,17 +68,17 @@ void QtDialogView::hideProgressDialog()
bool QtDialogView::startIndexingDialog(size_t cleanFileCount, size_t indexFileCount)
{
bool result = false;
bool done = false;
m_resultReady = false;
m_onQtThread(
[=, &result, &done]()
[=, &result]()
{
QtIndexingDialog* window = createWindow<QtIndexingDialog>();
window->setupStart(cleanFileCount, indexFileCount,
[&](bool start)
{
result = start;
done = true;
m_resultReady = true;
setUIBlocked(false);
}
@@ -86,7 +88,7 @@ bool QtDialogView::startIndexingDialog(size_t cleanFileCount, size_t indexFileCo
}
);
while (!done)
while (!m_resultReady)
{
const int SLEEP_TIME_MS = 25;
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME_MS));
@@ -155,10 +157,10 @@ void QtDialogView::finishedIndexingDialog(size_t fileCount, size_t totalFileCoun
int QtDialogView::confirm(const std::string& message, const std::vector<std::string>& options)
{
int result = -1;
bool done = false;
m_resultReady = false;
m_onQtThread(
[=, &result, &done]()
[=, &result]()
{
QMessageBox msgBox;
msgBox.setText(message.c_str());
@@ -179,11 +181,11 @@ int QtDialogView::confirm(const std::string& message, const std::vector<std::str
}
}
done = true;
m_resultReady = true;
}
);
while (!done)
while (!m_resultReady)
{
const int SLEEP_TIME_MS = 25;
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME_MS));
@@ -218,6 +220,11 @@ void QtDialogView::handleMessage(MessageShowErrors* message)
);
}
void QtDialogView::handleMessage(MessageWindowClosed* message)
{
m_resultReady = true;
}
void QtDialogView::updateErrorCount(size_t errorCount, size_t fatalCount)
{
QtIndexingDialog* window = dynamic_cast<QtIndexingDialog*>(m_windowStack.getTopWindow());
+5
View File
@@ -9,6 +9,7 @@
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageInterruptTasks.h"
#include "utility/messaging/type/MessageShowErrors.h"
#include "utility/messaging/type/MessageWindowClosed.h"
class QtMainWindow;
@@ -17,6 +18,7 @@ class QtDialogView
, public DialogView
, public MessageListener<MessageInterruptTasks>
, public MessageListener<MessageShowErrors>
, public MessageListener<MessageWindowClosed>
{
Q_OBJECT
@@ -36,6 +38,7 @@ public:
private:
void handleMessage(MessageInterruptTasks* message) override;
void handleMessage(MessageShowErrors* message) override;
void handleMessage(MessageWindowClosed* message) override;
void updateErrorCount(size_t errorCount, size_t fatalCount);
@@ -50,6 +53,8 @@ private:
QtThreadedLambdaFunctor m_onQtThread;
QtThreadedLambdaFunctor m_onQtThread2;
bool m_resultReady;
};
#endif // QT_DIALOG_VIEW_H
@@ -258,6 +258,25 @@ Id QtGraphNode::getTokenId() const
void QtGraphNode::addSubNode(const std::shared_ptr<QtGraphNode>& node)
{
m_subNodes.push_back(node);
// push parent nodes to back so all edges going to the active subnode are visible
if (node->getIsActive())
{
QtGraphNode* parent = this;
while (parent)
{
parent->setZValue(-10.0f);
parent->m_rect->setZValue(-10.0f);
parent->m_text->setZValue(-9.0f);
if (parent->m_undefinedRect)
{
parent->m_undefinedRect->setZValue(-10.0f);
}
parent = parent->getParent();
}
}
}
void QtGraphNode::moved(const Vec2i& oldPosition)