MantisBT - CMake
View Issue Details
0009733CMakeQtDialogpublic2009-10-19 13:002013-04-18 14:01
Alex Neundorf 
Alex Neundorf 
normalfeaturealways
closedfixed 
CMake-2-8 
 
0009733: search for string in log window
Hi,

it would be nice if it would be possible if I could press Ctrl+F and then enter a string which will be searched in the log widget containing the output from cmake.

Alex
No tags attached.
patch 0001-Search-functions-for-Output-window.patch (3,584) 2013-03-08 22:22
https://public.kitware.com/Bug/file/4669/0001-Search-functions-for-Output-window.patch
patch 0002-Search-functions-added-to-context-menu-of-the-Output.patch (2,256) 2013-03-08 22:22
https://public.kitware.com/Bug/file/4670/0002-Search-functions-added-to-context-menu-of-the-Output.patch
patch 0003-Changed-shortcuts-Alt-E-search-field-Ctrl-F-find-in-.patch (2,305) 2013-03-08 22:22
https://public.kitware.com/Bug/file/4671/0003-Changed-shortcuts-Alt-E-search-field-Ctrl-F-find-in-.patch
patch 0004-Goto-next-error-in-Output-window.patch (4,056) 2013-03-08 22:22
https://public.kitware.com/Bug/file/4672/0004-Goto-next-error-in-Output-window.patch
patch 0004-Goto-next-error-in-Output-window_v2.patch (4,939) 2013-03-09 10:32
https://public.kitware.com/Bug/file/4673/0004-Goto-next-error-in-Output-window_v2.patch
zip search for string_v2.zip (5,622) 2013-04-17 19:14
https://public.kitware.com/Bug/file/4743/search%20for%20string_v2.zip
Issue History
2009-10-19 13:00Alex NeundorfNew Issue
2009-10-19 13:01Alex NeundorfAssigned To => Clinton Stimpson
2009-10-19 13:01Alex NeundorfStatusnew => assigned
2012-08-13 23:25Clinton StimpsonStatusassigned => backlog
2013-03-08 22:22naggerFile Added: 0001-Search-functions-for-Output-window.patch
2013-03-08 22:22naggerFile Added: 0002-Search-functions-added-to-context-menu-of-the-Output.patch
2013-03-08 22:22naggerFile Added: 0003-Changed-shortcuts-Alt-E-search-field-Ctrl-F-find-in-.patch
2013-03-08 22:22naggerFile Added: 0004-Goto-next-error-in-Output-window.patch
2013-03-08 22:32naggerNote Added: 0032543
2013-03-09 04:07Alex NeundorfNote Added: 0032546
2013-03-09 10:32naggerFile Added: 0004-Goto-next-error-in-Output-window_v2.patch
2013-03-09 10:35naggerNote Added: 0032561
2013-04-10 15:48Alex NeundorfNote Added: 0032800
2013-04-17 19:14naggerFile Added: search for string_v2.zip
2013-04-17 19:16naggerNote Added: 0032903
2013-04-17 19:17naggerNote Edited: 0032903bug_revision_view_page.php?bugnote_id=32903#r1120
2013-04-18 14:01Alex NeundorfNote Added: 0032906
2013-04-18 14:01Alex NeundorfAssigned ToClinton Stimpson => Alex Neundorf
2013-04-18 14:01Alex NeundorfStatusbacklog => closed
2013-04-18 14:01Alex NeundorfResolutionopen => fixed

Notes
(0032543)
nagger   
2013-03-08 22:32   
Notice that Ctrl-F is already taken for focusing the search-field for cache-variables. But in my opinion this should be changed. (See patch 0003)

Attached Patches:
 0001: Search functions (forward and backward) - F3 and Shift-F3
 0002: Context menu for output window to select the search functions
 0003: search-field shortcut is now alt-e (alt-s is already taken)

 0004: additional functionality: goto next non-status message (red message) in output window. I registered several shortcuts for this, since there is no common key for that. I would like to see 'F8' like in VisualStudio.


The patches are only tested with on Windows7.
(0032546)
Alex Neundorf   
2013-03-09 04:07   
Cool :-)

Clinton, can you apply those patches ?
If you don't have the time, I could do that too.
(0032561)
nagger   
2013-03-09 10:35   
Added an improved version for patch 0004:
 * Subsequent error messages are not selected together anymore
(0032800)
Alex Neundorf   
2013-04-10 15:48   
A few comments to the patches:
I get the following warnings when applying the patches:

* 0001:
~/src/CMake/CMake-git$ git apply 0001-search-functions-for-output-window.patch
0001-search-functions-for-output-window.patch:33: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

~/src/CMake/CMake-git$ git apply 0004-goto-next-error-in-output-window_v2.patch
0004-goto-next-error-in-output-window_v2.patch:30: trailing whitespace.
  //QTextEdit will terminate the msg with a ParagraphSeparator, but it also replaces
0004-goto-next-error-in-output-window_v2.patch:31: trailing whitespace.
  //all newlines with ParagraphSeparators. By replacing the newlines by ourself, one
0004-goto-next-error-in-output-window_v2.patch:32: trailing whitespace.
  //error msg will be one paragraph.
0004-goto-next-error-in-output-window_v2.patch:33: trailing whitespace.
  QString paragraph(msg);
warning: 4 lines add whitespace errors.

Can you fix those please ?

I had to do the following change to make it compile:
@@ -1219,7 +1219,11 @@ void CMakeSetupDialog::doOutputFindNext(
 
   QTextCursor cursor = this->Output->textCursor();
   QTextDocument* document = this->Output->document();
- QTextDocument::FindFlags flags = directionForward ? 0 : QTextDocument::FindBackward;
+ QTextDocument::FindFlags flags;
+ if (!directionForward)
+ {
+ flags |= QTextDocument::FindBackward;
+ }

Otherwise I got:
Building CXX object Source/QtDialog/CMakeFiles/cmake-gui.dir/CMakeSetupDialog.cxx.o
/home/alex/src/CMake/CMake-git/Source/QtDialog/CMakeSetupDialog.cxx: In member function 'void CMakeSetupDialog::doOutputFindNext(bool)':
/home/alex/src/CMake/CMake-git/Source/QtDialog/CMakeSetupDialog.cxx:1222:74: error: conversion from 'int' to 'QTextDocument::FindFlags' is ambiguous
/usr/lib/qt/include/QtCore/qglobal.h:2180:12: note: candidates are: QFlags<Enum>::QFlags(void**) [with Enum = QTextDocument::FindFlag, void** = void**] <near match>
/usr/lib/qt/include/QtCore/qglobal.h:2179:12: note: QFlags<Enum>::QFlags(Enum) [with Enum = QTextDocument::FindFlag] <near match>



Additionally, can you please add menu entries to the new functions, so they can be found and the shortcuts are in this way discoverable ?
Probably the "Tools" menu is a good candidate.

And one more comment: some lines are quite long. In CMake the maximum allowed line length is 79. Can you try to make your patch so that the new code does not exceed the 79 characters per line ?

Beside that, very nice, thanks a lot. :-)
(0032903)
nagger   
2013-04-17 19:16   
(edited on: 2013-04-17 19:17)
Made it so. See attached search_for_strings_v2.

(0032906)
Alex Neundorf   
2013-04-18 14:01   
Thanks, great ! :-)

I applied your patches and merged them into next.
It should be in the next cmake release (2.8.12 probably).