unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add tipp10 touch typing tutor.
@ 2016-12-18 15:17 Hartmut Goebel
  2016-12-19 21:39 ` Ludovic Courtès
  2016-12-31 14:50 ` Hartmut Goebel
  0 siblings, 2 replies; 7+ messages in thread
From: Hartmut Goebel @ 2016-12-18 15:17 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/education.scm (touch10): New variable.
* gnu/packages/patches/tipp10-FixCompiling.patch,
  gnu/packages/patches/tipp10-RemoveLicenseCode.patch: New files.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                       |   2 +
 gnu/packages/education.scm                         |  56 ++++
 gnu/packages/patches/tipp10-FixCompiling.patch     | 213 +++++++++++++
 .../patches/tipp10-RemoveLicenseCode.patch         | 332 +++++++++++++++++++++
 4 files changed, 603 insertions(+)
 create mode 100644 gnu/packages/patches/tipp10-FixCompiling.patch
 create mode 100644 gnu/packages/patches/tipp10-RemoveLicenseCode.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9dfab4f..37af9b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -892,6 +892,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/texi2html-i18n.patch			\
   %D%/packages/patches/tidy-CVE-2015-5522+5523.patch		\
   %D%/packages/patches/tinyxml-use-stl.patch			\
+  %D%/packages/patches/tipp10-FixCompiling.patch		\
+  %D%/packages/patches/tipp10-RemoveLicenseCode.patch		\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
   %D%/packages/patches/ttfautohint-source-date-epoch.patch	\
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 3a88307..70d1abb 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -138,3 +139,58 @@ of categories with some of the activities available in that category.
 @end enumerate
 ")
     (license license:gpl3+)))
