forked from qt-creator/qt-creator
Made GUI app and library wizard honor the camelcase file settings.
Add setters in File page and the dialogs, convenience to QtWizard.
This commit is contained in:
@@ -175,5 +175,15 @@ void FilesPage::setFormInputChecked(bool checked)
|
||||
m_newClassWidget->setFormInputChecked(checked);
|
||||
}
|
||||
|
||||
bool FilesPage::lowerCaseFiles() const
|
||||
{
|
||||
return m_newClassWidget->lowerCaseFiles();
|
||||
}
|
||||
|
||||
void FilesPage::setLowerCaseFiles(bool l)
|
||||
{
|
||||
m_newClassWidget->setLowerCaseFiles(l);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
bool formInputCheckable() const;
|
||||
bool formInputChecked() const;
|
||||
QStringList baseClassChoices() const;
|
||||
bool lowerCaseFiles() const;
|
||||
|
||||
void setSuffixes(const QString &header, const QString &source, const QString &form = QString());
|
||||
|
||||
@@ -79,7 +80,7 @@ public slots:
|
||||
void setFormFileInputVisible(bool visible);
|
||||
void setFormInputCheckable(bool checkable);
|
||||
void setFormInputChecked(bool checked);
|
||||
|
||||
void setLowerCaseFiles(bool l);
|
||||
|
||||
private:
|
||||
Core::Utils::NewClassWidget *m_newClassWidget;
|
||||
|
||||
@@ -82,6 +82,7 @@ QWizard *GuiAppWizard::createWizardDialog(QWidget *parent,
|
||||
GuiAppWizardDialog *dialog = new GuiAppWizardDialog(name(), icon(), extensionPages, parent);
|
||||
dialog->setPath(defaultPath.isEmpty() ? Core::Utils::PathChooser::homePath() : defaultPath);
|
||||
// Order! suffixes first to generate files correctly
|
||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
||||
dialog->setBaseClasses(baseClasses());
|
||||
return dialog;
|
||||
|
||||
@@ -92,6 +92,12 @@ void GuiAppWizardDialog::setSuffixes(const QString &header, const QString &sourc
|
||||
m_filesPage->setSuffixes(header, source, form);
|
||||
}
|
||||
|
||||
void GuiAppWizardDialog::setLowerCaseFiles(bool l)
|
||||
{
|
||||
m_filesPage->setLowerCaseFiles(l);
|
||||
}
|
||||
|
||||
|
||||
void GuiAppWizardDialog::setPath(const QString &path)
|
||||
{
|
||||
m_introPage->setPath(path);
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
|
||||
void setBaseClasses(const QStringList &baseClasses);
|
||||
void setSuffixes(const QString &header, const QString &source, const QString &form);
|
||||
void setLowerCaseFiles(bool l);
|
||||
|
||||
QtProjectParameters projectParameters() const;
|
||||
GuiAppParameters parameters() const;
|
||||
|
||||
@@ -58,6 +58,7 @@ QWizard *LibraryWizard::createWizardDialog(QWidget *parent,
|
||||
const WizardPageList &extensionPages) const
|
||||
{
|
||||
LibraryWizardDialog *dialog = new LibraryWizardDialog(name(), icon(), extensionPages, parent);
|
||||
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
|
||||
dialog->setPath(defaultPath.isEmpty() ? Core::Utils::PathChooser::homePath() : defaultPath);
|
||||
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
|
||||
return dialog;
|
||||
|
||||
@@ -182,6 +182,11 @@ void LibraryWizardDialog::setSuffixes(const QString &header, const QString &sour
|
||||
m_filesPage->setSuffixes(header, source, form);
|
||||
}
|
||||
|
||||
void LibraryWizardDialog::setLowerCaseFiles(bool l)
|
||||
{
|
||||
m_filesPage->setLowerCaseFiles(l);
|
||||
}
|
||||
|
||||
void LibraryWizardDialog::setPath(const QString &path)
|
||||
{
|
||||
m_introPage->setPath(path);
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
QWidget *parent = 0);
|
||||
|
||||
void setSuffixes(const QString &header, const QString &source, const QString &form= QString());
|
||||
void setLowerCaseFiles(bool);
|
||||
|
||||
QtProjectParameters parameters() const;
|
||||
LibraryParameters libraryParameters() const;
|
||||
|
||||
@@ -33,12 +33,15 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
@@ -100,3 +103,18 @@ QString QtWizard::templateDir() const
|
||||
rc += QLatin1String("/templates/qt4project");
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool QtWizard::lowerCaseFiles()
|
||||
{
|
||||
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
|
||||
lowerCaseSettingsKey += QLatin1Char('/');
|
||||
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
|
||||
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
|
||||
return Core::ICore::instance()->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ protected:
|
||||
QString formSuffix() const;
|
||||
QString profileSuffix() const;
|
||||
|
||||
// Query CppTools settings for the class wizard settings
|
||||
static bool lowerCaseFiles();
|
||||
|
||||
private:
|
||||
bool postGenerateFiles(const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user