Commit 285fa4a5 authored by hjk's avatar hjk
Browse files

fakevim: remove "fakevim" option from text editor settings as it has a

page of its own now
parent f7c3b552
......@@ -2700,11 +2700,6 @@ const DisplaySettings &BaseTextEditor::displaySettings() const
return d->m_displaySettings;
}
const InteractionSettings &BaseTextEditor::interactionSettings() const
{
return d->m_interactionSettings;
}
void BaseTextEditor::indentOrUnindent(bool doIndent)
{
......
......@@ -32,7 +32,6 @@
#include "displaysettings.h"
#include "tabsettings.h"
#include "interactionsettings.h"
#include "itexteditable.h"
#include <QtGui/QPlainTextEdit>
......@@ -380,7 +379,6 @@ public:
const TabSettings &tabSettings() const;
const DisplaySettings &displaySettings() const;
const InteractionSettings &interactionSettings() const;
void markBlocksAsChanged(QList<int> blockNumbers);
......
......@@ -162,7 +162,6 @@ public:
QWidget *m_extraArea;
DisplaySettings m_displaySettings;
InteractionSettings m_interactionSettings;
int extraAreaSelectionAnchorBlockNumber;
int extraAreaToggleMarkBlockNumber;
......
......@@ -28,7 +28,6 @@
**************************************************************************/
#include "behaviorsettingspage.h"
#include "interactionsettings.h"
#include "storagesettings.h"
#include "tabsettings.h"
#include "ui_behaviorsettingspage.h"
......@@ -47,7 +46,6 @@ struct BehaviorSettingsPage::BehaviorSettingsPagePrivate
Ui::BehaviorSettingsPage m_page;
TabSettings m_tabSettings;
StorageSettings m_storageSettings;
InteractionSettings m_interactionSettings;
};
BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate
......@@ -57,7 +55,6 @@ BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate
if (const QSettings *s = Core::ICore::instance()->settings()) {
m_tabSettings.fromSettings(m_parameters.settingsPrefix, s);
m_storageSettings.fromSettings(m_parameters.settingsPrefix, s);
m_interactionSettings.fromSettings(m_parameters.settingsPrefix, s);
}
}
......@@ -105,9 +102,8 @@ void BehaviorSettingsPage::apply()
{
TabSettings newTabSettings;
StorageSettings newStorageSettings;
InteractionSettings newInteractionSettings;
settingsFromUI(newTabSettings, newStorageSettings, newInteractionSettings);
settingsFromUI(newTabSettings, newStorageSettings);
Core::ICore *core = Core::ICore::instance();
QSettings *s = core->settings();
......@@ -127,17 +123,10 @@ void BehaviorSettingsPage::apply()
emit storageSettingsChanged(newStorageSettings);
}
if (newInteractionSettings != m_d->m_interactionSettings) {
m_d->m_interactionSettings = newInteractionSettings;
if (s)
m_d->m_interactionSettings.toSettings(m_d->m_parameters.settingsPrefix, s);
}
}
void BehaviorSettingsPage::settingsFromUI(TabSettings &tabSettings,
StorageSettings &storageSettings,
InteractionSettings &interactionSettings) const
StorageSettings &storageSettings) const
{
tabSettings.m_spacesForTabs = m_d->m_page.insertSpaces->isChecked();
tabSettings.m_autoIndent = m_d->m_page.autoIndent->isChecked();
......@@ -149,8 +138,6 @@ void BehaviorSettingsPage::settingsFromUI(TabSettings &tabSettings,
storageSettings.m_inEntireDocument = m_d->m_page.inEntireDocument->isChecked();
storageSettings.m_cleanIndentation = m_d->m_page.cleanIndentation->isChecked();
storageSettings.m_addFinalNewLine = m_d->m_page.addFinalNewLine->isChecked();
interactionSettings.m_useVim = m_d->m_page.useVim->isChecked();
}
void BehaviorSettingsPage::settingsToUI()
......@@ -167,9 +154,6 @@ void BehaviorSettingsPage::settingsToUI()
m_d->m_page.inEntireDocument->setChecked(storageSettings.m_inEntireDocument);
m_d->m_page.cleanIndentation->setChecked(storageSettings.m_cleanIndentation);
m_d->m_page.addFinalNewLine->setChecked(storageSettings.m_addFinalNewLine);
const InteractionSettings &interactionSettings = m_d->m_interactionSettings;
m_d->m_page.useVim->setChecked(interactionSettings.m_useVim);
}
TabSettings BehaviorSettingsPage::tabSettings() const
......@@ -181,8 +165,3 @@ StorageSettings BehaviorSettingsPage::storageSettings() const
{
return m_d->m_storageSettings;
}
InteractionSettings BehaviorSettingsPage::interactionSettings() const
{
return m_d->m_interactionSettings;
}
......@@ -40,7 +40,6 @@ namespace TextEditor {
struct TabSettings;
struct StorageSettings;
struct InteractionSettings;
struct BehaviorSettingsPageParameters
{
......@@ -70,7 +69,6 @@ public:
TabSettings tabSettings() const;
StorageSettings storageSettings() const;
InteractionSettings interactionSettings() const;
signals:
void tabSettingsChanged(const TextEditor::TabSettings &);
......@@ -78,8 +76,7 @@ signals:
private:
void settingsFromUI(TabSettings &rc,
StorageSettings &storageSettings,
InteractionSettings &interactionSettings) const;
StorageSettings &storageSettings) const;
void settingsToUI();
struct BehaviorSettingsPagePrivate;
BehaviorSettingsPagePrivate *m_d;
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>428</width>
<height>384</height>
<height>325</height>
</rect>
</property>
<property name="windowTitle">
......@@ -107,25 +107,6 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBoxInteractionSettings">
<property name="title">
<string>Interaction</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="useVim">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Use &quot;vi&quot; style editing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......
/**************************************************************************
**
** 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 "interactionsettings.h"
#include <QSettings>
#include <QString>
namespace TextEditor {
static const char *useVimKey = "UseVim";
static const char *groupPostfix = "InteractionSettings";
InteractionSettings::InteractionSettings()
: m_useVim(false)
{
}
void InteractionSettings::toSettings(const QString &category, QSettings *s) const
{
QString group = QLatin1String(groupPostfix);
if (!category.isEmpty())
group.insert(0, category);
s->beginGroup(group);
s->setValue(QLatin1String(useVimKey), m_useVim);
s->endGroup();
}
void InteractionSettings::fromSettings(const QString &category, const QSettings *s)
{
QString group = QLatin1String(groupPostfix);
if (!category.isEmpty())
group.insert(0, category);
group += QLatin1Char('/');
m_useVim = s->value(group + QLatin1String(useVimKey), m_useVim).toBool();
}
bool InteractionSettings::equals(const InteractionSettings &ts) const
{
return m_useVim == ts.m_useVim;
}
} // namespace TextEditor
/**************************************************************************
**
** 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 INTERACTIONSETTINGS_H
#define INTERACTIONSETTINGS_H
#include "texteditor_global.h"
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace TextEditor {
struct TEXTEDITOR_EXPORT InteractionSettings
{
InteractionSettings();
void toSettings(const QString &category, QSettings *s) const;
void fromSettings(const QString &category, const QSettings *s);
bool equals(const InteractionSettings &ts) const;
bool m_useVim;
};
inline bool operator==(const InteractionSettings &t1, const InteractionSettings &t2) { return t1.equals(t2); }
inline bool operator!=(const InteractionSettings &t1, const InteractionSettings &t2) { return !t1.equals(t2); }
} // namespace TextEditor
#endif // INTERACTIONSETTINGS_H
......@@ -14,7 +14,6 @@ SOURCES += texteditorplugin.cpp \
completionsupport.cpp \
completionwidget.cpp \
fontsettingspage.cpp \
interactionsettings.cpp \
tabsettings.cpp \
storagesettings.cpp \
displaysettings.cpp \
......@@ -40,7 +39,6 @@ HEADERS += texteditorplugin.h \
texteditoractionhandler.h \
fontsettingspage.h \
icompletioncollector.h \
interactionsettings.h \
texteditorconstants.h \
tabsettings.h \
storagesettings.h \
......
......@@ -38,7 +38,6 @@
#include "plaintexteditorfactory.h"
#include "plaintexteditor.h"
#include "storagesettings.h"
#include "interactionsettings.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......
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