+
+(define-public tipp10
+  (package
+    (name "tipp10")
+    (version "2.1.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://debian/pool/main/"
+                                  "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
+              (sha256
+               (base32
+                "0d387b404j88gsv6kv0rb7wxr23v5g5vl6s5l7602x8pxf7slbbx"))
+              (patches (search-patches "tipp10-FixCompiling.patch"
+                                       "tipp10-RemoveLicenseCode.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; packages has no tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-new-version-check
+          (lambda _
+            ;; Make new version check to default to false.
+            ;; TODO: Remove the checkbox from the dialog and the check itself
+            (substitute* '("widget/settingspages.cpp" "widget/mainwindow.cpp")
+              (("settings.value(\"check_new_version\", true)")
+               "settings.value(\"check_new_version\", false)"))))
+         (replace 'configure
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              ;; Make program honor $PREFIX
+              (substitute* "tipp10.pro"
+                (("\\.path = /usr/") (string-append ".path = " out "/")))
+              (substitute* "def/defines.h"
+                (("\"/usr/") (string-append "\"" out "/")))
+              ;; Recreate Makefile
+              (zero? (system* "qmake"))))))))
+    (inputs
+     `(("qt4" ,qt-4)
+       ("sqlite" ,sqlite)))
+    (home-page "https://www.tipp10.com/")
+    (synopsis "Touch typing tutor")
+    (description " TIPP10 is a free touch typing tutor for Windows, Mac OS and
+Linux.  The ingenious thing about the software is its intelligence feature.
+Characters that are mistyped are repeated more frequently.  Beginners will
+find their way around right away so they can start practicing without a hitch.
+
+Useful support functions and an extensive progress tracker, topical lessons
+and the ability to create your own practice lessons make learning to type
+easy.
+
+Note: To change the language settings choose Datei (File) →
+Grundeinstellungen (Generell Settings) → Sprache (Language) and change from
+Deutsch to English. The you have restart the program to have the change take
+effect.")
+    (license license:gpl2)))
diff --git a/gnu/packages/patches/tipp10-FixCompiling.patch b/gnu/packages/patches/tipp10-FixCompiling.patch
new file mode 100644
index 0000000..4c206d4
--- /dev/null
+++ b/gnu/packages/patches/tipp10-FixCompiling.patch
@@ -0,0 +1,213 @@
+Description: Debian patches to make tipp10 compile
+Author: Christoph Martin <chrism@debian.org>
+Last-Update: 2016-07-20
+
+https://sources.debian.net/data/main/t/tipp10/2.1.0-2/debian/patches/0001-FixCompiling
+
+--- a/widget/tickerboard.cpp
++++ b/widget/tickerboard.cpp
+@@ -97,7 +97,8 @@ void TickerBoard::startTicker(bool wasPa
+ 
+ 		if (tickerSpeed == 50) {
+ 			scrollOffset = 290;
+-			scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++			const QRect qr = QRect(10, 15, 590, 35);
++			scroll(-290, 0, qr); //contentsRect());
+ 		}
+ 
+ 		startFlag = true;
+@@ -153,7 +154,8 @@ void TickerBoard::changeChar() {
+ 			scrollOffset = 0;
+ 		} else {
+ 			scrollOffset = 290;
+-			scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++			const QRect qr = QRect(10, 15, 590, 35);
++			scroll(-290, 0, qr); //contentsRect());
+ 		}
+ 		splitLesson();
+ 	}
+@@ -242,7 +244,8 @@ void TickerBoard::progress() {
+ 
+ 				// Move ticker 1 pixel to left
+ 				scrollOffset++;
+-				scroll(-1, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-1, 0, qr); //contentsRect());
+ 
+ 				if ((lessonOffset - scrollOffset) <= 30) {
+ 					setSpeed(tickerSpeed);
+@@ -265,14 +268,16 @@ void TickerBoard::progress() {
+ 			// 160 pixels overage (because the user must see at least the next word)
+ 			if ((lessonOffset - scrollOffset) > 200) {
+ 				scrollOffset += (lessonOffset - scrollOffset) - 200;
+-				scroll(-((lessonOffset - scrollOffset) - 200), 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-((lessonOffset - scrollOffset) - 200), 0, qr); //contentsRect());
+ 			}
+ 		} else {
+ 			// If the user types faster than the ticker, move ticker faster after
+ 			// 160 pixels overage (because the user must see at least the next word)
+ 			if ((lessonOffset - scrollOffset) > 280) {
+ 				scrollOffset += 570;
+-				scroll(-570, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-570, 0, qr); //contentsRect());
+ 			}
+ 
+ 		}
+--- a/widget/settingspages.cpp
++++ b/widget/settingspages.cpp
+@@ -501,7 +501,7 @@ void DatabasePage::writeSettings() {
+ 	QSettings settings;
+ 	#endif
+ 	settings.beginGroup("database");
+-	settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString::QString(APP_USER_DB));
++	settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString(APP_USER_DB));
+ 	settings.endGroup();
+ }
+ 
+--- a/widget/lessondialog.cpp
++++ b/widget/lessondialog.cpp
+@@ -89,7 +89,7 @@ void LessonDialog::updateContent() {
+ 			*lessonData = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
+ 			// Delete empty lines
+ 			for (int i = 0; i < lessonData->size(); i++) {
+-				if (QString::QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
++				if (QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
+ 					lessonData->removeAt(i);
+ 				}
+ 			}
+@@ -259,7 +259,7 @@ void LessonDialog::clickSave() {
+ 	contentList = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
+ 	// Delete empty lines
+ 	for (i = 0; i < contentList.size(); i++) {
+-		if (QString::QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
++		if (QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
+ 			contentList.removeAt(i);
+ 		}
+ 	}
+--- a/sql/chartablesql.cpp
++++ b/sql/chartablesql.cpp
+@@ -57,7 +57,7 @@ QVariant CharSqlModel::data(const QModel
+ 			// Read the unicode value
+ 			unicode = value.toInt();
+ 			// Convert unicode to a char
+-			unicodeToChar = QString::QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
++			unicodeToChar = QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
+ 			return unicodeToChar;
+ 		} else {
+ 			// Last column (error weight)
+--- a/sql/startsql.cpp
++++ b/sql/startsql.cpp
+@@ -344,7 +344,7 @@ bool StartSql::updateOwnLesson(QString l
+ 		for (i = 0; i < content.size(); i++) {
+ 			//simplifiedContent = QString::QString(
+ 			//	content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive).simplified();
+-			simplifiedContent = trim(QString::QString(
++			simplifiedContent = trim(QString(
+ 				content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive));
+ 
+ 			if (!query.exec("INSERT INTO own_content VALUES(NULL,'" +
+--- a/def/defines.h
++++ b/def/defines.h
+@@ -27,9 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #define DEFINES_H
+ 
+ // OS constants
+-#define APP_WIN						true
++#define APP_WIN						false
+ #define APP_MAC						false
+-#define APP_X11						false
++#define APP_X11						true
+ #define APP_PORTABLE				false //at least one of the 3 OS must be true too!
+ 
+ // Languages
+@@ -47,6 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #define APP_URL 					"http://www.tipp10.com"
+ #define APP_DB 						"tipp10v2.template"
+ #define APP_USER_DB					"tipp10v2.db"
++#define APP_SHARE_DIR					"/usr/share/tipp10"
+ 
+ // Update constants
+ #define UPDATE_URL 					"www.tipp10.com"
+--- a/tipp10.pro
++++ b/tipp10.pro
+@@ -88,3 +88,15 @@ SOURCES         += 	main.cpp \
+                     sql/startsql.cpp \
+                     games/abcrainwidget.cpp \
+                     games/charball.cpp
++
++target.path = /usr/bin/
++INSTALLS += target
++share.path = /usr/share/tipp10/
++share.files = release/* *wav
++INSTALLS += share
++desktop.path = /usr/share/applications/
++desktop.files = tipp10.desktop
++INSTALLS += desktop
++pixmap.path = /usr/share/pixmaps/
++pixmap.files = tipp10.png
++INSTALLS += pixmap
+--- a/sql/connection.h
++++ b/sql/connection.h
+@@ -179,11 +179,13 @@ static bool createConnection() {
+ 				CANCEL_NO, "Betroffener Pfad:\n" + dbPath);*/
+ 			// Try to create new databae in user path
+ 			// Exist a database in the program dir?
+-			if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
++			// if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
++		  	if (QFile::exists(QString(APP_SHARE_DIR) + "/" + dbNameTemplate)) {
+ 			//if (QFile::exists(":/" + dbNameTemplate)) {
+ 				// A database exist in the program dir
+ 				// -> copy database to user home dir
+-				QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
++				// QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
++			  	QFile file(QString(APP_SHARE_DIR) + "/" + dbNameTemplate);
+ 				//QFile file(":/" + dbNameTemplate);
+ 				if (file.copy(dbPath)) {
+ 					QFile::setPermissions(dbPath, QFile::permissions(dbPath) | QFile::WriteUser);
+@@ -229,7 +231,8 @@ static bool createConnection() {
+ 		// Exist a database in user's home dir?
+ 		if (!QFile::exists(dbPath)) {
+ 			// Exist a database template in the program dir?
+-			dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
++			// dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
++		  	dbPath = QString(APP_SHARE_DIR) + "/" + dbNameTemplate;
+ 			//dbPath = ":/" + dbNameTemplate;
+ 			if (QFile::exists(dbPath)) {
+ 				// A database template exist in the program dir
+--- a/widget/helpbrowser.cpp
++++ b/widget/helpbrowser.cpp
+@@ -52,13 +52,15 @@ HelpBrowser::HelpBrowser(QString link, Q
+     textBrowser->setOpenExternalLinks(true);
+ 	
+     textBrowser->setSource(QString("file:///") + 
+-    	QCoreApplication::applicationDirPath() + 
++	// QCoreApplication::applicationDirPath() + 
++    	APP_SHARE_DIR + 
+     	QString("/help/") + language + QString("/index.html"));
+     	
+     if (link != "") {
+     
+ 		textBrowser->setSource(QString("file:///") + 
+-			QCoreApplication::applicationDirPath() + 
++			// QCoreApplication::applicationDirPath() + 
++			APP_SHARE_DIR + 
+ 			QString("/help/") + language + QString("/content/") + link);
+ 			
+ 	}
+--- a/tipp10.desktop
++++ b/tipp10.desktop
+@@ -1,10 +1,10 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ Name=TIPP10
+ Comment=Touch Typing Tutor
+ Comment[de]=10-Finger-Schreibtrainer
+-Exec=tipp10
++Exec=/usr/bin/tipp10
+ Icon=tipp10.png
+ Terminal=false
+ Type=Application
+ Categories=Education;
++Keywords=learning;touchtyping
diff --git a/gnu/packages/patches/tipp10-RemoveLicenseCode.patch b/gnu/packages/patches/tipp10-RemoveLicenseCode.patch
new file mode 100644
index 0000000..4b7487e
--- /dev/null
+++ b/gnu/packages/patches/tipp10-RemoveLicenseCode.patch
@@ -0,0 +1,332 @@
+Description: Remove license dialog and license key checking
+
+https://sources.debian.net/data/main/t/tipp10/2.1.0-2/debian/patches/0002-RemoveLicenseCode
+
+--- a/main.cpp
++++ b/main.cpp
+@@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #include "def/defines.h"
+ #include "sql/connection.h"
+ #include "widget/mainwindow.h"
+-#include "widget/licensedialog.h"
+ #include "widget/illustrationdialog.h"
+ 
+ int main(int argc, char *argv[]) {
+@@ -59,7 +58,7 @@ int main(int argc, char *argv[]) {
+ 	QSettings settings;
+ 	#endif
+ 
+-	// Read/write language, license key and show illustration flag
++	// Read/write language and show illustration flag
+ 	settings.beginGroup("general");
+ 	QString languageGui = settings.value("language_gui",
+ 		QLocale::system().name()).toString();
+@@ -101,7 +100,6 @@ int main(int argc, char *argv[]) {
+ 	QString languageLesson = settings.value("language_lesson",
+ 		"").toString();
+ 
+-	QString licenseKey = settings.value("licensekey", "").toString();
+ 	bool showIllustration = settings.value("check_illustration", true).toBool();
+ 	bool useNativeStyle = settings.value("check_native_style", false).toBool();
+ 	settings.endGroup();
+--- a/tipp10.pro
++++ b/tipp10.pro
+@@ -43,7 +43,6 @@ HEADERS         += 	def/defines.h \
+                     widget/helpbrowser.h \
+                     widget/companylogo.h \
+                     widget/errormessage.h \
+-                    widget/licensedialog.h \
+                     widget/txtmessagedialog.h \
+                     widget/checkversion.h \
+                     sql/connection.h \
+@@ -78,7 +77,6 @@ SOURCES         += 	main.cpp \
+                     widget/helpbrowser.cpp \
+                     widget/companylogo.cpp \
+                     widget/errormessage.cpp \
+-                    widget/licensedialog.cpp \
+                     widget/txtmessagedialog.cpp \
+                     widget/checkversion.cpp \
+                     sql/lessontablesql.cpp \
+--- a/widget/licensedialog.cpp
++++ /dev/null
+@@ -1,168 +0,0 @@
+-/*
+-Copyright (c) 2006-2009, Tom Thielicke IT Solutions
+-
+-This program is free software; you can redistribute it and/or
+-modify it under the terms of the GNU General Public License
+-as published by the Free Software Foundation; either version 2
+-of the License.
+-
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-GNU General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301, USA.
+-*/
+-
+-/****************************************************************
+-**
+-** Implementation of the LicenseDialog class
+-** File name: licensedialog.cpp
+-**
+-****************************************************************/
+-
+-#include <QHBoxLayout>
+-#include <QVBoxLayout>
+-#include <QMessageBox>
+-#include <QSettings>
+-#include <QCoreApplication>
+-
+-#include "licensedialog.h"
+-#include "def/defines.h"
+-
+-LicenseDialog::LicenseDialog(QWidget *parent) : QDialog(parent) {
+-
+-	setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
+-
+-	setWindowTitle(tr("Lizenznummer"));
+-	setWindowIcon(QIcon(":/img/" + QString(ICON_FILENAME)));
+-
+-	// Create texbox
+-    createLineEdit();
+-
+-	// Create buttons
+-    createButtons();
+-
+-	// Set the layout of all widgets created above
+-	createLayout();
+-
+-	lineLicensing->setFocus();
+-}
+-
+-void LicenseDialog::createButtons() {
+-	//Buttons
+-	buttonOk = new QPushButton(this);
+-	buttonDemo = new QPushButton(this);
+-
+-	buttonOk->setText(tr("&Ok"));
+-	buttonDemo->setText(tr("&Demo starten"));
+-	buttonDemo->setToolTip(tr("Im Demo-Modus koennen pro Lektion nur\n"
+-		"10 Schriftzeichen eingegeben werden"));
+-
+-	buttonOk->setDefault(true);
+-	// Widget connections
+-    connect(buttonOk, SIGNAL(clicked()), this, SLOT(clickOk()));
+-    connect(buttonDemo, SIGNAL(clicked()), this, SLOT(clickDemo()));
+-}
+-
+-void LicenseDialog::createLineEdit() {
+-
+-	lineLicensing = new QLineEdit();
+-	lineLicensing->setInputMask(">NNNNNNNNNNNNNN");
+-
+-	labelLicensing = new QLabel(tr("Bitte geben Sie Ihre Lizenznummer "
+-		"(ohne Leerzeichen) ein, "
+-		"die Sie im Arbeitsbuch (Schulbuch) auf Seite 3 finden:"));
+-
+-	labelLicensing->setWordWrap(true);
+-}
+-
+-void LicenseDialog::createLayout() {
+-	// Button layout horizontal
+-	QHBoxLayout *buttonLayoutHorizontal = new QHBoxLayout;
+-    buttonLayoutHorizontal->addStretch(1);
+-    buttonLayoutHorizontal->addWidget(buttonDemo);
+-    buttonLayoutHorizontal->addWidget(buttonOk);
+-	// Full layout of all widgets vertical
+-	QVBoxLayout *mainLayout = new QVBoxLayout;
+-    mainLayout->addSpacing(1);
+-    mainLayout->addWidget(labelLicensing);
+-    mainLayout->addSpacing(1);
+-    mainLayout->addWidget(lineLicensing);
+-    mainLayout->addSpacing(1);
+-    mainLayout->addLayout(buttonLayoutHorizontal);
+-    mainLayout->setMargin(15);
+-    mainLayout->setSpacing(15);
+-    // Pass layout to parent widget (this)
+-	this->setLayout(mainLayout);
+-}
+-
+-void LicenseDialog::clickOk() {
+-
+-	// Check license key
+-	if (!checkLicenseKey(lineLicensing->text())) {
+-
+-		// License key is wrong
+-
+-		// Message to the user
+-		QMessageBox::information(0, APP_NAME,
+-			tr("Die eingegebene Lizenznummer ist leider nicht "
+-			"korrekt.\nBitte ueberpruefen Sie die Schreibweise."));
+-
+-		lineLicensing->setFocus();
+-
+-	} else {
+-
+-		// License key is ok
+-		writeSettings();
+-		accept();
+-	}
+-}
+-
+-void LicenseDialog::clickDemo() {
+-	accept();
+-}
+-
+-bool LicenseDialog::checkLicenseKey(QString licenseKey) {
+-	if (licenseKey.size() == 14 &&
+-		licenseKey[0].isLetter() &&
+-		licenseKey[1].isLetter() &&
+-		(licenseKey.mid(2, 2) == "39" ||
+-		licenseKey.mid(2, 2) == "41" ||
+-		licenseKey.mid(2, 2) == "43" ||
+-		licenseKey.mid(2, 2) == "49" ||
+-		licenseKey.mid(2, 2) == "99") &&
+-		licenseKey[4].isDigit() &&
+-		licenseKey[5].isDigit() &&
+-		licenseKey[6].isDigit() &&
+-		licenseKey[7].isLetter() &&
+-		licenseKey[8].isDigit() &&
+-		licenseKey[9].isDigit() &&
+-		licenseKey[10].isDigit() &&
+-		licenseKey[11].isDigit() &&
+-		licenseKey[12].isLetter() &&
+-		licenseKey[13].isLetter()) {
+-
+-		return true;
+-	}
+-	return false;
+-}
+-
+-void LicenseDialog::writeSettings() {
+-	// Saves settings of the startwiget
+-	// (uses the default constructor of QSettings, passing
+-	// the application and company name see main function)
+-	#if APP_PORTABLE
+-	QSettings settings(QCoreApplication::applicationDirPath() +
+-    	"/portable/settings.ini", QSettings::IniFormat);
+-    #else
+-	QSettings settings;
+-	#endif
+-
+-	settings.beginGroup("general");
+-	settings.setValue("licensekey", lineLicensing->text());
+-	settings.endGroup();
+-}
+--- a/widget/licensedialog.h
++++ /dev/null
+@@ -1,85 +0,0 @@
+-/*
+-Copyright (c) 2006-2009, Tom Thielicke IT Solutions
+-
+-This program is free software; you can redistribute it and/or
+-modify it under the terms of the GNU General Public License
+-as published by the Free Software Foundation; either version 2
+-of the License.
+-
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-GNU General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301, USA.
+-*/
+-
+-/****************************************************************
+-**
+-** Definition of the LicenseDialog class
+-** File name: licensedialog.h
+-**
+-****************************************************************/
+-
+-#ifndef LICENSEDIALOG_H
+-#define LICENSEDIALOG_H
+-
+-#include <QDialog>
+-#include <QWidget>
+-#include <QPushButton>
+-#include <QLabel>
+-#include <QLineEdit>
+-#include <QString>
+-
+-//! The LicenseDialog class provides a license input widget.
+-/*!
+-	The LicenseDialog class shows a dialog to enter a license key.
+-
+-	@author Tom Thielicke, s712715
+-	@version 0.0.1
+-	@date 09.09.2008
+-*/
+-class LicenseDialog : public QDialog {
+-	Q_OBJECT
+-
+-	public:
+-
+-		//! Constructor, creates two table objects and provide it in two tabs.
+-		LicenseDialog(QWidget *parent = 0);
+-
+-		bool checkLicenseKey(QString licenseKey);
+-
+-	public slots:
+-
+-	private slots:
+-
+-		//! Start button pressed
+-		void clickOk();
+-
+-		//! Demo button pressed
+-		void clickDemo();
+-
+-	private:
+-
+-		//! Creates a cancel and a ok button.
+-		void createButtons();
+-
+-		//! Creates a textbox.
+-		void createLineEdit();
+-
+-		//! Creates the layout of the complete class.
+-		void createLayout();
+-
+-		//! Writes user settings
+-		void writeSettings();
+-
+-		QPushButton *buttonOk;
+-		QPushButton *buttonDemo;
+-		QLabel *labelLicensing;
+-		QLineEdit *lineLicensing;
+-};
+-
+-#endif //LICENSEDIALOG_H
+--- a/widget/mainwindow.cpp
++++ b/widget/mainwindow.cpp
+@@ -116,11 +116,6 @@ void MainWindow::closeEvent(QCloseEvent
+ 	}
+ }
+ 
+-bool MainWindow::checkLicenseKey(QString licenseKey) {
+-
+-    return false;
+-}
+-
+ void MainWindow::createMenu() {
+ 	//Mac-Version:
+ 	//-----------
+--- a/widget/mainwindow.h
++++ b/widget/mainwindow.h
+@@ -39,7 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #include "trainingwidget.h"
+ #include "evaluationwidget.h"
+ #include "illustrationdialog.h"
+-#include "licensedialog.h"
+ #include "games/abcrainwidget.h"
+ #include "helpbrowser.h"
+ 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add tipp10 touch typing tutor.
  2016-12-18 15:17 [PATCH] gnu: Add tipp10 touch typing tutor Hartmut Goebel
@ 2016-12-19 21:39 ` Ludovic Courtès
  2016-12-31 14:36   ` Hartmut Goebel
  2016-12-31 14:50 ` Hartmut Goebel
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2016-12-19 21:39 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hi!

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * gnu/packages/education.scm (touch10): New variable.
> * gnu/packages/patches/tipp10-FixCompiling.patch,
>   gnu/packages/patches/tipp10-RemoveLicenseCode.patch: New files.
> * gnu/local.mk (dist_patch_DATA): Register them.

[...]

> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://debian/pool/main/"
> +                                  "t/tipp10/tipp10_2.1.0.orig.tar.gz"))

