aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectwelcomepage.h
blob: a6901f0d9b02dfa4c27db7e2e9b9f18bbe186803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <coreplugin/iwelcomepage.h>

#include <QCoreApplication>

namespace Utils { class FilePath; }
namespace Core { class SessionModel; }

namespace ProjectExplorer {
namespace Internal {

class ProjectModel;
class SessionsPage;

class ProjectWelcomePage : public Core::IWelcomePage
{
    Q_OBJECT
public:
    ProjectWelcomePage();

    QString title() const override { return QCoreApplication::translate("QtC::ProjectExplorer", "Projects"); }
    int priority() const override { return 20; }
    Utils::Id id() const override;
    QWidget *createWidget() const override;

    void reloadWelcomeScreenData() const;

    static QWidget *createRecentProjectsView();

signals:
    void requestProject(const Utils::FilePath &project);

private:
    void openSessionAt(int index);
    void openProjectAt(int index);
    void createActions();

    friend class SessionsPage;
    Core::SessionModel *m_sessionModel = nullptr;
    ProjectModel *m_projectModel = nullptr;
};

} // namespace Internal
} // namespace ProjectExplorer