changeset 231:e90dba0cd12a

Implement HTML stuff for about dialog.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 11 Apr 2018 12:38:47 +0300
parents 47dfb9bb004d
children 07d837442c55
files COPYING COPYING.html Makefile.gen src/aboutwindow.ui src/main.cpp src/resources.qrc
diffstat 6 files changed, 88 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/COPYING	Tue Mar 20 14:42:06 2018 +0200
+++ b/COPYING	Wed Apr 11 12:38:47 2018 +0300
@@ -31,3 +31,13 @@
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
+
+
+Qt 5 framework
+==============
+This software ("Syntilista") uses the cross-platform Qt 5 application
+framework, licensed under GNU Lesser General Public License version 3
+(LGPL v3). Please refer to Qt and GNU websites for more information.
+
+https://www.qt.io/
+https://www.gnu.org/licenses/lgpl-3.0.en.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/COPYING.html	Wed Apr 11 12:38:47 2018 +0300
@@ -0,0 +1,45 @@
+<h1>Qt 5 framework</h1>
+<p>
+This software ("Syntilista") uses the cross-platform Qt 5 application
+framework, licensed under GNU Lesser General Public License version 3
+(LGPL v3). Please refer to Qt and GNU websites for more information.
+</p>
+<p>
+<a href="https://www.qt.io/">https://www.qt.io/</a>
+<a
+href="https://www.gnu.org/licenses/lgpl-3.0.en.html">https://www.gnu.org/licenses/lgpl-3.0.en.html</a>
+</p>
+
+<h1>Syntilista license</h1>
+<p>Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+</p>
+
+<ol>
+ <li>Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.</li>
+
+ <li>Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.</li>
+
+ <li>The name of the author may not be used to endorse or promote
+    products derived from this software without specific prior written
+    permission.</li>
+</ol>
+
+<p>
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+</p>
--- a/Makefile.gen	Tue Mar 20 14:42:06 2018 +0200
+++ b/Makefile.gen	Wed Apr 11 12:38:47 2018 +0300
@@ -35,7 +35,7 @@
 LOGO_IMG ?= CafeKampus_logo_FINAL_RGB.png
 ICON_PNGS = icon-64.png icon-48.png icon-32.png icon-16.png
 
-APP_RESOURCES += $(addprefix $(APP_IMG),logo.png $(ICON_PNGS))
+APP_RESOURCES += $(addprefix $(APP_IMG),logo.png $(ICON_PNGS)) COPYING.html
 
 
 # And target lists
--- a/src/aboutwindow.ui	Tue Mar 20 14:42:06 2018 +0200
+++ b/src/aboutwindow.ui	Wed Apr 11 12:38:47 2018 +0300
@@ -23,7 +23,7 @@
       <attribute name="title">
        <string>Tietoja ohjelmasta</string>
       </attribute>
-      <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,5">
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
        <item>
         <widget class="QLabel" name="label_Logo">
          <property name="sizePolicy">
@@ -38,17 +38,25 @@
         </widget>
        </item>
        <item>
-        <widget class="QLabel" name="label_About">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QLabel" name="label_About">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QTextBrowser" name="text_License">
+          </widget>
+         </item>
+        </layout>
        </item>
       </layout>
      </widget>
--- a/src/main.cpp	Tue Mar 20 14:42:06 2018 +0200
+++ b/src/main.cpp	Wed Apr 11 12:38:47 2018 +0300
@@ -1555,11 +1555,6 @@
         "Kehitetty Raahen kaupungin Hanketoiminta ja Kehittäminen -yksikön "
         "alaisuudessa Café Kampuksen käyttöön."
         "</p>"
-        "<p>"
-        "Ohjelma ja sen lähdekoodi ovat uudemman BSD-tyylisen lisenssin alaisia. "
-        "Lue ohjelman mukana tullut tiedosto \"COPYING\" (tai \"COPYING.txt\") "
-        "nähdäksesi täydelliset lisenssiehdot."
-        "</p>"
         "<p>AppDataPath: <a href=\"file:///%3\">%3</a></p>"
         ).
         arg(tr(APP_NAME)).
@@ -1588,6 +1583,17 @@
         "</table>"
         ));
 
+    QFile fh(":/license");
+    if (fh.open(QIODevice::ReadOnly | QIODevice::Text))
+    {
+        QString text = "";
+        while (!fh.atEnd())
+            text += fh.readLine();
+
+        ui->text_License->setHtml(text);
+        fh.close();
+    }
+
     setModal(true);
     setAttribute(Qt::WA_DeleteOnClose);
     show();
--- a/src/resources.qrc	Tue Mar 20 14:42:06 2018 +0200
+++ b/src/resources.qrc	Wed Apr 11 12:38:47 2018 +0300
@@ -2,5 +2,6 @@
   <qresource>
     <file alias="logo">../img/logo.png</file>
     <file alias="icon">../img/icon-64.png</file>
+    <file alias="license">../COPYING.html</file>
   </qresource>
 </RCC>