Git: Only allow commit if author information is valid

Check author information to be valid before enableing
the commit button.

Task-number: QTCREATORBUG-2410
This commit is contained in:
Tobias Hunger
2010-10-04 15:37:15 +02:00
parent 685ae6bc55
commit c7142affef
5 changed files with 160 additions and 49 deletions

View File

@@ -31,8 +31,13 @@
#define GITSUBMITEDITORWIDGET_H
#include "ui_gitsubmitpanel.h"
#include <utils/submiteditorwidget.h>
QT_BEGIN_NAMESPACE
class QValidator;
QT_END_NAMESPACE
namespace Git {
namespace Internal {
@@ -49,6 +54,7 @@ struct GitSubmitEditorPanelData;
class GitSubmitEditorWidget : public Utils::SubmitEditorWidget
{
Q_OBJECT
public:
explicit GitSubmitEditorWidget(QWidget *parent = 0);
@@ -59,9 +65,18 @@ public:
void setPanelInfo(const GitSubmitEditorPanelInfo &info);
protected:
bool canSubmit() const;
private slots:
void authorInformationChanged();
private:
bool emailIsValid() const;
QWidget *m_gitSubmitPanel;
Ui::GitSubmitPanel m_gitSubmitPanelUi;
QValidator *m_emailValidator;
};
} // namespace Internal