| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-01-11 16:28:15 +01:00
										 |  |  | ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Contact: Nokia Corporation (info@qt.nokia.com) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** 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.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** In addition, as a special exception, Nokia gives you certain additional | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** rights. These rights are described in the Nokia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Other Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Alternatively, this file may be used in accordance with the terms and | 
					
						
							|  |  |  | ** conditions contained in a signed written agreement between you and Nokia. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** If you have questions regarding the use of this file, please contact | 
					
						
							| 
									
										
										
										
											2011-05-06 15:05:37 +02:00
										 |  |  | ** Nokia at info@qt.nokia.com. | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01: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>
 | 
					
						
							|  |  |  | #include <coreplugin/actionmanager/command.h>
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | #include <coreplugin/editormanager/editormanager.h>
 | 
					
						
							| 
									
										
										
										
											2011-09-05 16:10:37 +02:00
										 |  |  | #include <coreplugin/id.h>
 | 
					
						
							| 
									
										
										
										
											2008-12-09 15:25:01 +01:00
										 |  |  | #include <utils/qtcassert.h>
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <QtCore/QSet>
 | 
					
						
							|  |  |  | #include <QtCore/QtDebug>
 | 
					
						
							|  |  |  | #include <QtGui/QAction>
 | 
					
						
							|  |  |  | #include <QtGui/QTextCursor>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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), | 
					
						
							|  |  |  |     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), | 
					
						
							| 
									
										
										
										
											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) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2009-02-16 12:50:15 +01:00
										 |  |  |     connect(Core::ICore::instance()->editorManager(), 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() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     m_undoAction      = registerNewAction(QLatin1String(Core::Constants::UNDO),      this, SLOT(undoAction()), | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |                                           true, tr("&Undo")); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_redoAction      = registerNewAction(QLatin1String(Core::Constants::REDO),      this, SLOT(redoAction()), | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |                                           true, tr("&Redo")); | 
					
						
							|  |  |  |     m_copyAction      = registerNewAction(QLatin1String(Core::Constants::COPY),      this, SLOT(copyAction()), true); | 
					
						
							|  |  |  |     m_cutAction       = registerNewAction(QLatin1String(Core::Constants::CUT),       this, SLOT(cutAction()), true); | 
					
						
							|  |  |  |     m_pasteAction     = registerNewAction(QLatin1String(Core::Constants::PASTE),     this, SLOT(pasteAction()), true); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_pasteAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     m_selectAllAction = registerNewAction(QLatin1String(Core::Constants::SELECTALL), this, SLOT(selectAllAction()), true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_gotoAction      = registerNewAction(QLatin1String(Core::Constants::GOTO),      this, SLOT(gotoAction())); | 
					
						
							|  |  |  |     m_printAction     = registerNewAction(QLatin1String(Core::Constants::PRINT),     this, SLOT(printAction())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-20 15:31:33 +01:00
										 |  |  |     Core::ActionManager *am = Core::ICore::instance()->actionManager(); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-14 12:39:59 +01:00
										 |  |  |     Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); | 
					
						
							|  |  |  |     Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     m_selectEncodingAction = new QAction(tr("Select Encoding..."), this); | 
					
						
							| 
									
										
										
										
											2009-01-14 13:17:53 +01:00
										 |  |  |     Core::Command *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding())); | 
					
						
							|  |  |  |     medit->addAction(command, Core::Constants::G_EDIT_OTHER); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_formatAction = new QAction(tr("Auto-&indent Selection"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_formatAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_formatAction, TextEditor::Constants::AUTO_INDENT_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+I"))); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-09 13:32:28 +02:00
										 |  |  | #ifdef Q_WS_MAC
 | 
					
						
							|  |  |  |     QString modifier = tr("Meta"); | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  |     QString modifier = tr("Ctrl"); | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-21 10:37:00 +02:00
										 |  |  |     m_rewrapParagraphAction = new QAction(tr("&Rewrap Paragraph"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_rewrapParagraphAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_rewrapParagraphAction, TextEditor::Constants::REWRAP_PARAGRAPH, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2009-10-09 13:32:28 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("%1+E, R").arg(modifier))); | 
					
						
							| 
									
										
										
										
											2009-07-21 10:37:00 +02:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							|  |  |  |     connect(m_rewrapParagraphAction, SIGNAL(triggered(bool)), this, SLOT(rewrapParagraphAction())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 17:43:31 +01:00
										 |  |  |     m_visualizeWhitespaceAction = new QAction(tr("&Visualize Whitespace"), this); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_visualizeWhitespaceAction->setCheckable(true); | 
					
						
							|  |  |  |     command = am->registerAction(m_visualizeWhitespaceAction, | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |                                  TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId); | 
					
						
							| 
									
										
										
										
											2009-10-09 13:32:28 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+V").arg(modifier, modifier))); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     connect(m_visualizeWhitespaceAction, SIGNAL(triggered(bool)), this, SLOT(setVisualizeWhitespace(bool))); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 17:43:31 +01:00
										 |  |  |     m_cleanWhitespaceAction = new QAction(tr("Clean Whitespace"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_cleanWhitespaceAction; | 
					
						
							| 
									
										
										
										
											2008-12-09 17:43:31 +01:00
										 |  |  |     command = am->registerAction(m_cleanWhitespaceAction, | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |                                  TextEditor::Constants::CLEAN_WHITESPACE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-09 17:43:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							| 
									
										
										
										
											2008-12-09 17:43:31 +01:00
										 |  |  |     connect(m_cleanWhitespaceAction, SIGNAL(triggered()), this, SLOT(cleanWhitespace())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this); | 
					
						
							|  |  |  |     m_textWrappingAction->setCheckable(true); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     command = am->registerAction(m_textWrappingAction, TextEditor::Constants::TEXT_WRAPPING, m_contextId); | 
					
						
							| 
									
										
										
										
											2009-10-09 13:32:28 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+W").arg(modifier, modifier))); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     connect(m_textWrappingAction, SIGNAL(triggered(bool)), this, SLOT(setTextWrapping(bool))); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-07-19 14:46:47 +02:00
										 |  |  |     m_unCommentSelectionAction = new QAction(tr("Toggle Comment &Selection"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_unCommentSelectionAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_unCommentSelectionAction, Constants::UN_COMMENT_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+/"))); | 
					
						
							|  |  |  |     connect(m_unCommentSelectionAction, SIGNAL(triggered()), this, SLOT(unCommentSelection())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-14 17:24:35 +02:00
										 |  |  |     m_cutLineAction = new QAction(tr("Cut &Line"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_cutLineAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_cutLineAction, Constants::CUT_LINE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2009-05-14 17:24:35 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Shift+Del"))); | 
					
						
							|  |  |  |     connect(m_cutLineAction, SIGNAL(triggered()), this, SLOT(cutLine())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-27 14:02:20 +09:00
										 |  |  |     m_copyLineAction = new QAction(tr("Copy &Line"), this); | 
					
						
							|  |  |  |     command = am->registerAction(m_copyLineAction, Constants::COPY_LINE, m_contextId); | 
					
						
							| 
									
										
										
										
											2011-03-17 11:07:24 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Ins"))); | 
					
						
							| 
									
										
										
										
											2010-11-27 14:02:20 +09:00
										 |  |  |     connect(m_copyLineAction, SIGNAL(triggered()), this, SLOT(copyLine())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_deleteLineAction = new QAction(tr("Delete &Line"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_deleteLineAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_deleteLineAction, Constants::DELETE_LINE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     connect(m_deleteLineAction, SIGNAL(triggered()), this, SLOT(deleteLine())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-26 14:21:19 +02:00
										 |  |  |     m_deleteEndOfWordAction = new QAction(tr("Delete Word From The Cursor On"), this); | 
					
						
							|  |  |  |     m_modifyingActions << m_deleteEndOfWordAction; | 
					
						
							|  |  |  |     am->registerAction(m_deleteEndOfWordAction, Constants::DELETE_END_OF_WORD, m_contextId, true); | 
					
						
							|  |  |  |     connect(m_deleteEndOfWordAction, SIGNAL(triggered()), this, SLOT(deleteEndOfWord())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_deleteEndOfWordCamelCaseAction = new QAction(tr("Delete Word Camel Case From The Cursor On"), this); | 
					
						
							|  |  |  |     m_modifyingActions << m_deleteEndOfWordCamelCaseAction; | 
					
						
							|  |  |  |     am->registerAction(m_deleteEndOfWordCamelCaseAction, Constants::DELETE_END_OF_WORD_CAMEL_CASE, m_contextId, true); | 
					
						
							|  |  |  |     connect(m_deleteEndOfWordCamelCaseAction, SIGNAL(triggered()), this, SLOT(deleteEndOfWordCamelCase())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_deleteStartOfWordAction = new QAction(tr("Delete Word Up To The Cursor"), this); | 
					
						
							|  |  |  |     m_modifyingActions << m_deleteStartOfWordAction; | 
					
						
							|  |  |  |     am->registerAction(m_deleteStartOfWordAction, Constants::DELETE_START_OF_WORD, m_contextId, true); | 
					
						
							|  |  |  |     connect(m_deleteStartOfWordAction, SIGNAL(triggered()), this, SLOT(deleteStartOfWord())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_deleteStartOfWordCamelCaseAction = new QAction(tr("Delete Word Camel Case Up To The Cursor"), this); | 
					
						
							|  |  |  |     m_modifyingActions << m_deleteStartOfWordCamelCaseAction; | 
					
						
							|  |  |  |     am->registerAction(m_deleteStartOfWordCamelCaseAction, Constants::DELETE_START_OF_WORD_CAMEL_CASE, m_contextId, true); | 
					
						
							|  |  |  |     connect(m_deleteStartOfWordCamelCaseAction, SIGNAL(triggered()), this, SLOT(deleteStartOfWordCamelCase())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-20 15:10:26 +02:00
										 |  |  |     m_foldAction = new QAction(tr("Fold"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_foldAction, Constants::FOLD, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+<"))); | 
					
						
							| 
									
										
										
										
											2010-05-20 15:10:26 +02:00
										 |  |  |     connect(m_foldAction, SIGNAL(triggered()), this, SLOT(fold())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_COLLAPSING); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-20 15:10:26 +02:00
										 |  |  |     m_unfoldAction = new QAction(tr("Unfold"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_unfoldAction, Constants::UNFOLD, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+>"))); | 
					
						
							| 
									
										
										
										
											2010-05-20 15:10:26 +02:00
										 |  |  |     connect(m_unfoldAction, SIGNAL(triggered()), this, SLOT(unfold())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_COLLAPSING); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-07-19 14:46:47 +02:00
										 |  |  |     m_unfoldAllAction = new QAction(tr("Toggle &Fold All"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_unfoldAllAction, Constants::UNFOLD_ALL, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-20 15:10:26 +02:00
										 |  |  |     connect(m_unfoldAllAction, SIGNAL(triggered()), this, SLOT(unfoldAll())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_COLLAPSING); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     m_increaseFontSizeAction = new QAction(tr("Increase Font Size"), this); | 
					
						
							|  |  |  |     command = am->registerAction(m_increaseFontSizeAction, Constants::INCREASE_FONT_SIZE, m_contextId); | 
					
						
							|  |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl++"))); | 
					
						
							|  |  |  |     connect(m_increaseFontSizeAction, SIGNAL(triggered()), this, SLOT(increaseFontSize())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FONT); | 
					
						
							| 
									
										
										
										
											2009-09-14 13:02:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     m_decreaseFontSizeAction = new QAction(tr("Decrease Font Size"), this); | 
					
						
							|  |  |  |     command = am->registerAction(m_decreaseFontSizeAction, Constants::DECREASE_FONT_SIZE, m_contextId); | 
					
						
							|  |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+-"))); | 
					
						
							|  |  |  |     connect(m_decreaseFontSizeAction, SIGNAL(triggered()), this, SLOT(decreaseFontSize())); | 
					
						
							| 
									
										
										
										
											2009-01-20 09:48:50 +01:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FONT); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-30 19:00:36 +01:00
										 |  |  |     m_resetFontSizeAction = new QAction(tr("Reset Font Size"), this); | 
					
						
							|  |  |  |     command = am->registerAction(m_resetFontSizeAction, Constants::RESET_FONT_SIZE, m_contextId); | 
					
						
							| 
									
										
										
										
											2010-04-22 17:11:37 +02:00
										 |  |  | #ifndef Q_WS_MAC
 | 
					
						
							| 
									
										
										
										
											2009-11-30 19:00:36 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+0"))); | 
					
						
							| 
									
										
										
										
											2010-04-22 17:11:37 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2009-11-30 19:00:36 +01:00
										 |  |  |     connect(m_resetFontSizeAction, SIGNAL(triggered()), this, SLOT(resetFontSize())); | 
					
						
							|  |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_FONT); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-08 17:56:21 +01:00
										 |  |  |     m_gotoBlockStartAction = new QAction(tr("Go to Block Start"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_gotoBlockStartAction, Constants::GOTO_BLOCK_START, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+["))); | 
					
						
							|  |  |  |     connect(m_gotoBlockStartAction, SIGNAL(triggered()), this, SLOT(gotoBlockStart())); | 
					
						
							| 
									
										
										
										
											2009-09-24 14:50:22 +02:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_BLOCKS); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-08 17:56:21 +01:00
										 |  |  |     m_gotoBlockEndAction = new QAction(tr("Go to Block End"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_gotoBlockEndAction, Constants::GOTO_BLOCK_END, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+]"))); | 
					
						
							|  |  |  |     connect(m_gotoBlockEndAction, SIGNAL(triggered()), this, SLOT(gotoBlockEnd())); | 
					
						
							| 
									
										
										
										
											2009-09-24 14:50:22 +02:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_BLOCKS); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-08 17:56:21 +01:00
										 |  |  |     m_gotoBlockStartWithSelectionAction = new QAction(tr("Go to Block Start With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_gotoBlockStartWithSelectionAction, Constants::GOTO_BLOCK_START_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+{"))); | 
					
						
							|  |  |  |     connect(m_gotoBlockStartWithSelectionAction, SIGNAL(triggered()), this, SLOT(gotoBlockStartWithSelection())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-08 17:56:21 +01:00
										 |  |  |     m_gotoBlockEndWithSelectionAction = new QAction(tr("Go to Block End With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_gotoBlockEndWithSelectionAction, Constants::GOTO_BLOCK_END_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 18:37:02 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+}"))); | 
					
						
							|  |  |  |     connect(m_gotoBlockEndWithSelectionAction, SIGNAL(triggered()), this, SLOT(gotoBlockEndWithSelection())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_selectBlockUpAction = new QAction(tr("Select Block Up"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_selectBlockUpAction, Constants::SELECT_BLOCK_UP, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 19:25:20 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+U"))); | 
					
						
							|  |  |  |     connect(m_selectBlockUpAction, SIGNAL(triggered()), this, SLOT(selectBlockUp())); | 
					
						
							| 
									
										
										
										
											2009-09-24 14:50:22 +02:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_BLOCKS); | 
					
						
							| 
									
										
										
										
											2008-12-04 19:25:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_selectBlockDownAction = new QAction(tr("Select Block Down"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_selectBlockDownAction, Constants::SELECT_BLOCK_DOWN, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-04 19:25:20 +01:00
										 |  |  |     connect(m_selectBlockDownAction, SIGNAL(triggered()), this, SLOT(selectBlockDown())); | 
					
						
							| 
									
										
										
										
											2009-09-24 14:50:22 +02:00
										 |  |  |     advancedMenu->addAction(command, Core::Constants::G_EDIT_BLOCKS); | 
					
						
							| 
									
										
										
										
											2008-12-10 18:01:33 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_moveLineUpAction = new QAction(tr("Move Line Up"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_moveLineUpAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_moveLineUpAction, Constants::MOVE_LINE_UP, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-10 18:01:33 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+Up"))); | 
					
						
							|  |  |  |     connect(m_moveLineUpAction, SIGNAL(triggered()), this, SLOT(moveLineUp())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_moveLineDownAction = new QAction(tr("Move Line Down"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_moveLineDownAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_moveLineDownAction, Constants::MOVE_LINE_DOWN, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2008-12-10 18:01:33 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+Down"))); | 
					
						
							|  |  |  |     connect(m_moveLineDownAction, SIGNAL(triggered()), this, SLOT(moveLineDown())); | 
					
						
							| 
									
										
										
										
											2009-05-15 23:17:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_copyLineUpAction = new QAction(tr("Copy Line Up"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_copyLineUpAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_copyLineUpAction, Constants::COPY_LINE_UP, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2009-05-15 23:17:11 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Up"))); | 
					
						
							|  |  |  |     connect(m_copyLineUpAction, SIGNAL(triggered()), this, SLOT(copyLineUp())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_copyLineDownAction = new QAction(tr("Copy Line Down"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_copyLineDownAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_copyLineDownAction, Constants::COPY_LINE_DOWN, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2009-05-15 23:17:11 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Down"))); | 
					
						
							|  |  |  |     connect(m_copyLineDownAction, SIGNAL(triggered()), this, SLOT(copyLineDown())); | 
					
						
							| 
									
										
										
										
											2010-01-20 16:54:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 12:02:37 +02:00
										 |  |  |     m_joinLinesAction = new QAction(tr("Join Lines"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_joinLinesAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_joinLinesAction, Constants::JOIN_LINES, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-01-20 16:54:06 +01:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+J"))); | 
					
						
							| 
									
										
										
										
											2010-01-20 17:51:05 +01:00
										 |  |  |     connect(m_joinLinesAction, SIGNAL(triggered()), this, SLOT(joinLines())); | 
					
						
							| 
									
										
										
										
											2010-05-03 17:03:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     m_insertLineAboveAction = new QAction(tr("Insert Line Above Current Line"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_insertLineAboveAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_insertLineAboveAction, Constants::INSERT_LINE_ABOVE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-03 17:03:11 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+Return"))); | 
					
						
							|  |  |  |     connect(m_insertLineAboveAction, SIGNAL(triggered()), this, SLOT(insertLineAbove())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_insertLineBelowAction = new QAction(tr("Insert Line Below Current Line"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_insertLineBelowAction; | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(m_insertLineBelowAction, Constants::INSERT_LINE_BELOW, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-03 17:06:49 +02:00
										 |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Return"))); | 
					
						
							| 
									
										
										
										
											2010-05-03 17:03:11 +02:00
										 |  |  |     connect(m_insertLineBelowAction, SIGNAL(triggered()), this, SLOT(insertLineBelow())); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-25 11:10:42 +01:00
										 |  |  |     m_upperCaseSelectionAction = new QAction(tr("Uppercase Selection"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_upperCaseSelectionAction; | 
					
						
							| 
									
										
										
										
											2011-02-25 11:10:42 +01:00
										 |  |  |     command = am->registerAction(m_upperCaseSelectionAction, Constants::UPPERCASE_SELECTION, m_contextId, true); | 
					
						
							|  |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+U"))); | 
					
						
							|  |  |  |     connect(m_upperCaseSelectionAction, SIGNAL(triggered()), this, SLOT(uppercaseSelection())); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     m_lowerCaseSelectionAction = new QAction(tr("Lowercase Selection"), this); | 
					
						
							| 
									
										
										
										
											2011-05-19 12:25:27 +02:00
										 |  |  |     m_modifyingActions << m_lowerCaseSelectionAction; | 
					
						
							| 
									
										
										
										
											2011-02-25 11:10:42 +01:00
										 |  |  |     command = am->registerAction(m_lowerCaseSelectionAction, Constants::LOWERCASE_SELECTION, m_contextId, true); | 
					
						
							|  |  |  |     command->setDefaultKeySequence(QKeySequence(tr("Alt+U"))); | 
					
						
							|  |  |  |     connect(m_lowerCaseSelectionAction, SIGNAL(triggered()), this, SLOT(lowercaseSelection())); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     QAction *a = 0; | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Line Start"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_LINE_START, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoLineStart())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Line End"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_LINE_END, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoLineEnd())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Line"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_LINE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextLine())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Line"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_LINE, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousLine())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Character"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_CHARACTER, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousCharacter())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Character"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_CHARACTER, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextCharacter())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Word"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_WORD, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousWord())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Word"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_WORD, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextWord())); | 
					
						
							| 
									
										
										
										
											2010-11-10 12:53:45 +01:00
										 |  |  |     a = new QAction(tr("Goto Previous Word Camel Case"), this); | 
					
						
							|  |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_WORD_CAMEL_CASE, m_contextId); | 
					
						
							|  |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousWordCamelCase())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Word Camel Case"), this); | 
					
						
							|  |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_WORD_CAMEL_CASE, m_contextId); | 
					
						
							|  |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextWordCamelCase())); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Line Start With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_LINE_START_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoLineStartWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Line End With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_LINE_END_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoLineEndWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Line With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_LINE_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextLineWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Line With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_LINE_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousLineWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Character With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_CHARACTER_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousCharacterWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Character With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_CHARACTER_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextCharacterWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Previous Word With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_WORD_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousWordWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Word With Selection"), this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_WORD_WITH_SELECTION, m_contextId, true); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextWordWithSelection())); | 
					
						
							| 
									
										
										
										
											2010-11-10 12:53:45 +01:00
										 |  |  |     a = new QAction(tr("Goto Previous Word Camel Case With Selection"), this); | 
					
						
							|  |  |  |     command = am->registerAction(a, Constants::GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION, m_contextId); | 
					
						
							|  |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoPreviousWordCamelCaseWithSelection())); | 
					
						
							|  |  |  |     a = new QAction(tr("Goto Next Word Camel Case With Selection"), this); | 
					
						
							|  |  |  |     command = am->registerAction(a, Constants::GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION, m_contextId); | 
					
						
							|  |  |  |     connect(a, SIGNAL(triggered()), this, SLOT(gotoNextWordCamelCaseWithSelection())); | 
					
						
							| 
									
										
										
										
											2010-05-07 15:24:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool TextEditorActionHandler::supportsAction(const QString & /*id */) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  | QAction *TextEditorActionHandler::registerNewAction(const QString &id, bool scriptable, const QString &title) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     if (!supportsAction(id)) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QAction *result = new QAction(title, this); | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     Core::ICore::instance()->actionManager()->registerAction(result, id, m_contextId, scriptable); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     return result; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QAction *TextEditorActionHandler::registerNewAction(const QString &id, | 
					
						
							|  |  |  |                                                     QObject *receiver, | 
					
						
							|  |  |  |                                                     const char *slot, | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |                                                     bool scriptable, | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |                                                     const QString &title) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-12-20 10:35:30 +01:00
										 |  |  |     QAction *rc = registerNewAction(id, scriptable, title); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     if (!rc) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     connect(rc, SIGNAL(triggered()), receiver, slot); | 
					
						
							|  |  |  |     return rc; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01: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); | 
					
						
							| 
									
										
										
										
											2009-02-16 12:50:15 +01:00
										 |  |  |     if (m_copyAction) { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         m_copyAction->setEnabled(hasCopyableText); | 
					
						
							| 
									
										
										
										
											2009-02-16 12:50:15 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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(); | 
					
						
							|  |  |  |     locatorString += tr("<line number>"); | 
					
						
							|  |  |  |     locatorManager->show(locatorString, selectionStart, locatorString.size() - selectionStart); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void TextEditorActionHandler::printAction() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (m_currentEditor) | 
					
						
							| 
									
										
										
										
											2009-01-20 15:31:33 +01:00
										 |  |  |         m_currentEditor->print(Core::ICore::instance()->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) | 
					
						
							|  |  |  | 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) | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							|  |  |  | } |