QMessageBoxmessageBox{QMessageBox::Critical,tr("Unable to start the client help notification server"),
tr("Unable to start the client help notification server.\nThe following error occurred:\n\n%1.").arg(helpMessageServer->errorString()),QMessageBox::Ok};
helpMessageServer=newQTcpServer{this};
if(!helpMessageServer->listen(hostAddress,
settings->clientHelpNotificationServerPort)){
QMessageBoxmessageBox{
QMessageBox::Critical,
tr("Unable to start the client help notification server"),
tr("Unable to start the client help notification server.\nThe "
constQStringanonymousReceiptsPlaceholder;//!< Placeholder which shall be inserted for participant names if anonymous printing is desired (QString != "")
constQStringdateString;//!< The expected date string of the payment file in form 'yyMMdd_hhmm'
constQStringexpectedPaymentFileName;//!< The name of the expected payment file
constQStringexpectedPaymentFilePath;//!< The path of the expected payment file
constQStringlatexHeaderName;//!< The name of the chosen LaTeX header template
QFilepaymentFile;//!< A pointer to the '*.pay' file being watched for existance and starting the printing process
constboolprintReceiptsForLocalClients;//!< Stores if receipts shall be printed for local clients
ReceiptsPrinter*receiptsPrinter=nullptr;//!< Creates new thread for receipts printing
QTimer*timer=nullptr;//!< Used for regular checking if the payment file was created
constQStringzTreeDataTargetPath;//!< A reference to the data target path stored in the session class instance
constQString
anonymousReceiptsPlaceholder;//!< Placeholder which shall be inserted for
//!< participant names if anonymous printing
//!< is desired (QString != "")
constQStringdateString;//!< The expected date string of the payment file in
//!< form 'yyMMdd_hhmm'
constQString
expectedPaymentFileName;//!< The name of the expected payment file
constQString
expectedPaymentFilePath;//!< The path of the expected payment file
constQString
latexHeaderName;//!< The name of the chosen LaTeX header template
QFilepaymentFile;//!< A pointer to the '*.pay' file being watched for
//!< existance and starting the printing process
constboolprintReceiptsForLocalClients;//!< Stores if receipts shall be
//!< printed for local clients
ReceiptsPrinter*receiptsPrinter=
nullptr;//!< Creates new thread for receipts printing
QTimer*timer=
nullptr;//!< Used for regular checking if the payment file was created
constQStringzTreeDataTargetPath;//!< A reference to the data target path
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};
process->setProcessEnvironment(env);
process->setWorkingDirectory(workpath);
process->start(latexCmd,arguments);
if(!process->waitForFinished(processTimeOut)){
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};
message_box.exec();
deleteprocess;
process=nullptr;
@ -58,14 +63,20 @@ class ReceiptsPrinter : public QThread {
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"});
process->setProcessEnvironment(env);
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"});
deleteprocess;
process=nullptr;
return;
@ -74,64 +85,75 @@ class ReceiptsPrinter : public QThread {
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"));
process->setProcessEnvironment(env);
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"));
}
deleteprocess;
process=nullptr;
@ -139,10 +161,11 @@ class ReceiptsPrinter : public QThread {
//! This gets thrown as an exception if the chosen data target path could not be created.
//! This gets thrown as an exception if the chosen data target path could not
//! be created.
classlcDataTargetPathCreationFailed{};
signals:
voidSessionFinished(Session*argSession);
voidSessionFinished(Session*argSession);
privateslots:
/*! Starts the session by creating instances of the relevant classes
*/
voidInitializeClasses();
voidOnzTreeClosed(intargExitCode);
/*! Changes zTree's window title to contain its port number to make zTree windows distinguishable
voidOnzTreeClosed(intargExitCode);
/*! Changes zTree's window title to contain its port number to make zTree
*windowsdistinguishable
*/
voidRenameWindow();
private:
constQStringanonymousReceiptsPlaceholder;//! Placeholder which shall be inserted for participant names if anonymous printing is desired (QString != "")
constQVector<Client*>assocClients;
constQString
anonymousReceiptsPlaceholder;//! Placeholder which shall be inserted for
//! participant names if anonymous printing
//! is desired (QString != "")
constQVector<Client*>assocClients;
constQStringlatexHeaderName;//! The name of the chosen LaTeX header
constboolprintReceiptsForLocalClients=true;//! True if receipts shall be printed for local clients
QStringzTreeDataTargetPath;//! The path were the data of this zTree instance's session will be saved
ZTree*zTreeInstance=nullptr;//! The session's zTree instance
constQStringzTreeVersionPath;//! The path to the version of zTree used by this session's instance
constboolprintReceiptsForLocalClients=
true;//! True if receipts shall be printed for local clients
QStringzTreeDataTargetPath;//! The path were the data of this zTree
//! instance's session will be saved
ZTree*zTreeInstance=nullptr;//! The session's zTree instance
constQStringzTreeVersionPath;//! The path to the version of zTree used by
//! Disables widgets for functions not available due to lacking devices or settings
//! Disables widgets for functions not available due to lacking devices or
//! settings
voidDisableDisfunctionalWidgets();
//! Loads all needed client icon QPixmaps
voidLoadIconPixmaps();
//! Sets up all used widgets
voidSetupWidgets();
QStandardItemModel*clients_view_model=nullptr;//! The view storing all clients data
QTimer*gui_update_timer=nullptr;//! A QTimer triggering updates of the graphical user interface
QVector<QPixmap>icons;//! Vector of pixmaps storing the icons indicating the clients' statuses
Lablib*lablib=nullptr;//! Accumulator of all program logic being accessed by the GUI
boollocalzLeavesAreRunning=false;//! Stores if a local z-Leaf instance is running on the server ('true' if local z-Leaf exists)
QButtonGroup*userChooseButtonGroup=nullptr;//! Used to group the radio buttons choosing which user shall be used for administrative client actions
QStandardItemModel*clients_view_model=
nullptr;//! The view storing all clients data
QTimer*gui_update_timer=
nullptr;//! A QTimer triggering updates of the graphical user interface
QVector<QPixmap>icons;//! Vector of pixmaps storing the icons indicating the
//! clients' statuses
Lablib*lablib=
nullptr;//! Accumulator of all program logic being accessed by the GUI
boollocalzLeavesAreRunning=
false;//! Stores if a local z-Leaf instance is running on the server
//! ('true' if local z-Leaf exists)
QButtonGroup*userChooseButtonGroup=
nullptr;//! Used to group the radio buttons choosing which user shall be
//! used for administrative client actions
Ui::MainWindow*ui=nullptr;//! Pointer storing all GUI items
QVector<QStandardItem*>*valid_items=nullptr;//! Stores all valid Client instances displayed by the table view, its main use is as iterable object for 'update_clients_table_view()'
QVector<QStandardItem*>*valid_items=
nullptr;//! Stores all valid Client instances displayed by the table