From 6180c3733d26d2f972009fac28d89ede351543e2 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Mon, 17 Feb 2020 20:06:39 +0100 Subject: [PATCH] Add Postscript to supported formats --- qml/pages/FirstPage.qml | 6 +++++- qml/pages/utils.js | 10 ++++++++++ rpm/harbour-seaprint.spec | 2 +- rpm/harbour-seaprint.yaml | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index 320029a..3d5902a 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -51,6 +51,10 @@ Page { { selectedFileType = "application/pdf" } + else if(Utils.endsWith(".ps", selectedFile)) + { + selectedFileType = "application/postscript" + } else if(Utils.endsWith(".jpg", selectedFile) || Utils.endsWith(".jpeg", selectedFile)) { selectedFileType = "image/jpeg" @@ -280,7 +284,7 @@ Page { FilePickerPage { title: fileButton.label showSystemFiles: false - nameFilters: ["*.pdf", "*.jpg", "*.jpeg", "*.pwg", "*.urf"] + nameFilters: ["*.pdf", "*.jpg", "*.jpeg", "*.ps"] onSelectedContentPropertiesChanged: { page.selectedFile = selectedContentProperties.filePath diff --git a/qml/pages/utils.js b/qml/pages/utils.js index cf5a413..76ce63c 100644 --- a/qml/pages/utils.js +++ b/qml/pages/utils.js @@ -8,6 +8,11 @@ function supported_formats(printer) mimetypes.push("application/pdf"); supported.push("PDF"); } + if(has(formats, "application/postscript")) + { + mimetypes.push("application/postscript"); + supported.push("Postscript"); + } if(has(formats, "image/jpeg")) { mimetypes.push("image/jpeg"); @@ -27,6 +32,11 @@ function supported_formats(printer) mimetypes.push("application/pdf"); maybe.push("PDF"); } + if(!has(supported, "Postscript") && has(info[i].split(":")[1].split(","), "POSTSCRIPT")) + { + mimetypes.push("application/postscript"); + maybe.push("Postscript"); + } break; } } diff --git a/rpm/harbour-seaprint.spec b/rpm/harbour-seaprint.spec index b35427a..bd3deed 100644 --- a/rpm/harbour-seaprint.spec +++ b/rpm/harbour-seaprint.spec @@ -10,7 +10,7 @@ Name: harbour-seaprint Summary: SeaPrint Version: 0.4.2 -Release: 1 +Release: 2 Group: Qt/Qt License: LICENSE URL: http://example.org/ diff --git a/rpm/harbour-seaprint.yaml b/rpm/harbour-seaprint.yaml index 54b8576..a7ca1dc 100644 --- a/rpm/harbour-seaprint.yaml +++ b/rpm/harbour-seaprint.yaml @@ -1,7 +1,7 @@ Name: harbour-seaprint Summary: SeaPrint Version: 0.4.2 -Release: 1 +Release: 2 # The contents of the Group field should be one of the groups listed here: # https://github.com/mer-tools/spectacle/blob/master/data/GROUPS Group: Qt/Qt