Fixes: Naming glitch PagePage->Page

This commit is contained in:
Friedemann Kleint
2009-01-22 14:12:21 +01:00
parent 9a1dce5783
commit b60612c014
7 changed files with 25 additions and 25 deletions

View File

@@ -50,7 +50,7 @@ namespace Internal {
FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPages, FormClassWizardDialog::FormClassWizardDialog(const WizardPageList &extensionPages,
QWidget *parent) : QWidget *parent) :
QWizard(parent), QWizard(parent),
m_formPage(new FormTemplateWizardPagePage), m_formPage(new FormTemplateWizardPage),
m_classPage(new FormClassWizardPage) m_classPage(new FormClassWizardPage)
{ {
setWindowTitle(tr("Qt Designer Form Class")); setWindowTitle(tr("Qt Designer Form Class"));
@@ -97,8 +97,8 @@ void FormClassWizardDialog::slotCurrentIdChanged(int id)
m_rawFormTemplate = m_formPage->templateContents(); m_rawFormTemplate = m_formPage->templateContents();
// Strip namespaces from the ui class and suggest it as a new class // Strip namespaces from the ui class and suggest it as a new class
// name // name
if (FormTemplateWizardPagePage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName)) if (FormTemplateWizardPage::getUIXmlData(m_rawFormTemplate, &formBaseClass, &uiClassName))
m_classPage->setClassName(FormTemplateWizardPagePage::stripNamespaces(uiClassName)); m_classPage->setClassName(FormTemplateWizardPage::stripNamespaces(uiClassName));
} }
} }
@@ -107,7 +107,7 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const
FormClassWizardParameters rc; FormClassWizardParameters rc;
m_classPage->getParameters(&rc); m_classPage->getParameters(&rc);
// Name the ui class in the Ui namespace after the class specified // Name the ui class in the Ui namespace after the class specified
rc.uiTemplate = FormTemplateWizardPagePage::changeUiClassName(m_rawFormTemplate, rc.className); rc.uiTemplate = FormTemplateWizardPage::changeUiClassName(m_rawFormTemplate, rc.className);
return rc; return rc;
} }

View File

@@ -45,7 +45,7 @@ namespace Internal {
struct FormClassWizardParameters; struct FormClassWizardParameters;
class FormClassWizardPage; class FormClassWizardPage;
class FormTemplateWizardPagePage; class FormTemplateWizardPage;
class FormClassWizardDialog : public QWizard class FormClassWizardDialog : public QWizard
{ {
@@ -73,7 +73,7 @@ private slots:
void slotCurrentIdChanged(int id); void slotCurrentIdChanged(int id);
private: private:
FormTemplateWizardPagePage *m_formPage; FormTemplateWizardPage *m_formPage;
FormClassWizardPage *m_classPage; FormClassWizardPage *m_classPage;
QString m_rawFormTemplate; QString m_rawFormTemplate;
}; };

View File

@@ -57,7 +57,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
const QString indent = QString(indentation, QLatin1Char(' ')); const QString indent = QString(indentation, QLatin1Char(' '));
QString formBaseClass; QString formBaseClass;
QString uiClassName; QString uiClassName;
if (!FormTemplateWizardPagePage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) { if (!FormTemplateWizardPage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) {
qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData()); qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData());
return false; return false;
} }
@@ -107,7 +107,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
if (embedding == PointerAggregatedUiClass) { if (embedding == PointerAggregatedUiClass) {
headerStr << '\n' headerStr << '\n'
<< namespaceIndent << "namespace " << uiNamespaceC << " {\n" << namespaceIndent << "namespace " << uiNamespaceC << " {\n"
<< namespaceIndent << indent << "class " << FormTemplateWizardPagePage::stripNamespaces(uiClassName) << ";\n" << namespaceIndent << indent << "class " << FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n"
<< namespaceIndent << "}\n"; << namespaceIndent << "}\n";
} }

View File

