From 09d78308be828f12e5eba49288f43ed0fe81344d Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 22 Aug 2017 23:46:40 +0200 Subject: [PATCH] ui: Use QtTextEditDialog for include directive validation results --- src/lib_gui/qt/window/QtTextEditDialog.cpp | 1 + .../QtProjectWizzardContentPaths.cpp | 37 +++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/lib_gui/qt/window/QtTextEditDialog.cpp b/src/lib_gui/qt/window/QtTextEditDialog.cpp index d805200b..53adda0e 100644 --- a/src/lib_gui/qt/window/QtTextEditDialog.cpp +++ b/src/lib_gui/qt/window/QtTextEditDialog.cpp @@ -46,6 +46,7 @@ void QtTextEditDialog::populateWindow(QWidget* widget) QLabel* description = new QLabel(m_description); description->setObjectName("description"); + description->setWordWrap(true); layout->addWidget(description); m_text = new QPlainTextEdit(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index fd24c530..6263e826 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -484,33 +484,22 @@ void QtProjectWizzardContentPathsHeaderSearch::showValidationResult(const std::v detailedText += unresolvedInclude.getIncludingFile().str() + "[" + std::to_string(unresolvedInclude.getLineNumber()) + "]: " + unresolvedInclude.getDirective() + "\n"; } - QMessageBox msgBox; - msgBox.setText(QString::fromStdString( - "

The indexed files contain " + std::to_string(unresolvedIncludes.size()) + " include directive" + (unresolvedIncludes.size() == 1 ? "" : "s") + " that could " + m_filesDialog = std::make_shared("Unresolved Include Directives", + ("

The indexed files contain " + std::to_string(unresolvedIncludes.size()) + " include directive" + (unresolvedIncludes.size() == 1 ? "" : "s") + " that could " "not be resolved correctly. Please check the details and add the respective header search paths.

" "

Note: This is only a quick pass that does not regard block commenting or conditional preprocessor directives. This means that " - "some of the unresolved includes may actually not be required by the indexer.

")); - msgBox.setDetailedText(QString::fromStdString(detailedText)); - msgBox.exec(); + "some of the unresolved includes may actually not be required by the indexer.

").c_str() + ); + m_filesDialog->setup(); + m_filesDialog->setCloseVisible(false); + m_filesDialog->setReadOnly(true); + + m_filesDialog->setText(detailedText); + m_filesDialog->showWindow(); + + connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizzardContentPathsHeaderSearch::closedFilesDialog); + connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizzardContentPathsHeaderSearch::closedFilesDialog); } - - - //if (!m_filesDialog) - //{ - // m_filesDialog = std::make_shared( - // getFileNamesTitle(), QString::number(fileNames.size()) + " " + getFileNamesDescription()); - // m_filesDialog->setup(); - - // m_filesDialog->setText(utility::join(fileNames, "\n")); - // m_filesDialog->setCloseVisible(false); - // m_filesDialog->setReadOnly(true); - - // connect(m_filesDialog.get(), SIGNAL(finished()), this, SLOT(closedFilesDialog())); - // connect(m_filesDialog.get(), SIGNAL(canceled()), this, SLOT(closedFilesDialog())); - //} - - //m_filesDialog->showWindow(); - //m_filesDialog->raise(); } QtProjectWizzardContentPathsHeaderSearchGlobal::QtProjectWizzardContentPathsHeaderSearchGlobal(