ui: Fixed issues in source group type selection

* no visible scrollbar was shown
* better default size
* description links were not clickable
This commit is contained in:
Eberhard Graether
2018-06-12 14:52:58 +02:00
parent 32d0b01694
commit dca4c3c16b
3 changed files with 18 additions and 11 deletions
@@ -404,7 +404,7 @@ void QtProjectWizzard::selectedSourceGroupChanged(int index)
QTimer::singleShot(1, [&]() {
m_sourceGroupList->setCurrentRow(m_previouslySelectedIndex);
});
return;
}
@@ -726,11 +726,11 @@ void QtProjectWizzard::newSourceGroup()
QtProjectWizzardWindow* window = createWindowWithContent(
[](QtProjectWizzardWindow* window)
{
window->setPreferredSize(QSize(680, 400));
window->setPreferredSize(QSize(560, 520));
return new QtProjectWizzardContentSelect(window);
}
);
window->resize(QSize(680, 400));
window->resize(QSize(560, 520));
connect(dynamic_cast<QtProjectWizzardContentSelect*>(window->content()),
&QtProjectWizzardContentSelect::selected,
@@ -953,7 +953,7 @@ void QtProjectWizzard::sourcePaths()
contentGroup->addContent(new QtProjectWizzardContentPathsSource(settingsCxx, window));
contentGroup->addSpace();
contentGroup->addContent(new QtProjectWizzardContentPathsExclude(settingsCxx, window));
if (std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settingsSourceExtension =
if (std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settingsSourceExtension =
std::dynamic_pointer_cast<SourceGroupSettingsWithSourceExtensions>(m_newSourceGroupSettings))
{
contentGroup->addSpace();
@@ -58,17 +58,17 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
// define descriptions for each kind of Source Group
m_sourceGroupTypeDescriptions[SOURCE_GROUP_C_EMPTY] = "Create a new Sourcetrail Source Group by defining which C files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CPP_EMPTY] = "Create a new Sourcetrail Source Group by defining which C++ files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CDB] =
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CDB] =
"Create a Source Group from an existing Compilation Database (compile_commands.json). "
"They can be exported from CMake<br />(-D CMAKE_EXPORT_COMPILE_COMMANDS=1) and Make projects. Have a look at the "
"<a href=\"https://sourcetrail.com/documentation/#CreateAProjectFromCompilationDatabase\">"
"documentation</a>.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_VS] =
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_VS] =
"<p>Create a new Source Group from an existing Visual Studio Solution file.</p>"
"<p><b>Note</b>: Requires a running Visual Studio instance with the "
"<a href=\"https://sourcetrail.com/documentation/index.html#VisualStudio\">Sourcetrail Visual Studio Extension</a> installed.</p>";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_SONARGRAPH] = "Create a new Source Group from an existing Sonargraph project file.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CODEBLOCKS] =
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CODEBLOCKS] =
"<p>Create a new Source Group from an existing Code::Blocks project file.</p>"
"<p><b>Note</b>: A \".cbp\" file will also be generated by the <b>Qt Creator</b> if a CMakeLists file is imported.</p>";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_EMPTY] = "Create a new Sourcetrail Source Group by defining which Java files will be indexed.";
@@ -175,7 +175,7 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
m_description->setWordWrap(true);
m_description->setOpenExternalLinks(true);
m_description->setObjectName("sourceGroupDescription");
m_description->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_description->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
m_description->setMinimumHeight(80);
containerLayout->addWidget(m_description, 0);
@@ -238,3 +238,8 @@ bool QtProjectWizzardContentSelect::check()
return true;
}
bool QtProjectWizzardContentSelect::isScrollAble() const
{
return true;
}
@@ -17,10 +17,12 @@ public:
QtProjectWizzardContentSelect(QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
void populate(QGridLayout* layout, int& row) override;
virtual void save() override;
virtual bool check() override;
void save() override;
bool check() override;
bool isScrollAble() const override;
signals:
void selected(SourceGroupType);