Is there really no upstream for this program?  tipp10.com seems to be
live, no?

> +              (patches (search-patches "tipp10-FixCompiling.patch"
> +                                       "tipp10-RemoveLicenseCode.patch"))))

Please use lowercase and hyphens for file names.  :-)

> +    (home-page "https://www.tipp10.com/")
> +    (synopsis "Touch typing tutor")
> +    (description " TIPP10 is a free touch typing tutor for Windows, Mac OS and
                     ^
Extra space.

Please don’t mention supported operating systems; what matters is that
it works on GNU.

> +Linux.  The ingenious thing about the software is its intelligence feature.

“Intelligence feature” sounds vague; could it be rephrased in more
precise terms?

> +Note: To change the language settings choose Datei (File) →
> +Grundeinstellungen (Generell Settings) → Sprache (Language) and change from
> +Deutsch to English. The you have restart the program to have the change take
> +effect.")

This information doesn’t belong here.

Does Debian have patches to make this program honor the current locale?
That would be the best option.

> +    (license license:gpl2)))

Version 2 only?

> +--- a/tipp10.desktop
> ++++ b/tipp10.desktop
> +@@ -1,10 +1,10 @@
> + [Desktop Entry]
> +-Encoding=UTF-8
> + Name=TIPP10
> + Comment=Touch Typing Tutor
> + Comment[de]=10-Finger-Schreibtrainer
> +-Exec=tipp10
> ++Exec=/usr/bin/tipp10

