Package: collatinus / 10.0-3

main.cpp.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Applied Yves Ouvrard's patch received by e-mail (26 May 2012). It
enables a relation between collatinus and felix-latin

Changed gaffiot.djvu in the source (it become /usr/share/felix/Gaffiot.djvu)
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -856,12 +856,25 @@
 
 void fenestra::change_page_Felix (int p)
 {
+    QStringList args;
+    QString outfile=QDir::homePath ()+"/.felix-out.tif";
+    args << "-format=tif" << "-page"
+        // << QString::number(p) << "-size=980x1551"
+        << QString::number(p) << "-scale=230"
+        << "/usr/share/felix/Gaffiot.djvu" << outfile;
+    int res = QProcess::execute("/usr/bin/ddjvu", args);
     if (p > 1702) p = 1702;
     QString pg;
-    QTextStream (&pg) << "<html><img src=\"" 
-        + QApplication::applicationDirPath () 
-        + "/felix/" << p << ".jpg\"></html>";
-    // TODO : changer avec setText ();
+    if (res > 0)
+        QTextStream (&pg) << "<html><h1>Fichier djvu introuvable<br>\n"
+            "Sous Debian ou Ubuntu, installer le paquet felix-latin-data.<br>\n"
+            "Collatinux X - Licence GNU-GPL<br></h1></html>";
+    else
+        QTextStream (&pg) << "<html><img src=\""
+        // + QApplication::applicationDirPath ()
+        // + "/felix/" << p << ".jpg\"></html>";
+        << outfile
+        << "\"></html>";
     EditFelix->setText (pg);
     EditFelix->setTextCursor(QTextCursor(EditFelix->document()));
 }