Skip to content

Commit

Permalink
Remove Poppler instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Nov 20, 2021
1 parent 2d521dc commit f0eba7b
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 125 deletions.
5 changes: 0 additions & 5 deletions qml/pages/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ Page {

SectionHeader { text: qsTr("Optional dependencies") }

AboutLabel {
font.pixelSize: Theme.fontSizeSmall
text: "poppler-utils - "+(ConvertChecker.pdf ? qsTr("Installed") : qsTr("Not installed"))
}

AboutLabel {
font.pixelSize: Theme.fontSizeSmall
text: "calligraconverter - "+(ConvertChecker.calligra ? qsTr("Installed") : qsTr("Not installed"))
Expand Down
3 changes: 1 addition & 2 deletions qml/pages/FirstPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ Page {
onStatusChanged: {
if(status==PageStatus.Active && !nagged && nagScreenSetting.value != nagScreenSetting.expectedValue)
{
console.log("Can convert from PDF:", ConvertChecker.pdf)
console.log("Can convert from Office:", ConvertChecker.calligra)
if(!ConvertChecker.pdf || (expectCalligra && !ConvertChecker.calligra))
if(expectCalligra && !ConvertChecker.calligra)
{
nagged=true
pageStack.push(Qt.resolvedUrl("NagScreen.qml"))
Expand Down
27 changes: 1 addition & 26 deletions qml/pages/NagScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,12 @@ Page {
text: qsTr("Optional dependencies are not installed!")
}

Label {
width: parent.width
wrapMode: Text.WordWrap

text: qsTr("In order to print PDF files with printers that do not support PDF natively,"
+" you need the package \"poppler-utils\"."
+" This enables SeaPrint to convert to formats that are more likely to be accepted.")
}

Label {
visible: appWin.expectCalligra
width: parent.width
wrapMode: Text.WordWrap

text: qsTr("In order to print \"office\" documents like odt and doc(x) you <i>also</i> need "+
text: qsTr("In order to print \"office\" documents like odt and doc(x) you need "+
"\"calligraconverter\" from the \"calligra\" package (version 3.2.1+, Sailfish OS 4.2).")
}

Expand Down Expand Up @@ -69,22 +60,6 @@ Page {

}

Label {
width: parent.width
wrapMode: Text.WordWrap

text: qsTr("Install poppler-utils:") + " " + (ConvertChecker.pdf ? qsTr("(done)") : "")
}

Label {
width: parent.width
wrapMode: Text.WordWrap
font.family: "monospace"

text: "pkcon install poppler-utils"
Clipper {}
}

Label {
visible: appWin.expectCalligra
width: parent.width
Expand Down
31 changes: 5 additions & 26 deletions qml/pages/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function supported_formats(printer, considerAdditionalFormats)
var plaintext = false;

if(has(formats, Mimer.Mimer.PDF) ||
(ConvertChecker.ConvertChecker.pdf && ( has(formats, Mimer.Mimer.Postscript) || raster )))
(has(formats, Mimer.Mimer.Postscript) || raster ))
{
pdf = true;
mimetypes.push(Mimer.Mimer.PDF);
Expand All @@ -34,15 +34,15 @@ function supported_formats(printer, considerAdditionalFormats)
mimetypes.push(Mimer.Mimer.Postscript);
}

if((ConvertChecker.ConvertChecker.pdf && ConvertChecker.ConvertChecker.calligra) &&
if((ConvertChecker.ConvertChecker.calligra) &&
( has(formats, Mimer.Mimer.PDF) || has(formats, Mimer.Mimer.Postscript) || raster ))
{
office = true;
mimetypes = mimetypes.concat(Mimer.Mimer.OfficeFormats);
}

if (raster || has(formats, Mimer.Mimer.JPEG) || has(formats, Mimer.Mimer.PNG) ||
has(formats, Mimer.Mimer.PDF) || (ConvertChecker.ConvertChecker.pdf && has(formats, Mimer.Mimer.Postscript)))
has(formats, Mimer.Mimer.PDF) || has(formats, Mimer.Mimer.Postscript))
{
images = true;
mimetypes.push(Mimer.Mimer.JPEG);
Expand Down Expand Up @@ -373,12 +373,6 @@ function canConvertPdfTo(type)
return has(targets, type)
}

function canTransferPdfAs(type)
{
var targets = [Mimer.Mimer.OctetStream, Mimer.Mimer.PDF];
return has(targets, type)
}

function canTransferPostscriptAs(type)
{
var targets = [Mimer.Mimer.OctetStream, Mimer.Mimer.Postscript];
Expand Down Expand Up @@ -409,27 +403,12 @@ function fixupChoices(name, choices, mimeType)
case "document-format":
if(mimeType == Mimer.Mimer.PDF)
{
if(ConvertChecker.ConvertChecker.pdf)
{
return choices.filter(canConvertPdfTo)
}
else
{
return choices.filter(canTransferPdfAs)
}

return choices.filter(canConvertPdfTo)
}
else if(mimeType == Mimer.Mimer.Plaintext)
{
// We convert plaintext to PDF internally
if(ConvertChecker.ConvertChecker.pdf)
{
return choices.filter(canConvertPdfTo)
}
else
{
return choices.filter(canTransferPdfAs)
}
return choices.filter(canConvertPdfTo)
}
else if(mimeType == Mimer.Mimer.Postscript)
{
Expand Down
1 change: 0 additions & 1 deletion src/convertchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

ConvertChecker::ConvertChecker() : poppler("libpoppler-glib.so.8")
{
_pdf = true;
_calligra = false;

QProcess calligraconverter(this);
Expand Down
2 changes: 0 additions & 2 deletions src/convertchecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ConvertChecker : public QObject
Q_OBJECT
public:
static ConvertChecker* instance();
Q_PROPERTY(bool pdf MEMBER _pdf CONSTANT)
Q_PROPERTY(bool calligra MEMBER _calligra CONSTANT)

Q_INVOKABLE int pdfPages(QString pdf);
Expand All @@ -25,7 +24,6 @@ class ConvertChecker : public QObject
ConvertChecker& operator=(const ConvertChecker &);

LibLoader poppler;
bool _pdf;
bool _calligra;
};

Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@
<source>Become root:</source>
<translation>Root werden:</translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation>poppler-utils installieren:</translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation>Für die Installation muss der Entwickler Modus aktiviert und eine Konsole geöffnet werden.</translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation>Um PDF Dateien zu drucken wird für Drucker ohne PDF Support das Software Paket &quot;poppler-utils&quot; benötigt. Diese ermöglicht es SeaPrint das PDF in besser unterstützte Formate zu konvertieren.</translation>
</message>
<message>
<source>Install calligra:</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@
<source>Become root:</source>
<translation>Acceder como root:</translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation>Instalar poppler-utils:</translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation type="unfinished">Para instalar, habilita el modo de desarrollador y abre Terminal.</translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install calligra:</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@
<source>Become root:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install calligra:</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@
<source>Become root:</source>
<translation>Word root:</translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation>Poppler-utils installeren:</translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation>Schakel de ontwikkelaarsmodus in en open een terminal om te installeren.</translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation>Om PDF-bestanden af te drukken met printers die geen PDF ondersteunen, hebt u het pakket &quot;poppler-utils&quot; nodig. Hierdoor kan SeaPrint converteren naar formaten die waarschijnlijk wel worden geaccepteerd.</translation>
</message>
<message>
<source>Install calligra:</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,6 @@
<source>Optional dependencies are not installed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation type="unfinished"></translation>
Expand All @@ -396,10 +392,6 @@
<source>Become root:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dismiss</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint-zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,6 @@
<source>Become root:</source>
<translation>进入 root 模式:</translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation>安装 poppler-utils:</translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation>如果你想要用打印机打印PDF文件,你需要安装包 poppler-utils 。该包能够让 SeaPrint 转换格式为更容易接受的格式。</translation>
</message>
<message>
<source>Install calligra:</source>
<translation>安装 calligra:</translation>
Expand All @@ -417,7 +409,7 @@
<translation>(已完成)</translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
10 changes: 1 addition & 9 deletions translations/harbour-seaprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@
<source>Become root:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install poppler-utils:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>To install, enable developer mode, and open a terminal.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print PDF files with printers that do not support PDF natively, you need the package &quot;poppler-utils&quot;. This enables SeaPrint to convert to formats that are more likely to be accepted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Install calligra:</source>
<translation type="unfinished"></translation>
Expand All @@ -417,7 +409,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you &lt;i&gt;also&lt;/i&gt; need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<source>In order to print &quot;office&quot; documents like odt and doc(x) you need &quot;calligraconverter&quot; from the &quot;calligra&quot; package (version 3.2.1+, Sailfish OS 4.2).</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down

0 comments on commit f0eba7b

Please sign in to comment.