Add collection tab to About FreeCAD

This commit is contained in:
triplus
2020-03-08 12:57:20 +01:00
committed by wmayer
parent 8624564469
commit b368c14a0d
2 changed files with 19 additions and 0 deletions

View File

@@ -268,6 +268,7 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent)
ui->tabWidget->setCurrentIndex(0); // always start on the About tab
setupLabels();
showLicenseInformation();
showCollectionInformation();
}
/**
@@ -695,6 +696,23 @@ void AboutDialog::showLicenseInformation()
connect(textField, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkActivated(QUrl)));
}
void AboutDialog::showCollectionInformation()
{
QString doc = QString::fromUtf8(App::Application::getHelpDir().c_str());
QString path = doc + QLatin1String("Collection.html");
if (!QFile::exists(path))
return;
QWidget *tab_collection = new QWidget();
tab_collection->setObjectName(QString::fromLatin1("tab_collection"));
ui->tabWidget->addTab(tab_collection, tr("Collection"));
QVBoxLayout* hlayout = new QVBoxLayout(tab_collection);
QTextBrowser* textField = new QTextBrowser(tab_collection);
textField->setOpenExternalLinks(true);
hlayout->addWidget(textField);
textField->setSource(path);
}
void AboutDialog::linkActivated(const QUrl& link)
{
//#if defined(Q_OS_WIN) && QT_VERSION < 0x050602

View File

@@ -102,6 +102,7 @@ public:
protected:
void setupLabels();
void showLicenseInformation();
void showCollectionInformation();
protected Q_SLOTS:
virtual void on_copyButton_clicked();