This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Show Sourcetrail license on top in licenses window
* updated versions and license files of some 3rd party libraries
- Loading branch information
Showing
9 changed files
with
133 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include "QtLicenseWindow.h" | ||
|
||
#include <QVBoxLayout> | ||
#include <QLabel> | ||
|
||
#include "licenses.h" | ||
|
||
QtLicenseWindow::QtLicenseWindow(QWidget *parent) | ||
: QtWindow(false, parent) | ||
{ | ||
setScrollAble(true); | ||
} | ||
|
||
QSize QtLicenseWindow::sizeHint() const | ||
{ | ||
return QSize(650, 600); | ||
} | ||
|
||
void QtLicenseWindow::populateWindow(QWidget* widget) | ||
{ | ||
QVBoxLayout* layout = new QVBoxLayout(widget); | ||
|
||
QLabel* licenseName = new QLabel(); | ||
licenseName->setText( | ||
QString::fromLatin1(licenseApp.name) + | ||
QString::fromLatin1( | ||
std::string(licenseApp.version).empty() ? | ||
"" : | ||
(std::string(" (v") + licenseApp.version + ")").c_str() | ||
) | ||
); | ||
QFont _font = licenseName->font(); | ||
_font.setPixelSize(36); | ||
_font.setBold(true); | ||
licenseName->setFont(_font); | ||
layout->addWidget(licenseName); | ||
|
||
QLabel* licenseURL = new QLabel(); | ||
licenseURL->setText(QString::fromLatin1("<a href=\"%1\">%1</a>") | ||
.arg(QString::fromLatin1(licenseApp.url))); | ||
licenseURL->setOpenExternalLinks(true); | ||
layout->addWidget(licenseURL); | ||
|
||
QLabel* licenseText = new QLabel(); | ||
licenseText->setFixedWidth(550); | ||
licenseText->setWordWrap(true); | ||
licenseText->setText(QString::fromLatin1(licenseApp.license)); | ||
layout->addWidget(licenseText); | ||
|
||
layout->addSpacing(30); | ||
|
||
QLabel* header3rdParties = new QLabel( | ||
"<b>Copyrights and Licenses for Third Party Software Distributed with Sourcetrail:</b><br />" | ||
"Sourcetaril contains code written by the following third parties that have <br />" | ||
"additional or alternate copyrights, licenses, and/or restrictions:"); | ||
layout->addWidget(header3rdParties); | ||
|
||
layout->addSpacing(30); | ||
|
||
for (LicenseInfo license : licenses3rdParties) | ||
{ | ||
QLabel* licenseName = new QLabel(); | ||
licenseName->setText( | ||
QString::fromLatin1(license.name) + | ||
QString::fromLatin1( | ||
std::string(license.version).empty() ? | ||
"" : | ||
(std::string(" (v") + license.version + ")").c_str() | ||
) | ||
); | ||
licenseName->setFont(_font); | ||
layout->addWidget(licenseName); | ||
|
||
QLabel* licenseURL = new QLabel(); | ||
licenseURL->setText(QString::fromLatin1("<a href=\"%1\">%1</a>") | ||
.arg(QString::fromLatin1(license.url))); | ||
licenseURL->setOpenExternalLinks(true); | ||
layout->addWidget(licenseURL); | ||
|
||
QLabel* licenseText = new QLabel(); | ||
licenseText->setFixedWidth(550); | ||
licenseText->setWordWrap(true); | ||
licenseText->setText(QString::fromLatin1(license.license)); | ||
layout->addWidget(licenseText); | ||
|
||
layout->addSpacing(30); | ||
} | ||
|
||
widget->setLayout(layout); | ||
} | ||
|
||
void QtLicenseWindow::windowReady() | ||
{ | ||
updateTitle("License"); | ||
updateCloseButton("Close"); | ||
|
||
setNextVisible(false); | ||
setPreviousVisible(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters