aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/branchcheckoutdialog.h
blob: 2b58e7a4546a622f434d4abdbe2b758b06fdc77b (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
// Copyright (C) 2016 Petar Perisin <petar.perisin@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QDialog>

QT_BEGIN_NAMESPACE
class QCheckBox;
class QGroupBox;
class QRadioButton;
QT_END_NAMESPACE

namespace Git {
namespace Internal {

class BranchCheckoutDialog : public QDialog
{
    Q_OBJECT

public:
    explicit BranchCheckoutDialog(QWidget *parent, const QString &currentBranch,
                                  const QString &nextBranch);
    ~BranchCheckoutDialog() override;

    void foundNoLocalChanges();
    void foundStashForNextBranch();

    bool makeStashOfCurrentBranch();
    bool moveLocalChangesToNextBranch();
    bool discardLocalChanges();
    bool popStashOfNextBranch();

    bool hasStashForNextBranch();
    bool hasLocalChanges();

private:
    void updatePopStashCheckBox(bool moveChangesChecked);

    bool m_foundStashForNextBranch = false;
    bool m_hasLocalChanges = true;

    QGroupBox *m_localChangesGroupBox;
    QRadioButton *m_makeStashRadioButton;
    QRadioButton *m_moveChangesRadioButton;
    QRadioButton *m_discardChangesRadioButton;
    QCheckBox *m_popStashCheckBox;
};

} // namespace Internal
} // namespace Git