980 B
Programming
Code Structure
The code is structered in a way that everything belonging to the gui is declared and defined in the MainWindow class. All program logic is defined in the classes contained in Lib
the main actor being the Lablib class.
For example: If the Boot button on the gui is clicked, the boot function of the existing Lablib instance is executed. Lablib's boot function checks for all activated clients and calls the boot functions of the Client instances, which make a call to wakeonlan. => MainWindow::on_PBBoot_clicked() calls Lablib::boot() calls Client::boot(QString *network_broadcast_address)
For z-Tree itself the logic differs a bit. A click on Start zTree does not directly create a new z-Tree instance. All running z-Tree instances are stored in a std::list of instances of the Session class containing all important informations of the running session. The constructor of these Session instances starts a new z-Tree.