diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index 4ec8511..9fc45df 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -242,7 +242,7 @@ Page { FilePickerPage { title: fileButton.label showSystemFiles: false - nameFilters: ["*.pdf", "*.jpg", "*.jpeg"] + nameFilters: ["*.pdf", "*.jpg", "*.jpeg", "*.pwg", "*.urf"] onSelectedContentPropertiesChanged: { page.selectedFile = selectedContentProperties.filePath diff --git a/src/ippdiscovery.cpp b/src/ippdiscovery.cpp index 4ccfd0a..440f48b 100644 --- a/src/ippdiscovery.cpp +++ b/src/ippdiscovery.cpp @@ -1,4 +1,6 @@ #include "ippdiscovery.h" +#include + #define A 1 #define PTR 12 #define TXT 16 @@ -287,7 +289,10 @@ QImage IppDiscovery::requestImage(const QString &id, QSize *size, const QSize &r url.setHost(_AAs.value(url.host())); } - QNetworkReply* reply = nam->get(QNetworkRequest(url)); + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); + + QNetworkReply* reply = nam->get(request); QEventLoop el; connect(reply, SIGNAL(finished()),&el,SLOT(quit())); diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index 9094882..ba2071e 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -1,4 +1,6 @@ #include "ippprinter.h" +#include "ioprepender.h" +#include IppPrinter::IppPrinter() { @@ -84,6 +86,7 @@ void IppPrinter::refresh() { request.setUrl(httpUrl()); // request.setRawHeader("User-Agent", "MyOwnBrowser 1.0"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/ipp"); + request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); QJsonObject o = opAttrs(); IppMsg msg = IppMsg(o); @@ -205,6 +208,7 @@ bool IppPrinter::print(QJsonObject attrs, QString filename){ request.setUrl(httpUrl()); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/ipp"); + request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); QJsonObject o = opAttrs(); o.insert("job-name", QJsonObject {{"tag", IppMsg::NameWithoutLanguage}, {"value", fileinfo.fileName()}}); @@ -246,6 +250,8 @@ bool IppPrinter::getJobs() { request.setUrl(httpUrl()); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/ipp"); + request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); + _jobs_nam->post(request, contents); return true; @@ -266,6 +272,8 @@ bool IppPrinter::cancelJob(qint32 jobId) { request.setUrl(httpUrl()); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/ipp"); + request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); + _job_cancel_nam->post(request, contents); return true;