ui: generic solution parser

completed first version of generic solution parsers
This commit is contained in:
Manuel Dobusch
2016-05-18 16:50:26 +02:00
parent 2f25279662
commit 5295267513
6 changed files with 24 additions and 39 deletions
@@ -68,31 +68,23 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
QToolButton* c = createProjectButton(
"from Compilation\nDatabase", (ResourcePaths::getGuiPath() + "icon/project_cdb_256_256.png").c_str());
/*QToolButton* b = createProjectButton(
"from Visual\nStudio Solution", (ResourcePaths::getGuiPath() + "icon/project_vs_256_256.png").c_str());*/
m_solutionDescription.push_back("Create a new Coati project by defining what files will be analyzed and header search paths.");
m_solutionDescription.push_back("Create a project from an existing Compilation Database. Compilation Databases can be created from "
"cmake projects. Have a look at the "
"<a href=\"https://staging.coati.io/documentation/#CreateAProjectFromCompilationDatabase\">"
"documentation</a> to find out more.");
//m_solutionDescription.push_back("Create a new project from an existing Visual Studio Solution file.");
m_buttons = new QButtonGroup(this);
m_buttons->addButton(a);
m_buttons->addButton(c);
//m_buttons->addButton(b);
m_buttons->setId(a, PROJECT_EMPTY);
m_buttons->setId(c, PROJECT_CDB);
//m_buttons->setId(b, PROJECT_VS);
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->addWidget(a);
hlayout->addWidget(c);
//hlayout->addWidget(b);
unsigned int runningId = 2;
std::shared_ptr<SolutionParserManager> manager = m_solutionParserManager.lock();
@@ -103,7 +95,7 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
std::string name = manager->getParserButtonText(i);
QToolButton* button = createProjectButton(name.c_str(),
(ResourcePaths::getGuiPath() + "icon/project_vs_256_256.png").c_str());
(ResourcePaths::getGuiPath() + manager->getIconPath(i)).c_str());
m_buttons->addButton(button);
@@ -120,30 +112,12 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
connect(m_buttons, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
[this](int id)
{
/*switch (id)
{
case 0: m_description->setText(
"Create a new Coati project by defining what files will be analyzed and header search paths."
); break;
case 1: m_description->setText(
"Create a new project from an existing Visual Studio Solution file."
); break;
case 2: m_description->setText(
"Create a project from an existing Compilation Database. Compilation Databases can be created from "
"cmake projects. Have a look at the "
"<a href=\"https://staging.coati.io/documentation/#CreateAProjectFromCompilationDatabase\">"
"documentation</a> to find out more."
); break;
}*/
m_description->setText(m_solutionDescription[id].c_str());
m_window->setNextEnabled(true);
}
);
QFrame* container = new QFrame();
container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
container->setObjectName("projectContainer");
@@ -179,13 +153,11 @@ void QtProjectWizzardContentSelect::save()
{
case 0: type = PROJECT_EMPTY; break;
case 1: type = PROJECT_CDB; break;
case 2: type = PROJECT_VS; break;
default: type = PROJECT_VS; break; // use vs for "standard" solutions TODO: change name of enum to reflect this is the default type
case 2: type = PROJECT_MANAGED; break;
default: type = PROJECT_MANAGED; break;
}
emit selected(type);
// emit selected(m_buttons->checkedId());
}
bool QtProjectWizzardContentSelect::check()