forked from qt-creator/qt-creator
Options dialog: Further polishing.
Task-number: QTCREATOR-26
This commit is contained in:
@@ -40,9 +40,12 @@
|
||||
#include <QtCore/QtConcurrentRun>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QBoxLayout>
|
||||
#include <QtGui/QDesktopServices>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QSpacerItem>
|
||||
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
@@ -258,13 +261,17 @@ QString CMakeSettingsPage::trCategory() const
|
||||
|
||||
QWidget *CMakeSettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
QFormLayout *fl = new QFormLayout(w);
|
||||
m_pathchooser = new Utils::PathChooser(w);
|
||||
QWidget *outerWidget = new QWidget(parent);
|
||||
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
|
||||
QGroupBox *groupBox = new QGroupBox(trCategory());
|
||||
outerLayout->addWidget(groupBox);
|
||||
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
|
||||
QFormLayout *formLayout = new QFormLayout(groupBox);
|
||||
m_pathchooser = new Utils::PathChooser;
|
||||
m_pathchooser->setExpectedKind(Utils::PathChooser::Command);
|
||||
fl->addRow(tr("CMake executable"), m_pathchooser);
|
||||
formLayout->addRow(tr("Executable:"), m_pathchooser);
|
||||
m_pathchooser->setPath(cmakeExecutable());
|
||||
return w;
|
||||
return outerWidget;
|
||||
}
|
||||
|
||||
void CMakeSettingsPage::updateInfo()
|
||||
|
||||
@@ -184,6 +184,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
|
||||
m_applied(false)
|
||||
{
|
||||
setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
#ifdef Q_OS_MAC
|
||||
setWindowTitle(tr("Preferences"));
|
||||
#else
|
||||
|
||||
@@ -34,8 +34,11 @@
|
||||
#include <utils/consoleprocess.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include "ui_generalsettings.h"
|
||||
|
||||
using namespace Utils;
|
||||
@@ -94,9 +97,20 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
||||
this, SLOT(resetTerminal()));
|
||||
#endif
|
||||
|
||||
if (m_searchKeywords.isEmpty()) {
|
||||
QTextStream(&m_searchKeywords) << m_page->colorLabel->text() << ' '
|
||||
<< m_page->terminalLabel->text() << ' ' << m_page->editorLabel->text()
|
||||
<< ' '<< m_page->modifiedLabel->text();
|
||||
m_searchKeywords.remove(QLatin1Char('&'));
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
bool GeneralSettings::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
void GeneralSettings::apply()
|
||||
{
|
||||
// Apply the new base color if accepted
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
QWidget* createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish();
|
||||
virtual bool matches(const QString &) const;
|
||||
|
||||
private slots:
|
||||
void resetInterfaceColor();
|
||||
@@ -66,6 +67,7 @@ private slots:
|
||||
|
||||
private:
|
||||
Ui::GeneralSettings *m_page;
|
||||
QString m_searchKeywords;
|
||||
QPointer<QWidget> m_dialog;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,49 +2,28 @@
|
||||
<ui version="4.0">
|
||||
<class>Core::Internal::GeneralSettings</class>
|
||||
<widget class="QWidget" name="Core::Internal::GeneralSettings">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>536</width>
|
||||
<height>233</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>General settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="colorLabel">
|
||||
<property name="text">
|
||||
<string>User &interface color:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>colorButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="rowWrapPolicy">
|
||||
<enum>QFormLayout::WrapLongRows</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="colorLabel">
|
||||
<property name="text">
|
||||
<string>User &interface color:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>colorButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="colorHorizontalLayout">
|
||||
<item>
|
||||
<widget class="Utils::QtColorButton" name="colorButton">
|
||||
<property name="sizePolicy">
|
||||
@@ -93,15 +72,15 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="terminalLabel">
|
||||
<property name="text">
|
||||
<string>Terminal:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="terminalLabel">
|
||||
<property name="text">
|
||||
<string>Terminal:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="terminalHorizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="terminalEdit"/>
|
||||
</item>
|
||||
@@ -121,15 +100,15 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>External editor:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="editorLabel">
|
||||
<property name="text">
|
||||
<string>External editor:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="editorHorizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="externalEditorEdit"/>
|
||||
</item>
|
||||
@@ -156,47 +135,43 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="modifiedLabel">
|
||||
<property name="text">
|
||||
<string>When files are externally modified:</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="reloadBehavior">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>When files are externally modified:</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="text">
|
||||
<string>Always ask</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="reloadBehavior">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always ask</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Reload all modified files</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ignore modifications</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<property name="text">
|
||||
<string>Reload all modified files</string>
|
||||
</property>
|
||||
</item>
|
||||
</layout>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ignore modifications</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
@@ -70,22 +73,26 @@ QString CodePasterSettingsPage::trCategory() const
|
||||
}
|
||||
|
||||
QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
QLabel *label = new QLabel(tr("Server:"));
|
||||
QLineEdit *lineedit = new QLineEdit;
|
||||
lineedit->setText(m_host);
|
||||
{
|
||||
QGroupBox *groupBox = new QGroupBox(category());
|
||||
QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox);
|
||||
QFormLayout *formLayout = new QFormLayout;
|
||||
QLineEdit *lineedit = new QLineEdit(m_host);
|
||||
connect(lineedit, SIGNAL(textChanged(QString)), this, SLOT(serverChanged(QString)));
|
||||
formLayout->addRow(tr("Server:"), lineedit);
|
||||
groupBoxLayout->addLayout(formLayout);
|
||||
groupBoxLayout->addSpacerItem(new QSpacerItem(0, 60, QSizePolicy::Ignored, QSizePolicy::Fixed));
|
||||
|
||||
QLabel *noteLabel = new QLabel(tr("Note: Specify the host name for the CodePaster service "
|
||||
"without any protocol prepended (e.g. codepaster.mycompany.com)."));
|
||||
noteLabel->setWordWrap(true);
|
||||
QGridLayout* layout = new QGridLayout();
|
||||
layout->addWidget(label, 0, 0);
|
||||
layout->addWidget(lineedit, 0, 1);
|
||||
layout->addWidget(noteLabel, 1, 1);
|
||||
layout->addItem(new QSpacerItem(1,1, QSizePolicy::Preferred, QSizePolicy::MinimumExpanding), 2, 0);
|
||||
w->setLayout(layout);
|
||||
return w;
|
||||
groupBoxLayout->addWidget(noteLabel);
|
||||
|
||||
QWidget *outerWidget = new QWidget(parent);
|
||||
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
|
||||
outerLayout->addWidget(groupBox);
|
||||
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
|
||||
return outerWidget;
|
||||
}
|
||||
|
||||
void CodePasterSettingsPage::apply()
|
||||
|
||||
@@ -6,45 +6,67 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>520</width>
|
||||
<height>475</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Server Prefix:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://pastebin.com"><span style=" text-decoration: underline; color:#0000ff;">pastebin.com</span></a><span style=" font-size:8pt;"> allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Note that the plugin will use this for posting as well as fetching.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>PasteBin</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="serverPrefix">
|
||||
<property name="text">
|
||||
<string>Server Prefix:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="explanatoryTextSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="explanatoryTextLabel">
|
||||
<property name="text">
|
||||
<string><html><head/><body>
|
||||
<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.</p>
|
||||
<p>Note that the plugin will use this for posting as well as fetching.</p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
|
||||
@@ -31,11 +31,13 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
using namespace CodePaster;
|
||||
|
||||
@@ -86,6 +88,11 @@ QWidget *SettingsPage::createPage(QWidget *parent)
|
||||
m_ui.userEdit->setText(m_username);
|
||||
m_ui.clipboardBox->setChecked(m_copy);
|
||||
m_ui.displayBox->setChecked(m_output);
|
||||
if (m_searchKeywords.isEmpty()) {
|
||||
QTextStream(&m_searchKeywords) << m_ui.protocolLabel->text() << ' '
|
||||
<< m_ui.userNameLabel->text();
|
||||
m_searchKeywords.remove(QLatin1Char('&'));
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
@@ -107,6 +114,11 @@ void SettingsPage::apply()
|
||||
m_settings->endGroup();
|
||||
}
|
||||
|
||||
bool SettingsPage::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
void SettingsPage::addProtocol(const QString &name)
|
||||
{
|
||||
m_protocols.append(name);
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish() { }
|
||||
virtual bool matches(const QString &) const;
|
||||
|
||||
void addProtocol(const QString& name);
|
||||
QString username() const;
|
||||
@@ -71,6 +72,7 @@ private:
|
||||
Ui_SettingsPage m_ui;
|
||||
QSettings *m_settings;
|
||||
|
||||
QString m_searchKeywords;
|
||||
QStringList m_protocols;
|
||||
QString m_username;
|
||||
QString m_protocol;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>362</width>
|
||||
<width>453</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -24,7 +24,7 @@
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="protocolLabel">
|
||||
<property name="text">
|
||||
<string>Default Protocol:</string>
|
||||
</property>
|
||||
@@ -50,7 +50,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="userNameLabel">
|
||||
<property name="text">
|
||||
<string>Username:</string>
|
||||
</property>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
using namespace CppTools::Internal;
|
||||
|
||||
CompletionSettingsPage::CompletionSettingsPage(CppCodeCompletion *completion)
|
||||
@@ -75,7 +77,12 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent)
|
||||
m_page->caseSensitive->setChecked(m_completion->caseSensitivity() == Qt::CaseSensitive);
|
||||
m_page->autoInsertBrackets->setChecked(m_completion->autoInsertBrackets());
|
||||
m_page->partiallyComplete->setChecked(m_completion->isPartialCompletionEnabled());
|
||||
|
||||
if (m_searchKeywords.isEmpty()) {
|
||||
QTextStream(&m_searchKeywords) << m_page->caseSensitive->text()
|
||||
<< ' ' << m_page->autoInsertBrackets->text()
|
||||
<< ' ' << m_page->partiallyComplete->text();
|
||||
m_searchKeywords.remove(QLatin1Char('&'));
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
@@ -86,3 +93,8 @@ void CompletionSettingsPage::apply()
|
||||
m_completion->setAutoInsertBrackets(m_page->autoInsertBrackets->isChecked());
|
||||
m_completion->setPartialCompletionEnabled(m_page->partiallyComplete->isChecked());
|
||||
}
|
||||
|
||||
bool CompletionSettingsPage::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
@@ -57,10 +57,12 @@ public:
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish() { }
|
||||
virtual bool matches(const QString &) const;
|
||||
|
||||
private:
|
||||
CppCodeCompletion *m_completion;
|
||||
Ui_CompletionSettingsPage *m_page;
|
||||
QString m_searchKeywords;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDate>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMessageBox>
|
||||
@@ -237,6 +238,16 @@ CppFileSettings CppFileSettingsWidget::settings() const
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString CppFileSettingsWidget::searchKeywords() const
|
||||
{
|
||||
QString rc;
|
||||
QTextStream(&rc) << m_ui->headerSuffixLabel->text()
|
||||
<< ' ' << m_ui->sourceSuffixLabel->text()
|
||||
<< ' ' << m_ui->lowerCaseFileNamesCheckBox->text();
|
||||
rc.remove(QLatin1Char('&'));
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline void setComboText(QComboBox *cb, const QString &text, int defaultIndex = 0)
|
||||
{
|
||||
const int index = cb->findText(text);
|
||||
@@ -312,6 +323,8 @@ QWidget *CppFileSettingsPage::createPage(QWidget *parent)
|
||||
|
||||
m_widget = new CppFileSettingsWidget(parent);
|
||||
m_widget->setSettings(*m_settings);
|
||||
if (m_searchKeywords.isEmpty())
|
||||
m_searchKeywords = m_widget->searchKeywords();
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
@@ -327,6 +340,11 @@ void CppFileSettingsPage::apply()
|
||||
}
|
||||
}
|
||||
|
||||
bool CppFileSettingsPage::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ public:
|
||||
CppFileSettings settings() const;
|
||||
void setSettings(const CppFileSettings &s);
|
||||
|
||||
QString searchKeywords() const;
|
||||
|
||||
private slots:
|
||||
void slotEdit();
|
||||
|
||||
@@ -103,10 +105,12 @@ public:
|
||||
virtual QWidget *createPage(QWidget *parent);
|
||||
virtual void apply();
|
||||
virtual void finish() { }
|
||||
virtual bool matches(const QString &) const;
|
||||
|
||||
private:
|
||||
const QSharedPointer<CppFileSettings> m_settings;
|
||||
QPointer<CppFileSettingsWidget> m_widget;
|
||||
QString m_searchKeywords;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user