1#pragma once
2
3#include <QWidget>
4#include <QMap>
5
6#include <JenkinsViewInfo.h>
7#include <IFetcher.h>
8
9class GitBase;
10class QStackedLayout;
11class QButtonGroup;
12class QHBoxLayout;
13class QVBoxLayout;
14class QTimer;
15
16namespace Jenkins
17{
18
19class RepoFetcher;
20class JobContainer;
21
22class JenkinsWidget : public QWidget
23{
24 Q_OBJECT
25
26signals:
27 void gotoPullRequest(int prNumber);
28 void gotoBranch(const QString &branchName);
29
30public:
31 JenkinsWidget(const QSharedPointer<GitBase> &git, QWidget *parent = nullptr);
32 ~JenkinsWidget() override;
33
34 void reload() const;
35
36private:
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