1 #ifndef CSV_WIDGET_SCENETOOLRUN_H
2 #define CSV_WIDGET_SCENETOOLRUN_H
3 
4 #include <set>
5 #include <string>
6 
7 #include "scenetool.hpp"
8 
9 class QFrame;
10 class QTableWidget;
11 class QModelIndex;
12 
13 namespace CSVWidget
14 {
15     class SceneToolRun : public SceneTool
16     {
17             Q_OBJECT
18 
19             std::set<std::string> mProfiles;
20             std::set<std::string>::iterator mSelected;
21             QString mToolTip;
22             QFrame *mPanel;
23             QTableWidget *mTable;
24 
25         private:
26 
27             void adjustToolTips();
28 
29             void updateIcon();
30 
31             void updatePanel();
32 
33         public:
34 
35             SceneToolRun (SceneToolbar *parent, const QString& toolTip, const QString& icon,
36                 const std::vector<std::string>& profiles);
37 
38             void showPanel (const QPoint& position) override;
39 
40             void activate() override;
41 
42             /// \attention This function does not remove the profile from the profile selection
43             /// panel.
44             void removeProfile (const std::string& profile);
45 
46             /// \attention This function doe not add the profile to the profile selection
47             /// panel. This only happens when the panel is re-opened.
48             ///
49             /// \note Adding profiles that are already listed is a no-op.
50             void addProfile (const std::string& profile);
51 
52         private slots:
53 
54             void clicked (const QModelIndex& index);
55 
56         signals:
57 
58             void runRequest (const std::string& profile);
59     };
60 }
61 
62 #endif
63