Removed multiple dialog steps in Source Group setup (issue #723) (#913)

* removed QtSourceGroupWizard, QtSourceGroupWizardPage and context types
* removed isInForm flag of QtProjectWizardContent
* added check of empty source paths
* set project window as parent for message boxes, so they don't get hidden behind main window
* fixed issues when removing and duplicating source groups
* updated project setup tests to no steps
This commit is contained in:
Eberhard Gräther
2020-02-10 20:00:36 +01:00
committed by GitHub
parent 7f9f098c70
commit 260f1227bc
51 changed files with 485 additions and 1010 deletions
@@ -21,12 +21,6 @@ QtProjectWizardContentProjectData::QtProjectWizardContentProjectData(
void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
row++;
}
QLabel* nameLabel = createFormLabel(QStringLiteral("Sourcetrail Project Name"));
m_projectName = new QLineEdit();
m_projectName->setObjectName(QStringLiteral("name"));
@@ -57,12 +51,6 @@ void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
row);
layout->setRowMinimumHeight(row, 30);
row++;
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
layout->setRowStretch(row, 1);
}
}
void QtProjectWizardContentProjectData::load()
@@ -83,7 +71,7 @@ bool QtProjectWizardContentProjectData::check()
{
if (m_projectName->text().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please enter a project name."));
msgBox.exec();
return false;
@@ -91,7 +79,7 @@ bool QtProjectWizardContentProjectData::check()
if (!boost::filesystem::portable_file_name(m_projectName->text().toStdString()))
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The provided project name is not a valid file name. Please adjust the name "
"accordingly.");
@@ -101,7 +89,7 @@ bool QtProjectWizardContentProjectData::check()
if (m_projectFileLocation->getText().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please define the location for the Sourcetrail project file."));
msgBox.exec();
return false;
@@ -111,7 +99,7 @@ bool QtProjectWizardContentProjectData::check()
FilePath(m_projectFileLocation->getText().toStdWString()).expandEnvironmentVariables();
if (paths.size() != 1)
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please make sure that the used "
"environment variables are unambiguous.");
@@ -120,7 +108,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths.front().isAbsolute())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please specify an absolute directory "
"path.");
@@ -129,7 +117,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths.front().isValid())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please check the characters used in the "
"path.");
@@ -138,7 +126,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths[0].exists())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
QStringLiteral("The specified location does not exist. Do you want to create the directory?"));
msgBox.addButton(QStringLiteral("Abort"), QMessageBox::ButtonRole::NoRole);