This doesn’t look useful.

Could you send an updated version?

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add tipp10 touch typing tutor.
  2016-12-19 21:39 ` Ludovic Courtès
@ 2016-12-31 14:36   ` Hartmut Goebel
  2017-01-05 10:55     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Hartmut Goebel @ 2016-12-31 14:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Am 19.12.2016 um 22:39 schrieb Ludovic Courtès:
>
>> +              (uri (string-append "mirror://debian/pool/main/"
>> +                                  "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
> Is there really no upstream for this program?  tipp10.com seems to be
> live, no?

There is, but guix is not able to handle the download URL, which is
<https://www.tipp10.com/en/download/getfile/3/> or
<https://www.tipp10.com/en/download/getfile/3/1483193655/>.This page
uses  "<meta http-equiv="refresh"
content="1;url=/en/download/getfile/3/1483193955/" />". I asked the
author for a different URL, but he did not answer.


>
>> +              (patches (search-patches "tipp10-FixCompiling.patch"
>> +                                       "tipp10-RemoveLicenseCode.patch"))))
> Please use lowercase and hyphens for file names.  :-)

Anything else unimportant I can waste my time on? These are the
file-names of the patches at debian. I see absolutely no benefit in
changing them.


>
>> +    (description " TIPP10 is a free touch typing tutor for Windows, Mac OS and
>                      ^
> Extra space.
>
> Please don’t mention supported operating systems; what matters is that
> it works on GNU.

IMO this is interesting for users and for spreading free software. If
one reads this i might think: "O, coll, I can recommend this to some
friend still using Windooze and ma convince her about free software."

>
>> +Linux.  The ingenious thing about the software is its intelligence feature.
> “Intelligence feature” sounds vague; could it be rephrased in more
> precise terms?
>
>> +Note: To change the language settings choose Datei (File) →
>> +Grundeinstellungen (Generell Settings) → Sprache (Language) and change from
>> +Deutsch to English. The you have restart the program to have the change take
>> +effect.")
> This information doesn’t belong here.
>
> Does Debian have patches to make this program honor the current locale?
> That would be the best option.

No, there are not patches, this is why I put this information there. If
ou dislike, please recommend a better place.

>
>> +    (license license:gpl2)))
> Version 2 only?

This is what https://www.tipp10.com/en/download/ says.

>
>> +-Exec=tipp10
>> ++Exec=/usr/bin/tipp10
> This doesn’t look useful.

Yes, but this is part of the original Debian patch. I'd prefer to keep
this patch unchanged to make it easier to follow any changes or fixes
Debian incorporates. Since guix is fixing this path anyway, there is no
use in maintaining a own set of patches.

To be frank, some of your comment on this patch are nitpicking at its
best. I have the impression that you did not trust me to have spend only
a little thought on what I'm doing. And you are demanding things (patch
filenames, change to upstream patches) which have no or negligible
benefit – even if seen in the long run. This *very* discouraging!

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] gnu: Add tipp10 touch typing tutor.
  2016-12-18 15:17 [PATCH] gnu: Add tipp10 touch typing tutor Hartmut Goebel
  2016-12-19 21:39 ` Ludovic Courtès
@ 2016-12-31 14:50 ` Hartmut Goebel
  2017-01-05 10:56   ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: Hartmut Goebel @ 2016-12-31 14:50 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/education.scm (touch10): New variable.
