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:
@@ -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());
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -74,13 +74,13 @@ void QtIndexingDialog::setupProgress()
|
||||
|
||||
QBoxLayout* layout = createLayout();
|
||||
|
||||
addTopAndProgressBar(0.62);
|
||||
addTopAndProgressBar(0.5);
|
||||
addTitle("Clearing", layout);
|
||||
addMessageLabel(layout);
|
||||
|
||||
layout->addStretch();
|
||||
|
||||
m_sizeHint = QSize(350, 350);
|
||||
m_sizeHint = QSize(350, 280);
|
||||
|
||||
m_progressBar->showUnknownProgressAnimated();
|
||||
|
||||
@@ -268,12 +268,12 @@ void QtIndexingDialog::addTopAndProgressBar(float topRatio)
|
||||
|
||||
m_top = new QWidget(m_window);
|
||||
m_top->setObjectName("topHalf");
|
||||
m_top->setGeometry(0, 0, m_window->size().width(), m_window->size().height() * topRatio);
|
||||
m_top->setGeometry(0, 0, 0, 0);
|
||||
m_top->show();
|
||||
m_top->lower();
|
||||
|
||||
m_progressBar = new QtProgressBar(m_window);
|
||||
m_progressBar->setGeometry(0, m_window->size().height() * topRatio - 5, m_window->size().width(), 10);
|
||||
m_progressBar->setGeometry(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void QtIndexingDialog::addTitle(QString title, QBoxLayout* layout)
|
||||
@@ -393,7 +393,7 @@ void QtIndexingDialog::setGeometries()
|
||||
|
||||
void QtIndexingDialog::finishSetup()
|
||||
{
|
||||
setGeometries();
|
||||
|
||||
setupDone();
|
||||
|
||||
setGeometries();
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "utility/messaging/type/MessageResetZoom.h"
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/messaging/type/MessageUndo.h"
|
||||
#include "utility/messaging/type/MessageWindowClosed.h"
|
||||
#include "utility/messaging/type/MessageWindowFocus.h"
|
||||
#include "utility/messaging/type/MessageZoom.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
@@ -314,6 +315,11 @@ void QtMainWindow::contextMenuEvent(QContextMenuEvent* event)
|
||||
QtContextMenu::getInstance()->showDefault(event, this);
|
||||
}
|
||||
|
||||
void QtMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
MessageWindowClosed().dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::about()
|
||||
{
|
||||
QtAbout* aboutWindow = createWindow<QtAbout>();
|
||||
|
||||
@@ -91,6 +91,7 @@ protected:
|
||||
bool event(QEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void contextMenuEvent(QContextMenuEvent* event);
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
public slots:
|
||||
void about();
|
||||
|
||||
@@ -138,7 +138,6 @@ void QtProjectWizzardContentData::addNameAndLocation(QGridLayout* layout, int& r
|
||||
|
||||
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL);
|
||||
layout->setRowMinimumHeight(row, 50);
|
||||
row++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user