aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/sessiondialog.h
blob: ccb8a51e8b5f503e60de20f35d9c8b561171878e (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
49
50
51
52
53
54
55
56
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QString>
#include <QDialog>

QT_BEGIN_NAMESPACE
class QCheckBox;
class QLineEdit;
class QPushButton;
QT_END_NAMESPACE

namespace ProjectExplorer::Internal {

class SessionDialog : public QDialog
{
    Q_OBJECT

public:
    explicit SessionDialog(QWidget *parent = nullptr);

    void setAutoLoadSession(bool);
    bool autoLoadSession() const;

private:
    void updateActions(const QStringList &sessions);

    QPushButton *m_renameButton;
    QPushButton *m_cloneButton;
    QPushButton *m_deleteButton;
    QPushButton *m_switchButton;
    QCheckBox *m_autoLoadCheckBox;
};

class SessionNameInputDialog : public QDialog
{
    Q_OBJECT

public:
    explicit SessionNameInputDialog(QWidget *parent);

    void setActionText(const QString &actionText, const QString &openActionText);
    void setValue(const QString &value);
    QString value() const;
    bool isSwitchToRequested() const;

private:
    QLineEdit *m_newSessionLineEdit = nullptr;
    QPushButton *m_switchToButton = nullptr;
    QPushButton *m_okButton = nullptr;
    bool m_usedSwitchTo = false;
};

} // ProjectExplorer::Internal