About.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /**
  2. * Copyright (c) 2011-2018 by Andrew Mustun. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * QCAD is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * QCAD is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with QCAD.
  18. */
  19. include("scripts/Help/Help.js");
  20. include("AboutCredits.js");
  21. /**
  22. * \class About
  23. * \brief Shows about dialog.
  24. * \ingroup ecma_help
  25. */
  26. function About(guiAction) {
  27. Help.call(this, guiAction);
  28. }
  29. About.prototype = new Help();
  30. About.prototype.beginEvent = function() {
  31. Help.prototype.beginEvent.call(this);
  32. var dialog = this.createWidget("AboutDialog.ui");
  33. var f = 1;
  34. if (RS.getSystemId()==="osx") {
  35. f = 1.33;
  36. }
  37. var blue = "#0000cc";
  38. if (RSettings.hasDarkGuiBackground()) {
  39. blue = "#2E9AFE";
  40. }
  41. this.head = "<head>\n"
  42. + "<style type='text/css'>\n"
  43. + "body,td { font-family:Arial, Helvetica, sans-serif;font-size:%1pt; }\n".arg(9*f)
  44. + "a { text-decoration:none;color:" + blue +" }\n"
  45. + "h1 { font-size:%1pt;margin-bottom:8pt; }\n".arg(13*f)
  46. + "h2 { font-size:%1pt;font-style:italic;margin-bottom:5pt; }\n".arg(9*f)
  47. + "}\n</style>\n"
  48. + "</head>";
  49. this.applicationName = qApp.applicationName;
  50. this.version = undefined;
  51. this.iconFile = undefined;
  52. // init plugin view:
  53. var textBrowser = dialog.findChild("PluginsText");
  54. WidgetFactory.initTextBrowser(textBrowser, QDesktopServices.openUrl);
  55. this.initAboutPlugins(textBrowser);
  56. dialog.windowTitle = qsTr("About %1").arg(this.applicationName);
  57. if (!isNull(this.iconFile)) {
  58. dialog.findChild("Icon").icon = new QIcon(this.iconFile);
  59. }
  60. // init about view:
  61. textBrowser = dialog.findChild("AppText");
  62. WidgetFactory.initTextBrowser(textBrowser, QDesktopServices.openUrl);
  63. this.initAboutApp(textBrowser);
  64. // init scripts view:
  65. textBrowser = dialog.findChild("ScriptsText");
  66. WidgetFactory.initTextBrowser(textBrowser, QDesktopServices.openUrl);
  67. this.initAboutScripts(textBrowser);
  68. textBrowser = dialog.findChild("CreditsText");
  69. WidgetFactory.initTextBrowser(textBrowser, QDesktopServices.openUrl);
  70. this.initCredits(textBrowser);
  71. // init system view:
  72. var textEdit = dialog.findChild("SystemText");
  73. this.initAboutSystem(textEdit);
  74. // init licenses view:
  75. textBrowser = dialog.findChild("LicensesText");
  76. this.initAboutLicenses(textBrowser);
  77. dialog.exec();
  78. destr(dialog);
  79. EAction.activateMainWindow();
  80. };
  81. About.prototype.initAboutApp = function(textBrowser) {
  82. var version = RSettings.getVersionString();
  83. var versionComplete = "%1.%2.%3.%4"
  84. .arg(RSettings.getMajorVersion())
  85. .arg(RSettings.getMinorVersion())
  86. .arg(RSettings.getRevisionVersion())
  87. .arg(RSettings.getBuildVersion());
  88. if (!isNull(this.version)) {
  89. version = "";
  90. versionComplete = this.version;
  91. }
  92. var html =
  93. "<html>"
  94. + this.head
  95. + "<body>"
  96. + "<h1>%1</h1>".arg(this.applicationName)
  97. + "<hr/>";
  98. html +=
  99. "<table border='0'><tr>"
  100. + "<td><b>" + qsTr("Version:") + "</b> </td><td>%1 %2</td>"
  101. .arg(versionComplete)
  102. .arg(version.length>0 ? "("+version+")" : "")
  103. + "</tr><tr>"
  104. + "<td><b>" + qsTr("Internet:") + "</b> </td><td><a href='https://%1'>%1</a></td>".arg(qApp.organizationDomain)
  105. + "</tr><tr>"
  106. + "<td><b>" + qsTr("Build Date:") + "</b> </td><td>%1</td>".arg(RSettings.getReleaseDate())
  107. + "</tr><tr>"
  108. + "<td><b>" + qsTr("Revision:") + "</b> </td><td>%1</td>".arg(RSettings.getRevisionString().left(7))
  109. + "</tr><tr>"
  110. + "<td><b>" + qsTr("Qt Version:") + "</b> </td><td>%1</td>".arg(RSettings.getQtVersionString())
  111. + "</tr>";
  112. var bca = RS.getBuildCpuArchitecture();
  113. if (bca.length!==0) {
  114. html += "<tr><td><b>" + qsTr("Architecture:") + "</b> </td><td>%1</td>".arg(bca) + "</tr>";
  115. }
  116. html += "<tr><td><b>" + qsTr("Compiler:") + "</b> </td><td>%1</td>".arg(RSettings.getCompilerVersion()) + "</tr>";
  117. var lk = RSettings.getStringValue("License/LicenseKey", "");
  118. if (lk.length>0) {
  119. html += "<tr><td><b>" + qsTr("License Key:") + "</b> </td><td>%1</td>".arg(lk) + "</tr>";
  120. }
  121. html += "</table>";
  122. html += "<hr/>"
  123. + "<p>" + qsTr("%1 is an application for computer-aided design (CAD).").arg(this.applicationName) + "</p>"
  124. + "<p/>";
  125. if (this.applicationName!=="QCAD" && this.applicationName!=="QCAD Community Edition") {
  126. html += "<p>" + qsTr("%1 is based on QCAD, a free (open source) software.").arg(this.applicationName) + "</p>";
  127. }
  128. else {
  129. html += "<p>" + qsTr("%1 is free (open source) software.").arg("QCAD") + "<br/>"
  130. + "" + qsTr("This means that everyone can <a href='%1'>get involved</a>!").arg("https://www.qcad.org/contribute") + "</p>"
  131. + "" + qsTr("Additional tools, features and file formats including DWG are available in <a href='%1'>QCAD Professional</a> or <a href='%2'>QCAD/CAM</a>.").arg("https://qcad.org/shop").arg("https://qcad.org/shop");
  132. }
  133. html += "<p>" + qsTr("Plugins and script add-ons are subject to their respective license (see \"Plugins\" tab).") + "</p>"
  134. + "<p/>"
  135. + "<p>" + qsTr("All brand or product names are trademarks or registered trademarks of their respective holders.") + "</p>"
  136. + "<p/>"
  137. + "<p>© 2011-2023 RibbonSoft, GmbH.</p>"
  138. + "<p>" + qsTr("Portions of this software © %1 The Qt Company Ltd.").arg("2008-2023") + "</p>"
  139. + "<p>" + qsTr("Qt ships with QCAD under the <a href='%1'>LGPL Open Source license</a> which confers various rights to you as the user, including the right to recompile the Qt libraries for your platform. To do that follow the <a href='%2'>documentation shown on the Qt website</a>.").arg("https://www.gnu.org/licenses/lgpl-3.0.html").arg("https://doc.qt.io/qt-5/build-sources.html") + "</p>"
  140. + "<p>" + qsTr("The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.") + "</p>"
  141. + "<p/>"
  142. + "</body></html>";
  143. textBrowser.setHtml(html);
  144. };
  145. About.prototype.initAboutPlugins = function(textBrowser) {
  146. RPluginLoader.loadPlugins(false);
  147. var html =
  148. "<html>"
  149. + this.head
  150. + "<body>"
  151. + "<h1>%1</h1>".arg(qsTr("Plugins"))
  152. + "<hr/>";
  153. var numPlugins = RPluginLoader.countPlugins();
  154. if (numPlugins===0) {
  155. html += qsTr("No plugins found.");
  156. }
  157. else {
  158. var maxPri = undefined;
  159. for (var i=0; i<numPlugins; i++) {
  160. html += "<table border='0' width='100%'>";
  161. var text, url;
  162. var pluginInfo = RPluginLoader.getPluginInfo(i);
  163. // override priority:
  164. var pri = pluginInfo.get("OverridePriority");
  165. if (!isNull(pri)) {
  166. pri = parseInt(pri);
  167. }
  168. else {
  169. // default to lowest priority:
  170. pri = 0;
  171. }
  172. //qDebug("ID:", pluginInfo.get("ID"));
  173. //qDebug("pri:", pri);
  174. // plugin about info:
  175. text = pluginInfo.get("Name", qsTr("No information available"));
  176. html += this.getTableRow(qsTr("Plugin:"), "<b>" + RS.escape(text) + "</b>", false);
  177. // overrides:
  178. if (isNull(maxPri) || pri>maxPri) {
  179. maxPri = pri;
  180. text = pluginInfo.get("NameOverride");
  181. if (!isNull(text)) {
  182. this.applicationName = text;
  183. }
  184. text = pluginInfo.get("VersionOverride");
  185. if (!isNull(text)) {
  186. this.version = text;
  187. }
  188. text = pluginInfo.get("IconOverride");
  189. if (!isNull(text)) {
  190. this.iconFile = text;
  191. }
  192. }
  193. // ID:
  194. text = pluginInfo.get("ID");
  195. if (!isNull(text)) {
  196. html += this.getTableRow(qsTr("ID:"), text, false);
  197. }
  198. // description:
  199. text = pluginInfo.get("Description");
  200. if (!isNull(text)) {
  201. html += this.getTableRow(qsTr("Description:"), text, false);
  202. }
  203. // plugin version:
  204. text = pluginInfo.get("Version", qsTr("Unknown"));
  205. html += this.getTableRow(qsTr("Version:"), text);
  206. // Qt plugin version:
  207. text = pluginInfo.get("QtVersion", qsTr("Unknown"));
  208. html += this.getTableRow(qsTr("Qt Version:"), text);
  209. // plugin license:
  210. text = pluginInfo.get("License", qsTr("Unknown"));
  211. html += this.getTableRow(qsTr("License:"), text);
  212. // plugin URL:
  213. text = pluginInfo.get("URL");
  214. if (!isNull(text)) {
  215. url = new QUrl(text);
  216. if (url.isValid()) {
  217. if (!RSettings.isQt(5)) {
  218. html += this.getTableRow(
  219. qsTr("Internet:"),
  220. "<a href='%2'>%3</a>"
  221. .arg(url.toString()).arg(url.host().replace(/^www./, "")),
  222. false
  223. );
  224. }
  225. else {
  226. // TODO Qt5:
  227. var fixedUrl = url.toString();
  228. fixedUrl = fixedUrl.replace("QUrl( \"", "");
  229. fixedUrl = fixedUrl.replace("\" )", "");
  230. html += this.getTableRow(qsTr("Internet:"), "<a href='%2'>%3</a>" .arg(fixedUrl).arg(fixedUrl), false);
  231. }
  232. }
  233. }
  234. // trial:
  235. var exp = pluginInfo.get("TrialExpired");
  236. if (!isNull(exp)) {
  237. var color = "green";
  238. text = qsTr("Active");
  239. if (exp) {
  240. color = "red";
  241. text = qsTr("Inactive (restart)");
  242. }
  243. html += this.getTableRow(qsTr("Trial Version:"),
  244. "<span style='color:" + color + "'>" + text + "</span>", false);
  245. }
  246. // file name:
  247. text = pluginInfo.get("FileName");
  248. if (!isNull(text)) {
  249. var fi = new QFileInfo(text);
  250. text = fi.fileName();
  251. url = QUrl.fromLocalFile(fi.absolutePath());
  252. html += this.getTableRow(qsTr("File:"), "<a href='" + url.toString() + "'>" + text + "</a>", false);
  253. }
  254. // plugin error:
  255. text = pluginInfo.get("Error");
  256. if (!isNull(text)) {
  257. html += this.getTableRow(qsTr("Error:"),
  258. "<span style='color:red'>" + text + "</span>", false);
  259. }
  260. html += "</table>";
  261. html += "<hr/>";
  262. }
  263. }
  264. if (this.applicationName==="QCAD") {
  265. this.applicationName = qApp.applicationName + " Community Edition";
  266. }
  267. html += "</body>";
  268. html += "</html>";
  269. textBrowser.setHtml(html);
  270. };
  271. About.prototype.initAboutScripts = function(textBrowser) {
  272. var html =
  273. "<html>"
  274. + this.head
  275. + "<body>"
  276. + "<h1>%1</h1>".arg(qsTr("Script Add-Ons"))
  277. + "<hr/>";
  278. var addOns = AddOn.getAddOns();
  279. var numAddOns = addOns.length;
  280. if (numAddOns===0) {
  281. html += qsTr("No script add-ons found.");
  282. }
  283. else {
  284. var i;
  285. var scriptsPath = RS.getDirectoryList("scripts")[0];
  286. var scriptsDir = undefined;
  287. if (!isNull(scriptsPath)) {
  288. scriptsDir = new QDir(scriptsPath);
  289. }
  290. var sorted = [];
  291. for (i=0; i<numAddOns; i++) {
  292. var addOn = addOns[i];
  293. var path = addOn.getPath();
  294. if (path.startsWith(":")) {
  295. path = path.substring(1);
  296. }
  297. else {
  298. if (!isNull(scriptsDir)) {
  299. path = scriptsDir.relativeFilePath(path);
  300. }
  301. }
  302. sorted.push([addOn.getClassName(), path]);
  303. }
  304. sorted = sorted.sort(function(a,b) { return a[1].localeCompare(b[1]); });
  305. html += "<table border='0' width='100%'>";
  306. for (i=0; i<sorted.length; i++) {
  307. html += "<tr><td>" + sorted[i][0] + "</td><td>" + sorted[i][1] + "</td></tr>"
  308. }
  309. }
  310. html += "</table>";
  311. html += "</body>";
  312. html += "</html>";
  313. textBrowser.setHtml(html);
  314. };
  315. About.prototype.initCredits = function(textBrowser) {
  316. var html =
  317. "<html>"
  318. + this.head
  319. + "<body>"
  320. + "<h1>%1</h1>".arg(qsTr("Credits"))
  321. + "<hr/>";
  322. for (var i=0; i<credits.length; i++) {
  323. html += "<h2>%1</h2>".arg(credits[i][0])
  324. if (credits[i].length>1 && credits[i][1].length>1) {
  325. // table with names and credits:
  326. html += "<table border='0' width='100%'>";
  327. for (var k=1; k<credits[i].length; k++) {
  328. if (isArray(credits[i][k]) && credits[i][k].length>1) {
  329. html += "<tr>";
  330. html += "<td width='30%' valign='top'>" + credits[i][k][0] + "</td>";
  331. html += "<td width='70%' valign='top'>" + credits[i][k][1] + "</td>";
  332. html += "</tr>";
  333. }
  334. }
  335. html += "</table>";
  336. // list of names:
  337. var first = true;
  338. for (var k=1; k<credits[i].length; k++) {
  339. if (!isArray(credits[i][k])) {
  340. if (!first) {
  341. html += ", ";
  342. }
  343. html += credits[i][k];
  344. first = false;
  345. }
  346. }
  347. }
  348. }
  349. html += "</body>";
  350. html += "</html>";
  351. textBrowser.setHtml(html);
  352. };
  353. About.prototype.getTableRow = function(text1, text2, escape) {
  354. if (isNull(escape) || escape!==false) {
  355. text2 = RS.escape(text2);
  356. }
  357. return "<tr><td width='25%' valign='top'>%1 </td><td width='75%'>%2</td></tr>".arg(text1).arg(text2);
  358. };
  359. About.prototype.initAboutSystem = function(textEdit) {
  360. var text = "";
  361. var i;
  362. text += "Versions";
  363. if (!isNull(this.version)) {
  364. text += "\n%1 version: %2"
  365. .arg(qApp.applicationName)
  366. .arg(this.version);
  367. }
  368. else {
  369. text += "\n%1 version: %2.%3.%4.%5"
  370. .arg(qApp.applicationName)
  371. .arg(RSettings.getMajorVersion())
  372. .arg(RSettings.getMinorVersion())
  373. .arg(RSettings.getRevisionVersion())
  374. .arg(RSettings.getBuildVersion());
  375. }
  376. var lk = RSettings.getStringValue("License/LicenseKey", "");
  377. if (lk.length>0) {
  378. text += "\nLicense Key: " + lk;
  379. }
  380. text += "\nDate: " + RSettings.getReleaseDate();
  381. text += "\nQt version: " + RSettings.getQtVersionString();
  382. text += "\nCompiler version: " + RSettings.getCompilerVersion();
  383. text += "\nBuild date: " + RSettings.getReleaseDate();
  384. text += "\nRevision: " + RSettings.getRevisionString();
  385. text += "\nArchitecture: " + RS.getBuildCpuArchitecture();
  386. text += "\nDevice pixel ratio: " + RSettings.getDevicePixelRatio();
  387. text += "\nConfiguration file: " + RSettings.getFileName();
  388. text += "\nOS: ";
  389. if (RS.getSystemId()==="win") {
  390. text += "Windows";
  391. }
  392. if (RS.getSystemId()==="osx") {
  393. text += "macOS";
  394. }
  395. if (RS.getSystemId()==="linux") {
  396. text += "Linux";
  397. }
  398. if (RS.getSystemId()==="freebsd") {
  399. text += "FreeBSD";
  400. }
  401. if (RS.getSystemId()==="netbsd") {
  402. text += "NetBSD";
  403. }
  404. if (RS.getSystemId()==="openbsd") {
  405. text += "OpenBSD";
  406. }
  407. if (RS.getSystemId()==="solaris") {
  408. text += "Solaris";
  409. }
  410. text += "\nOS version: " + RSettings.getOSVersion();
  411. text += "\n";
  412. text += "\nLocale";
  413. text += "\n" + qApp.applicationName + " locale: " + RSettings.getLocale();
  414. var sysloc = QLocale.system();
  415. text += "\nName: " + sysloc.name();
  416. text += "\nCountry: " + sysloc.country();
  417. if (isFunction(sysloc.nativeCountryName)) {
  418. text += "\nCountry name: " + sysloc.nativeCountryName();
  419. }
  420. text += "\nLanguage: " + sysloc.language();
  421. if (isFunction(sysloc.nativeLanguageName)) {
  422. text += "\nLanguage name: " + sysloc.nativeLanguageName();
  423. }
  424. text += "\nScript: " + sysloc.script();
  425. text += "\nScript name: " + QLocale.scriptToString(sysloc.script());
  426. text += "\nDecimal point: " + sysloc.decimalPoint();
  427. text += "\nNegative sign: " + sysloc.negativeSign();
  428. text += "\nPositive sign: " + sysloc.positiveSign();
  429. text += "\nText direction: " + sysloc.textDirection();
  430. if (RSettings.getQtVersion() > 0x060000) {
  431. // TODO #qt6: prints number not name
  432. text += "\nSystem codec: " + QStringConverter.nameForEncoding(QStringConverter.System);
  433. }
  434. else {
  435. text += "\nSystem codec: " + QTextCodec.codecForLocale().name();
  436. }
  437. text += "\n";
  438. text += "\nArguments: " + RSettings.getOriginalArguments();
  439. if (RS.getSystemId()==="win") {
  440. text += "\n"
  441. text += "\nOpenGL:\n" + RSettings.getOpenGLMessages().join("\n");
  442. }
  443. var numPlugins = RPluginLoader.countPlugins();
  444. if (numPlugins>0) {
  445. text += "\n";
  446. text += "\nPlugins";
  447. for (i=0; i<numPlugins; i++) {
  448. var pluginInfo = RPluginLoader.getPluginInfo(i);
  449. var keys = pluginInfo.getKeys();
  450. for (var k=0; k<keys.length; k++) {
  451. text += "\n" + keys[k] + "=" + pluginInfo.get(keys[k]);
  452. }
  453. text += "\n"
  454. }
  455. }
  456. else {
  457. text += "\n";
  458. }
  459. var env = QProcessEnvironment.systemEnvironment();
  460. var keyValues = env.toStringList();
  461. text += "\nEnvironment";
  462. for (i=0; i<keyValues.length; i++) {
  463. var keyValue = keyValues[i];
  464. text += "\n" + keyValue;
  465. }
  466. textEdit.plainText = text;
  467. };
  468. About.prototype.initAboutLicenses = function(textBrowser) {
  469. var html =
  470. "<html>"
  471. + this.head
  472. + "<body>"
  473. + "<h1>%1</h1>".arg(qsTr("Licenses"))
  474. + "<hr/>";
  475. html += "<h2>libspatialindex</h2>"
  476. html += "<p>Permission is hereby granted, free of charge, to any person obtaining a "
  477. + "copy of this software and associated documentation files (the \"Software\"), "
  478. + "to deal in the Software without restriction, including without limitation "
  479. + "the rights to use, copy, modify, merge, publish, distribute, sublicense, "
  480. + "and/or sell copies of the Software, and to permit persons to whom the "
  481. + "Software is furnished to do so, subject to the following conditions:"
  482. + "<br/><br/>"
  483. + "The above copyright notice and this permission notice shall be included in "
  484. + "all copies or substantial portions of the Software."
  485. + "<br/><br/>"
  486. + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR "
  487. + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, "
  488. + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
  489. + "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "
  490. + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING "
  491. + "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER "
  492. + "DEALINGS IN THE SOFTWARE.</p>";
  493. html += "<h2>libstemmer</h2>"
  494. html += "<p>Copyright (c) 2001, Dr Martin Porter."
  495. + "<br/>All rights reserved."
  496. + "<br/><br/>"
  497. + "Redistribution and use in source and binary forms, with or without modification, "
  498. + "are permitted provided that the following conditions are met:"
  499. + "<br/><br/>"
  500. + " - Redistributions of source code must retain the above copyright notice, "
  501. + " this list of conditions and the following disclaimer."
  502. + "<br/> - Redistributions in binary form must reproduce the above copyright notice, "
  503. + " this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
  504. + "<br/><br/>"
  505. + "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" "
  506. + "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED "
  507. + "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. "
  508. + "IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, "
  509. + "INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT "
  510. + "NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR "
  511. + "PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, "
  512. + "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) "
  513. + "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY "
  514. + "OF SUCH DAMAGE.</p>"
  515. html += "<h2>numeraljs</h2>"
  516. html += "<p>Copyright (c) 2016, Adam Draper."
  517. + "<br/><br/>"
  518. + "Permission is hereby granted, free of charge, to any person "
  519. + "obtaining a copy of this software and associated documentation "
  520. + "files (the \"Software\"), to deal in the Software without "
  521. + "restriction, including without limitation the rights to use, "
  522. + "copy, modify, merge, publish, distribute, sublicense, and/or sell "
  523. + "copies of the Software, and to permit persons to whom the "
  524. + "Software is furnished to do so, subject to the following "
  525. + "conditions:"
  526. + "<br/><br/>"
  527. + " - The above copyright notice and this permission notice shall be "
  528. + "included in all copies or substantial portions of the Software."
  529. + "<br/> - Redistributions in binary form must reproduce the above copyright notice, "
  530. + " this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
  531. + "<br/><br/>"
  532. + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
  533. + "INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR "
  534. + "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE "
  535. + "FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, "
  536. + "ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>"
  537. var palettesDirs = RS.getDirectoryList("palettes");
  538. if (palettesDirs.length>0 && new QFileInfo(palettesDirs[0]).exists()) {
  539. html += "<h2>Color Palette Files</h2>"
  540. html += "<p>Copyright 2016<br/>"
  541. + "dtp studio oldenburg (<a href='https://www.dtpstudio.de'>https://www.dtpstudio.de</a>)<br/>"
  542. + "Grünteweg 31<br/>"
  543. + "D-26127 Oldenburg<br/>"
  544. + "Tel. +49 - (0)441-3001807<br/>"
  545. + "info@dtpstudio.de<br/>"
  546. + "<br/>"
  547. + "Creative Commons Attribution-NoDerivatives 4.0 International Public License (<a href='https://creativecommons.org/licenses/by-nd/4.0/legalcode'>https://creativecommons.org/licenses/by-nd/4.0/legalcode</a>)</p>"
  548. }
  549. var numPlugins = RPluginLoader.countPlugins();
  550. for (var i=0; i<numPlugins; i++) {
  551. var text, url;
  552. var pluginInfo = RPluginLoader.getPluginInfo(i);
  553. var lic = pluginInfo.get("LicenseText", "");
  554. if (lic.length>0) {
  555. html += "<h2>" + qsTr("Plugin:") + " " + new QFileInfo(pluginInfo.get("FileName")).fileName() + "</h2>"
  556. html += "<p>" + lic.replace(/\n/g, "<br/>") + "</p>";
  557. }
  558. }
  559. html += "</body>";
  560. html += "</html>";
  561. textBrowser.setHtml(html);
  562. WidgetFactory.initTextBrowser(textBrowser, QDesktopServices.openUrl);
  563. };