File indexing completed on 2024-04-21 05:40:58

0001 /*
0002     SPDX-FileCopyrightText: 2010 Sebastian Doerner <sebastian@sebastian-doerner.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef COMMITDIALOG_H
0008 #define COMMITDIALOG_H
0009 
0010 #include <QDialog>
0011 
0012 class QCheckBox;
0013 class QDialogButtonBox;
0014 class QTextCodec;
0015 class KTextEdit;
0016 
0017 class CommitDialog : public QDialog
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit CommitDialog(QWidget* parent = nullptr);
0023     /**
0024      * Returns the commit message given by the user.
0025      * @returns The commit message.
0026      */
0027     QByteArray commitMessage() const;
0028     /**
0029      * Indicated whether the user wants to amend the last commit.
0030      * @returns True if the last commit is to be amended, false otherwise
0031      */
0032     bool amend() const;
0033 private Q_SLOTS:
0034     void signOffButtonClicked();
0035     void amendCheckBoxStateChanged();
0036     void saveDialogSize();
0037     void setOkButtonState();
0038 private:
0039     KTextEdit* m_commitMessageTextEdit;
0040     QCheckBox* m_amendCheckBox;
0041     QDialogButtonBox *m_buttonBox;
0042     /**
0043      * @brief Holds an alternative message, that is not displayed currently.
0044      * One message is the amend message, the other one for normal commits.
0045      */
0046     QString m_alternativeMessage;
0047     QTextCodec* m_localCodec;
0048     ///Cache for GitWrapper::userName();
0049     QString m_userName;
0050     ///Cache for GitWrapper::userEmail();
0051     QString m_userEmail;
0052 };
0053 
0054 #endif // COMMITDIALOG_H