Learn Environment
Loading...
Searching...
No Matches
task_ui.hpp
Go to the documentation of this file.
1#ifndef TASKUI_HPP
2#define TASKUI_HPP
3
4#include "sidebar.hpp"
5#include "task.hpp"
6#include "task_manager.hpp"
7#include "execute_frame.hpp"
8
9#include <QObject>
10#include <QVBoxLayout>
11#include <QLabel>
12#include <QToolButton>
13#include <QPushButton>
14#include <QFrame>
15
24class TaskUI : public QWidget {
25 Q_OBJECT
26
27public:
42 TaskUI(QVBoxLayout *subtaskListLayout, QLabel *mainTitleLabel,
43 QLabel *difficultyLabel, QLabel *folderLabel, QLabel *topicLabel,
44 QPushButton *nextButton, QPushButton *previousButton, QToolButton *menuButton,
45 QToolButton *resetRobotStartButton, QFrame *resetRobotFrame, QWidget *centralwidget, QWidget *parent = nullptr);
46
51 void initializeUI(const QVector<QSharedPointer<Task>> &tasks);
52
57 void setTaskUI(int currentTaskIndex);
58
63
69
74 void startedRobotResetUI(bool noSubtasksLeft);
75
80
85 void failedRobotResetUI(const QString &error);
86
87Q_SIGNALS:
92 void taskSelected(int index);
93
94private Q_SLOTS:
98 void toggleSidebarVisibility();
99
100private:
101 Sidebar *sidebar;
102 QVBoxLayout *subtaskListLayout;
103 QLabel *mainTitleLabel;
104 QLabel *difficultyLabel;
105 QLabel *folderLabel;
106 QLabel *topicLabel;
107 QPushButton *nextButton;
108 QPushButton *previousButton;
109 QToolButton *menuButton;
110 QToolButton *resetRobotStartButton;
111 QFrame *resetRobotFrame;
112 ExecuteFrame *executeResetRobotFrame;
113 QWidget *centralwidget;
114 QVector<QSharedPointer<Task>> tasks;
115 TaskManager *taskManager;
116
121 void setSubtaskItems(int currentTaskIndex);
122
126 void addLineBetweenWidgets();
127
131 void setupSplitterAndLayout();
132};
133
134#endif // TASKUI_HPP
A custom QFrame that displays an image and text. For logging and task execution.
Definition execute_frame.hpp:14
Represents the sidebar UI component for displaying tasks.
Definition sidebar.hpp:23
Manages tasks and their execution within the application.
Definition task_manager.hpp:21
Manages the user interface for tasks and subtasks.
Definition task_ui.hpp:24
void startedRobotResetUI(bool noSubtasksLeft)
Update the UI to show that the robot reset has been started.
void setTaskManager(TaskManager *manager)
Sets the TaskManager object.
void initializeUI(const QVector< QSharedPointer< Task > > &tasks)
Initializes the UI with the loaded tasks.
void finishedRobotResetUI()
Update the UI to show that the robot reset has finished.
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.
void failedRobotResetUI(const QString &error)
Update the UI to show that the robot reset has failed.
void updateSubtaskItemsUI()
Updates the UI elements for the subtasks.
void setTaskUI(int currentTaskIndex)
Sets the UI elements for the current task.
void taskSelected(int index)
Signal emitted when a task is selected.