QMessageBoxmessage_box{QMessageBox::Warning,"dvi creation failed","The creation of the receipts dvi timed out after 30 seconds. Automatic receipts creation will not work.",QMessageBox::Ok};
" after 30 seconds. Automatic receipts creation will not work.",
QMessageBox::Ok};
message_box.exec();
deleteprocess;
process=nullptr;
@ -65,7 +70,8 @@ class ReceiptsPrinter : public QThread {
process->setWorkingDirectory(workpath);
process->start(dvipsCmd,arguments);
if(!process->waitForFinished(processTimeOut)){
emitErrorOccurred(newQString{"The conversion of the receipts dvi to postscript timed out after 30 seconds. Automatic receipts creation will not work."},newQString{"dvi to postscript conversion failed"});
emitErrorOccurred(newQString{"The conversion of the receipts dvi to postscript timed out after 30 seconds. Automatic receipts creation will not work."},
newQString{"dvi to postscript conversion failed"});
deleteprocess;
process=nullptr;
return;
@ -83,7 +89,8 @@ class ReceiptsPrinter : public QThread {
process->setWorkingDirectory(workpath);
process->start(lprCmd,arguments);
if(!process->waitForFinished(processTimeOut)){
emitErrorOccurred(newQString{"The receipts postscript file was successfully created but could not be printed."},newQString{"Printing failed"});
emitErrorOccurred(newQString{"The receipts postscript file was successfully created but could not be printed."},
newQString{"Printing failed"});
}
deleteprocess;
process=nullptr;
@ -99,7 +106,8 @@ class ReceiptsPrinter : public QThread {
process->setWorkingDirectory(workpath);
process->start(ps2pdfCmd,arguments);
if(!process->waitForFinished(processTimeOut)){
emitErrorOccurred(newQString{"The receipts were successfully printed but the creation of the PDF file failed."},newQString{"PDF creation failed"});
emitErrorOccurred(newQString{"The receipts were successfully printed but the creation of the PDF file failed."},
newQString{"PDF creation failed"});
}
deleteprocess;
process=nullptr;
@ -131,7 +139,9 @@ class ReceiptsPrinter : public QThread {
process->setWorkingDirectory(workpath);
process->start(rmCmd,arguments);
if(!process->waitForFinished(processTimeOut)){
emitErrorOccurred(newQString("The cleanup of the temporary files for receipts creation timed out. Some spare files may be left in your zTree working directory."),newQString("Cleanup failed"));
emitErrorOccurred(new
QString("The cleanup of the temporary files for receipts creation timed out. Some spare files may be left in your zTree working directory."),
newQString("Cleanup failed"));
}
deleteprocess;
process=nullptr;
@ -154,13 +164,14 @@ private:
constQStringlatexCmd;
constQStringlprCmd;
constQStringpostscriptViewer;
constintprocessTimeOut=15000;//! The maximum time which will be granted to a started process
constintprocessTimeOut=
15000;//! The maximum time which will be granted to a started process
constQStringps2pdfCmd;
constQStringrmCmd;
constQStringvncViewer;
constQStringworkpath;//!< The path were zTree was ordered to store all its data