* gnu/packages/patches/tipp10-fix-compiling.patch,
  gnu/packages/patches/tipp10-remove-license-code.patch: New files.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                       |   2 +
 gnu/packages/education.scm                         |  58 ++++
 gnu/packages/patches/tipp10-fix-compiling.patch    | 213 +++++++++++++
 .../patches/tipp10-remove-license-code.patch       | 332 +++++++++++++++++++++
 4 files changed, 605 insertions(+)
 create mode 100644 gnu/packages/patches/tipp10-fix-compiling.patch
 create mode 100644 gnu/packages/patches/tipp10-remove-license-code.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b7c182f..ee2014e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -873,6 +873,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/texi2html-i18n.patch			\
   %D%/packages/patches/tidy-CVE-2015-5522+5523.patch		\
   %D%/packages/patches/tinyxml-use-stl.patch			\
+  %D%/packages/patches/tipp10-fix-compiling.patch		\
+  %D%/packages/patches/tipp10-remove-license-code.patch		\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
   %D%/packages/patches/ttfautohint-source-date-epoch.patch	\
diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 3a88307..43e73a0 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -138,3 +139,60 @@ of categories with some of the activities available in that category.
 @end enumerate
 ")
     (license license:gpl3+)))
+
+(define-public tipp10
+  (package
+    (name "tipp10")
+    (version "2.1.0")
+    (source (origin
+              (method url-fetch)
+              ;; guix download is not able to handle the download links on the
+              ;; home-page, which use '<meta http-equiv="refresh" …>'
+              (uri (string-append "mirror://debian/pool/main/"
+                                  "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
+              (sha256
+               (base32
+                "0d387b404j88gsv6kv0rb7wxr23v5g5vl6s5l7602x8pxf7slbbx"))
+              (patches (search-patches "tipp10-fix-compiling.patch"
+                                       "tipp10-remove-license-code.patch"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; packages has no tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-new-version-check
+          (lambda _
+            ;; Make new version check to default to false.
+            ;; TODO: Remove the checkbox from the dialog and the check itself
+            (substitute* '("widget/settingspages.cpp" "widget/mainwindow.cpp")
+              (("settings.value(\"check_new_version\", true)")
+               "settings.value(\"check_new_version\", false)"))))
+         (replace 'configure
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              ;; Make program honor $PREFIX
+              (substitute* "tipp10.pro"
+                (("\\.path = /usr/") (string-append ".path = " out "/")))
+              (substitute* "def/defines.h"
+                (("\"/usr/") (string-append "\"" out "/")))
+              ;; Recreate Makefile
+              (zero? (system* "qmake"))))))))
+    (inputs
+     `(("qt4" ,qt-4)
+       ("sqlite" ,sqlite)))
+    (home-page "https://www.tipp10.com/")
+    (synopsis "Touch typing tutor")
+    (description "Tipp10 is a touch typing tutor for Windows, Mac OS and
+Linux.  The ingenious thing about the software is its intelligence feature:
+Characters that are mistyped are repeated more frequently.  Beginners will
+find their way around right away so they can start practicing without a hitch.
+
+Useful support functions and an extensive progress tracker, topical lessons
+and the ability to create your own practice lessons make learning to type
+easy.
+
+Note: To change the language settings choose Datei (File) →
+Grundeinstellungen (Generell Settings) → Sprache (Language) and change from
+Deutsch to English. The you have restart the program to have the change take
+effect.")
+    (license license:gpl2)))
diff --git a/gnu/packages/patches/tipp10-fix-compiling.patch b/gnu/packages/patches/tipp10-fix-compiling.patch
new file mode 100644
index 0000000..4c206d4
--- /dev/null
+++ b/gnu/packages/patches/tipp10-fix-compiling.patch
@@ -0,0 +1,213 @@
+Description: Debian patches to make tipp10 compile
+Author: Christoph Martin <chrism@debian.org>
+Last-Update: 2016-07-20
+
+https://sources.debian.net/data/main/t/tipp10/2.1.0-2/debian/patches/0001-FixCompiling
+
+--- a/widget/tickerboard.cpp
++++ b/widget/tickerboard.cpp
+@@ -97,7 +97,8 @@ void TickerBoard::startTicker(bool wasPa
+ 
+ 		if (tickerSpeed == 50) {
+ 			scrollOffset = 290;
+-			scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++			const QRect qr = QRect(10, 15, 590, 35);
++			scroll(-290, 0, qr); //contentsRect());
+ 		}
+ 
+ 		startFlag = true;
+@@ -153,7 +154,8 @@ void TickerBoard::changeChar() {
+ 			scrollOffset = 0;
+ 		} else {
+ 			scrollOffset = 290;
+-			scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++			const QRect qr = QRect(10, 15, 590, 35);
++			scroll(-290, 0, qr); //contentsRect());
+ 		}
+ 		splitLesson();
+ 	}
+@@ -242,7 +244,8 @@ void TickerBoard::progress() {
+ 
+ 				// Move ticker 1 pixel to left
+ 				scrollOffset++;
+-				scroll(-1, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-1, 0, qr); //contentsRect());
+ 
+ 				if ((lessonOffset - scrollOffset) <= 30) {
+ 					setSpeed(tickerSpeed);
+@@ -265,14 +268,16 @@ void TickerBoard::progress() {
+ 			// 160 pixels overage (because the user must see at least the next word)
+ 			if ((lessonOffset - scrollOffset) > 200) {
+ 				scrollOffset += (lessonOffset - scrollOffset) - 200;
+-				scroll(-((lessonOffset - scrollOffset) - 200), 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-((lessonOffset - scrollOffset) - 200), 0, qr); //contentsRect());
+ 			}
+ 		} else {
+ 			// If the user types faster than the ticker, move ticker faster after
+ 			// 160 pixels overage (because the user must see at least the next word)
+ 			if ((lessonOffset - scrollOffset) > 280) {
+ 				scrollOffset += 570;
+-				scroll(-570, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
++				const QRect qr = QRect(10, 15, 590, 35);
++				scroll(-570, 0, qr); //contentsRect());
+ 			}
+ 
+ 		}
+--- a/widget/settingspages.cpp
++++ b/widget/settingspages.cpp
+@@ -501,7 +501,7 @@ void DatabasePage::writeSettings() {
+ 	QSettings settings;
+ 	#endif
+ 	settings.beginGroup("database");
+-	settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString::QString(APP_USER_DB));
++	settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString(APP_USER_DB));
+ 	settings.endGroup();
+ }
+ 
+--- a/widget/lessondialog.cpp
++++ b/widget/lessondialog.cpp
+@@ -89,7 +89,7 @@ void LessonDialog::updateContent() {
+ 			*lessonData = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
+ 			// Delete empty lines
+ 			for (int i = 0; i < lessonData->size(); i++) {
+-				if (QString::QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
++				if (QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
+ 					lessonData->removeAt(i);
+ 				}
+ 			}
+@@ -259,7 +259,7 @@ void LessonDialog::clickSave() {
+ 	contentList = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
+ 	// Delete empty lines
+ 	for (i = 0; i < contentList.size(); i++) {
+-		if (QString::QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
++		if (QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
+ 			contentList.removeAt(i);
+ 		}
+ 	}
+--- a/sql/chartablesql.cpp
++++ b/sql/chartablesql.cpp
+@@ -57,7 +57,7 @@ QVariant CharSqlModel::data(const QModel
+ 			// Read the unicode value
+ 			unicode = value.toInt();
+ 			// Convert unicode to a char
+-			unicodeToChar = QString::QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
++			unicodeToChar = QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
+ 			return unicodeToChar;
+ 		} else {
+ 			// Last column (error weight)
+--- a/sql/startsql.cpp
++++ b/sql/startsql.cpp
+@@ -344,7 +344,7 @@ bool StartSql::updateOwnLesson(QString l
+ 		for (i = 0; i < content.size(); i++) {
+ 			//simplifiedContent = QString::QString(
+ 			//	content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive).simplified();
+-			simplifiedContent = trim(QString::QString(
++			simplifiedContent = trim(QString(
+ 				content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive));
+ 
+ 			if (!query.exec("INSERT INTO own_content VALUES(NULL,'" +
+--- a/def/defines.h
++++ b/def/defines.h
+@@ -27,9 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #define DEFINES_H
+ 
+ // OS constants
+-#define APP_WIN						true
++#define APP_WIN						false
+ #define APP_MAC						false
+-#define APP_X11						false
++#define APP_X11						true
+ #define APP_PORTABLE				false //at least one of the 3 OS must be true too!
+ 
+ // Languages
+@@ -47,6 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #define APP_URL 					"http://www.tipp10.com"
+ #define APP_DB 						"tipp10v2.template"
+ #define APP_USER_DB					"tipp10v2.db"
++#define APP_SHARE_DIR					"/usr/share/tipp10"
+ 
+ // Update constants
+ #define UPDATE_URL 					"www.tipp10.com"
+--- a/tipp10.pro
++++ b/tipp10.pro
+@@ -88,3 +88,15 @@ SOURCES         += 	main.cpp \
+                     sql/startsql.cpp \
+                     games/abcrainwidget.cpp \
+                     games/charball.cpp
++
++target.path = /usr/bin/
++INSTALLS += target
++share.path = /usr/share/tipp10/
++share.files = release/* *wav
++INSTALLS += share
++desktop.path = /usr/share/applications/
++desktop.files = tipp10.desktop
++INSTALLS += desktop
++pixmap.path = /usr/share/pixmaps/
++pixmap.files = tipp10.png
++INSTALLS += pixmap
+--- a/sql/connection.h
++++ b/sql/connection.h
+@@ -179,11 +179,13 @@ static bool createConnection() {
+ 				CANCEL_NO, "Betroffener Pfad:\n" + dbPath);*/
+ 			// Try to create new databae in user path
+ 			// Exist a database in the program dir?
+-			if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
++			// if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
++		  	if (QFile::exists(QString(APP_SHARE_DIR) + "/" + dbNameTemplate)) {
+ 			//if (QFile::exists(":/" + dbNameTemplate)) {
+ 				// A database exist in the program dir
+ 				// -> copy database to user home dir
+-				QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
++				// QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
++			  	QFile file(QString(APP_SHARE_DIR) + "/" + dbNameTemplate);
+ 				//QFile file(":/" + dbNameTemplate);
+ 				if (file.copy(dbPath)) {
+ 					QFile::setPermissions(dbPath, QFile::permissions(dbPath) | QFile::WriteUser);
+@@ -229,7 +231,8 @@ static bool createConnection() {
+ 		// Exist a database in user's home dir?
+ 		if (!QFile::exists(dbPath)) {
+ 			// Exist a database template in the program dir?
+-			dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
++			// dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
++		  	dbPath = QString(APP_SHARE_DIR) + "/" + dbNameTemplate;
+ 			//dbPath = ":/" + dbNameTemplate;
+ 			if (QFile::exists(dbPath)) {
+ 				// A database template exist in the program dir
+--- a/widget/helpbrowser.cpp
++++ b/widget/helpbrowser.cpp
+@@ -52,13 +52,15 @@ HelpBrowser::HelpBrowser(QString link, Q
+     textBrowser->setOpenExternalLinks(true);
+ 	
+     textBrowser->setSource(QString("file:///") + 
+-    	QCoreApplication::applicationDirPath() + 
++	// QCoreApplication::applicationDirPath() + 
++    	APP_SHARE_DIR + 
+     	QString("/help/") + language + QString("/index.html"));
+     	
+     if (link != "") {
+     
+ 		textBrowser->setSource(QString("file:///") + 
+-			QCoreApplication::applicationDirPath() + 
++			// QCoreApplication::applicationDirPath() + 
++			APP_SHARE_DIR + 
+ 			QString("/help/") + language + QString("/content/") + link);
+ 			
+ 	}
+--- a/tipp10.desktop
++++ b/tipp10.desktop
+@@ -1,10 +1,10 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ Name=TIPP10
+ Comment=Touch Typing Tutor
+ Comment[de]=10-Finger-Schreibtrainer
+-Exec=tipp10
++Exec=/usr/bin/tipp10
+ Icon=tipp10.png
+ Terminal=false
+ Type=Application
+ Categories=Education;
++Keywords=learning;touchtyping
diff --git a/gnu/packages/patches/tipp10-remove-license-code.patch b/gnu/packages/patches/tipp10-remove-license-code.patch
new file mode 100644
index 0000000..4b7487e
--- /dev/null
+++ b/gnu/packages/patches/tipp10-remove-license-code.patch
@@ -0,0 +1,332 @@
+Description: Remove license dialog and license key checking
+
+https://sources.debian.net/data/main/t/tipp10/2.1.0-2/debian/patches/0002-RemoveLicenseCode
+
+--- a/main.cpp
++++ b/main.cpp
+@@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #include "def/defines.h"
+ #include "sql/connection.h"
+ #include "widget/mainwindow.h"
+-#include "widget/licensedialog.h"
+ #include "widget/illustrationdialog.h"
+ 
+ int main(int argc, char *argv[]) {
+@@ -59,7 +58,7 @@ int main(int argc, char *argv[]) {
+ 	QSettings settings;
+ 	#endif
+ 
+-	// Read/write language, license key and show illustration flag
++	// Read/write language and show illustration flag
+ 	settings.beginGroup("general");
+ 	QString languageGui = settings.value("language_gui",
+ 		QLocale::system().name()).toString();
+@@ -101,7 +100,6 @@ int main(int argc, char *argv[]) {
+ 	QString languageLesson = settings.value("language_lesson",
+ 		"").toString();
+ 
+-	QString licenseKey = settings.value("licensekey", "").toString();
+ 	bool showIllustration = settings.value("check_illustration", true).toBool();
+ 	bool useNativeStyle = settings.value("check_native_style", false).toBool();
+ 	settings.endGroup();
+--- a/tipp10.pro
++++ b/tipp10.pro
+@@ -43,7 +43,6 @@ HEADERS         += 	def/defines.h \
+                     widget/helpbrowser.h \
+                     widget/companylogo.h \
+                     widget/errormessage.h \
+-                    widget/licensedialog.h \
+                     widget/txtmessagedialog.h \
+                     widget/checkversion.h \
+                     sql/connection.h \
+@@ -78,7 +77,6 @@ SOURCES         += 	main.cpp \
+                     widget/helpbrowser.cpp \
+                     widget/companylogo.cpp \
+                     widget/errormessage.cpp \
+-                    widget/licensedialog.cpp \
+                     widget/txtmessagedialog.cpp \
+                     widget/checkversion.cpp \
+                     sql/lessontablesql.cpp \
+--- a/widget/licensedialog.cpp
++++ /dev/null
+@@ -1,168 +0,0 @@
+-/*
+-Copyright (c) 2006-2009, Tom Thielicke IT Solutions
+-
+-This program is free software; you can redistribute it and/or
+-modify it under the terms of the GNU General Public License
+-as published by the Free Software Foundation; either version 2
+-of the License.
+-
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-GNU General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301, USA.
+-*/
+-
+-/****************************************************************
+-**
+-** Implementation of the LicenseDialog class
+-** File name: licensedialog.cpp
+-**
+-****************************************************************/
+-
+-#include <QHBoxLayout>
+-#include <QVBoxLayout>
+-#include <QMessageBox>
+-#include <QSettings>
+-#include <QCoreApplication>
+-
+-#include "licensedialog.h"
+-#include "def/defines.h"
+-
+-LicenseDialog::LicenseDialog(QWidget *parent) : QDialog(parent) {
+-
+-	setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
+-
+-	setWindowTitle(tr("Lizenznummer"));
+-	setWindowIcon(QIcon(":/img/" + QString(ICON_FILENAME)));
+-
+-	// Create texbox
+-    createLineEdit();
+-
+-	// Create buttons
+-    createButtons();
+-
+-	// Set the layout of all widgets created above
+-	createLayout();
+-
+-	lineLicensing->setFocus();
+-}
+-
+-void LicenseDialog::createButtons() {
+-	//Buttons
+-	buttonOk = new QPushButton(this);
+-	buttonDemo = new QPushButton(this);
+-
+-	buttonOk->setText(tr("&Ok"));
+-	buttonDemo->setText(tr("&Demo starten"));
+-	buttonDemo->setToolTip(tr("Im Demo-Modus koennen pro Lektion nur\n"
+-		"10 Schriftzeichen eingegeben werden"));
+-
+-	buttonOk->setDefault(true);
+-	// Widget connections
+-    connect(buttonOk, SIGNAL(clicked()), this, SLOT(clickOk()));
+-    connect(buttonDemo, SIGNAL(clicked()), this, SLOT(clickDemo()));
+-}
+-
+-void LicenseDialog::createLineEdit() {
+-
+-	lineLicensing = new QLineEdit();
+-	lineLicensing->setInputMask(">NNNNNNNNNNNNNN");
+-
+-	labelLicensing = new QLabel(tr("Bitte geben Sie Ihre Lizenznummer "
+-		"(ohne Leerzeichen) ein, "
+-		"die Sie im Arbeitsbuch (Schulbuch) auf Seite 3 finden:"));
+-
+-	labelLicensing->setWordWrap(true);
+-}
+-
+-void LicenseDialog::createLayout() {
+-	// Button layout horizontal
+-	QHBoxLayout *buttonLayoutHorizontal = new QHBoxLayout;
+-    buttonLayoutHorizontal->addStretch(1);
+-    buttonLayoutHorizontal->addWidget(buttonDemo);
+-    buttonLayoutHorizontal->addWidget(buttonOk);
+-	// Full layout of all widgets vertical
+-	QVBoxLayout *mainLayout = new QVBoxLayout;
+-    mainLayout->addSpacing(1);
+-    mainLayout->addWidget(labelLicensing);
+-    mainLayout->addSpacing(1);
+-    mainLayout->addWidget(lineLicensing);
+-    mainLayout->addSpacing(1);
+-    mainLayout->addLayout(buttonLayoutHorizontal);
+-    mainLayout->setMargin(15);
+-    mainLayout->setSpacing(15);
+-    // Pass layout to parent widget (this)
+-	this->setLayout(mainLayout);
+-}
+-
+-void LicenseDialog::clickOk() {
+-
+-	// Check license key
+-	if (!checkLicenseKey(lineLicensing->text())) {
+-
+-		// License key is wrong
+-
+-		// Message to the user
+-		QMessageBox::information(0, APP_NAME,
+-			tr("Die eingegebene Lizenznummer ist leider nicht "
+-			"korrekt.\nBitte ueberpruefen Sie die Schreibweise."));
+-
+-		lineLicensing->setFocus();
+-
+-	} else {
+-
+-		// License key is ok
+-		writeSettings();
+-		accept();
+-	}
+-}
+-
+-void LicenseDialog::clickDemo() {
+-	accept();
+-}
+-
+-bool LicenseDialog::checkLicenseKey(QString licenseKey) {
+-	if (licenseKey.size() == 14 &&
+-		licenseKey[0].isLetter() &&
+-		licenseKey[1].isLetter() &&
+-		(licenseKey.mid(2, 2) == "39" ||
+-		licenseKey.mid(2, 2) == "41" ||
+-		licenseKey.mid(2, 2) == "43" ||
+-		licenseKey.mid(2, 2) == "49" ||
+-		licenseKey.mid(2, 2) == "99") &&
+-		licenseKey[4].isDigit() &&
+-		licenseKey[5].isDigit() &&
+-		licenseKey[6].isDigit() &&
+-		licenseKey[7].isLetter() &&
+-		licenseKey[8].isDigit() &&
+-		licenseKey[9].isDigit() &&
+-		licenseKey[10].isDigit() &&
+-		licenseKey[11].isDigit() &&
+-		licenseKey[12].isLetter() &&
+-		licenseKey[13].isLetter()) {
+-
+-		return true;
+-	}
+-	return false;
+-}
+-
+-void LicenseDialog::writeSettings() {
+-	// Saves settings of the startwiget
+-	// (uses the default constructor of QSettings, passing
+-	// the application and company name see main function)
+-	#if APP_PORTABLE
+-	QSettings settings(QCoreApplication::applicationDirPath() +
+-    	"/portable/settings.ini", QSettings::IniFormat);
+-    #else
+-	QSettings settings;
+-	#endif
+-
+-	settings.beginGroup("general");
+-	settings.setValue("licensekey", lineLicensing->text());
+-	settings.endGroup();
+-}
+--- a/widget/licensedialog.h
++++ /dev/null
+@@ -1,85 +0,0 @@
+-/*
+-Copyright (c) 2006-2009, Tom Thielicke IT Solutions
+-
+-This program is free software; you can redistribute it and/or
+-modify it under the terms of the GNU General Public License
+-as published by the Free Software Foundation; either version 2
+-of the License.
+-
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-GNU General Public License for more details.
+-
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-02110-1301, USA.
+-*/
+-
+-/****************************************************************
+-**
+-** Definition of the LicenseDialog class
+-** File name: licensedialog.h
+-**
+-****************************************************************/
+-
+-#ifndef LICENSEDIALOG_H
+-#define LICENSEDIALOG_H
+-
+-#include <QDialog>
+-#include <QWidget>
+-#include <QPushButton>
+-#include <QLabel>
+-#include <QLineEdit>
+-#include <QString>
+-
+-//! The LicenseDialog class provides a license input widget.
+-/*!
+-	The LicenseDialog class shows a dialog to enter a license key.
+-
+-	@author Tom Thielicke, s712715
+-	@version 0.0.1
+-	@date 09.09.2008
+-*/
+-class LicenseDialog : public QDialog {
+-	Q_OBJECT
+-
+-	public:
+-
+-		//! Constructor, creates two table objects and provide it in two tabs.
+-		LicenseDialog(QWidget *parent = 0);
+-
+-		bool checkLicenseKey(QString licenseKey);
+-
+-	public slots:
+-
+-	private slots:
+-
+-		//! Start button pressed
+-		void clickOk();
+-
+-		//! Demo button pressed
+-		void clickDemo();
+-
+-	private:
+-
+-		//! Creates a cancel and a ok button.
+-		void createButtons();
+-
+-		//! Creates a textbox.
+-		void createLineEdit();
+-
+-		//! Creates the layout of the complete class.
+-		void createLayout();
+-
+-		//! Writes user settings
+-		void writeSettings();
+-
+-		QPushButton *buttonOk;
+-		QPushButton *buttonDemo;
+-		QLabel *labelLicensing;
+-		QLineEdit *lineLicensing;
+-};
+-
+-#endif //LICENSEDIALOG_H
+--- a/widget/mainwindow.cpp
++++ b/widget/mainwindow.cpp
+@@ -116,11 +116,6 @@ void MainWindow::closeEvent(QCloseEvent
+ 	}
+ }
+ 
+-bool MainWindow::checkLicenseKey(QString licenseKey) {
+-
+-    return false;
+-}
+-
+ void MainWindow::createMenu() {
+ 	//Mac-Version:
+ 	//-----------
+--- a/widget/mainwindow.h
++++ b/widget/mainwindow.h
+@@ -39,7 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fi
+ #include "trainingwidget.h"
+ #include "evaluationwidget.h"
+ #include "illustrationdialog.h"
+-#include "licensedialog.h"
+ #include "games/abcrainwidget.h"
+ #include "helpbrowser.h"
+ 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add tipp10 touch typing tutor.
  2016-12-31 14:36   ` Hartmut Goebel
@ 2017-01-05 10:55     ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-01-05 10:55 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hello,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> Am 19.12.2016 um 22:39 schrieb Ludovic Courtès:
>>
>>> +              (uri (string-append "mirror://debian/pool/main/"
>>> +                                  "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
>> Is there really no upstream for this program?  tipp10.com seems to be
>> live, no?
>
> There is, but guix is not able to handle the download URL, which is
> <https://www.tipp10.com/en/download/getfile/3/> or
> <https://www.tipp10.com/en/download/getfile/3/1483193655/>.This page
> uses  "<meta http-equiv="refresh"
> content="1;url=/en/download/getfile/3/1483193955/" />". I asked the
> author for a different URL, but he did not answer.

OK.  In this case, I think the future you (or anyone else) would
appreciate a comment that says just that.  ;-)

>>
>>> +              (patches (search-patches "tipp10-FixCompiling.patch"
>>> +                                       "tipp10-RemoveLicenseCode.patch"))))
>> Please use lowercase and hyphens for file names.  :-)
>
> Anything else unimportant I can waste my time on? These are the
> file-names of the patches at debian. I see absolutely no benefit in
> changing them.

We have conventions, comments like the one I did are certainly boring,
but I think it’s beneficial to everyone when the code is consistent.

>>
>>> +    (description " TIPP10 is a free touch typing tutor for Windows, Mac OS and
>>                      ^
>> Extra space.
>>
>> Please don’t mention supported operating systems; what matters is that
>> it works on GNU.
>
> IMO this is interesting for users and for spreading free software. If
> one reads this i might think: "O, coll, I can recommend this to some
> friend still using Windooze and ma convince her about free software."

I understand, but the description is meant for Guix users, so it’s a
different purpose.

>>> +Linux.  The ingenious thing about the software is its intelligence feature.
>> “Intelligence feature” sounds vague; could it be rephrased in more
>> precise terms?
>>
>>> +Note: To change the language settings choose Datei (File) →
>>> +Grundeinstellungen (Generell Settings) → Sprache (Language) and change from
>>> +Deutsch to English. The you have restart the program to have the change take
>>> +effect.")
>> This information doesn’t belong here.
>>
>> Does Debian have patches to make this program honor the current locale?
>> That would be the best option.
>
> No, there are not patches, this is why I put this information there. If
> ou dislike, please recommend a better place.

No suggestions, leave it here if that’s the best we can do.

>>> +    (license license:gpl2)))
>> Version 2 only?
>
> This is what https://www.tipp10.com/en/download/ says.

