Commit 6ef0cf1a authored by David Schulz's avatar David Schulz

Editor: Refactor Open Link in Next Split.

Cleanup code and added shortcuts and menu entries for
- open header/source in next split
- follow symbol under cursor in next split
- open declaration/definition in next split

Change-Id: I2c4347749d26669d88b7c2968f30f60710f442b1
Reviewed-by: default avatarPetar Perisin <petar.perisin@gmail.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent a37770ba
......@@ -123,8 +123,8 @@
You can move directly to the definition or the declaration of a symbol by
holding the \key Ctrl and clicking the symbol. If you have multiple splits
opened, link will be opened in next split. To open it in current split,
hold \key Ctrl and \key Alt while clicking on the symbol.
opened, you can open the link in the next split by holding \key Ctrl and
\key Alt while clicking on the symbol.
To enable this moving function, in \gui Tools > \gui{Options} >
\gui{Text Editor} > \gui Behavior, select \gui{Enable mouse navigation}.
......@@ -132,17 +132,20 @@
You can also select the symbol and press \key F2, or right-click the symbol
and select \gui {Follow Symbol Under Cursor} to move to its definition or
declaration. This feature is supported for namespaces, classes, methods,
variables, include statements, and macros. If you have multiple splits
opened, the result will be shown in another split.
variables, include statements, and macros.
To switch between the definition and declaration of a symbol, press
\key {Shift+F2} or right-click the symbol and select \gui {Switch Between
Method Declaration/Definition}. If you have multiple splits opened, the
result will be shown in another split.
Although links are opened in another split by default, this can be disabled
in \gui Tools > \gui{Options} > \gui{Text Editor} > \gui Display, by
unchecking \gui{Open Links in Next Split}.
Method Declaration/Definition}.
Links are opened in the same split by default. Every operation can also be opened in
the next split by prebending \key {Ctrl+E} to the shortcut. For example \key {Ctrl+E,F2}
to follow the symbol in the next split. If currently is just one editor open a split will be
automatically opened. The default behavior could also be changed in
\gui Tools > \gui{Options} > \gui{Text Editor} > \gui Display, by checking
\gui{Always Open Links in Next Split}. Additional symbols and switching between definition
and decleration is opened in another split. If you change the default behavior the shortcuts
for open in next split are used to open the target in the current split.
\section1 Using Update Code Model
......
......@@ -1268,7 +1268,18 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName,
IEditor *EditorManager::openEditor(const QString &fileName, const Id &editorId,
OpenEditorFlags flags, bool *newEditor)
{
return m_instance->openEditor(m_instance->currentEditorView(), fileName, editorId, flags, newEditor);
return m_instance->openEditor(m_instance->currentEditorView(),
fileName, editorId, flags, newEditor);
}
IEditor *EditorManager::openEditorInNextSplit(const QString &fileName, const Id &editorId, OpenEditorFlags flags, bool *newEditor)
{
if (!m_instance->hasSplitter())
m_instance->splitSideBySide();
m_instance->gotoOtherSplit();
return m_instance->openEditor(m_instance->currentEditorView(),
fileName, editorId, flags, newEditor);
}
static int extractLineNumber(QString *fileName)
......@@ -2237,22 +2248,23 @@ void EditorManager::removeAllSplits()
void EditorManager::gotoOtherSplit()
{
if (d->m_splitter->isSplitter()) {
SplitterOrView *currentView = d->m_currentView;
if (!currentView && d->m_currentEditor)
currentView = d->m_splitter->findView(d->m_currentEditor);
if (!currentView)
currentView = d->m_splitter->findFirstView();
SplitterOrView *view = d->m_splitter->findNextView(currentView);
if (!view)
view = d->m_splitter->findFirstView();
if (view) {
if (IEditor *editor = view->editor()) {
setCurrentEditor(editor, true);
editor->widget()->setFocus();
} else {
setCurrentView(view);
}
if (!d->m_splitter->isSplitter())
splitSideBySide();
SplitterOrView *currentView = d->m_currentView;
if (!currentView && d->m_currentEditor)
currentView = d->m_splitter->findView(d->m_currentEditor);
if (!currentView)
currentView = d->m_splitter->findFirstView();
SplitterOrView *view = d->m_splitter->findNextView(currentView);
if (!view)
view = d->m_splitter->findFirstView();
if (view) {
if (IEditor *editor = view->editor()) {
setCurrentEditor(editor, true);
editor->widget()->setFocus();
} else {
setCurrentView(view);
}
}
}
......
......@@ -117,6 +117,8 @@ public:
static QString splitLineNumber(QString *fileName);
static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(),
OpenEditorFlags flags = 0, bool *newEditor = 0);
static IEditor *openEditorInNextSplit(const QString &fileName, const Id &editorId = Id(),
OpenEditorFlags flags = 0, bool *newEditor = 0);
static IEditor *openEditorWithContents(const Id &editorId,
QString *titlePattern = 0, const QString &contents = QString());
......
......@@ -1127,7 +1127,7 @@ void CPPEditorWidget::finishHighlightSymbolUsages()
}
void CPPEditorWidget::switchDeclarationDefinition()
void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
{
if (! m_modelManager)
return;
......@@ -1146,7 +1146,7 @@ void CPPEditorWidget::switchDeclarationDefinition()
if (! function)
function = lastVisibleSymbol->enclosingFunction();
Core::EditorManager* editorManager = Core::EditorManager::instance();
CPPEditorWidget::Link symbolLink;
if (function) {
LookupContext context(thisDocument, snapshot);
......@@ -1168,62 +1168,18 @@ void CPPEditorWidget::switchDeclarationDefinition()
}
}
}
if (! best.isEmpty()) {
Core::IEditor *editor = editorManager->currentEditor();
CPPEditorWidget::Link symbolLink = linkToSymbol(best.first());
if (editorManager->hasSplitter()) {
if (forceOpenLinksInNextSplit()) {
editorManager->gotoOtherSplit();
} else if (openLinksInNextSplit()) {
bool isVisible = false;
foreach (Core::IEditor *visEditor, editorManager->visibleEditors()) {
if (visEditor->document() &&
(symbolLink.targetFileName == visEditor->document()->fileName()) &&
(visEditor != editor)) {
isVisible = true;
editorManager->activateEditor(visEditor);
break;
}
}
if (!isVisible)
editorManager->gotoOtherSplit();
} else {
editorManager->addCurrentPositionToNavigationHistory();
}
}
openCppEditorAt(symbolLink);
}
} else if (lastVisibleSymbol && lastVisibleSymbol->isDeclaration() && lastVisibleSymbol->type()->isFunctionType()) {
if (Symbol *def = symbolFinder()->findMatchingDefinition(lastVisibleSymbol, snapshot)) {
Core::IEditor *editor = editorManager->currentEditor();
CPPEditorWidget::Link symbolLink = linkToSymbol(def);
if (editorManager->hasSplitter() && (editor->document()->fileName() != symbolLink.targetFileName)) {
if (forceOpenLinksInNextSplit()) {
editorManager->gotoOtherSplit();
} else if (openLinksInNextSplit()) {
bool isVisible = false;
foreach (Core::IEditor *visEditor, editorManager->visibleEditors()) {
if (visEditor->document()
&& (symbolLink.targetFileName == visEditor->document()->fileName())
&& (visEditor != editor)) {
isVisible = true;
editorManager->activateEditor(visEditor);
break;
}
}
if (!isVisible)
editorManager->gotoOtherSplit();
} else {
editorManager->addCurrentPositionToNavigationHistory();
}
}
openCppEditorAt(symbolLink);
}
if (best.isEmpty())
return;
symbolLink = linkToSymbol(best.first());
} else if (lastVisibleSymbol
&& lastVisibleSymbol->isDeclaration()
&& lastVisibleSymbol->type()->isFunctionType()) {
symbolLink = linkToSymbol(symbolFinder()->findMatchingDefinition(lastVisibleSymbol, snapshot));
}
if (symbolLink.hasValidTarget())
openCppEditorAt(symbolLink, inNextSplit != alwaysOpenLinksInNextSplit());
}
}
......@@ -1937,11 +1893,23 @@ CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
return Link(filename, line, column);
}
bool CPPEditorWidget::openCppEditorAt(const Link &link)
bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
{
if (link.targetFileName.isEmpty())
if (!link.hasValidTarget())
return false;
Core::EditorManager *editorManager = Core::EditorManager::instance();
if (inNextSplit) {
if (!editorManager->hasSplitter())
editorManager->splitSideBySide();
editorManager->gotoOtherSplit();
} else if (baseTextDocument()->fileName() == link.targetFileName) {
editorManager->addCurrentPositionToNavigationHistory();
gotoLine(link.targetLine, link.targetColumn);
setFocus();
return true;
}
return TextEditor::BaseTextEditorWidget::openEditorAt(link.targetFileName,
link.targetLine,
link.targetColumn,
......
......@@ -186,7 +186,7 @@ public:
void setObjCEnabled(bool onoff);
bool isObjCEnabled() const;
bool openLink(const Link &link) { return openCppEditorAt(link); }
bool openLink(const Link &link, bool inNextSplit) { return openCppEditorAt(link, inNextSplit); }
static Link linkToSymbol(CPlusPlus::Symbol *symbol);
......@@ -205,7 +205,7 @@ public Q_SLOTS:
virtual void setFontSettings(const TextEditor::FontSettings &);
virtual void setTabSettings(const TextEditor::TabSettings &);
void setSortedOutline(bool sort);
void switchDeclarationDefinition();
void switchDeclarationDefinition(bool inNextSplit);
void renameSymbolUnderCursor();
void renameUsages();
void findUsages();
......@@ -281,7 +281,7 @@ private:
Link findMacroLink(const QByteArray &name, CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot,
QSet<QString> *processed) const;
QString identifierUnderCursor(QTextCursor *macroCursor) const;
bool openCppEditorAt(const Link &);
bool openCppEditorAt(const Link &, bool inNextSplit = false);
QModelIndex indexForPosition(int line, int column, const QModelIndex &rootIndex = QModelIndex()) const;
......
......@@ -38,6 +38,7 @@ const char C_CPPEDITOR[] = "CppPlugin.C++Editor";
const char CPPEDITOR_ID[] = "CppPlugin.C++Editor";
const char CPPEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "C++ Editor");
const char SWITCH_DECLARATION_DEFINITION[] = "CppEditor.SwitchDeclarationDefinition";
const char OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT[] = "CppEditor.OpenDeclarationDefinitionInNextSplit";
const char RENAME_SYMBOL_UNDER_CURSOR[] = "CppEditor.RenameSymbolUnderCursor";
const char FIND_USAGES[] = "CppEditor.FindUsages";
const char M_REFACTORING_MENU_INSERTION_POINT[] = "CppEditor.RefactorGroup";
......
......@@ -235,6 +235,18 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
cmd = Core::ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT);
cppToolsMenu->addAction(cmd);
QAction *openDeclarationDefinitionInNextSplit =
new QAction(tr("Open Method Declaration/Definition In Next Split"), this);
cmd = Core::ActionManager::registerAction(openDeclarationDefinitionInNextSplit,
Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, context, true);
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::Key_E, Qt::Key_Shift + Qt::Key_F2));
connect(openDeclarationDefinitionInNextSplit, SIGNAL(triggered()),
this, SLOT(openDeclarationDefinitionInNextSplit()));
cppToolsMenu->addAction(cmd);
m_findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = Core::ActionManager::registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
......@@ -324,7 +336,14 @@ void CppPlugin::switchDeclarationDefinition()
{
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(Core::EditorManager::currentEditor()->widget());
if (editor)
editor->switchDeclarationDefinition();
editor->switchDeclarationDefinition(/*inNextSplit*/ false);
}
void CppPlugin::openDeclarationDefinitionInNextSplit()
{
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(Core::EditorManager::currentEditor()->widget());
if (editor)
editor->switchDeclarationDefinition(/*inNextSplit*/ true);
}
void CppPlugin::renameSymbolUnderCursor()
......
......@@ -80,6 +80,7 @@ public slots:
private slots:
void switchDeclarationDefinition();
void openDeclarationDefinitionInNextSplit();
void renameSymbolUnderCursor();
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
......
......@@ -37,6 +37,7 @@ namespace Constants {
const char M_TOOLS_CPP[] = "CppTools.Tools.Menu";
const char SWITCH_HEADER_SOURCE[] = "CppTools.SwitchHeaderSource";
const char OPEN_HEADER_SOURCE_IN_NEXT_SPLIT[] = "CppTools.OpenHeaderSourceInNextSplit";
const char TASK_INDEX[] = "CppTools.Task.Index";
const char TASK_SEARCH[] = "CppTools.Task.Search";
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
......
......@@ -138,6 +138,12 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
QAction *openInNextSplitAction = new QAction(tr("Open corresponding Header/Source in Next Split"), this);
command = Core::ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true);
command->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::Key_E, Qt::Key_F4));
mcpptools->addAction(command);
connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit()));
return true;
}
......@@ -157,33 +163,18 @@ ExtensionSystem::IPlugin::ShutdownFlag CppToolsPlugin::aboutToShutdown()
void CppToolsPlugin::switchHeaderSource()
{
Core::IEditor *editor = Core::EditorManager::currentEditor();
QString otherFile = correspondingHeaderOrSource(editor->document()->fileName());
if (otherFile.isEmpty())
return;
Core::EditorManager* editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory();
TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget());
if (editorManager->hasSplitter()) {
if (ed->forceOpenLinksInNextSplit()) {
editorManager->gotoOtherSplit();
} else if (ed->openLinksInNextSplit()) {
bool isVisible = false;
foreach (Core::IEditor *visEditor, editorManager->visibleEditors()) {
if (visEditor->document() &&
(otherFile == visEditor->document()->fileName())) {
isVisible = true;
editorManager->activateEditor(visEditor);
break;
}
}
QString otherFile = correspondingHeaderOrSource(
Core::EditorManager::currentEditor()->document()->fileName());
if (!otherFile.isEmpty())
Core::EditorManager::openEditor(otherFile);
}
if (!isVisible)
editorManager->gotoOtherSplit();
}
}
Core::EditorManager::openEditor(otherFile);
void CppToolsPlugin::switchHeaderSourceInNextSplit()
{
QString otherFile = correspondingHeaderOrSource(
Core::EditorManager::currentEditor()->document()->fileName());
if (!otherFile.isEmpty())
Core::EditorManager::openEditorInNextSplit(otherFile);
}
static QStringList findFilesInProject(const QString &name,
......
......@@ -74,6 +74,7 @@ public:
private slots:
void switchHeaderSource();
void switchHeaderSourceInNextSplit();
#ifdef WITH_TESTS
void test_codegen_public_in_empty_class();
......
......@@ -1079,35 +1079,16 @@ void BaseTextEditorWidget::unindent()
void BaseTextEditorWidget::openLinkUnderCursor()
{
Core::EditorManager* editorManager = Core::EditorManager::instance();
Link symbolLink = findLinkAt(textCursor());
if (!openLinksInNextSplit() || !editorManager->hasSplitter()) {
openLink(symbolLink);
return;
}
Core::IEditor *editor = Core::EditorManager::currentEditor();
openLink(symbolLink, alwaysOpenLinksInNextSplit());
}
if (forceOpenLinksInNextSplit()) {
editorManager->gotoOtherSplit();
} else {
bool isVisible = false;
foreach (Core::IEditor *visEditor, editorManager->visibleEditors()) {
if (visEditor->document() &&
(symbolLink.targetFileName == visEditor->document()->fileName()) &&
(visEditor != editor)) {
isVisible = true;
editorManager->activateEditor(visEditor);
break;
}
}
void BaseTextEditorWidget::openLinkUnderCursorInNextSplit()
{
Link symbolLink = findLinkAt(textCursor());
if (!isVisible)
editorManager->gotoOtherSplit();
}
openLink(symbolLink);
editorManager->activateEditor(editor);
openLink(symbolLink, !alwaysOpenLinksInNextSplit());
}
void BaseTextEditorWidget::moveLineUpDown(bool up)
......@@ -2336,25 +2317,16 @@ bool BaseTextEditorWidget::lineNumbersVisible() const
return d->m_lineNumbersVisible;
}
void BaseTextEditorWidget::setOpenLinksInNextSplit(bool b)
void BaseTextEditorWidget::setAlwaysOpenLinksInNextSplit(bool b)
{
d->m_displaySettings.m_openLinksInNextSplit = b;
}
bool BaseTextEditorWidget::openLinksInNextSplit() const
bool BaseTextEditorWidget::alwaysOpenLinksInNextSplit() const
{
return d->m_displaySettings.m_openLinksInNextSplit;
}
void BaseTextEditorWidget::setForceOpenLinksInNextSplit(bool b)
{
d->m_displaySettings.m_forceOpenLinksInNextSplit = b;
}
bool BaseTextEditorWidget::forceOpenLinksInNextSplit() const
{
return d->m_displaySettings.m_forceOpenLinksInNextSplit;
}
void BaseTextEditorWidget::setMarksVisible(bool b)
{
......@@ -4315,32 +4287,10 @@ void BaseTextEditorWidget::mouseReleaseEvent(QMouseEvent *e)
&& e->button() == Qt::LeftButton
) {
Core::EditorManager* editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory();
Core::IEditor *editor = Core::EditorManager::currentEditor();
const QTextCursor cursor = cursorForPosition(e->pos());
Link symbolLink = findLinkAt(cursor);
if (((!(e->modifiers() & Qt::AltModifier)) == openLinksInNextSplit()) &&
(editorManager->hasSplitter())) {
if (forceOpenLinksInNextSplit()) {
editorManager->gotoOtherSplit();
} else {
bool isVisible = false;
foreach (Core::IEditor *visEditor, editorManager->visibleEditors())
if (visEditor->document() &&
(symbolLink.targetFileName == visEditor->document()->fileName()) &&
(editor != visEditor)) {
isVisible = true;
editorManager->activateEditor(visEditor);
break;
}
if (!isVisible)
editorManager->gotoOtherSplit();
}
}
if (openLink(symbolLink)) {
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory();
bool inNextSplit = ((e->modifiers() & Qt::AltModifier) && !alwaysOpenLinksInNextSplit())
|| (alwaysOpenLinksInNextSplit() && !(e->modifiers() & Qt::AltModifier));
if (openLink(findLinkAt(cursorForPosition(e->pos())), inNextSplit)) {
clearLink();
return;
}
......@@ -4909,13 +4859,18 @@ BaseTextEditorWidget::Link BaseTextEditorWidget::findLinkAt(const QTextCursor &,
return Link();
}
bool BaseTextEditorWidget::openLink(const Link &link)
bool BaseTextEditorWidget::openLink(const Link &link, bool inNextSplit)
{
if (!link.hasValidTarget())
return false;
if (baseTextDocument()->fileName() == link.targetFileName) {
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory();
Core::EditorManager *editorManager = Core::EditorManager::instance();
if (inNextSplit) {
if (!editorManager->hasSplitter())
editorManager->splitSideBySide();
editorManager->gotoOtherSplit();
} else if (baseTextDocument()->fileName() == link.targetFileName) {
editorManager->addCurrentPositionToNavigationHistory();
gotoLine(link.targetLine, link.targetColumn);
setFocus();
return true;
......
......@@ -181,11 +181,8 @@ public:
void setLineNumbersVisible(bool b);
bool lineNumbersVisible() const;
void setOpenLinksInNextSplit(bool b);
bool openLinksInNextSplit() const;
void setForceOpenLinksInNextSplit(bool b);
bool forceOpenLinksInNextSplit() const;
void setAlwaysOpenLinksInNextSplit(bool b);
bool alwaysOpenLinksInNextSplit() const;
void setMarksVisible(bool b);
bool marksVisible() const;
......@@ -333,6 +330,7 @@ public slots:
void unindent();
void openLinkUnderCursor();
void openLinkUnderCursorInNextSplit();
signals:
void changed();
......@@ -530,7 +528,7 @@ protected:
Reimplement this function if you want to customize the way a link is
opened. Returns whether the link was opened successfully.
*/
virtual bool openLink(const Link &link);
virtual bool openLink(const Link &link, bool inNextSplit = false);
void maybeClearSomeExtraSelections(const QTextCursor &cursor);
......
......@@ -46,7 +46,6 @@ static const char markTextChangesKey[] = "MarkTextChanges";
static const char autoFoldFirstCommentKey[] = "AutoFoldFirstComment";
static const char centerCursorOnScrollKey[] = "CenterCursorOnScroll";
static const char openLinksInNextSplitKey[] = "OpenLinksInNextSplitKey";
static const char forceOpenLinksInNextSplitKey[] = "ForceOpenLinksInNextSplitKey";
static const char groupPostfix[] = "DisplaySettings";
namespace TextEditor {
......@@ -90,7 +89,6 @@ void DisplaySettings::toSettings(const QString &category, QSettings *s) const
s->setValue(QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment);
s->setValue(QLatin1String(centerCursorOnScrollKey), m_centerCursorOnScroll);
s->setValue(QLatin1String(openLinksInNextSplitKey), m_openLinksInNextSplit);
s->setValue(QLatin1String(forceOpenLinksInNextSplitKey), m_forceOpenLinksInNextSplit);
s->endGroup();
}
......@@ -117,7 +115,6 @@ void DisplaySettings::fromSettings(const QString &category, const QSettings *s)
m_autoFoldFirstComment = s->value(group + QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment).toBool();
m_centerCursorOnScroll = s->value(group + QLatin1String(centerCursorOnScrollKey), m_centerCursorOnScroll).toBool();
m_openLinksInNextSplit = s->value(group + QLatin1String(openLinksInNextSplitKey), m_openLinksInNextSplit).toBool();
m_forceOpenLinksInNextSplit = s->value(group + QLatin1String(forceOpenLinksInNextSplitKey), m_forceOpenLinksInNextSplit).toBool();
}
bool DisplaySettings::equals(const DisplaySettings &ds) const
......
......@@ -74,7 +74,6 @@ QWidget *DisplaySettingsPage::createPage(QWidget *parent)
QWidget *w = new QWidget(parent);
d->m_page = new Internal::Ui::DisplaySettingsPage;
d->m_page->setupUi(w);
connect(d->m_page->openLinksInNextSplit, SIGNAL(toggled(bool)), this, SLOT(updateForceOpenLinksInNextSplit(bool)));
settingsToUI();
if (d->m_searchKeywords.isEmpty()) {
QTextStream(&d->m_searchKeywords) << d->m_page->displayLineNumbers->text()
......@@ -87,8 +86,7 @@ QWidget *DisplaySettingsPage::createPage(QWidget *parent)
<< ' ' << d->m_page->enableTextWrapping->text()
<< ' ' << d->m_page->autoFoldFirstComment->text()
<< ' ' << d->m_page->centerOnScroll->text()
<< ' ' << d->m_page->openLinksInNextSplit->text()
<< ' ' << d->m_page->forceOpenLinksInNextSplit->text();
<< ' ' << d->m_page->openLinksInNextSplit->text();
d->m_searchKeywords.remove(QLatin1Char('&'));
}
return w;
......@@ -112,13 +110,6 @@ void DisplaySettingsPage::finish()
d->m_page = 0;
}
void DisplaySettingsPage::updateForceOpenLinksInNextSplit(bool openLinksInNextSplitChecked)
{
d->m_page->forceOpenLinksInNextSplit->setEnabled(openLinksInNextSplitChecked);
if (!openLinksInNextSplitChecked)
d->m_page->forceOpenLinksInNextSplit->setChecked(openLinksInNextSplitChecked);
}
void DisplaySettingsPage::settingsFromUI(DisplaySettings &displaySettings) const
{
displaySettings.m_displayLineNumbers = d->m_page->displayLineNumbers->isChecked();
......@@ -135,7 +126,6 @@ void DisplaySettingsPage::settingsFromUI(DisplaySettings &displaySettings) const
displaySettings.m_autoFoldFirstComment = d->m_page->autoFoldFirstComment->isChecked();
displaySettings.m_centerCursorOnScroll = d->m_page->centerOnScroll->isChecked();
displaySettings.m_openLinksInNextSplit = d->m_page->openLinksInNextSplit->isChecked();
displaySettings.m_forceOpenLinksInNextSplit = d->m_page->forceOpenLinksInNextSplit->isChecked();
}
void DisplaySettingsPage::settingsToUI()
......@@ -155,7 +145,6 @@ void DisplaySettingsPage::settingsToUI()
d->m_page->autoFoldFirstComment->setChecked(displaySettings.m_autoFoldFirstComment);
d->m_page->centerOnScroll->setChecked(displaySettings.m_centerCursorOnScroll);
d->m_page->openLinksInNextSplit->setChecked(displaySettings.m_openLinksInNextSplit);
d->m_page->forceOpenLinksInNextSplit->setChecked(displaySettings.m_forceOpenLinksInNextSplit);
}
const DisplaySettings &DisplaySettingsPage::displaySettings() const
......