@@ -55,9 +55,9 @@
namespace Designer { namespace Designer {
namespace Internal { namespace Internal {
// ----------------- FormTemplateWizardPagePage // ----------------- FormTemplateWizardPage
FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) : FormTemplateWizardPage::FormTemplateWizardPage(QWidget * parent) :
QWizardPage(parent), QWizardPage(parent),
m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(FormEditorW::instance()->designerEditor())), m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(FormEditorW::instance()->designerEditor())),
m_templateSelected(m_newFormWidget->hasCurrentTemplate()) m_templateSelected(m_newFormWidget->hasCurrentTemplate())
@@ -74,12 +74,12 @@ FormTemplateWizardPagePage::FormTemplateWizardPagePage(QWidget * parent) :
setLayout(layout); setLayout(layout);
} }
bool FormTemplateWizardPagePage::isComplete() const bool FormTemplateWizardPage::isComplete() const
{ {
return m_templateSelected; return m_templateSelected;
} }
void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelected) void FormTemplateWizardPage::slotCurrentTemplateChanged(bool templateSelected)
{ {
if (m_templateSelected == templateSelected) if (m_templateSelected == templateSelected)
return; return;
@@ -87,7 +87,7 @@ void FormTemplateWizardPagePage::slotCurrentTemplateChanged(bool templateSelecte
emit completeChanged(); emit completeChanged();
} }
bool FormTemplateWizardPagePage::validatePage() bool FormTemplateWizardPage::validatePage()
{ {
QString errorMessage; QString errorMessage;
m_templateContents = m_newFormWidget->currentTemplate(&errorMessage); m_templateContents = m_newFormWidget->currentTemplate(&errorMessage);
@@ -98,7 +98,7 @@ bool FormTemplateWizardPagePage::validatePage()
return true; return true;
} }
QString FormTemplateWizardPagePage::stripNamespaces(const QString &className) QString FormTemplateWizardPage::stripNamespaces(const QString &className)
{ {
QString rc = className; QString rc = className;
const int namespaceIndex = rc.lastIndexOf(QLatin1String("::")); const int namespaceIndex = rc.lastIndexOf(QLatin1String("::"));
@@ -107,7 +107,7 @@ QString FormTemplateWizardPagePage::stripNamespaces(const QString &className)
return rc; return rc;
} }
bool FormTemplateWizardPagePage::getUIXmlData(const QString &uiXml, bool FormTemplateWizardPage::getUIXmlData(const QString &uiXml,
QString *formBaseClass, QString *formBaseClass,
QString *uiClassName) QString *uiClassName)
{ {
@@ -179,7 +179,7 @@ static const char *classNameChangingSheetFormatC =
"</xsl:template>\n" "</xsl:template>\n"
"</xsl:stylesheet>\n"; "</xsl:stylesheet>\n";
QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
{ {
// Prepare I/O: Sheet // Prepare I/O: Sheet
const QString xsltSheet = QString::fromLatin1(classNameChangingSheetFormatC).arg(newUiClassName); const QString xsltSheet = QString::fromLatin1(classNameChangingSheetFormatC).arg(newUiClassName);
@@ -280,7 +280,7 @@ namespace {
// of the <class> element, as name of the first <widget> element, and possibly // of the <class> element, as name of the first <widget> element, and possibly
// in the signal/slot connections // in the signal/slot connections
QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, const QString &newUiClassName) QString FormTemplateWizardPage::changeUiClassName(const QString &uiXml, const QString &newUiClassName)
{ {
QDomDocument domUi; QDomDocument domUi;
if (!domUi.setContent(uiXml)) { if (!domUi.setContent(uiXml)) {

View File

@@ -46,12 +46,12 @@ namespace Internal {
// A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface // A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface
// widget. // widget.
class FormTemplateWizardPagePage : public QWizardPage class FormTemplateWizardPage : public QWizardPage
{ {
Q_DISABLE_COPY(FormTemplateWizardPagePage) Q_DISABLE_COPY(FormTemplateWizardPage)
Q_OBJECT Q_OBJECT
public: public:
explicit FormTemplateWizardPagePage(QWidget * parent = 0); explicit FormTemplateWizardPage(QWidget * parent = 0);
virtual bool isComplete () const; virtual bool isComplete () const;
virtual bool validatePage(); virtual bool validatePage();

View File

@@ -53,7 +53,7 @@ namespace Internal {
FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages, FormWizardDialog::FormWizardDialog(const WizardPageList &extensionPages,
QWidget *parent) QWidget *parent)
: QWizard(parent), : QWizard(parent),
m_formPage(new FormTemplateWizardPagePage) m_formPage(new FormTemplateWizardPage)
{ {
init(extensionPages); init(extensionPages);
} }
@@ -114,8 +114,8 @@ void FormFileWizardDialog::slotCurrentIdChanged(int id)
// the ui class // the ui class
QString formBaseClass; QString formBaseClass;
QString uiClassName; QString uiClassName;
if (FormTemplateWizardPagePage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) { if (FormTemplateWizardPage::getUIXmlData(templateContents(), &formBaseClass, &uiClassName)) {
QString fileName = FormTemplateWizardPagePage::stripNamespaces(uiClassName).toLower(); QString fileName = FormTemplateWizardPage::stripNamespaces(uiClassName).toLower();
fileName += QLatin1String(".ui"); fileName += QLatin1String(".ui");
m_filePage->setName(fileName); m_filePage->setName(fileName);
} }

View File

@@ -45,7 +45,7 @@ namespace Utils {
namespace Designer { namespace Designer {
namespace Internal { namespace Internal {
class FormTemplateWizardPagePage; class FormTemplateWizardPage;
// Single-Page Wizard for new forms offering all types known to Qt Designer. // Single-Page Wizard for new forms offering all types known to Qt Designer.
// To be used for Mode "CreateNewEditor" [not currently used] // To be used for Mode "CreateNewEditor" [not currently used]
@@ -65,7 +65,7 @@ public:
private: private:
void init(const WizardPageList &extensionPages); void init(const WizardPageList &extensionPages);
FormTemplateWizardPagePage *m_formPage; FormTemplateWizardPage *m_formPage;
mutable QString m_templateContents; mutable QString m_templateContents;
}; };