tr("Unable to start the client help notification server.\nThe following error occurred:\n\n%1.").arg(helpMessageServer->errorString()),QMessageBox::Ok};
settings.endGroup();
messageBox.exec();
}
return;
}
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 != "")
constQString
constQStringdateString;//!< The expected date string of the payment file in form 'yyMMdd_hhmm'
anonymousReceiptsPlaceholder;//!< Placeholder which shall be inserted for
constQStringexpectedPaymentFileName;//!< The name of the expected payment file
//!< participant names if anonymous printing
constQStringexpectedPaymentFilePath;//!< The path of the expected payment file
//!< is desired (QString != "")
constQStringlatexHeaderName;//!< The name of the chosen LaTeX header template
constQStringdateString;//!< The expected date string of the payment file in
QFilepaymentFile;//!< A pointer to the '*.pay' file being watched for existance and starting the printing process
//!< form 'yyMMdd_hhmm'
constboolprintReceiptsForLocalClients;//!< Stores if receipts shall be printed for local clients
constQString
ReceiptsPrinter*receiptsPrinter=nullptr;//!< Creates new thread for receipts printing
expectedPaymentFileName;//!< The name of the expected payment file
QTimer*timer=nullptr;//!< Used for regular checking if the payment file was created
constQString
constQStringzTreeDataTargetPath;//!< A reference to the data target path stored in the session class instance
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};
if(!process->waitForFinished(processTimeOut)){
message_box.exec();
QMessageBoxmessage_box{
deleteprocess;
QMessageBox::Warning,"dvi creation failed",
process=nullptr;
"The creation of the receipts dvi timed out after 30 seconds. "
return;
"Automatic receipts creation will not work.",
}
QMessageBox::Ok};
deleteprocess;
message_box.exec();
process=nullptr;
deleteprocess;
process=nullptr;
return;
}
deleteprocess;
process=nullptr;
// Convert the dvi file to postscript
arguments=QStringList{};
arguments<<"-q*"
<<"-o"<<QString{dateString+".ps"}
<<QString{dateString+".dvi"};
process=newQProcess{};
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"});
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 cleanup of the temporary files for receipts creation timed out. Some spare files may be left in your zTree working directory."),newQString("Cleanup failed"));
//! 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
classlcDataTargetPathCreationFailed{};
//! be created.
classlcDataTargetPathCreationFailed{};
signals:
signals:
voidSessionFinished(Session*argSession);
voidSessionFinished(Session*argSession);
privateslots:
privateslots:
/*! Starts the session by creating instances of the relevant classes
/*! Starts the session by creating instances of the relevant classes
*/
*/
voidInitializeClasses();
voidInitializeClasses();
voidOnzTreeClosed(intargExitCode);
voidOnzTreeClosed(intargExitCode);
/*! Changes zTree's window title to contain its port number to make zTree windows distinguishable
/*! Changes zTree's window title to contain its port number to make zTree
*/
*windowsdistinguishable
voidRenameWindow();
*/
voidRenameWindow();
private:
private:
constQStringanonymousReceiptsPlaceholder;//! Placeholder which shall be inserted for participant names if anonymous printing is desired (QString != "")
constQString
constQVector<Client*>assocClients;
anonymousReceiptsPlaceholder;//! Placeholder which shall be inserted for
constQStringlatexHeaderName;//! The name of the chosen LaTeX header
//! participant names if anonymous printing
constboolprintReceiptsForLocalClients=true;//! True if receipts shall be printed for local clients
//! is desired (QString != "")
QStringzTreeDataTargetPath;//! The path were the data of this zTree instance's session will be saved
constQVector<Client*>assocClients;
ZTree*zTreeInstance=nullptr;//! The session's zTree instance
constQStringlatexHeaderName;//! The name of the chosen LaTeX header
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
boolCheckIfUserIsAdmin();
voidDisableDisfunctionalWidgets();
//! Disables widgets for functions not available due to lacking devices or
//! Loads all needed client icon QPixmaps
//! settings
voidLoadIconPixmaps();
voidDisableDisfunctionalWidgets();
//! Sets up all used widgets
//! Loads all needed client icon QPixmaps
voidSetupWidgets();
voidLoadIconPixmaps();
//! Sets up all used widgets
QStandardItemModel*clients_view_model=nullptr;//! The view storing all clients data
voidSetupWidgets();
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
QStandardItemModel*clients_view_model=
Lablib*lablib=nullptr;//! Accumulator of all program logic being accessed by the GUI
nullptr;//! The view storing all clients data
boollocalzLeavesAreRunning=false;//! Stores if a local z-Leaf instance is running on the server ('true' if local z-Leaf exists)
QTimer*gui_update_timer=
QButtonGroup*userChooseButtonGroup=nullptr;//! Used to group the radio buttons choosing which user shall be used for administrative client actions
nullptr;//! A QTimer triggering updates of the graphical user interface
Ui::MainWindow*ui=nullptr;//! Pointer storing all GUI items
QVector<QPixmap>icons;//! Vector of pixmaps storing the icons indicating the
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()'
//! 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