My comment was more about whether you checked the source code headers,
which are authoritative.  They do not have the “or any later version”
wording, so that’s ‘gpl2’ indeed.

>>> +-Exec=tipp10
>>> ++Exec=/usr/bin/tipp10
>> This doesn’t look useful.
>
> Yes, but this is part of the original Debian patch. I'd prefer to keep
> this patch unchanged to make it easier to follow any changes or fixes
> Debian incorporates. Since guix is fixing this path anyway, there is no
> use in maintaining a own set of patches.

OK.

> To be frank, some of your comment on this patch are nitpicking at its
> best. I have the impression that you did not trust me to have spend only
> a little thought on what I'm doing. And you are demanding things (patch
> filenames, change to upstream patches) which have no or negligible
> benefit – even if seen in the long run. This *very* discouraging!

(As a side note, these are not “upstream patches”.)

I’m sorry to read that.  The way I see it is that we all do our best to
improve the system.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add tipp10 touch typing tutor.
  2016-12-31 14:50 ` Hartmut Goebel
@ 2017-01-05 10:56   ` Ludovic Courtès
  2017-01-14 19:18     ` Hartmut Goebel
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-01-05 10:56 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * gnu/packages/education.scm (touch10): New variable.
> * gnu/packages/patches/tipp10-fix-compiling.patch,
>   gnu/packages/patches/tipp10-remove-license-code.patch: New files.
> * gnu/local.mk (dist_patch_DATA): Register them.

[...]

> +    (description "Tipp10 is a touch typing tutor for Windows, Mac OS and
> +Linux.  The ingenious thing about the software is its intelligence feature:

Please remove “for Windows, Mac OS and Linux.”

OK with this change!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gnu: Add tipp10 touch typing tutor.
  2017-01-05 10:56   ` Ludovic Courtès
@ 2017-01-14 19:18     ` Hartmut Goebel
  0 siblings, 0 replies; 7+ messages in thread
From: Hartmut Goebel @ 2017-01-14 19:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Am 05.01.2017 um 11:56 schrieb Ludovic Courtès:
> Please remove “for Windows, Mac OS and Linux.”
>
> OK with this change!

Pushed with these changes b84257c0ffaa26b635f6a617d28da4b7edf26442

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-01-14 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-18 15:17 [PATCH] gnu: Add tipp10 touch typing tutor Hartmut Goebel
2016-12-19 21:39 ` Ludovic Courtès
2016-12-31 14:36   ` Hartmut Goebel
2017-01-05 10:55     ` Ludovic Courtès
2016-12-31 14:50 ` Hartmut Goebel
2017-01-05 10:56   ` Ludovic Courtès
2017-01-14 19:18     ` Hartmut Goebel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).