Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
execute_button.h
1#pragma once
2
3#include "dropdown_button.h"
4
5class ExecuteButton : public DropDownButton
6{
7 Q_OBJECT
8
9public:
10 ExecuteButton(QWidget* parent = nullptr);
11
12 void addOption(const QString& name, const QString& id);
13 void removeOption(const QString& id);
14
15 void setRunning(bool running);
16
17 void reset() override;
18
19signals:
20 void executeRequested(const QString& option, bool fromScratch);
21 void editOptionRequested(const QString& option);
22 void renameOptionRequested(const QString& option);
23 void deleteOptionRequested(const QString& option);
24
25protected:
26 QSize sizeHint() const override;
27 // void paintEvent(QPaintEvent* event) override;
28 int leadingContentWidth(const oclero::qlementine::Theme& theme) const override;
29 void paintLeadingContent(QPainter& painter, const QRect& rect, const oclero::qlementine::Theme& theme) override;
30
31private:
33 {
34 QString id;
35 QString name;
36 };
37
38 OptionInfo mCurrentOption;
39 bool mRunning = false;
40 const QString DEFAULT_TEXT;
41 const QString ADD_NEW_TEXT;
42
43 void setCurrentOption(const OptionInfo& option);
44 OptionInfo currentOption();
45
46 void buildMenu(QMenu* menu, const OptionInfo& option, bool addSelect);
47
48 void rebuildMenu(const std::vector<OptionInfo>& pipelines);
49 void setupDone();
50
51 void updateButtonText();
52 void showContextMenu(const QPoint& point);
53
54 std::vector<OptionInfo> getPipelineNames() const;
55};
Definition execute_button.h:33