1
/******************************************************************************
2
* Copyright (C) 2010 by Sebastian Doerner <sebastian@sebastian-doerner.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18
******************************************************************************/
20
#ifndef CHECKOUTDIALOG_H
21
#define CHECKOUTDIALOG_H
34
* @brief The dialog for checking out Branches or Tags in Git.
36
class CheckoutDialog : public KDialog
41
CheckoutDialog(QWidget* parent = 0);
43
* Returns the name of the selected tag or branch to be checkout out
44
* @returns The name of the selected tag or branch
46
QString checkoutIdentifier() const;
48
* @returns True if the user selected a forced checkout, false otherwise.
52
* @returns The user selected name of the new branch, if a new branch is to be
53
* created, empty String otherwise.
55
QString newBranchName() const;
58
void branchRadioButtonToggled(bool checked);
59
void newBranchCheckBoxStateToggled(int state);
61
* Checks whether the values of all relevant widgets are valid.
62
* Enables or disables the OK button and sets tooltips accordingly.
64
void setOkButtonState();
65
void noteUserEditedNewBranchName();
67
* Inserts a default name for the new branch into m_newBranchName unless the user
68
* has already edited the content.
69
* @param baseBranchName The base name to derive the new name of.
71
void setDefaultNewBranchName(const QString & baseBranchName);
73
inline void setLineEditErrorModeActive(bool active);
75
///@brief true if the user has manually edited the branchName, false otherwise
76
bool m_userEditedNewBranchName;
77
QSet<QString> m_branchNames;
78
QPalette m_errorColors;
79
QGroupBox * m_branchSelectGroupBox;
80
QRadioButton * m_branchRadioButton;
81
KComboBox * m_branchComboBox;
82
KComboBox * m_tagComboBox;
83
QCheckBox * m_newBranchCheckBox;
84
KLineEdit * m_newBranchName;
85
QCheckBox * m_forceCheckBox;
88
#endif // CHECKOUTDIALOG_H