1 | #pragma once |
---|---|
2 | |
3 | #include <JenkinsViewInfo.h> |
4 | #include <JenkinsJobInfo.h> |
5 | #include <IFetcher.h> |
6 | |
7 | #include <QFrame> |
8 | |
9 | class QVBoxLayout; |
10 | class QTreeWidgetItem; |
11 | class QListWidget; |
12 | class QLabel; |
13 | class QHBoxLayout; |
14 | class QTreeWidget; |
15 | |
16 | namespace Jenkins |
17 | { |
18 | class JenkinsJobPanel; |
19 | class JobFetcher; |
20 | |
21 | class JobContainer : public QFrame |
22 | { |
23 | Q_OBJECT |
24 | |
25 | signals: |
26 | void signalJobAreViews(const QVector<JenkinsViewInfo> &views); |
27 | void gotoPullRequest(int prNumber); |
28 | void gotoBranch(const QString &branchName); |
29 | |
30 | public: |
31 | explicit JobContainer(const IFetcher::Config &config, const JenkinsViewInfo &viewInfo, QWidget *parent = nullptr); |
32 | |
33 | void reload(); |
34 | |
35 | private: |
36 | IFetcher::Config mConfig; |
37 | JenkinsViewInfo mView; |
38 | JobFetcher *mJobFetcher = nullptr; |
39 | QHBoxLayout *mMainLayout = nullptr; |
40 | QVBoxLayout *mJobListLayout = nullptr; |
41 | JenkinsJobPanel *mJobPanel = nullptr; |
42 | QVector<JenkinsJobInfo> mJobsList; |
43 | QTreeWidget *mJobsTree = nullptr; |
44 | QMap<QString, QListWidget *> mListsMap; |
45 | |
46 | void addJobs(const QMultiMap<QString, JenkinsJobInfo> &jobs); |
47 | void requestUpdatedJobInfo(const JenkinsJobInfo &jobInfo); |
48 | void onJobInfoReceived(JenkinsJobInfo oldInfo, const JenkinsJobInfo &newInfo); |
49 | void showJobInfo(QTreeWidgetItem *item, int column); |
50 | QIcon getIconForJob(JenkinsJobInfo job) const; |
51 | void createHeader(const QString &name, QListWidget *listWidget); |
52 | void onHeaderClicked(QListWidget *listWidget, QLabel *mTagArrow); |
53 | }; |
54 | } |
55 |