diff options
author | Serhii Moroz <frost.asm@gmail.com> | 2017-08-13 20:38:08 +0300 |
---|---|---|
committer | Serhii Moroz <frost.asm@gmail.com> | 2017-09-11 17:43:02 +0000 |
commit | bb58ab34c17d7153cdf1df727e9bb2b7529991b9 (patch) | |
tree | 7a4f44e788847009d958fe068ff5dc9f67cf265a /src/plugins/texteditor/texteditoractionhandler.cpp | |
parent | b506fce0fe853464beea23f7bafe004272acca2e (diff) |
TextEditor: Add sortSelectedLines action
Change-Id: Ifdc82766bac3cfe2e9c287b4ef04902a943c8f72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.cpp')
-rw-r--r-- | src/plugins/texteditor/texteditoractionhandler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 35c7d5e285..e1e0962f9f 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -176,6 +176,7 @@ public: QAction *m_insertLineBelowAction = nullptr; QAction *m_upperCaseSelectionAction = nullptr; QAction *m_lowerCaseSelectionAction = nullptr; + QAction *m_sortSelectedLinesAction = nullptr; QAction *m_indentAction = nullptr; QAction *m_unindentAction = nullptr; QAction *m_followSymbolAction = nullptr; @@ -382,6 +383,10 @@ void TextEditorActionHandlerPrivate::createActions() [] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")), G_EDIT_TEXT, advancedEditMenu); + m_sortSelectedLinesAction = registerAction(SORT_SELECTED_LINES, + [this] (TextEditorWidget *w) { w->sortSelectedLines(); }, false, tr("&Sort Selected Lines"), + QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+S") : tr("Alt+Shift+S")), + G_EDIT_TEXT, advancedEditMenu); m_foldAction = registerAction(FOLD, [] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"), QKeySequence(tr("Ctrl+<")), @@ -500,6 +505,7 @@ void TextEditorActionHandlerPrivate::createActions() m_modifyingActions << m_unCommentSelectionAction; m_modifyingActions << m_unindentAction; m_modifyingActions << m_upperCaseSelectionAction; + m_modifyingActions << m_sortSelectedLinesAction; // set enabled state of optional actions m_followSymbolAction->setEnabled(m_optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor); |