logic: Inspect errors during indexing (issue #235)
* Enabled errors table during indexing * Store intermediate errors in StorageCache * Open tab for errors if no tab yet * "Show errors" for file disabled during indexing * Hide indexing dialogs with ESC instead of stopping indexing
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <QLabel>
|
||||
#include <QVariant>
|
||||
|
||||
#include "Application.h"
|
||||
#include "Project.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "MessageErrorsForFile.h"
|
||||
|
||||
@@ -120,6 +122,12 @@ void QtCodeFileTitleBar::setIsComplete(bool isComplete)
|
||||
{
|
||||
m_titleButton->setIsComplete(isComplete);
|
||||
m_showErrorsButton->setVisible(!isComplete);
|
||||
|
||||
Project* project = Application::getInstance()->getCurrentProject().get();
|
||||
if (project && project->isIndexing())
|
||||
{
|
||||
m_showErrorsButton->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void QtCodeFileTitleBar::setIsIndexed(bool isIndexed)
|
||||
|
||||
@@ -160,8 +160,6 @@ void QtStatusBar::showIndexingProgress(size_t progressPercent)
|
||||
m_indexingStatus->show();
|
||||
m_vlineIndexing->show();
|
||||
|
||||
m_errorButton.setEnabled(false);
|
||||
|
||||
m_indexingProgress->setValue(progressPercent);
|
||||
}
|
||||
|
||||
@@ -169,8 +167,6 @@ void QtStatusBar::hideIndexingProgress()
|
||||
{
|
||||
m_indexingStatus->hide();
|
||||
m_vlineIndexing->hide();
|
||||
|
||||
m_errorButton.setEnabled(true);
|
||||
}
|
||||
|
||||
void QtStatusBar::resizeEvent(QResizeEvent* event)
|
||||
|
||||
@@ -539,6 +539,11 @@ QtIndexingDialog* QtDialogView::createWindow()
|
||||
|
||||
connect(window, &QtIndexingDialog::visibleChanged, this, &QtDialogView::dialogVisibilityChanged);
|
||||
|
||||
if (m_mainWindow)
|
||||
{
|
||||
connect(m_mainWindow, &QtMainWindow::hideIndexingDialog, window, &QtWindow::handleClosePress);
|
||||
}
|
||||
|
||||
m_windowStack.pushWindow(window);
|
||||
|
||||
if (!m_dialogsVisible)
|
||||
|
||||
@@ -401,6 +401,17 @@ void QtIndexingDialog::handleNext()
|
||||
}
|
||||
|
||||
void QtIndexingDialog::handleClose()
|
||||
{
|
||||
if (m_type == DIALOG_INDEXING || m_type == DIALOG_PROGRESS || m_type == DIALOG_UNKNOWN_PROGRESS)
|
||||
{
|
||||
emit visibleChanged(false);
|
||||
return;
|
||||
}
|
||||
|
||||
QtWindow::handleClose();
|
||||
}
|
||||
|
||||
void QtIndexingDialog::handleCancelPress()
|
||||
{
|
||||
if (m_type == DIALOG_INDEXING)
|
||||
{
|
||||
@@ -543,7 +554,7 @@ void QtIndexingDialog::addButtons(QBoxLayout* layout)
|
||||
|
||||
m_closeButton = new QPushButton("Cancel");
|
||||
m_closeButton->setObjectName("windowButton");
|
||||
connect(m_closeButton, &QPushButton::clicked, this, &QtIndexingDialog::handleClosePress);
|
||||
connect(m_closeButton, &QPushButton::clicked, this, &QtIndexingDialog::handleCancelPress);
|
||||
|
||||
QHBoxLayout* buttons = new QHBoxLayout();
|
||||
buttons->addWidget(m_closeButton);
|
||||
|
||||
@@ -61,6 +61,9 @@ protected:
|
||||
virtual void handleNext() override;
|
||||
virtual void handleClose() override;
|
||||
|
||||
private slots:
|
||||
void handleCancelPress();
|
||||
|
||||
private:
|
||||
void setType(DialogType type);
|
||||
|
||||
|
||||
@@ -493,6 +493,7 @@ void QtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
|
||||
case Qt::Key_Escape:
|
||||
emit hideScreenSearch();
|
||||
emit hideIndexingDialog();
|
||||
break;
|
||||
|
||||
case Qt::Key_Slash:
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
signals:
|
||||
void showScreenSearch();
|
||||
void hideScreenSearch();
|
||||
void hideIndexingDialog();
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent* event) override;
|
||||
|
||||
Reference in New Issue
Block a user