1 | #pragma once |
---|---|
2 | |
3 | #include <QWidget> |
4 | #include <QMap> |
5 | |
6 | #include <JenkinsViewInfo.h> |
7 | #include <IFetcher.h> |
8 | |
9 | class GitBase; |
10 | class QStackedLayout; |
11 | class QButtonGroup; |
12 | class QHBoxLayout; |
13 | class QVBoxLayout; |
14 | class QTimer; |
15 | |
16 | namespace Jenkins |
17 | { |
18 | |
19 | class RepoFetcher; |
20 | class JobContainer; |
21 | |
22 | class JenkinsWidget : public QWidget |
23 | { |
24 | Q_OBJECT |
25 | |
26 | signals: |
27 | void gotoPullRequest(int prNumber); |
28 | void gotoBranch(const QString &branchName); |
29 | |
30 | public: |
31 | JenkinsWidget(const QSharedPointer<GitBase> &git, QWidget *parent = nullptr); |
32 | ~JenkinsWidget() override; |
33 | |
34 | void reload() const; |
35 | |
36 | private: |
37 | QSharedPointer<GitBase> mGit; |
38 | IFetcher::Config mConfig; |
39 | QStackedLayout *mStackedLayout = nullptr; |
40 | RepoFetcher *mRepoFetcher = nullptr; |
41 | QHBoxLayout *mBodyLayout = nullptr; |
42 | QButtonGroup *mBtnGroup = nullptr; |
43 | QVBoxLayout *mButtonsLayout = nullptr; |
44 | QVector<JenkinsViewInfo> mViews; |
45 | QMap<QString, JobContainer *> mJobsMap; |
46 | QTimer *mTimer = nullptr; |
47 | |
48 | void configureGeneralView(const QVector<JenkinsViewInfo> &views); |
49 | }; |
50 | |
51 | } |
52 |