diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-07 21:31:44 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-07 21:48:56 +0100 |
commit | 9fcdb44e55b5bee585e4906e93d055d230ee01d9 (patch) | |
tree | 5e3a65649d9e9b5ea4cd0c9a4ca833cc4e2a6f5a | |
parent | db7c4424e463055723edcb30e51c879358ac9831 (diff) | |
download | rockbox-9fcdb44e55b5bee585e4906e93d055d230ee01d9.tar.gz rockbox-9fcdb44e55b5bee585e4906e93d055d230ee01d9.zip |
rbutil: Show the license of all libraries included.
Replace the Speex license tab in the about dialog with one that lists
all used libraries and their respective licenses, including Speex.
Previously only Speex required including the license in binary
distribution; the recently added bspatch also wants this. Show
the license for all used libraries so we can more easily add new ones in
the future.
Change-Id: Ic8b403f8a2a05d0f1734ddf092782b85ddfa5ed9
-rw-r--r-- | rbutil/rbutilqt/aboutbox.ui | 14 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 38 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.qrc | 9 |
3 files changed, 46 insertions, 15 deletions
diff --git a/rbutil/rbutilqt/aboutbox.ui b/rbutil/rbutilqt/aboutbox.ui index e73fccde79..e13f06a15a 100644 --- a/rbutil/rbutilqt/aboutbox.ui +++ b/rbutil/rbutilqt/aboutbox.ui | |||
@@ -6,7 +6,7 @@ | |||
6 | <rect> | 6 | <rect> |
7 | <x>0</x> | 7 | <x>0</x> |
8 | <y>0</y> | 8 | <y>0</y> |
9 | <width>500</width> | 9 | <width>640</width> |
10 | <height>500</height> | 10 | <height>500</height> |
11 | </rect> | 11 | </rect> |
12 | </property> | 12 | </property> |
@@ -127,13 +127,13 @@ | |||
127 | </item> | 127 | </item> |
128 | </layout> | 128 | </layout> |
129 | </widget> | 129 | </widget> |
130 | <widget class="QWidget" name="licenseSpeex"> | 130 | <widget class="QWidget" name="licenseSpeex" > |
131 | <attribute name="title"> | 131 | <attribute name="title" > |
132 | <string>&Speex License</string> | 132 | <string>L&ibraries</string> |
133 | </attribute> | 133 | </attribute> |
134 | <layout class="QGridLayout" name="gridLayout_2"> | 134 | <layout class="QGridLayout" name="gridLayout_2" > |
135 | <item row="0" column="0"> | 135 | <item row="0" column="0" > |
136 | <widget class="QTextBrowser" name="browserSpeexLicense"/> | 136 | <widget class="QTextBrowser" name="browserLicenses"/> |
137 | </item> | 137 | </item> |
138 | </layout> | 138 | </layout> |
139 | </widget> | 139 | </widget> |
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 60f517825d..1c00ef9a07 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -282,12 +282,37 @@ void RbUtilQt::about() | |||
282 | QTextStream c(&licence); | 282 | QTextStream c(&licence); |
283 | about.browserLicense->insertHtml(c.readAll()); | 283 | about.browserLicense->insertHtml(c.readAll()); |
284 | about.browserLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); | 284 | about.browserLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); |
285 | 285 | licence.close(); | |
286 | QFile speexlicense(":/docs/COPYING.SPEEX"); | 286 | |
287 | speexlicense.open(QIODevice::ReadOnly); | 287 | QString html = "<p>" + tr("Libraries used") + "</p>"; |
288 | QTextStream s(&speexlicense); | 288 | html += "<ul>"; |
289 | about.browserSpeexLicense->insertHtml("<pre>" + s.readAll() + "</pre>"); | 289 | html += "<li>Speex: <a href='#speex'>Speex License</a></li>"; |
290 | about.browserSpeexLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); | 290 | html += "<li>bspatch: <a href='#bspatch'>bspatch License</a></li>"; |
291 | html += "<li>bzip2: <a href='#bzip2'>bzip2 License</a></li>"; | ||
292 | html += "<li>mspack: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; | ||
293 | html += "<li>quazip: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; | ||
294 | html += "<li>tomcrypt: <a href='#tomcrypt'>Tomcrypt License</a></li>"; | ||
295 | html += "<li>CuteLogger: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; | ||
296 | html += "</ul>"; | ||
297 | about.browserLicenses->insertHtml(html); | ||
298 | |||
299 | QMap<QString, QString> licenses; | ||
300 | licenses[":/docs/COPYING.SPEEX"] = "<a id='speex'>Speex License</a>"; | ||
301 | licenses[":/docs/lgpl-2.1.txt"] = "<a id='lgpl2'>LGPL v2.1</a>"; | ||
302 | licenses[":/docs/LICENSE.TOMCRYPT"] = "<a id='tomcrypt'>Tomcrypt License</a>"; | ||
303 | licenses[":/docs/LICENSE.BZIP2"] = "<a id='bzip2'>bzip2 License</a>"; | ||
304 | licenses[":/docs/LICENSE.BSPATCH"] = "<a id='bspatch'>bspatch License</a>"; | ||
305 | |||
306 | for (int i = 0; i < licenses.size(); i++) { | ||
307 | QString key = licenses.keys().at(i); | ||
308 | QFile license(key); | ||
309 | license.open(QIODevice::ReadOnly); | ||
310 | QTextStream s(&license); | ||
311 | about.browserLicenses->insertHtml("<hr/><h2>" + licenses[key] + "</h2><br/>\n"); | ||
312 | about.browserLicenses->insertHtml("<pre>" + s.readAll() + "</pre>"); | ||
313 | license.close(); | ||
314 | } | ||
315 | about.browserLicenses->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); | ||
291 | 316 | ||
292 | QFile credits(":/docs/CREDITS"); | 317 | QFile credits(":/docs/CREDITS"); |
293 | credits.open(QIODevice::ReadOnly); | 318 | credits.open(QIODevice::ReadOnly); |
@@ -304,6 +329,7 @@ void RbUtilQt::about() | |||
304 | line.remove(QRegExp("^People.*")); | 329 | line.remove(QRegExp("^People.*")); |
305 | about.browserCredits->append(line); | 330 | about.browserCredits->append(line); |
306 | } | 331 | } |
332 | credits.close(); | ||
307 | about.browserCredits->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); | 333 | about.browserCredits->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); |
308 | QString title = QString("<b>The Rockbox Utility</b><br/>Version %1").arg(FULLVERSION); | 334 | QString title = QString("<b>The Rockbox Utility</b><br/>Version %1").arg(FULLVERSION); |
309 | about.labelTitle->setText(title); | 335 | about.labelTitle->setText(title); |
diff --git a/rbutil/rbutilqt/rbutilqt.qrc b/rbutil/rbutilqt/rbutilqt.qrc index 3ce83f33c6..b1427b118f 100644 --- a/rbutil/rbutilqt/rbutilqt.qrc +++ b/rbutil/rbutilqt/rbutilqt.qrc | |||
@@ -1,8 +1,12 @@ | |||
1 | <RCC> | 1 | <RCC> |
2 | <qresource prefix="/"> | 2 | <qresource prefix="/"> |
3 | <file>../../docs/CREDITS</file> | 3 | <file alias="docs/CREDITS">../../docs/CREDITS</file> |
4 | <file>../../docs/gpl-2.0.html</file> | 4 | <file alias="docs/gpl-2.0.html">../../docs/gpl-2.0.html</file> |
5 | <file alias="docs/lgpl-2.1.txt">logger/LICENSE.LGPL</file> | ||
5 | <file alias="docs/COPYING.SPEEX">../../lib/rbcodec/codecs/libspeex/COPYING</file> | 6 | <file alias="docs/COPYING.SPEEX">../../lib/rbcodec/codecs/libspeex/COPYING</file> |
7 | <file alias="docs/LICENSE.TOMCRYPT">../../utils/tomcrypt/LICENSE</file> | ||
8 | <file alias="docs/LICENSE.BZIP2">../bzip2/LICENSE</file> | ||
9 | <file alias="docs/LICENSE.BSPATCH">../bspatch/LICENSE</file> | ||
6 | <file alias="docs/changelog.txt">changelog.txt</file> | 10 | <file alias="docs/changelog.txt">changelog.txt</file> |
7 | </qresource> | 11 | </qresource> |
8 | <qresource> | 12 | <qresource> |
@@ -41,6 +45,7 @@ | |||
41 | <file>icons/view-refresh.svg</file> | 45 | <file>icons/view-refresh.svg</file> |
42 | <file>icons/wizard.jpg</file> | 46 | <file>icons/wizard.jpg</file> |
43 | <file alias="icons/rockbox-clef.svg">../../docs/logo/rockbox-clef.svg</file> | 47 | <file alias="icons/rockbox-clef.svg">../../docs/logo/rockbox-clef.svg</file> |
48 | <file alias="icons/rockbox-logo.svg">../../docs/logo/rockbox-logo.svg</file> | ||
44 | </qresource> | 49 | </qresource> |
45 | <qresource> | 50 | <qresource> |
46 | <file>icons/players/archosfmrecorder-small.png</file> | 51 | <file>icons/players/archosfmrecorder-small.png</file> |