ui: fixes in project setup and indexing

* allow to ignore missing paths in project setup
* button to remove missing paths in project setup
* fixed progress dialog stays on empty project indexing
* don't unblock ui between indexin steps
This commit is contained in:
Eberhard Graether
2017-12-20 22:48:37 +01:00
parent bfa43df491
commit f849c9d01d
11 changed files with 73 additions and 30 deletions
+8 -4
View File
@@ -163,18 +163,18 @@ void QtDialogView::startIndexingDialog(
Task::dispatch(std::make_shared<TaskLambda>(
[=]()
{
project->buildIndex(info);
project->buildIndex(info, this);
}
));
m_windowStack.clearWindows();
showUnknownProgress("Preparing Indexing", "Setting up Indexers", false);
}
);
connect(window, &QtWindow::canceled,
[=]()
{
std::cout << "cancelse" << std::endl;
setUIBlocked(false);
}
);
@@ -228,13 +228,17 @@ void QtDialogView::finishedIndexingDialog(
);
}
void QtDialogView::hideDialogs()
void QtDialogView::hideDialogs(bool unblockUI)
{
m_onQtThread2(
[=]()
{
m_windowStack.clearWindows();
setUIBlocked(false);
if (unblockUI)
{
setUIBlocked(false);
}
}
);
+1 -1
View File
@@ -43,7 +43,7 @@ public:
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
float time, ErrorCountInfo errorInfo, bool interrupted) override;
virtual void hideDialogs() override;
virtual void hideDialogs(bool unblockUI = true) override;
int confirm(const std::string& message, const std::vector<std::string>& options) override;
@@ -69,30 +69,54 @@ void QtProjectWizzardContentPaths::populate(QGridLayout* layout, int& row)
bool QtProjectWizzardContentPaths::check()
{
QString missingPaths;
std::vector<FilePath> existingPaths;
std::vector<FilePath> paths = m_list->getList();
if (m_settings)
for (const FilePath& path : m_list->getList())
{
paths = m_settings->makePathsExpandedAndAbsolute(paths);
}
for (const FilePath& path : paths)
{
if (!path.exists())
std::vector<FilePath> expandedPaths(1, path);
std::cout << path.str() << std::endl;
if (m_settings)
{
missingPaths.append(path.str().c_str());
missingPaths.append("\n");
break;
expandedPaths = m_settings->makePathsExpandedAndAbsolute(expandedPaths);
}
size_t existingCount = 0;
for (const FilePath& expandedPath : expandedPaths)
{
if (!expandedPath.exists())
{
missingPaths.append((expandedPath.str() + "\n").c_str());
}
else
{
existingCount++;
}
}
if (expandedPaths.size() && expandedPaths.size() == existingCount)
{
existingPaths.push_back(path);
}
}
if (!missingPaths.isEmpty())
{
QMessageBox msgBox;
msgBox.setText("Some provided paths do not exist at \"" + m_titleString + "\".");
msgBox.setText(QString("Some provided paths do not exist at \"%1\". Do you want to remove them "
"before continuing?").arg(m_titleString));
msgBox.setDetailedText(missingPaths);
msgBox.exec();
return false;
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
{
m_list->setList(existingPaths);
save();
}
else if (ret == QMessageBox::Cancel)
{
return false;
}
}
return true;
@@ -91,6 +91,11 @@ std::shared_ptr<CombinedPathDetector> utility::getCxxVsHeaderPathDetector()
{
std::shared_ptr<CombinedPathDetector> combinedDetector = std::make_shared<CombinedPathDetector>();
if (utility::getOsType() != OS_WINDOWS)
{
return combinedDetector;
}
combinedDetector->addDetector(std::make_shared<CxxVs15HeaderPathDetector>());
combinedDetector->addDetector(std::make_shared<CxxVs10To14HeaderPathDetector>(CxxVs10To14HeaderPathDetector::VISUAL_STUDIO_2015, false, APPLICATION_ARCHITECTURE_X86_32));