diff --git a/src/convertworker.cpp b/src/convertworker.cpp index be11f88..de6aa9c 100644 --- a/src/convertworker.cpp +++ b/src/convertworker.cpp @@ -78,14 +78,14 @@ void ConvertWorker::convertPdf(QNetworkRequest request, QString filename, QTempo { qDebug() << "pdftoppm died"; tempfile->deleteLater(); - emit failed(); + emit failed(tr("Conversion error")); return; } if(!ppm2pwg->waitForStarted()) { qDebug() << "ppm2pwg died"; tempfile->deleteLater(); - emit failed(); + emit failed(tr("Conversion error")); return; } qDebug() << "All started"; @@ -108,7 +108,7 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem if(!inImage.load(filename)) { qDebug() << "failed to load"; - emit failed(); + emit failed(tr("Failed to load image")); return; } @@ -153,7 +153,7 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem { qDebug() << "ppm2pwg died"; tempfile->deleteLater(); - emit failed(); + emit failed(tr("Conversion error")); return; } qDebug() << "All started"; diff --git a/src/convertworker.h b/src/convertworker.h index 0246efd..ec8cdc3 100644 --- a/src/convertworker.h +++ b/src/convertworker.h @@ -17,7 +17,7 @@ public slots: signals: void done(QNetworkRequest request, QTemporaryFile* data); - void failed(); + void failed(QString message); }; #endif // CONVERTWORKER_H diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index d9ba839..d88bb09 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -97,7 +97,6 @@ void IppPrinter::refresh() { QNetworkRequest request; request.setUrl(httpUrl()); -// request.setRawHeader("User-Agent", "MyOwnBrowser 1.0"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/ipp"); request.setHeader(QNetworkRequest::UserAgentHeader, "SeaPrint "SEAPRINT_VERSION); @@ -220,10 +219,10 @@ void IppPrinter::convertDone(QNetworkRequest request, QTemporaryFile* data) } -void IppPrinter::convertFailed() +void IppPrinter::convertFailed(QString message) { _jobAttrs = QJsonObject(); - _jobAttrs.insert("job-state-message", QJsonObject {{"tag", IppMsg::TextWithoutLanguage}, {"value", "Internal error"}}); + _jobAttrs.insert("job-state-message", QJsonObject {{"tag", IppMsg::TextWithoutLanguage}, {"value", message}}); emit jobAttrsChanged(); emit jobFinished(false); } @@ -235,7 +234,7 @@ void IppPrinter::print(QJsonObject attrs, QString filename){ bool file_ok = file.open(QIODevice::ReadOnly); if(!file_ok) { - emit jobFinished(false); + emit convertFailed(tr("Failed to open file")); return; } diff --git a/src/ippprinter.h b/src/ippprinter.h index 5b64d4a..b154e43 100644 --- a/src/ippprinter.h +++ b/src/ippprinter.h @@ -74,7 +74,7 @@ public slots: void ignoreKnownSslErrors(QNetworkReply *reply, const QList &errors); void convertDone(QNetworkRequest request, QTemporaryFile* data); - void convertFailed(); + void convertFailed(QString message); private: QUrl _url; diff --git a/translations/harbour-seaprint-de.ts b/translations/harbour-seaprint-de.ts index adccea9..a6ae0fb 100644 --- a/translations/harbour-seaprint-de.ts +++ b/translations/harbour-seaprint-de.ts @@ -118,6 +118,17 @@ + + ConvertWorker + + Conversion error + + + + Failed to load image + + + CoverPage @@ -172,6 +183,13 @@ + + IppPrinter + + Failed to open file + + + JobsPage diff --git a/translations/harbour-seaprint-es.ts b/translations/harbour-seaprint-es.ts index de6bc41..2efd2b2 100644 --- a/translations/harbour-seaprint-es.ts +++ b/translations/harbour-seaprint-es.ts @@ -118,6 +118,17 @@ Impresión fallida: + + ConvertWorker + + Conversion error + + + + Failed to load image + + + CoverPage @@ -172,6 +183,13 @@ Elegir archivo + + IppPrinter + + Failed to open file + + + JobsPage diff --git a/translations/harbour-seaprint-fr.ts b/translations/harbour-seaprint-fr.ts index 5cd01b3..a3c24e7 100644 --- a/translations/harbour-seaprint-fr.ts +++ b/translations/harbour-seaprint-fr.ts @@ -118,6 +118,17 @@ Échec de l'impression : + + ConvertWorker + + Conversion error + + + + Failed to load image + + + CoverPage @@ -172,6 +183,13 @@ Choisir un fichier + + IppPrinter + + Failed to open file + + + JobsPage diff --git a/translations/harbour-seaprint-zh_CN.ts b/translations/harbour-seaprint-zh_CN.ts index 9770587..b9d1038 100644 --- a/translations/harbour-seaprint-zh_CN.ts +++ b/translations/harbour-seaprint-zh_CN.ts @@ -118,6 +118,17 @@ 打印失败: + + ConvertWorker + + Conversion error + + + + Failed to load image + + + CoverPage @@ -172,6 +183,13 @@ 选择文件 + + IppPrinter + + Failed to open file + + + JobsPage diff --git a/translations/harbour-seaprint.ts b/translations/harbour-seaprint.ts index ce589df..8af979a 100644 --- a/translations/harbour-seaprint.ts +++ b/translations/harbour-seaprint.ts @@ -118,6 +118,17 @@ + + ConvertWorker + + Conversion error + + + + Failed to load image + + + CoverPage @@ -172,6 +183,13 @@ + + IppPrinter + + Failed to open file + + + JobsPage