2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "texteditoractionhandler.h"
|
2009-12-08 17:43:01 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "basetexteditor.h"
|
2009-12-08 17:43:01 +01:00
|
|
|
#include "displaysettings.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "linenumberfilter.h"
|
2009-12-08 17:43:01 +01:00
|
|
|
#include "texteditorconstants.h"
|
|
|
|
|
#include "texteditorplugin.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-16 11:44:18 +02:00
|
|
|
#include <locator/locatormanager.h>
|
2009-01-20 15:31:33 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <coreplugin/coreconstants.h>
|
2009-01-13 13:39:31 +01:00
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
2010-03-18 10:59:06 +01:00
|
|
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
2013-04-25 20:24:06 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-08-06 13:42:46 +02:00
|
|
|
#include <QDebug>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QAction>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
using namespace TextEditor;
|
|
|
|
|
using namespace TextEditor::Internal;
|
|
|
|
|
|
2010-06-25 17:37:59 +02:00
|
|
|
TextEditorActionHandler::TextEditorActionHandler(const char *context,
|
2009-09-14 13:02:50 +02:00
|
|
|
uint optionalActions)
|
2009-01-20 15:31:33 +01:00
|
|
|
: QObject(Core::ICore::instance()),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_undoAction(0),
|
|
|
|
|
m_redoAction(0),
|
|
|
|
|
m_copyAction(0),
|
|
|
|
|
m_cutAction(0),
|
|
|
|
|
m_pasteAction(0),
|
2011-12-13 12:15:30 +01:00
|
|
|
m_circularPasteAction(0),
|
2012-03-02 08:16:23 +08:00
|
|
|
m_switchUtf8bomAction(0),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_selectAllAction(0),
|
|
|
|
|
m_gotoAction(0),
|
|
|
|
|
m_printAction(0),
|
|
|
|
|
m_formatAction(0),
|
|
|
|
|
m_visualizeWhitespaceAction(0),
|
|
|
|
|
m_cleanWhitespaceAction(0),
|
|
|
|
|
m_textWrappingAction(0),
|
|
|
|
|
m_unCommentSelectionAction(0),
|
2010-05-20 15:10:26 +02:00
|
|
|
m_unfoldAllAction(0),
|
|
|
|
|
m_foldAction(0),
|
|
|
|
|
m_unfoldAction(0),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_cutLineAction(0),
|
2010-11-27 14:02:20 +09:00
|
|
|
m_copyLineAction(0),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_deleteLineAction(0),
|
2011-09-26 14:21:19 +02:00
|
|
|
m_deleteEndOfWordAction(0),
|
|
|
|
|
m_deleteEndOfWordCamelCaseAction(0),
|
|
|
|
|
m_deleteStartOfWordAction(0),
|
|
|
|
|
m_deleteStartOfWordCamelCaseAction(0),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_selectEncodingAction(0),
|
|
|
|
|
m_increaseFontSizeAction(0),
|
|
|
|
|
m_decreaseFontSizeAction(0),
|
2009-11-30 19:00:36 +01:00
|
|
|
m_resetFontSizeAction(0),
|
2009-05-26 11:11:47 +02:00
|
|
|
m_gotoBlockStartAction(0),
|
|
|
|
|
m_gotoBlockEndAction(0),
|
|
|
|
|
m_gotoBlockStartWithSelectionAction(0),
|
|
|
|
|
m_gotoBlockEndWithSelectionAction(0),
|
|
|
|
|
m_selectBlockUpAction(0),
|
|
|
|
|
m_selectBlockDownAction(0),
|
|
|
|
|
m_moveLineUpAction(0),
|
|
|
|
|
m_moveLineDownAction(0),
|
|
|
|
|
m_copyLineUpAction(0),
|
|
|
|
|
m_copyLineDownAction(0),
|
2010-01-20 17:51:05 +01:00
|
|
|
m_joinLinesAction(0),
|
2011-02-25 11:10:42 +01:00
|
|
|
m_insertLineAboveAction(0),
|
|
|
|
|
m_insertLineBelowAction(0),
|
|
|
|
|
m_upperCaseSelectionAction(0),
|
|
|
|
|
m_lowerCaseSelectionAction(0),
|
2012-01-22 17:05:02 -05:00
|
|
|
m_indentAction(0),
|
|
|
|
|
m_unindentAction(0),
|
2012-03-27 23:18:46 +04:00
|
|
|
m_followSymbolAction(0),
|
2013-02-05 14:14:33 +01:00
|
|
|
m_followSymbolInNextSplitAction(0),
|
2012-03-27 23:18:46 +04:00
|
|
|
m_jumpToFileAction(0),
|
2013-02-05 14:14:33 +01:00
|
|
|
m_jumpToFileInNextSplitAction(0),
|
2008-12-02 12:01:29 +01:00
|
|
|
m_optionalActions(optionalActions),
|
|
|
|
|
m_currentEditor(0),
|
2010-06-25 17:37:59 +02:00
|
|
|
m_contextId(context),
|
2008-12-02 12:01:29 +01:00
|
|
|
m_initialized(false)
|
|
|
|
|
{
|
2013-08-29 17:17:24 +02:00
|
|
|
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
2009-03-17 18:17:51 +01:00
|
|
|
this, SLOT(updateCurrentEditor(Core::IEditor*)));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2011-08-18 14:23:06 +02:00
|
|
|
TextEditorActionHandler::~TextEditorActionHandler()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
void TextEditorActionHandler::setupActions(BaseTextEditorWidget *editor)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
initializeActions();
|
|
|
|
|
editor->setActionHack(this);
|
|
|
|
|
QObject::connect(editor, SIGNAL(undoAvailable(bool)), this, SLOT(updateUndoAction()));
|
|
|
|
|
QObject::connect(editor, SIGNAL(redoAvailable(bool)), this, SLOT(updateRedoAction()));
|
|
|
|
|
QObject::connect(editor, SIGNAL(copyAvailable(bool)), this, SLOT(updateCopyAction()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::initializeActions()
|
|
|
|
|
{
|
|
|
|
|
if (!m_initialized) {
|
|
|
|
|
createActions();
|
|
|
|
|
m_initialized = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::createActions()
|
|
|
|
|
{
|
2013-05-17 16:32:57 +02:00
|
|
|
using namespace Core::Constants;
|
|
|
|
|
using namespace TextEditor::Constants;
|
|
|
|
|
|
|
|
|
|
m_undoAction = registerAction(UNDO,
|
|
|
|
|
SLOT(undoAction()), true, tr("&Undo"));
|
|
|
|
|
m_redoAction = registerAction(REDO,
|
|
|
|
|
SLOT(redoAction()), true, tr("&Redo"));
|
|
|
|
|
m_copyAction = registerAction(COPY,
|
|
|
|
|
SLOT(copyAction()), true);
|
|
|
|
|
m_cutAction = registerAction(CUT,
|
|
|
|
|
SLOT(cutAction()), true);
|
|
|
|
|
m_pasteAction = registerAction(PASTE,
|
|
|
|
|
SLOT(pasteAction()), true);
|
|
|
|
|
m_selectAllAction = registerAction(SELECTALL,
|
|
|
|
|
SLOT(selectAllAction()), true);
|
|
|
|
|
m_gotoAction = registerAction(GOTO,
|
|
|
|
|
SLOT(gotoAction()));
|
|
|
|
|
m_printAction = registerAction(PRINT,
|
|
|
|
|
SLOT(printAction()));
|
|
|
|
|
m_cutLineAction = registerAction(CUT_LINE,
|
|
|
|
|
SLOT(cutLine()), true, tr("Cut &Line"),
|
|
|
|
|
QKeySequence(tr("Shift+Del")));
|
|
|
|
|
m_copyLineAction = registerAction(COPY_LINE,
|
|
|
|
|
SLOT(copyLine()), false, tr("Copy &Line"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Ins")));
|
|
|
|
|
m_deleteLineAction = registerAction(DELETE_LINE,
|
|
|
|
|
SLOT(deleteLine()), true, tr("Delete &Line"));
|
|
|
|
|
m_deleteEndOfWordAction = registerAction(DELETE_END_OF_WORD,
|
|
|
|
|
SLOT(deleteEndOfWord()), true, tr("Delete Word from Cursor On"));
|
|
|
|
|
m_deleteEndOfWordCamelCaseAction = registerAction(DELETE_END_OF_WORD_CAMEL_CASE,
|
|
|
|
|
SLOT(deleteEndOfWordCamelCase()), true, tr("Delete Word Camel Case from Cursor On"));
|
|
|
|
|
m_deleteStartOfWordAction = registerAction(DELETE_START_OF_WORD,
|
|
|
|
|
SLOT(deleteStartOfWord()), true, tr("Delete Word up to Cursor"));
|
|
|
|
|
m_deleteStartOfWordCamelCaseAction = registerAction(DELETE_START_OF_WORD_CAMEL_CASE,
|
|
|
|
|
SLOT(deleteStartOfWordCamelCase()), true, tr("Delete Word Camel Case up to Cursor"));
|
|
|
|
|
m_gotoBlockStartWithSelectionAction = registerAction(GOTO_BLOCK_START_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoBlockStartWithSelection()), true, tr("Go to Block Start with Selection"),
|
|
|
|
|
QKeySequence(tr("Ctrl+{")));
|
|
|
|
|
m_gotoBlockEndWithSelectionAction = registerAction(GOTO_BLOCK_END_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoBlockEndWithSelection()), true, tr("Go to Block End with Selection"),
|
|
|
|
|
QKeySequence(tr("Ctrl+}")));
|
|
|
|
|
m_moveLineUpAction = registerAction(MOVE_LINE_UP,
|
|
|
|
|
SLOT(moveLineUp()), true, tr("Move Line Up"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Shift+Up")));
|
|
|
|
|
m_moveLineDownAction = registerAction(MOVE_LINE_DOWN,
|
|
|
|
|
SLOT(moveLineDown()), true, tr("Move Line Down"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Shift+Down")));
|
|
|
|
|
m_copyLineUpAction = registerAction(COPY_LINE_UP,
|
|
|
|
|
SLOT(copyLineUp()), true, tr("Copy Line Up"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Alt+Up")));
|
|
|
|
|
m_copyLineDownAction = registerAction(COPY_LINE_DOWN,
|
|
|
|
|
SLOT(copyLineDown()), true, tr("Copy Line Down"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Alt+Down")));
|
|
|
|
|
m_joinLinesAction = registerAction(JOIN_LINES,
|
|
|
|
|
SLOT(joinLines()), true, tr("Join Lines"),
|
|
|
|
|
QKeySequence(tr("Ctrl+J")));
|
|
|
|
|
m_insertLineAboveAction = registerAction(INSERT_LINE_ABOVE,
|
|
|
|
|
SLOT(insertLineAbove()), true, tr("Insert Line Above Current Line"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Shift+Return")));
|
|
|
|
|
m_insertLineBelowAction = registerAction(INSERT_LINE_BELOW,
|
|
|
|
|
SLOT(insertLineBelow()), true, tr("Insert Line Below Current Line"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Return")));
|
|
|
|
|
m_upperCaseSelectionAction = registerAction(UPPERCASE_SELECTION,
|
|
|
|
|
SLOT(uppercaseSelection()), true, tr("Uppercase Selection"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")));
|
|
|
|
|
m_lowerCaseSelectionAction = registerAction(LOWERCASE_SELECTION,
|
|
|
|
|
SLOT(lowercaseSelection()), true, tr("Lowercase Selection"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")));
|
|
|
|
|
m_switchUtf8bomAction = registerAction(SWITCH_UTF8BOM,
|
|
|
|
|
SLOT(switchUtf8bomAction()), true);
|
|
|
|
|
m_indentAction = registerAction(INDENT,
|
|
|
|
|
SLOT(indent()), true, tr("Indent"));
|
|
|
|
|
m_unindentAction = registerAction(UNINDENT,
|
|
|
|
|
SLOT(unindent()), true, tr("Unindent"));
|
|
|
|
|
m_followSymbolAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR,
|
|
|
|
|
SLOT(openLinkUnderCursor()), true, tr("Follow Symbol Under Cursor"),
|
|
|
|
|
QKeySequence(Qt::Key_F2));
|
|
|
|
|
m_followSymbolInNextSplitAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT,
|
|
|
|
|
SLOT(openLinkUnderCursorInNextSplit()), true, tr("Follow Symbol Under Cursor in Next Split"),
|
|
|
|
|
QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2")));
|
|
|
|
|
m_jumpToFileAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR,
|
|
|
|
|
SLOT(openLinkUnderCursor()), true, tr("Jump To File Under Cursor"),
|
|
|
|
|
QKeySequence(Qt::Key_F2));
|
|
|
|
|
m_jumpToFileInNextSplitAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR_IN_NEXT_SPLIT,
|
|
|
|
|
SLOT(openLinkUnderCursorInNextSplit()), true,
|
|
|
|
|
QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2")));
|
|
|
|
|
|
|
|
|
|
// register "Edit" Menu Actions
|
|
|
|
|
Core::ActionContainer *editMenu = Core::ActionManager::actionContainer(M_EDIT);
|
|
|
|
|
m_selectEncodingAction = registerAction(SELECT_ENCODING,
|
|
|
|
|
SLOT(selectEncoding()), false, tr("Select Encoding..."),
|
|
|
|
|
QKeySequence(), G_EDIT_OTHER, editMenu);
|
|
|
|
|
m_circularPasteAction = registerAction(CIRCULAR_PASTE,
|
|
|
|
|
SLOT(circularPasteAction()), false, tr("Paste from Clipboard History"),
|
|
|
|
|
QKeySequence(tr("Ctrl+Shift+V")), G_EDIT_COPYPASTE, editMenu);
|
|
|
|
|
|
|
|
|
|
// register "Edit -> Advanced" Menu Actions
|
|
|
|
|
Core::ActionContainer *advancedEditMenu = Core::ActionManager::actionContainer(M_EDIT_ADVANCED);
|
|
|
|
|
m_formatAction = registerAction(AUTO_INDENT_SELECTION,
|
|
|
|
|
SLOT(formatAction()), true, tr("Auto-&indent Selection"),
|
|
|
|
|
QKeySequence(tr("Ctrl+I")),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);
|
|
|
|
|
m_rewrapParagraphAction = registerAction(REWRAP_PARAGRAPH,
|
|
|
|
|
SLOT(rewrapParagraphAction()), true, tr("&Rewrap Paragraph"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, R") : tr("Ctrl+E, R")),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);
|
|
|
|
|
m_visualizeWhitespaceAction = registerAction(VISUALIZE_WHITESPACE,
|
|
|
|
|
SLOT(setVisualizeWhitespace(bool)), false, tr("&Visualize Whitespace"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, Meta+V") : tr("Ctrl+E, Ctrl+V")),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);
|
|
|
|
|
m_cleanWhitespaceAction = registerAction(CLEAN_WHITESPACE,
|
|
|
|
|
SLOT(setTextWrapping(bool)), true, tr("Clean Whitespace"),
|
|
|
|
|
QKeySequence(),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);;
|
|
|
|
|
m_textWrappingAction = registerAction(TEXT_WRAPPING,
|
|
|
|
|
SLOT(setTextWrapping(bool)), false, tr("Enable Text &Wrapping"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, Meta+W") : tr("Ctrl+E, Ctrl+W")),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);
|
|
|
|
|
m_textWrappingAction->setCheckable(true);
|
|
|
|
|
m_unCommentSelectionAction = registerAction(UN_COMMENT_SELECTION,
|
|
|
|
|
SLOT(unCommentSelection()), true, tr("Toggle Comment &Selection"),
|
|
|
|
|
QKeySequence(tr("Ctrl+/")),
|
|
|
|
|
G_EDIT_FORMAT, advancedEditMenu);
|
|
|
|
|
m_foldAction = registerAction(FOLD,
|
|
|
|
|
SLOT(fold()), true, tr("Fold"),
|
|
|
|
|
QKeySequence(tr("Ctrl+<")),
|
|
|
|
|
G_EDIT_COLLAPSING, advancedEditMenu);
|
|
|
|
|
m_unfoldAction = registerAction(UNFOLD,
|
|
|
|
|
SLOT(unfold()), true, tr("Unfold"),
|
|
|
|
|
QKeySequence(tr("Ctrl+>")),
|
|
|
|
|
G_EDIT_COLLAPSING, advancedEditMenu);
|
|
|
|
|
m_unfoldAllAction = registerAction(UNFOLD_ALL,
|
|
|
|
|
SLOT(unfoldAll()), true, tr("Toggle &Fold All"),
|
|
|
|
|
QKeySequence(),
|
|
|
|
|
G_EDIT_COLLAPSING, advancedEditMenu);
|
|
|
|
|
m_increaseFontSizeAction = registerAction(INCREASE_FONT_SIZE,
|
|
|
|
|
SLOT(increaseFontSize()), false, tr("Increase Font Size"),
|
|
|
|
|
QKeySequence(tr("Ctrl++")),
|
|
|
|
|
G_EDIT_FONT, advancedEditMenu);
|
|
|
|
|
m_decreaseFontSizeAction = registerAction(DECREASE_FONT_SIZE,
|
|
|
|
|
SLOT(decreaseFontSize()), false, tr("Decrease Font Size"),
|
|
|
|
|
QKeySequence(tr("Ctrl+-")),
|
|
|
|
|
G_EDIT_FONT, advancedEditMenu);
|
|
|
|
|
m_resetFontSizeAction = registerAction(RESET_FONT_SIZE,
|
|
|
|
|
SLOT(resetFontSize()), false, tr("Reset Font Size"),
|
|
|
|
|
QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")),
|
|
|
|
|
G_EDIT_FONT, advancedEditMenu);
|
|
|
|
|
m_gotoBlockStartAction = registerAction(GOTO_BLOCK_START,
|
|
|
|
|
SLOT(gotoBlockStart()), true, tr("Go to Block Start"),
|
|
|
|
|
QKeySequence(tr("Ctrl+[")),
|
|
|
|
|
G_EDIT_BLOCKS, advancedEditMenu);
|
|
|
|
|
m_gotoBlockEndAction = registerAction(GOTO_BLOCK_END,
|
|
|
|
|
SLOT(gotoBlockEnd()), true, tr("Go to Block End"),
|
|
|
|
|
QKeySequence(tr("Ctrl+]")),
|
|
|
|
|
G_EDIT_BLOCKS, advancedEditMenu);
|
|
|
|
|
m_selectBlockUpAction = registerAction(SELECT_BLOCK_UP,
|
|
|
|
|
SLOT(selectBlockUp()), true, tr("Select Block Up"),
|
|
|
|
|
QKeySequence(tr("Ctrl+U")),
|
|
|
|
|
G_EDIT_BLOCKS, advancedEditMenu);
|
|
|
|
|
m_selectBlockDownAction = registerAction(SELECT_BLOCK_DOWN,
|
|
|
|
|
SLOT(selectBlockDown()), true, tr("Select Block Down"),
|
|
|
|
|
QKeySequence(),
|
|
|
|
|
G_EDIT_BLOCKS, advancedEditMenu);
|
|
|
|
|
|
|
|
|
|
// register GOTO Actions
|
|
|
|
|
registerAction(GOTO_LINE_START,
|
|
|
|
|
SLOT(gotoLineStart()), true, tr("Go to Line Start"));
|
|
|
|
|
registerAction(GOTO_LINE_END,
|
|
|
|
|
SLOT(gotoLineEnd()), true, tr("Go to Line End"));
|
|
|
|
|
registerAction(GOTO_NEXT_LINE,
|
|
|
|
|
SLOT(gotoNextLine()), true, tr("Go to Next Line"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_LINE,
|
|
|
|
|
SLOT(gotoPreviousLine()), true, tr("Go to Previous Line"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_CHARACTER,
|
|
|
|
|
SLOT(gotoPreviousCharacter()), true, tr("Go to Previous Character"));
|
|
|
|
|
registerAction(GOTO_NEXT_CHARACTER,
|
|
|
|
|
SLOT(gotoNextCharacter()), true, tr("Go to Next Character"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_WORD,
|
|
|
|
|
SLOT(gotoPreviousWord()), true, tr("Go to Previous Word"));
|
|
|
|
|
registerAction(GOTO_NEXT_WORD,
|
|
|
|
|
SLOT(gotoNextWord()), true, tr("Go to Next Word"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE,
|
|
|
|
|
SLOT(gotoPreviousWordCamelCase()), false, tr("Go to Previous Word Camel Case"));
|
|
|
|
|
registerAction(GOTO_NEXT_WORD_CAMEL_CASE,
|
|
|
|
|
SLOT(gotoNextWordCamelCase()), false, tr("Go to Next Word Camel Case"));
|
|
|
|
|
|
|
|
|
|
// register GOTO actions with selection
|
|
|
|
|
registerAction(GOTO_LINE_START_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoLineStartWithSelection()), true, tr("Go to Line Start with Selection"));
|
|
|
|
|
registerAction(GOTO_LINE_END_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoLineEndWithSelection()), true, tr("Go to Line End with Selection"));
|
|
|
|
|
registerAction(GOTO_NEXT_LINE_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoNextLineWithSelection()), true, tr("Go to Next Line with Selection"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_LINE_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoPreviousLineWithSelection()), true, tr("Go to Previous Line with Selection"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_CHARACTER_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoPreviousCharacterWithSelection()), true, tr("Go to Previous Character with Selection"));
|
|
|
|
|
registerAction(GOTO_NEXT_CHARACTER_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoNextCharacterWithSelection()), true, tr("Go to Next Character with Selection"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_WORD_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoPreviousWordWithSelection()), true, tr("Go to Previous Word with Selection"));
|
|
|
|
|
registerAction(GOTO_NEXT_WORD_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoNextWordWithSelection()), true, tr("Go to Next Word with Selection"));
|
|
|
|
|
registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoPreviousWordCamelCaseWithSelection()), false, tr("Go to Previous Word Camel Case with Selection"));
|
|
|
|
|
registerAction(GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION,
|
|
|
|
|
SLOT(gotoNextWordCamelCaseWithSelection()), false, tr("Go to Next Word Camel Case with Selection"));
|
|
|
|
|
|
|
|
|
|
// Collect all modifying actions so we can check for them inside a readonly file
|
|
|
|
|
// and disable them
|
2011-05-19 12:25:27 +02:00
|
|
|
m_modifyingActions << m_pasteAction;
|
|
|
|
|
m_modifyingActions << m_formatAction;
|
|
|
|
|
m_modifyingActions << m_rewrapParagraphAction;
|
|
|
|
|
m_modifyingActions << m_cleanWhitespaceAction;
|
|
|
|
|
m_modifyingActions << m_unCommentSelectionAction;
|
|
|
|
|
m_modifyingActions << m_cutLineAction;
|
|
|
|
|
m_modifyingActions << m_deleteLineAction;
|
2011-09-26 14:21:19 +02:00
|
|
|
m_modifyingActions << m_deleteEndOfWordAction;
|
|
|
|
|
m_modifyingActions << m_deleteEndOfWordCamelCaseAction;
|
|
|
|
|
m_modifyingActions << m_deleteStartOfWordAction;
|
|
|
|
|
m_modifyingActions << m_deleteStartOfWordCamelCaseAction;
|
2011-05-19 12:25:27 +02:00
|
|
|
m_modifyingActions << m_moveLineUpAction;
|
|
|
|
|
m_modifyingActions << m_moveLineDownAction;
|
|
|
|
|
m_modifyingActions << m_copyLineUpAction;
|
|
|
|
|
m_modifyingActions << m_copyLineDownAction;
|
|
|
|
|
m_modifyingActions << m_joinLinesAction;
|
|
|
|
|
m_modifyingActions << m_insertLineAboveAction;
|
|
|
|
|
m_modifyingActions << m_insertLineBelowAction;
|
|
|
|
|
m_modifyingActions << m_upperCaseSelectionAction;
|
|
|
|
|
m_modifyingActions << m_lowerCaseSelectionAction;
|
2011-12-13 12:15:30 +01:00
|
|
|
m_modifyingActions << m_circularPasteAction;
|
2012-03-02 08:16:23 +08:00
|
|
|
m_modifyingActions << m_switchUtf8bomAction;
|
2012-01-22 17:05:02 -05:00
|
|
|
m_modifyingActions << m_indentAction;
|
|
|
|
|
m_modifyingActions << m_unindentAction;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-05-17 16:32:57 +02:00
|
|
|
QAction *TextEditorActionHandler::registerAction(const Core::Id &id,
|
|
|
|
|
const char *slot,
|
|
|
|
|
bool scriptable,
|
|
|
|
|
const QString &title,
|
|
|
|
|
const QKeySequence &keySequence,
|
|
|
|
|
const char *menueGroup,
|
|
|
|
|
Core::ActionContainer *container)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
QAction *result = new QAction(title, this);
|
2013-05-17 16:32:57 +02:00
|
|
|
Core::Command *command = Core::ActionManager::registerAction(result, id, m_contextId, scriptable);
|
|
|
|
|
if (!keySequence.isEmpty())
|
|
|
|
|
command->setKeySequence(keySequence);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-05-17 16:32:57 +02:00
|
|
|
if (container && menueGroup)
|
|
|
|
|
container->addAction(command, menueGroup);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-05-17 16:32:57 +02:00
|
|
|
connect(result, SIGNAL(triggered(bool)), this, slot);
|
|
|
|
|
return result;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextEditorActionHandler::UpdateMode TextEditorActionHandler::updateMode() const
|
|
|
|
|
{
|
2009-02-16 12:50:15 +01:00
|
|
|
Q_ASSERT(m_currentEditor != 0);
|
2011-05-19 12:25:27 +02:00
|
|
|
return m_currentEditor->isReadOnly() ? ReadOnlyMode : WriteMode;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::updateActions()
|
|
|
|
|
{
|
2009-02-16 12:50:15 +01:00
|
|
|
if (!m_currentEditor || !m_initialized)
|
|
|
|
|
return;
|
2008-12-02 12:01:29 +01:00
|
|
|
updateActions(updateMode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::updateActions(UpdateMode um)
|
|
|
|
|
{
|
2011-05-19 12:25:27 +02:00
|
|
|
foreach (QAction *a, m_modifyingActions)
|
|
|
|
|
a->setEnabled(um != ReadOnlyMode);
|
2009-02-16 12:50:15 +01:00
|
|
|
m_formatAction->setEnabled((m_optionalActions & Format) && um != ReadOnlyMode);
|
|
|
|
|
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection) && um != ReadOnlyMode);
|
2012-03-27 23:18:46 +04:00
|
|
|
m_followSymbolAction->setEnabled(m_optionalActions & FollowSymbolUnderCursor);
|
2013-02-05 14:14:33 +01:00
|
|
|
m_followSymbolInNextSplitAction->setEnabled(m_optionalActions & FollowSymbolUnderCursor);
|
2012-03-27 23:18:46 +04:00
|
|
|
m_jumpToFileAction->setEnabled(m_optionalActions & JumpToFileUnderCursor);
|
2013-02-05 14:14:33 +01:00
|
|
|
m_jumpToFileInNextSplitAction->setEnabled(m_optionalActions & JumpToFileUnderCursor);
|
2009-02-16 12:50:15 +01:00
|
|
|
|
2010-05-20 15:10:26 +02:00
|
|
|
m_unfoldAllAction->setEnabled((m_optionalActions & UnCollapseAll));
|
2009-02-16 12:50:15 +01:00
|
|
|
m_visualizeWhitespaceAction->setChecked(m_currentEditor->displaySettings().m_visualizeWhitespace);
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
if (m_textWrappingAction)
|
2009-02-16 12:50:15 +01:00
|
|
|
m_textWrappingAction->setChecked(m_currentEditor->displaySettings().m_textWrapping);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
updateRedoAction();
|
|
|
|
|
updateUndoAction();
|
|
|
|
|
updateCopyAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::updateRedoAction()
|
|
|
|
|
{
|
|
|
|
|
if (m_redoAction)
|
|
|
|
|
m_redoAction->setEnabled(m_currentEditor && m_currentEditor->document()->isRedoAvailable());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::updateUndoAction()
|
|
|
|
|
{
|
|
|
|
|
if (m_undoAction)
|
|
|
|
|
m_undoAction->setEnabled(m_currentEditor && m_currentEditor->document()->isUndoAvailable());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::updateCopyAction()
|
|
|
|
|
{
|
2009-02-16 12:50:15 +01:00
|
|
|
const bool hasCopyableText = m_currentEditor && m_currentEditor->textCursor().hasSelection();
|
2008-12-02 12:01:29 +01:00
|
|
|
if (m_cutAction)
|
|
|
|
|
m_cutAction->setEnabled(hasCopyableText && updateMode() == WriteMode);
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
if (m_copyAction)
|
2008-12-02 12:01:29 +01:00
|
|
|
m_copyAction->setEnabled(hasCopyableText);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::gotoAction()
|
|
|
|
|
{
|
2009-10-16 11:30:46 +02:00
|
|
|
Locator::LocatorManager *locatorManager = Locator::LocatorManager::instance();
|
2009-10-16 10:40:57 +02:00
|
|
|
QTC_ASSERT(locatorManager, return);
|
2009-11-17 16:56:04 +01:00
|
|
|
QString locatorString = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString();
|
|
|
|
|
locatorString += QLatin1Char(' ');
|
|
|
|
|
const int selectionStart = locatorString.size();
|
2013-04-08 10:45:50 +02:00
|
|
|
locatorString += tr("<line>:<column>");
|
2009-11-17 16:56:04 +01:00
|
|
|
locatorManager->show(locatorString, selectionStart, locatorString.size() - selectionStart);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::printAction()
|
|
|
|
|
{
|
|
|
|
|
if (m_currentEditor)
|
2012-01-24 15:36:40 +01:00
|
|
|
m_currentEditor->print(Core::ICore::printer());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::setVisualizeWhitespace(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (m_currentEditor) {
|
|
|
|
|
DisplaySettings ds = m_currentEditor->displaySettings();
|
|
|
|
|
ds.m_visualizeWhitespace = checked;
|
|
|
|
|
m_currentEditor->setDisplaySettings(ds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TextEditorActionHandler::setTextWrapping(bool checked)
|
|
|
|
|
{
|
|
|
|
|
if (m_currentEditor) {
|
|
|
|
|
DisplaySettings ds = m_currentEditor->displaySettings();
|
|
|
|
|
ds.m_textWrapping = checked;
|
|
|
|
|
m_currentEditor->setDisplaySettings(ds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-04 18:37:02 +01:00
|
|
|
#define FUNCTION(funcname) void TextEditorActionHandler::funcname ()\
|
|
|
|
|
{\
|
|
|
|
|
if (m_currentEditor)\
|
|
|
|
|
m_currentEditor->funcname ();\
|
|
|
|
|
}
|
|
|
|
|
#define FUNCTION2(funcname, funcname2) void TextEditorActionHandler::funcname ()\
|
|
|
|
|
{\
|
|
|
|
|
if (m_currentEditor)\
|
|
|
|
|
m_currentEditor->funcname2 ();\
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-09 17:43:31 +01:00
|
|
|
|
|
|
|
|
FUNCTION2(undoAction, undo)
|
|
|
|
|
FUNCTION2(redoAction, redo)
|
|
|
|
|
FUNCTION2(copyAction, copy)
|
|
|
|
|
FUNCTION2(cutAction, cut)
|
|
|
|
|
FUNCTION2(pasteAction, paste)
|
2011-12-13 12:15:30 +01:00
|
|
|
FUNCTION2(circularPasteAction, circularPaste)
|
2012-03-02 08:16:23 +08:00
|
|
|
FUNCTION2(switchUtf8bomAction, switchUtf8bom)
|
2008-12-09 17:43:31 +01:00
|
|
|
FUNCTION2(formatAction, format)
|
2009-07-21 10:37:00 +02:00
|
|
|
FUNCTION2(rewrapParagraphAction, rewrapParagraph)
|
2008-12-09 17:43:31 +01:00
|
|
|
FUNCTION2(selectAllAction, selectAll)
|
|
|
|
|
FUNCTION(cleanWhitespace)
|
2008-12-04 18:37:02 +01:00
|
|
|
FUNCTION(unCommentSelection)
|
2009-05-14 17:24:35 +02:00
|
|
|
FUNCTION(cutLine)
|
2010-11-27 14:02:20 +09:00
|
|
|
FUNCTION(copyLine)
|
2008-12-04 18:37:02 +01:00
|
|
|
FUNCTION(deleteLine)
|
2011-09-26 14:21:19 +02:00
|
|
|
FUNCTION(deleteEndOfWord)
|
|
|
|
|
FUNCTION(deleteEndOfWordCamelCase)
|
|
|
|
|
FUNCTION(deleteStartOfWord)
|
|
|
|
|
FUNCTION(deleteStartOfWordCamelCase)
|
2010-05-20 15:10:26 +02:00
|
|
|
FUNCTION(unfoldAll)
|
|
|
|
|
FUNCTION(fold)
|
|
|
|
|
FUNCTION(unfold)
|
2008-12-04 18:37:02 +01:00
|
|
|
FUNCTION2(increaseFontSize, zoomIn)
|
|
|
|
|
FUNCTION2(decreaseFontSize, zoomOut)
|
2009-11-30 19:00:36 +01:00
|
|
|
FUNCTION2(resetFontSize, zoomReset)
|
2008-12-04 18:37:02 +01:00
|
|
|
FUNCTION(selectEncoding)
|
|
|
|
|
FUNCTION(gotoBlockStart)
|
|
|
|
|
FUNCTION(gotoBlockEnd)
|
|
|
|
|
FUNCTION(gotoBlockStartWithSelection)
|
|
|
|
|
FUNCTION(gotoBlockEndWithSelection)
|
2008-12-04 19:25:20 +01:00
|
|
|
FUNCTION(selectBlockUp)
|
|
|
|
|
FUNCTION(selectBlockDown)
|
2008-12-10 18:01:33 +01:00
|
|
|
FUNCTION(moveLineUp)
|
|
|
|
|
FUNCTION(moveLineDown)
|
2009-05-15 23:17:11 +02:00
|
|
|
FUNCTION(copyLineUp)
|
|
|
|
|
FUNCTION(copyLineDown)
|
2010-01-20 17:51:05 +01:00
|
|
|
FUNCTION(joinLines)
|
2011-02-25 11:10:42 +01:00
|
|
|
FUNCTION(uppercaseSelection)
|
|
|
|
|
FUNCTION(lowercaseSelection)
|
2010-05-03 17:03:11 +02:00
|
|
|
FUNCTION(insertLineAbove)
|
|
|
|
|
FUNCTION(insertLineBelow)
|
2012-01-22 17:05:02 -05:00
|
|
|
FUNCTION(indent)
|
|
|
|
|
FUNCTION(unindent)
|
2012-03-27 23:18:46 +04:00
|
|
|
FUNCTION(openLinkUnderCursor)
|
2013-02-05 14:14:33 +01:00
|
|
|
FUNCTION(openLinkUnderCursorInNextSplit)
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-05-07 15:24:30 +02:00
|
|
|
FUNCTION(gotoLineStart)
|
|
|
|
|
FUNCTION(gotoLineStartWithSelection)
|
|
|
|
|
FUNCTION(gotoLineEnd)
|
|
|
|
|
FUNCTION(gotoLineEndWithSelection)
|
|
|
|
|
FUNCTION(gotoNextLine)
|
|
|
|
|
FUNCTION(gotoNextLineWithSelection)
|
|
|
|
|
FUNCTION(gotoPreviousLine)
|
|
|
|
|
FUNCTION(gotoPreviousLineWithSelection)
|
|
|
|
|
FUNCTION(gotoPreviousCharacter)
|
|
|
|
|
FUNCTION(gotoPreviousCharacterWithSelection)
|
|
|
|
|
FUNCTION(gotoNextCharacter)
|
|
|
|
|
FUNCTION(gotoNextCharacterWithSelection)
|
|
|
|
|
FUNCTION(gotoPreviousWord)
|
|
|
|
|
FUNCTION(gotoPreviousWordWithSelection)
|
2010-11-10 12:53:45 +01:00
|
|
|
FUNCTION(gotoPreviousWordCamelCase)
|
|
|
|
|
FUNCTION(gotoPreviousWordCamelCaseWithSelection)
|
2010-05-07 15:24:30 +02:00
|
|
|
FUNCTION(gotoNextWord)
|
|
|
|
|
FUNCTION(gotoNextWordWithSelection)
|
2010-11-10 12:53:45 +01:00
|
|
|
FUNCTION(gotoNextWordCamelCase)
|
|
|
|
|
FUNCTION(gotoNextWordCamelCaseWithSelection)
|
2010-05-07 15:24:30 +02:00
|
|
|
|
|
|
|
|
|
2009-02-16 12:50:15 +01:00
|
|
|
void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-02-16 12:50:15 +01:00
|
|
|
m_currentEditor = 0;
|
|
|
|
|
|
|
|
|
|
if (!editor)
|
|
|
|
|
return;
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
BaseTextEditorWidget *baseEditor = qobject_cast<BaseTextEditorWidget *>(editor->widget());
|
2009-02-16 12:50:15 +01:00
|
|
|
|
|
|
|
|
if (baseEditor && baseEditor->actionHack() == this) {
|
|
|
|
|
m_currentEditor = baseEditor;
|
|
|
|
|
updateActions();
|
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
const QPointer<BaseTextEditorWidget> &TextEditorActionHandler::currentEditor() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return m_currentEditor;
|
|
|
|
|
}
|