Go to the documentation of this file. 1 #ifndef SUBTASK_ITEM_HPP
2 #define SUBTASK_ITEM_HPP
10 #include <QPushButton>
11 #include <QToolButton>
13 #include <QHBoxLayout>
14 #include <QVBoxLayout>
39 void updateUI(
bool constructorCall =
false);
58 void handleStartButtonClick();
59 void handleHelpButtonClick();
60 void handleStartOwnScript();
61 void handleStartSolution();
62 void handleToggleSolution();
63 void handleResetNotebook();
75 void setupItemUI(
const QString &headerText,
const QString &linkText,
const QString &bodyText);
76 void initializeHelpMenu();
77 void initializeStartMenu();
78 void setExecutionFrame(
const QString& imagePath,
const QString& text);
79 void showToast(
const QString &message);
86 QToolButton *startButton;
87 QToolButton *helpButton;
88 QVBoxLayout *baseLayout;
91 QPushButton *menuStartOwnBtn;
92 QPushButton *menuStartSolutionBtn;
94 QPushButton *menuToggleSolutionBtn;
95 QPushButton *menuResetNotebookBtn;
103 #endif // SUBTASK_ITEM_HPP
A class for converting Jupyter notebooks to Python scripts and processing task pools.
Definition: notebook_converter.hpp:23
void resizeEvent(QResizeEvent *event) override
Definition: subtask_item.cpp:80
Manages tasks and their execution within the application.
Definition: task_manager.hpp:20
SubtaskStatus status
The status of the subtask.
Definition: task.hpp:46
@ Queued
The subtask is queued for execution.
static bool hasSolutionCells(const QString ¬ebookPath)
Checks if the notebook contains any solution cells.
Definition: notebook_converter.cpp:428
QString lastExecutionError
The error message from the last execution of the subtask.
Definition: task.hpp:50
@ Running
The subtask is currently being executed.
QString solutionFilePath
The file path to the solution of the subtask.
Definition: task.hpp:36
SubtaskItem(QWidget *parent, Subtask *subtask)
Constructs a SubtaskItem object.
Definition: subtask_item.cpp:62
@ Inactive
The subtask is inactive (state where it can't be executed).
void toggleSolution(Subtask &subtask)
Show or hide the solution of a subtask.
Definition: task_manager.cpp:74
QString filePath
The file path of the subtask.
Definition: task.hpp:35
void setImage(const QString &path)
Sets the image to be displayed.
Definition: execute_frame.cpp:52
Represents a UI item for a subtask.
Definition: subtask_item.hpp:25
void showToast(const QString &message)
Definition: toast.cpp:27
void subtaskStartStopRequested(const Subtask &subtask)
Signal emitted when a start/stop request is made for the subtask.
bool hasBeenExecuted
Whether the subtask has been executed at least once.
Definition: task.hpp:48
void setText(const QString &text)
Sets the text to be displayed.
Definition: execute_frame.cpp:84
void startStopSubtask(Subtask &subtask, bool startSolution=false)
Starts or stops a subtask.
Definition: task_manager.cpp:45
@ Ready
The subtask is ready to be executed.
void resetNotebook(const QString ¬ebookPath, const QString ¬ebookSolutionPath)
Removes solution code from a Jupyter notebook.
Definition: notebook_converter.cpp:104
void updateUI(bool constructorCall=false)
Updates the UI elements based on the subtask's status.
Definition: subtask_item.cpp:88
Represents a subtask within a task.
Definition: task.hpp:31
A custom QFrame that displays an image and text. For logging and task execution.
Definition: execute_frame.hpp:13
void setTaskManager(TaskManager *manager)
Sets the TaskManager object.
Definition: subtask_item.cpp:151