Learn Environment
Signals | Public Member Functions | List of all members
TaskUI Class Reference

Manages the user interface for tasks and subtasks. More...

#include <task_ui.hpp>

Inheritance diagram for TaskUI:
Inheritance graph
Collaboration diagram for TaskUI:
Collaboration graph

Signals

void taskSelected (int index)
 Signal emitted when a task is selected. More...
 

Public Member Functions

 TaskUI (QVBoxLayout *subtaskListLayout, QLabel *mainTitleLabel, QLabel *difficultyLabel, QLabel *folderLabel, QLabel *topicLabel, QPushButton *nextButton, QPushButton *previousButton, QToolButton *menuButton, QToolButton *resetRobotStartButton, QFrame *resetRobotFrame, QWidget *centralwidget, QWidget *parent=nullptr)
 Constructs a TaskUI object. More...
 
void initializeUI (const QVector< QSharedPointer< Task >> &tasks)
 Initializes the UI with the loaded tasks. More...
 
void setTaskUI (int currentTaskIndex, const QVector< QSharedPointer< Task >> &tasks)
 Sets the UI elements for the current task. More...
 
void updateSubtaskItemsUI ()
 Updates the UI elements for the subtasks. More...
 
void setTaskManager (TaskManager *manager)
 Sets the TaskManager object. More...
 
void startedRobotResetUI (bool noSubtasksLeft)
 Update the UI to show that the robot reset has been started. More...
 
void finishedRobotResetUI ()
 Update the UI to show that the robot reset has finished. More...
 
void failedRobotResetUI (const QString &error)
 Update the UI to show that the robot reset has failed. More...
 

Detailed Description

Manages the user interface for tasks and subtasks.

The TaskUI class is responsible for initializing and updating the UI elements related to tasks and subtasks. It interacts with the TaskManager and Sidebar to provide a cohesive user experience.

Constructor & Destructor Documentation

◆ TaskUI()

TaskUI::TaskUI ( QVBoxLayout *  subtaskListLayout,
QLabel *  mainTitleLabel,
QLabel *  difficultyLabel,
QLabel *  folderLabel,
QLabel *  topicLabel,
QPushButton *  nextButton,
QPushButton *  previousButton,
QToolButton *  menuButton,
QToolButton *  resetRobotStartButton,
QFrame resetRobotFrame,
QWidget centralwidget,
QWidget parent = nullptr 
)

Constructs a TaskUI object.

Parameters
subtaskListLayoutPointer to the vertical layout for displaying subtasks.
mainTitleLabelPointer to the QLabel for displaying the main title.
difficultyLabelPointer to the QLabel for displaying the difficulty level.
folderLabelPointer to the QLabel for displaying the folder information.
nextButtonPointer to the QPushButton for navigating to the next task.
previousButtonPointer to the QPushButton for navigating to the previous task.
menuButtonPointer to the QToolButton for opening the sidebar.
resetRobotStartButtonPointer to the QToolButton for resetting the robot.
resetRobotFramePointer to the QFrame displaying the reset of the robot.
centralWidgetPointer to the central QWidget for the plugin.
parentPointer to the parent QObject.

Member Function Documentation

◆ failedRobotResetUI()

void TaskUI::failedRobotResetUI ( const QString &  error)

Update the UI to show that the robot reset has failed.

Parameters
errorthe error that occured while resetting the robot.

◆ finishedRobotResetUI()

void TaskUI::finishedRobotResetUI ( )

Update the UI to show that the robot reset has finished.

◆ initializeUI()

void TaskUI::initializeUI ( const QVector< QSharedPointer< Task >> &  tasks)

Initializes the UI with the loaded tasks.

Parameters
tasksVector of loaded tasks.
Here is the caller graph for this function:

◆ setTaskManager()

void TaskUI::setTaskManager ( TaskManager manager)

Sets the TaskManager object.

Parameters
managerPointer to the TaskManager object.
Here is the caller graph for this function:

◆ setTaskUI()

void TaskUI::setTaskUI ( int  currentTaskIndex,
const QVector< QSharedPointer< Task >> &  tasks 
)

Sets the UI elements for the current task.

Parameters
currentTaskIndexIndex of the current task.
tasksVector of tasks.
Here is the caller graph for this function:

◆ startedRobotResetUI()

void TaskUI::startedRobotResetUI ( bool  noSubtasksLeft)

Update the UI to show that the robot reset has been started.

Parameters
noSubtasksLeftindicator, if subtasks are running after the rest or not.

◆ taskSelected

void TaskUI::taskSelected ( int  index)
signal

Signal emitted when a task is selected.

Parameters
indexIndex of the selected task.

◆ updateSubtaskItemsUI()

void TaskUI::updateSubtaskItemsUI ( )

Updates the UI elements for the subtasks.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: