Commit 1b414e00 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Designer: Set C++ suffix and header lower case setting.



to be used for the promoted widgets dialog.
See also 00e954ca817f89958a8a8777d93d3843252dc88c in Qt 4.8.
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@nokia.com>
Task-number: QTCREATORBUG-163
parent 9e352be3
......@@ -71,13 +71,13 @@ FormClassWizardPage::~FormClassWizardPage()
}
// Retrieve settings of CppTools plugin.
static bool inline lowerCaseFiles(const Core::ICore *core)
bool FormClassWizardPage::lowercaseHeaderFiles()
{
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
lowerCaseSettingsKey += QLatin1Char('/');
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
return core->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
return Core::ICore::instance()->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
}
// Set up new class widget from settings
......@@ -87,7 +87,7 @@ void FormClassWizardPage::initFileGenerationSettings()
const Core::MimeDatabase *mdb = core->mimeDatabase();
m_ui->newClassWidget->setHeaderExtension(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
m_ui->newClassWidget->setSourceExtension(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE)));
m_ui->newClassWidget->setLowerCaseFiles(lowerCaseFiles(core));
m_ui->newClassWidget->setLowerCaseFiles(lowercaseHeaderFiles());
}
// Pop up settings dialog for generation settings
......
......@@ -63,6 +63,8 @@ public:
FormClassWizardGenerationParameters generationParameters() const;
void setGenerationParameters(const FormClassWizardGenerationParameters &gp);
static bool lowercaseHeaderFiles();
public slots:
void setClassName(const QString &suggestedClassName);
void setPath(const QString &);
......
......@@ -29,6 +29,7 @@
#include "formeditorplugin.h"
#include "formwindoweditor.h"
#include "formclasswizardpage.h"
#include "qtcreatorintegration.h"
#include "formeditorw.h"
#include "editordata.h"
......@@ -36,6 +37,7 @@
#include <widgethost.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <cplusplus/InsertionPointLocator.h>
#include <cplusplus/Symbols.h>
#include <cplusplus/Overview.h>
......@@ -47,6 +49,7 @@
#include <cplusplus/Control.h>
#include <cplusplus/TranslationUnit.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/basetexteditor.h>
......@@ -98,6 +101,9 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, F
this, SLOT(slotNavigateToSlot(QString, QString, QStringList)));
connect(this, SIGNAL(helpRequested(QString,QString)),
this, SLOT(slotDesignerHelpRequested(QString,QString)));
slotSyncSettingsToDesigner();
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
this, SLOT(slotSyncSettingsToDesigner()));
}
void QtCreatorIntegration::slotDesignerHelpRequested(const QString &manual, const QString &document)
......@@ -552,3 +558,13 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
return true;
}
void QtCreatorIntegration::slotSyncSettingsToDesigner()
{
#if QT_VERSION >= 0x040800
// Set promotion-relevant parameters on integration.
const Core::MimeDatabase *mdb = Core::ICore::instance()->mimeDatabase();
setHeaderSuffix(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
setHeaderLowercase(FormClassWizardPage::lowercaseHeaderFiles());
#endif
}
......@@ -59,6 +59,7 @@ public slots:
private slots:
void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList &parameterNames);
void slotDesignerHelpRequested(const QString &manual, const QString &document);
void slotSyncSettingsToDesigner();
private:
bool navigateToSlot(const QString &objectName,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment