emit validReturnPressed();
}
+void BaseValidatingLineEdit::triggerChanged()
+{
+ slotChanged(text());
+}
+
} // namespace Utils
} // namespace Core
QColor errorColor() const;
void setErrorColor(const QColor &);
+ // Trigger an update (after changing settings)
+ void triggerChanged();
+
static QColor textColor(const QWidget *w);
static void setTextColor(QWidget *w, const QColor &c);
const QRegExp m_nameRegexp;
const QString m_namespaceDelimiter;
bool m_namespacesEnabled;
+ bool m_lowerCaseFileName;
};
// Match something like "Namespace1::Namespace2::ClassName".
ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
m_nameRegexp(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*")),
m_namespaceDelimiter(QLatin1String("::")),
- m_namespacesEnabled(false)
+ m_namespacesEnabled(false),
+ m_lowerCaseFileName(false)
{
QTC_ASSERT(m_nameRegexp.isValid(), return);
}
Core::Utils::BaseValidatingLineEdit::slotChanged(t);
if (isValid()) {
// Suggest file names, strip namespaces
- QString fileName = t.toLower();
+ QString fileName = m_d->m_lowerCaseFileName ? t.toLower() : t;
if (m_d->m_namespacesEnabled) {
const int namespaceIndex = fileName.lastIndexOf(m_d->m_namespaceDelimiter);
if (namespaceIndex != -1)
return className;
}
+bool ClassNameValidatingLineEdit::lowerCaseFileName() const
+{
+ return m_d->m_lowerCaseFileName;
+}
+
+void ClassNameValidatingLineEdit::setLowerCaseFileName(bool v)
+{
+ m_d->m_lowerCaseFileName = v;
+}
+
} // namespace Utils
} // namespace Core
{
Q_DISABLE_COPY(ClassNameValidatingLineEdit)
Q_PROPERTY(bool namespacesEnabled READ namespacesEnabled WRITE setNamespacesEnabled DESIGNABLE true)
+ Q_PROPERTY(bool lowerCaseFileName READ lowerCaseFileName WRITE setLowerCaseFileName)
Q_OBJECT
public:
bool namespacesEnabled() const;
void setNamespacesEnabled(bool b);
+ bool lowerCaseFileName() const;
+ void setLowerCaseFileName(bool v);
+
// Clean an input string to get a valid class name.
static QString createClassName(const QString &name);
m_d->m_ui.baseClassComboBox->setEditable(false);
connect(m_d->m_ui.classLineEdit, SIGNAL(updateFileName(QString)),
- this, SLOT(updateFileNames(QString)));
+ this, SLOT(slotUpdateFileNames(QString)));
connect(m_d->m_ui.classLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(classNameEdited()));
connect(m_d->m_ui.baseClassComboBox, SIGNAL(currentIndexChanged(int)),
}
}
+bool NewClassWidget::lowerCaseFiles() const
+{
+ return m_d->m_ui.classLineEdit->lowerCaseFileName();
+}
+
+void NewClassWidget::setLowerCaseFiles(bool v)
+{
+ m_d->m_ui.classLineEdit->setLowerCaseFileName(v);
+}
+
void NewClassWidget::slotValidChanged()
{
const bool newValid = isValid();
return true;
}
-void NewClassWidget::updateFileNames(const QString &baseName)
+void NewClassWidget::triggerUpdateFileNames()
+{
+ m_d->m_ui.classLineEdit->triggerChanged();
+}
+
+void NewClassWidget::slotUpdateFileNames(const QString &baseName)
{
if (debugNewClassWidget)
qDebug() << Q_FUNC_INFO << baseName << m_d->m_headerExtension << m_d->m_sourceExtension;
Q_PROPERTY(bool formInputCheckable READ formInputCheckable WRITE setFormInputCheckable DESIGNABLE true)
Q_PROPERTY(bool formInputChecked READ formInputChecked WRITE setFormInputChecked DESIGNABLE true)
Q_PROPERTY(bool allowDirectories READ allowDirectories WRITE setAllowDirectories)
+ Q_PROPERTY(bool lowerCaseFiles READ lowerCaseFiles WRITE setLowerCaseFiles)
// Utility "USER" property for wizards containing file names.
Q_PROPERTY(QStringList files READ files DESIGNABLE false USER true)
public:
QString headerExtension() const;
QString formExtension() const;
bool allowDirectories() const;
+ bool lowerCaseFiles() const;
bool isValid(QString *error = 0) const;
void setHeaderExtension(const QString &e);
void setFormExtension(const QString &e);
void setAllowDirectories(bool v);
+ void setLowerCaseFiles(bool v);
/* Suggest a class name from the base class by stripping the leading 'Q'
* character. This will happen automagically if the base class combo
* changes until the class line edited is manually edited. */
void suggestClassNameFromBase();
+public slots:
+ // Trigger an update (after changing settings)
+ void triggerUpdateFileNames();
+
private slots:
- void updateFileNames(const QString &t);
+ void slotUpdateFileNames(const QString &t);
void slotValidChanged();
void slotActivated();
void classNameEdited();
void slotFormInputChecked();
+
private:
void setFormInputCheckable(bool checkable, bool force);
return env.searchInPath("cmake");
}
+QString CMakeSettingsPage::id() const
+{
+ return QLatin1String("CMake");
+}
-QString CMakeSettingsPage::name() const
+QString CMakeSettingsPage::trName() const
{
- return "CMake";
+ return tr("CMake");
}
QString CMakeSettingsPage::category() const
{
- return "CMake";
+ return QLatin1String("CMake");
}
QString CMakeSettingsPage::trCategory() const
public:
CMakeSettingsPage();
virtual ~CMakeSettingsPage();
- virtual QString name() const;
+ virtual QString id() const;
+ virtual QString trName() const;
virtual QString category() const;
virtual QString trCategory() const;
return m_mainwindow->showNewItemDialog(title, wizards, defaultLocation);
}
-void CoreImpl::showOptionsDialog(const QString &group, const QString &page)
+bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWidget *parent)
{
- m_mainwindow->showOptionsDialog(group, page);
+ return m_mainwindow->showOptionsDialog(group, page, parent);
}
ActionManager *CoreImpl::actionManager() const
QStringList showNewItemDialog(const QString &title,
const QList<IWizard *> &wizards,
const QString &defaultLocation = QString());
- void showOptionsDialog(const QString &group = QString(),
- const QString &page = QString());
+ bool showOptionsDialog(const QString &group = QString(),
+ const QString &page = QString(),
+ QWidget *parent = 0);
ActionManager *actionManager() const;
FileManager *fileManager() const ;
namespace Core {
+/*!
+ \class Core::IOptionsPage
+ \brief The IOptionsPage is an interface for providing options pages.
+
+ Guidelines for implementing:
+ \list
+ \o id() is an id used for filtering when calling ICore:: showOptionsDialog()
+ \o trName() is the (translated) name for display.
+ \o category() is the category used for filtering when calling ICore:: showOptionsDialog()
+ \o trCategory() is the translated category
+ \o apply() is called to store the settings. It should detect if any changes have been
+ made and store those.
+ \endlist
+*/
+
class CORE_EXPORT IOptionsPage : public QObject
{
Q_OBJECT
IOptionsPage(QObject *parent = 0) : QObject(parent) {}
virtual ~IOptionsPage() {}
- virtual QString name() const = 0;
+ virtual QString id() const = 0;
+ virtual QString trName() const = 0;
virtual QString category() const = 0;
virtual QString trCategory() const = 0;
SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
const QString &initialPage)
- : QDialog(parent)
+ : QDialog(parent), m_applied(false)
{
setupUi(this);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
int index = 0;
foreach (IOptionsPage *page, pages) {
QTreeWidgetItem *item = new QTreeWidgetItem;
- item->setText(0, page->name());
+ item->setText(0, page->trName());
item->setData(0, Qt::UserRole, index);
QStringList categoriesId = page->category().split(QLatin1Char('|'));
m_pages.append(page);
stackedPages->addWidget(page->createPage(stackedPages));
- if (page->name() == initialPage && currentCategory == initialCategory) {
+ if (page->id() == initialPage && currentCategory == initialCategory) {
stackedPages->setCurrentIndex(stackedPages->count());
pageTree->setCurrentItem(item);
}
void SettingsDialog::accept()
{
+ m_applied = true;
foreach (IOptionsPage *page, m_pages) {
page->apply();
page->finish();
{
foreach (IOptionsPage *page, m_pages)
page->apply();
+ m_applied = true;
+}
+
+bool SettingsDialog::execDialog()
+{
+ m_applied = false;
+ exec();
+ return m_applied;
}
const QString &initialPage = QString());
~SettingsDialog();
+ // Run the dialog and return true if 'Ok' was choosen or 'Apply' was invoked
+ // at least once
+ bool execDialog();
+
private slots:
void pageSelected(QTreeWidgetItem *cat);
void accept();
private:
QList<Core::IOptionsPage*> m_pages;
+ bool m_applied;
};
} // namespace Internal
}
// IOptionsPage
-QString ShortcutSettings::name() const
+
+QString ShortcutSettings::id() const
+{
+ return QLatin1String("Keyboard");
+}
+
+QString ShortcutSettings::trName() const
{
return tr("Keyboard");
}
~ShortcutSettings();
// IOptionsPage
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
{
}
-QString GeneralSettings::name() const
+QString GeneralSettings::id() const
+{
+ return QLatin1String("General");
+}
+
+QString GeneralSettings::trName() const
{
return tr("General");
}
public:
GeneralSettings();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
QWidget* createPage(QWidget *parent);
const QList<IWizard *> &wizards,
const QString &defaultLocation = QString()) = 0;
- virtual void showOptionsDialog(const QString &group = QString(),
- const QString &page = QString()) = 0;
+ virtual bool showOptionsDialog(const QString &group = QString(),
+ const QString &page = QString(),
+ QWidget *parent = 0) = 0;
virtual ActionManager *actionManager() const = 0;
virtual FileManager *fileManager() const = 0;
return wizard->runWizard(defaultDir, this);
}
-void MainWindow::showOptionsDialog(const QString &category, const QString &page)
+bool MainWindow::showOptionsDialog(const QString &category,
+ const QString &page,
+ QWidget *parent)
{
emit m_coreImpl->optionsDialogRequested();
- SettingsDialog dlg(this, category, page);
- dlg.exec();
+ if (!parent)
+ parent = this;
+ SettingsDialog dlg(parent, category, page);
+ return dlg.execDialog();
}
void MainWindow::saveAll()
const QList<IWizard *> &wizards,
const QString &defaultLocation = QString());
- void showOptionsDialog(const QString &category = QString(), const QString &page = QString());
+ bool showOptionsDialog(const QString &category = QString(),
+ const QString &page = QString(),
+ QWidget *parent = 0);
protected:
virtual void changeEvent(QEvent *e);
}
}
-QString SettingsPage::name() const
+QString SettingsPage::id() const
{
- return "General";
+ return QLatin1String("General");
+}
+
+QString SettingsPage::trName() const
+{
+ return tr("General");
}
QString SettingsPage::category() const
{
- return "CodePaster";
+ return QLatin1String("CodePaster");
}
QString SettingsPage::trCategory() const
public:
SettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
#include "cppclasswizard.h"
#include "cppeditorconstants.h"
+#include <cpptools/cpptoolsconstants.h>
+#include <coreplugin/icore.h>
+#include <coreplugin/mimedatabase.h>
+
#include <utils/codegeneration.h>
#include <utils/newclasswidget.h>
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QTextStream>
+#include <QtCore/QSettings>
#include <QtGui/QVBoxLayout>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QPushButton>
+#include <QtGui/QToolButton>
+#include <QtGui/QSpacerItem>
#include <QtGui/QWizard>
using namespace CppEditor;
using namespace CppEditor::Internal;
-
// ========= ClassNamePage =========
-ClassNamePage::ClassNamePage(const QString &sourceSuffix,
- const QString &headerSuffix,
- QWidget *parent) :
+ClassNamePage::ClassNamePage(QWidget *parent) :
QWizardPage(parent),
m_isValid(false)
{
m_newClassWidget = new Core::Utils::NewClassWidget;
// Order, set extensions first before suggested name is derived
- m_newClassWidget->setHeaderExtension(headerSuffix);
- m_newClassWidget->setSourceExtension(sourceSuffix);
m_newClassWidget->setBaseClassInputVisible(true);
m_newClassWidget->setBaseClassChoices(QStringList() << QString()
<< QLatin1String("QObject")
m_newClassWidget->setNamespacesEnabled(true);
m_newClassWidget->setAllowDirectories(true);
- connect(m_newClassWidget, SIGNAL(validChanged()),
- this, SLOT(slotValidChanged()));
+ connect(m_newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
- QVBoxLayout *pageLayout = new QVBoxLayout(this);
+ QVBoxLayout *pageLayout = new QVBoxLayout(this);
pageLayout->addWidget(m_newClassWidget);
+ QSpacerItem *vSpacer = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding);
+ pageLayout->addItem(vSpacer);
+ QHBoxLayout *buttonLayout = new QHBoxLayout;
+ pageLayout->addLayout(buttonLayout);
+ QSpacerItem *hSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored);
+ buttonLayout->addItem(hSpacer);
+ QToolButton *settingsButton = new QToolButton;
+ settingsButton->setText(tr("Configure..."));
+ connect(settingsButton, SIGNAL(clicked()), this, SLOT(slotSettings()));
+ buttonLayout->addWidget(settingsButton);
+ initParameters();
+}
+
+// Retrieve settings of CppTools plugin.
+static inline bool lowerCaseFiles(const Core::ICore *core)
+{
+ QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
+ camelCaseSettingsKey += QLatin1Char('/');
+ camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
+ return core->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
+}
+
+// Set up new class widget from settings
+void ClassNamePage::initParameters()
+{
+ Core::ICore *core = Core::ICore::instance();
+ const Core::MimeDatabase *mdb = core->mimeDatabase();
+ m_newClassWidget->setHeaderExtension(mdb->preferredSuffixByType(QLatin1String(Constants::CPP_HEADER_MIMETYPE)));
+ m_newClassWidget->setSourceExtension(mdb->preferredSuffixByType(QLatin1String(Constants::CPP_SOURCE_MIMETYPE)));
+ m_newClassWidget->setLowerCaseFiles(lowerCaseFiles(core));
+}
+
+void ClassNamePage::slotSettings()
+{
+ const QString id = QLatin1String(CppTools::Constants::CPP_SETTINGS_ID);
+ const QString cat = QLatin1String(CppTools::Constants::CPP_SETTINGS_CATEGORY);
+ if (Core::ICore::instance()->showOptionsDialog(cat, id, this)) {
+ initParameters();
+ m_newClassWidget->triggerUpdateFileNames();
+ }
}
void ClassNamePage::slotValidChanged()
}
}
-CppClassWizardDialog::CppClassWizardDialog(const QString &sourceSuffix,
- const QString &headerSuffix,
- QWidget *parent) :
+CppClassWizardDialog::CppClassWizardDialog(QWidget *parent) :
QWizard(parent),
- m_classNamePage(new ClassNamePage(sourceSuffix, headerSuffix, this))
+ m_classNamePage(new ClassNamePage(this))
{
Core::BaseFileWizard::setupWizard(this);
setWindowTitle(tr("C++ Class Wizard"));
const QString &defaultPath,
const WizardPageList &extensionPages) const
{
- CppClassWizardDialog *wizard = new CppClassWizardDialog(sourceSuffix(), headerSuffix(), parent);
+ CppClassWizardDialog *wizard = new CppClassWizardDialog(parent);
foreach (QWizardPage *p, extensionPages)
wizard->addPage(p);
wizard->setPath(defaultPath);
Q_OBJECT
public:
- ClassNamePage(const QString &sourceSuffix,
- const QString &headerSuffix,
- QWidget *parent = 0);
+ explicit ClassNamePage(QWidget *parent = 0);
bool isComplete() const { return m_isValid; }
Core::Utils::NewClassWidget *newClassWidget() const { return m_newClassWidget; }
private slots:
void slotValidChanged();
+ void slotSettings();
private:
+ void initParameters();
+
Core::Utils::NewClassWidget *m_newClassWidget;
bool m_isValid;
};
Q_OBJECT
Q_DISABLE_COPY(CppClassWizardDialog)
public:
- explicit CppClassWizardDialog(const QString &sourceSuffix,
- const QString &headerSuffix,
- QWidget *parent = 0);
+ explicit CppClassWizardDialog(QWidget *parent = 0);
void setPath(const QString &path);
CppClassWizardParameters parameters() const;
#include <QtGui/QMenu>
#include <QtGui/QAction>
-static const char *headerSuffixKeyC = "CppEditor/HeaderSuffix";
-static const char *sourceSuffixKeyC = "CppEditor/SourceSuffix";
-
using namespace CppEditor::Internal;
//////////////////////////// CppEditorFactory /////////////////////////////
| TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::UnCollapseAll);
- // Check Suffixes
- if (const QSettings *settings = core->settings()) {
- const QString headerSuffixKey = QLatin1String(headerSuffixKeyC);
- if (settings->contains(headerSuffixKey)) {
- const QString headerSuffix = settings->value(headerSuffixKey, QString()).toString();
- if (!headerSuffix.isEmpty())
- core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_HEADER_MIMETYPE), headerSuffix);
- const QString sourceSuffix = settings->value(QLatin1String(sourceSuffixKeyC), QString()).toString();
- if (!sourceSuffix.isEmpty())
- core->mimeDatabase()->setPreferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE), sourceSuffix);
- }
- }
return true;
}
delete m_page;
}
-QString CompletionSettingsPage::name() const
+QString CompletionSettingsPage::id() const
+{
+ return QLatin1String("Completion");
+}
+
+QString CompletionSettingsPage::trName() const
{
return tr("Completion");
}
CompletionSettingsPage(CppCodeCompletion *completion);
~CompletionSettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
--- /dev/null
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+**************************************************************************/
+
+#include "cppfilesettingspage.h"
+#include "cpptoolsconstants.h"
+#include "ui_cppfilesettingspage.h"
+
+#include <coreplugin/icore.h>
+#include <coreplugin/mimedatabase.h>
+#include <extensionsystem/pluginmanager.h>
+
+#include <QtCore/QSettings>
+#include <QtCore/QDebug>
+#include <QtCore/QCoreApplication>
+
+static const char *headerSuffixKeyC = "HeaderSuffix";
+static const char *sourceSuffixKeyC = "SourceSuffix";
+
+namespace CppTools {
+namespace Internal {
+
+CppFileSettings::CppFileSettings() :
+ lowerCaseFiles(false)
+{
+}
+
+void CppFileSettings::toSettings(QSettings *s) const
+{
+ s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
+ s->setValue(QLatin1String(headerSuffixKeyC), headerSuffix);
+ s->setValue(QLatin1String(sourceSuffixKeyC), sourceSuffix);
+ s->setValue(QLatin1String(Constants::LOWERCASE_CPPFILES_KEY), lowerCaseFiles);
+ s->endGroup();
+}
+
+void CppFileSettings::fromSettings(QSettings *s)
+{
+ s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
+ headerSuffix= s->value(QLatin1String(headerSuffixKeyC), QLatin1String("h")).toString();
+ sourceSuffix = s->value(QLatin1String(sourceSuffixKeyC), QLatin1String("cpp")).toString();
+ lowerCaseFiles = s->value(QLatin1String(Constants::LOWERCASE_CPPFILES_KEY), QVariant(true)).toBool();
+ s->endGroup();
+}
+
+void CppFileSettings::applySuffixesToMimeDB()
+{
+ Core::MimeDatabase *mdb = Core::ICore::instance()->mimeDatabase();
+ mdb->setPreferredSuffix(QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE), sourceSuffix);
+ mdb->setPreferredSuffix(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE), headerSuffix);
+}
+
+bool CppFileSettings::equals(const CppFileSettings &rhs) const
+{
+ return lowerCaseFiles == rhs.lowerCaseFiles
+ && headerSuffix == rhs.headerSuffix
+ && sourceSuffix == rhs.sourceSuffix;
+}
+
+// ------------------ CppFileSettingsWidget
+
+CppFileSettingsWidget::CppFileSettingsWidget(QWidget *parent) :
+ QWidget(parent),
+ m_ui(new Ui::CppFileSettingsPage)
+{
+ m_ui->setupUi(this);
+ const Core::MimeDatabase *mdb = Core::ICore::instance()->mimeDatabase();
+ // populate suffix combos
+ if (const Core::MimeType sourceMt = mdb->findByType(QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE)))
+ foreach (const QString &suffix, sourceMt.suffixes())
+ m_ui->sourceSuffixComboBox->addItem(suffix);
+
+ if (const Core::MimeType headerMt = mdb->findByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)))
+ foreach (const QString &suffix, headerMt.suffixes())
+ m_ui->headerSuffixComboBox->addItem(suffix);
+}
+
+CppFileSettingsWidget::~CppFileSettingsWidget()
+{
+ delete m_ui;
+}
+
+CppFileSettings CppFileSettingsWidget::settings() const
+{
+ CppFileSettings rc;
+ rc.lowerCaseFiles = m_ui->lowerCaseFileNamesCheckBox->isChecked();
+ rc.headerSuffix = m_ui->headerSuffixComboBox->currentText();
+ rc.sourceSuffix = m_ui->sourceSuffixComboBox->currentText();
+ return rc;
+}
+
+static inline void setComboText(QComboBox *cb, const QString &text, int defaultIndex = 0)
+{
+ const int index = cb->findText(text);
+ cb->setCurrentIndex(index == -1 ? defaultIndex: index);
+}
+
+void CppFileSettingsWidget::setSettings(const CppFileSettings &s)
+{
+ m_ui->lowerCaseFileNamesCheckBox->setChecked(s.lowerCaseFiles);
+ setComboText(m_ui->headerSuffixComboBox, s.headerSuffix);
+ setComboText(m_ui->sourceSuffixComboBox, s.sourceSuffix);
+}
+
+// --------------- CppFileSettingsPage
+CppFileSettingsPage::CppFileSettingsPage(QObject *parent) :
+ Core::IOptionsPage(parent)
+{
+ m_settings.fromSettings(Core::ICore::instance()->settings());
+ m_settings.applySuffixesToMimeDB();
+}
+
+CppFileSettingsPage::~CppFileSettingsPage()
+{
+}
+
+QString CppFileSettingsPage::id() const
+{
+ return QLatin1String(Constants::CPP_SETTINGS_ID);
+}
+
+QString CppFileSettingsPage::trName() const
+{
+ return QCoreApplication::translate("CppTools", Constants::CPP_SETTINGS_ID);
+}
+
+QString CppFileSettingsPage::category() const
+{
+ return QLatin1String(Constants::CPP_SETTINGS_CATEGORY);
+}
+
+QString CppFileSettingsPage::trCategory() const
+{
+ return QCoreApplication::translate("CppTools", Constants::CPP_SETTINGS_CATEGORY);
+}
+
+QWidget *CppFileSettingsPage::createPage(QWidget *parent)
+{
+
+ m_widget = new CppFileSettingsWidget(parent);
+ m_widget->setSettings(m_settings);
+ return m_widget;
+}
+
+void CppFileSettingsPage::apply()
+{
+ if (m_widget) {
+ const CppFileSettings newSettings = m_widget->settings();
+ if (newSettings != m_settings) {
+ m_settings = newSettings;
+ m_settings.toSettings(Core::ICore::instance()->settings());
+ m_settings.applySuffixesToMimeDB();
+ }
+ }
+}
+
+}
+}
+
--- /dev/null
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+**************************************************************************/
+
+#ifndef CPPSETTINGSPAGE_H
+#define CPPSETTINGSPAGE_H
+
+#include <coreplugin/dialogs/ioptionspage.h>
+#include <QtCore/QPointer>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+ class CppFileSettingsPage;
+}
+class QSettings;
+QT_END_NAMESPACE
+
+namespace CppTools {
+namespace Internal {
+
+struct CppFileSettings {
+ CppFileSettings();
+
+ QString headerSuffix;
+ QString sourceSuffix;
+ bool lowerCaseFiles;
+
+ void toSettings(QSettings *) const;
+ void fromSettings(QSettings *);
+ void applySuffixesToMimeDB();
+
+ bool equals(const CppFileSettings &rhs) const;
+};
+
+inline bool operator==(const CppFileSettings &s1, const CppFileSettings &s2) { return s1.equals(s2); }
+inline bool operator!=(const CppFileSettings &s1, const CppFileSettings &s2) { return !s1.equals(s2); }
+
+class CppFileSettingsWidget : public QWidget {
+ Q_OBJECT
+public:
+ explicit CppFileSettingsWidget(QWidget *parent = 0);
+ virtual ~CppFileSettingsWidget();
+
+ CppFileSettings settings() const;
+ void setSettings(const CppFileSettings &s);
+
+private:
+ Ui::CppFileSettingsPage *m_ui;
+};
+
+class CppFileSettingsPage : public Core::IOptionsPage
+{
+public:
+ explicit CppFileSettingsPage(QObject *parent = 0);
+ virtual ~CppFileSettingsPage();
+
+ virtual QString id() const;
+ virtual QString trName() const;
+ virtual QString category() const;
+ virtual QString trCategory() const;
+
+ virtual QWidget *createPage(QWidget *parent);
+ virtual void apply();
+ virtual void finish() { }
+
+private:
+ QPointer<CppFileSettingsWidget> m_widget;
+ CppFileSettings m_settings;
+};
+
+} // namespace Internal
+} // namespace CppTools
+
+#endif // CPPSETTINGSPAGE_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CppFileSettingsPage</class>
+ <widget class="QWidget" name="CppFileSettingsPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>424</width>
+ <height>503</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="headerSuffixLabel">
+ <property name="text">
+ <string>Header suffix:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="headerSuffixComboBox"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="lowerCaseFileNamesLabel">
+ <property name="toolTip">
+ <string>This determines how the file names of the class wizards are generated ("MyClass.h" versus "myclass.h").</string>
+ </property>
+ <property name="text">
+ <string>Lower case file names:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="lowerCaseFileNamesCheckBox"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="sourceSuffixLabel">
+ <property name="text">
+ <string>Source suffix:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sourceSuffixComboBox"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>430</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
cpptoolseditorsupport.h \
cpptoolsplugin.h \
searchsymbols.h \
- cppdoxygen.h
+ cppdoxygen.h \
+ cppfilesettingspage.h
SOURCES += completionsettingspage.cpp \
cppclassesfilter.cpp \
cpptoolseditorsupport.cpp \
cpptoolsplugin.cpp \
searchsymbols.cpp \
- cppdoxygen.cpp
+ cppdoxygen.cpp \
+ cppfilesettingspage.cpp
-FORMS += completionsettingspage.ui
+FORMS += completionsettingspage.ui \
+ cppfilesettingspage.ui
#ifndef CPPTOOLSCONSTANTS_H
#define CPPTOOLSCONSTANTS_H
+#include <QtCore/QtGlobal>
+
namespace CppTools {
namespace Constants {
const char * const CPP_SOURCE_MIMETYPE = "text/x-c++src";
const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
+// QSettings keys for use by the "New Class" wizards.
+const char * const CPPTOOLS_SETTINGSGROUP = "CppTools";
+const char * const LOWERCASE_CPPFILES_KEY = "LowerCaseFiles";
+
+const char * const CPP_SETTINGS_ID = QT_TRANSLATE_NOOP("CppTools", "File naming conventions");
+const char * const CPP_SETTINGS_CATEGORY = QT_TRANSLATE_NOOP("CppTools", "C++");
+
} // namespace Constants
} // namespace CppTools
#include "cpptoolsplugin.h"
#include "completionsettingspage.h"
+#include "cppfilesettingspage.h"
#include "cppclassesfilter.h"
#include "cppcodecompletion.h"
#include "cppfunctionsfilter.h"
addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
addAutoReleasedObject(new CompletionSettingsPage(m_completion));
+ addAutoReleasedObject(new CppFileSettingsPage);
// Menus
Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS);
GdbOptionPage(DebuggerPlugin *plugin) : m_plugin(plugin) {}
// IOptionsPage
- QString name() const { return tr("Gdb"); }
- QString category() const { return "Debugger"; }
+ QString id() const { return QLatin1String("Gdb"); }
+ QString trName() const { return tr("Gdb"); }
+ QString category() const { return QLatin1String("Debugger"); }
QString trCategory() const { return tr("Debugger"); }
QWidget *createPage(QWidget *parent);
#include <coreplugin/icore.h>
#include <cppeditor/cppeditorconstants.h>
+#include <cpptools/cpptoolsconstants.h>
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QDebug>
+#include <QtCore/QSettings>
using namespace Designer;
using namespace Designer::Internal;
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
}
+// Retrieve settings of CppTools plugin.
+static inline bool lowerCaseFiles()
+{
+ QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
+ camelCaseSettingsKey += QLatin1Char('/');
+ camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
+ return Core::ICore::instance()->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
+}
+
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
const QString &defaultPath,
const WizardPageList &extensionPages) const
{
FormClassWizardDialog *wizardDialog = new FormClassWizardDialog(extensionPages,
parent);
- wizardDialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
wizardDialog->setPath(defaultPath);
return wizardDialog;
}
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
}
-void FormClassWizardDialog::setSuffixes(const QString &header, const QString &source, const QString &form)
-{
- m_classPage->setSuffixes(header, source, form);
-}
-
QString FormClassWizardDialog::path() const
{
return m_classPage->path();
explicit FormClassWizardDialog(const WizardPageList &extensionPages,
QWidget *parent = 0);
- void setSuffixes(const QString &header, const QString &source, const QString &form);
-
QString path() const;
FormClassWizardParameters parameters() const;
#include "formclasswizardparameters.h"
#include <coreplugin/icore.h>
+#include <coreplugin/mimedatabase.h>
#include <cppeditor/cppeditorconstants.h>
+#include <cpptools/cpptoolsconstants.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
m_ui->extensionWidget->setVisible(false);
connect(m_ui->moreButton, SIGNAL(clicked(bool)), m_ui->extensionWidget, SLOT(setVisible(bool)));
+ connect(m_ui->settingsToolButton, SIGNAL(clicked()), this, SLOT(slotSettings()));
+
restoreSettings();
}
delete m_ui;
}
-void FormClassWizardPage::setSuffixes(const QString &header, const QString &source, const QString &form)
+// Retrieve settings of CppTools plugin.
+static inline bool lowerCaseFiles(const Core::ICore *core)
{
- m_ui->newClassWidget->setSourceExtension(source);
- m_ui->newClassWidget->setHeaderExtension(header);
- m_ui->newClassWidget->setFormExtension(form);
+ QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
+ camelCaseSettingsKey += QLatin1Char('/');
+ camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
+ return core->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool();
+}
+
+// Set up new class widget from settings
+void FormClassWizardPage::initParameters()
+{
+ Core::ICore *core = Core::ICore::instance();
+ 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));
+}
+
+void FormClassWizardPage::slotSettings()
+{
+ const QString id = QLatin1String(CppTools::Constants::CPP_SETTINGS_ID);
+ const QString cat = QLatin1String(CppTools::Constants::CPP_SETTINGS_CATEGORY);
+ if (Core::ICore::instance()->showOptionsDialog(cat, id, this)) {
+ initParameters();
+ m_ui->newClassWidget->triggerUpdateFileNames();
+ }
}
void FormClassWizardPage::setClassName(const QString &suggestedClassName)
explicit FormClassWizardPage(QWidget * parent = 0);
~FormClassWizardPage();
- void setSuffixes(const QString &header, const QString &source, const QString &form);
-
virtual bool isComplete () const;
virtual bool validatePage();
QString path() const;
// Fill out applicable parameters
- void getParameters(FormClassWizardParameters *) const;
+ void getParameters(FormClassWizardParameters *) const;
public slots:
void setClassName(const QString &suggestedClassName);
void setPath(const QString &);
void setRetranslationSupport(bool);
void setUiClassEmbedding(int v);
+ void slotSettings();
private slots:
void slotValidChanged();
private:
+ void initParameters();
void saveSettings();
void restoreSettings();
</spacer>
</item>
<item>
+ <widget class="QToolButton" name="settingsToolButton">
+ <property name="text">
+ <string>Configure...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QToolButton" name="moreButton">
<property name="text">
<string>More</string>
{
}
-QString SettingsPage::name() const
+QString SettingsPage::id() const
+{
+ return m_designerPage->name();
+}
+
+QString SettingsPage::trName() const
{
return m_designerPage->name();
}
explicit SettingsPage(QDesignerOptionsPageInterface *designerPage);
virtual ~SettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
#include "gitsettings.h"
#include "gitplugin.h"
+#include <vcsbase/vcsbaseconstants.h>
+
+#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtGui/QMessageBox>
{
}
-QString SettingsPage::name() const
+QString SettingsPage::id() const
+{
+ return QLatin1String("Git");
+}
+
+QString SettingsPage::trName() const
{
- return tr("General");
+ return tr("Git");
}
QString SettingsPage::category() const
{
- return QLatin1String("Git");
+ return QLatin1String(VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QString SettingsPage::trCategory() const
{
- return tr("Git");
+ return QCoreApplication::translate("VCSBase", VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QWidget *SettingsPage::createPage(QWidget *parent)
public:
SettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
{
}
-QString DocSettingsPage::name() const
+QString DocSettingsPage::id() const
{
- return "Documentation";
+ return QLatin1String("Documentation");
}
+QString DocSettingsPage::trName() const
+{
+ return tr("Documentation");
+}
+
+
QString DocSettingsPage::category() const
{
- return "Help";
+ return QLatin1String("Help");
}
QString DocSettingsPage::trCategory() const
public:
DocSettingsPage(QHelpEngine *helpEngine);
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
using namespace Help::Internal;
-FilterSettingsPage::FilterSettingsPage(QHelpEngine *helpEngine)
+FilterSettingsPage::FilterSettingsPage(QHelpEngine *helpEngine) :
+ m_helpEngine(helpEngine)
{
- m_helpEngine = helpEngine;
}
-QString FilterSettingsPage::name() const
+QString FilterSettingsPage::id() const
{
- return "Filters";
+ return QLatin1String("Filters");
+}
+
+QString FilterSettingsPage::trName() const
+{
+ return tr("Filters");
}
QString FilterSettingsPage::category() const
{
- return "Help";
+ return QLatin1String("Help");
}
QString FilterSettingsPage::trCategory() const
public:
FilterSettingsPage(QHelpEngine *helpEngine);
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
#include "perforcesettings.h"
#include "perforceplugin.h"
+#include <vcsbase/vcsbaseconstants.h>
+
+#include <QtCore/QCoreApplication>
#include <QtGui/QLineEdit>
#include <QtGui/QFileDialog>
{
}
-QString SettingsPage::name() const
+QString SettingsPage::id() const
+{
+ return QLatin1String("Perforce");
+}
+
+QString SettingsPage::trName() const
{
- return tr("General");
+ return tr("Perforce");
}
QString SettingsPage::category() const
{
- return QLatin1String("Perforce");
+ return QLatin1String(VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QString SettingsPage::trCategory() const
{
- return tr("Perforce");
+ return QCoreApplication::translate("VCSBase", VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QWidget *SettingsPage::createPage(QWidget *parent)
public:
SettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
return m_idcount++;
}
-QString QtVersionManager::name() const
+QString QtVersionManager::id() const
+{
+ return QLatin1String(Constants::QTVERSION_PAGE);
+}
+
+QString QtVersionManager::trName() const
{
return tr(Constants::QTVERSION_PAGE);
}
QtVersionManager();
~QtVersionManager();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
#ifndef QUICKOPENCONSTANTS_H
#define QUICKOPENCONSTANTS_H
+#include <QtCore/QtGlobal>
+
namespace QuickOpen {
namespace Constants {
-const char * const FILTER_OPTIONS_PAGE = "Filters";
-const char * const QUICKOPEN_CATEGORY = "Locator";
+const char * const FILTER_OPTIONS_PAGE = QT_TRANSLATE_NOOP("Locator", "Filters");
+const char * const QUICKOPEN_CATEGORY = QT_TRANSLATE_NOOP("Locator", "Locator");
const char * const TASK_INDEX = "QuickOpen.Task.Index";
} // namespace Constants
**************************************************************************/
#include "quickopenplugin.h"
+#include "quickopenconstants.h"
#include "quickopenfiltersfilter.h"
#include "quickopenmanager.h"
#include "quickopentoolwindow.h"
filters = m_filters;
QFuture<void> task = QtConcurrent::run(&IQuickOpenFilter::refresh, filters);
Core::FutureProgress *progress = Core::ICore::instance()
- ->progressManager()->addTask(task, tr("Indexing"), Constants::TASK_INDEX, Core::ProgressManager::CloseOnSuccess);
+ ->progressManager()->addTask(task, tr("Indexing"), QuickOpen::Constants::TASK_INDEX, Core::ProgressManager::CloseOnSuccess);
connect(progress, SIGNAL(finished()), this, SLOT(saveSettings()));
}
**************************************************************************/
#include "settingspage.h"
+#include "quickopenconstants.h"
#include "quickopenplugin.h"
#include "iquickopenfilter.h"
#include <qtconcurrent/QtConcurrentTools>
#include <utils/qtcassert.h>
+#include <QtCore/QCoreApplication>
+
Q_DECLARE_METATYPE(QuickOpen::IQuickOpenFilter*)
using namespace QuickOpen;
{
}
+QString SettingsPage::id() const
+{
+ return QLatin1String(Constants::FILTER_OPTIONS_PAGE);
+}
+
+QString SettingsPage::trName() const
+{
+ return QCoreApplication::translate("Locator", QuickOpen::Constants::FILTER_OPTIONS_PAGE);
+}
+
+QString SettingsPage::category() const
+{
+ return Constants::QUICKOPEN_CATEGORY;
+}
+
+QString SettingsPage::trCategory() const
+{
+ return QCoreApplication::translate("Locator", QuickOpen::Constants::QUICKOPEN_CATEGORY);
+}
+
QWidget *SettingsPage::createPage(QWidget *parent)
{
if (!m_page) {
#define SETTINGSPAGE_H
#include "ui_settingspage.h"
-#include "quickopenconstants.h"
#include <QtCore/QPointer>
#include <QtCore/QHash>
public:
explicit SettingsPage(QuickOpenPlugin *plugin);
- QString name() const { return tr(Constants::FILTER_OPTIONS_PAGE); }
- QString category() const { return Constants::QUICKOPEN_CATEGORY; }
- QString trCategory() const { return tr(Constants::QUICKOPEN_CATEGORY); }
+ QString id() const;
+ QString trName() const;
+ QString category() const;
+ QString trCategory() const;
QWidget *createPage(QWidget *parent);
void apply();
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
+#include <vcsbase/vcsbaseconstants.h>
+#include <utils/pathchooser.h>
+#include <QtCore/QCoreApplication>
#include <QtGui/QFileDialog>
-#include <utils/pathchooser.h>
using namespace Subversion::Internal;
using namespace Core::Utils;
-
SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
QWidget(parent)
{
{
}
-QString SettingsPage::name() const
+QString SettingsPage::id() const
+{
+ return QLatin1String("Subversion");
+}
+
+QString SettingsPage::trName() const
{
- return tr("General");
+ return tr("Subversion");
}
QString SettingsPage::category() const
{
- return QLatin1String("Subversion");
+ return QLatin1String(VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QString SettingsPage::trCategory() const
{
- return tr("Subversion");
+ return QCoreApplication::translate("VCSBase", VCSBase::Constants::VCS_SETTINGS_CATEGORY);
}
QWidget *SettingsPage::createPage(QWidget *parent)
public:
SettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
delete m_d;
}
-QString BehaviorSettingsPage::name() const
+QString BehaviorSettingsPage::id() const
+{
+ return m_d->m_parameters.name;
+}
+
+QString BehaviorSettingsPage::trName() const
{
return m_d->m_parameters.name;
}
virtual ~BehaviorSettingsPage();
// IOptionsPage
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
delete m_d;
}
-QString DisplaySettingsPage::name() const
+QString DisplaySettingsPage::id() const
+{
+ return m_d->m_parameters.name;
+}
+
+QString DisplaySettingsPage::trName() const
{
return m_d->m_parameters.name;
}
virtual ~DisplaySettingsPage();
// IOptionsPage
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
delete d_ptr;
}
-QString FontSettingsPage::name() const
+QString FontSettingsPage::id() const
+{
+ return d_ptr->m_name;
+}
+
+QString FontSettingsPage::trName() const
{
return d_ptr->m_name;
}
~FontSettingsPage();
- QString name() const;
+ QString id() const;
+ QString trName() const;
QString category() const;
QString trCategory() const;
#ifndef VCSBASE_CONSTANTS_H
#define VCSBASE_CONSTANTS_H
+#include <QtCore/QtGlobal>
+
namespace VCSBase {
namespace Constants {
+const char * const VCS_SETTINGS_CATEGORY = QT_TRANSLATE_NOOP("VCSBase", "Version Control System");
+
namespace Internal {
-enum { debug = 0 };
+ enum { debug = 0 };
} // namespace Internal
} // namespace Constants
linux-* {
# form abs path to qtcreator lib dir
- GH_LIB=$$dirname(PWD)
- GH_LIB=$$dirname(GH_LIB)
- GH_LIB=$$dirname(GH_LIB)
- GH_LIB=$$GH_LIB/lib
- QMAKE_RPATHDIR *= $$GH_LIB
+ QTC_LIBS=$$dirname(PWD)
+ QTC_LIBS=$$dirname(QTC_LIBS)
+ QTC_LIBS=$$dirname(QTC_LIBS)
+ QTC_LIBS=$$QTC_LIBS/lib/qtcreator
+ QMAKE_RPATHDIR *= $$QTC_LIBS
}
INCLUDEPATH += ../../../src/libs
CONFIG(debug, debug|release):LIBS += -lUtils_debug
else:LIBS += -lUtils
} else {
- LIBS += -L../../../lib -lUtils
+ LIBS += -L$$QTC_LIBS -lUtils
}
DESTDIR= $$[QT_INSTALL_PLUGINS]/designer