From 844ece10b57ec1f0ae5f56335104c79b153868c7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Feb 2010 12:06:49 +0100 Subject: [PATCH] NewClassWidget: Validate generate form check box correctly. Introduce buddies & key accelerators. Task-number: QTCREATORBUG-712 --- src/libs/utils/newclasswidget.cpp | 5 +++- src/libs/utils/newclasswidget.ui | 50 ++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/libs/utils/newclasswidget.cpp b/src/libs/utils/newclasswidget.cpp index 0d1168fd9ca..4303b53cff1 100644 --- a/src/libs/utils/newclasswidget.cpp +++ b/src/libs/utils/newclasswidget.cpp @@ -103,6 +103,8 @@ NewClassWidget::NewClassWidget(QWidget *parent) : this, SLOT(slotValidChanged())); connect(m_d->m_ui.pathChooser, SIGNAL(validChanged()), this, SLOT(slotValidChanged())); + connect(m_d->m_ui.generateFormCheckBox, SIGNAL(toggled(bool)), + this, SLOT(slotValidChanged())); connect(m_d->m_ui.classLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated())); @@ -431,7 +433,8 @@ bool NewClassWidget::isValid(QString *error) const return false; } - if (isFormInputVisible()) { + if (isFormInputVisible() && + (!m_d->m_formInputCheckable || m_d->m_ui.generateFormCheckBox->isChecked())) { if (!m_d->m_ui.formFileLineEdit->isValid()) { if (error) *error = tr("Invalid form file name: '%1'").arg(m_d->m_ui.formFileLineEdit->errorMessage()); diff --git a/src/libs/utils/newclasswidget.ui b/src/libs/utils/newclasswidget.ui index 92576f3aeec..e23ef8ed4b0 100644 --- a/src/libs/utils/newclasswidget.ui +++ b/src/libs/utils/newclasswidget.ui @@ -2,14 +2,6 @@ Utils::NewClassWidget - - - 0 - 0 - 431 - 291 - - QFormLayout::ExpandingFieldsGrow @@ -20,7 +12,10 @@ - Class name: + &Class name: + + + classLineEdit @@ -30,7 +25,10 @@ - Base class: + &Base class: + + + baseClassComboBox @@ -47,7 +45,10 @@ - Type information: + &Type information: + + + classTypeComboBox @@ -110,7 +111,10 @@ - Header file: + &Header file: + + + headerFileLineEdit @@ -120,7 +124,10 @@ - Source file: + &Source file: + + + sourceFileLineEdit @@ -130,7 +137,10 @@ - Generate form: + &Generate form: + + + generateFormCheckBox @@ -144,7 +154,10 @@ - Form file: + &Form file: + + + formFileLineEdit @@ -154,12 +167,15 @@ - Path: + &Path: + + + pathLabel - +