View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009733CMakeQtDialogpublic2009-10-19 13:002013-04-18 14:01
ReporterAlex Neundorf 
Assigned ToAlex Neundorf 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009733: search for string in log window
DescriptionHi,

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
TagsNo tags attached.
Attached Filespatch file icon 0001-Search-functions-for-Output-window.patch [^] (3,584 bytes) 2013-03-08 22:22 [Show Content]
patch file icon 0002-Search-functions-added-to-context-menu-of-the-Output.patch [^] (2,256 bytes) 2013-03-08 22:22 [Show Content]
patch file icon 0003-Changed-shortcuts-Alt-E-search-field-Ctrl-F-find-in-.patch [^] (2,305 bytes) 2013-03-08 22:22 [Show Content]
patch file icon 0004-Goto-next-error-in-Output-window.patch [^] (4,056 bytes) 2013-03-08 22:22 [Show Content]
patch file icon 0004-Goto-next-error-in-Output-window_v2.patch [^] (4,939 bytes) 2013-03-09 10:32 [Show Content]
zip file icon search for string_v2.zip [^] (5,622 bytes) 2013-04-17 19:14

 Relationships

  Notes
(0032543)
nagger (reporter)
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 (developer)
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 (reporter)
2013-03-09 10:35

Added an improved version for patch 0004:
 * Subsequent error messages are not selected together anymore
(0032800)
Alex Neundorf (developer)
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 (reporter)
2013-04-17 19:16
edited on: 2013-04-17 19:17

Made it so. See attached search_for_strings_v2.

(0032906)
Alex Neundorf (developer)
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).

 Issue History
Date Modified Username Field Change
2009-10-19 13:00 Alex Neundorf New Issue
2009-10-19 13:01 Alex Neundorf Assigned To => Clinton Stimpson
2009-10-19 13:01 Alex Neundorf Status new => assigned
2012-08-13 23:25 Clinton Stimpson Status assigned => backlog
2013-03-08 22:22 nagger File Added: 0001-Search-functions-for-Output-window.patch
2013-03-08 22:22 nagger File Added: 0002-Search-functions-added-to-context-menu-of-the-Output.patch
2013-03-08 22:22 nagger File Added: 0003-Changed-shortcuts-Alt-E-search-field-Ctrl-F-find-in-.patch
2013-03-08 22:22 nagger File Added: 0004-Goto-next-error-in-Output-window.patch
2013-03-08 22:32 nagger Note Added: 0032543
2013-03-09 04:07 Alex Neundorf Note Added: 0032546
2013-03-09 10:32 nagger File Added: 0004-Goto-next-error-in-Output-window_v2.patch
2013-03-09 10:35 nagger Note Added: 0032561
2013-04-10 15:48 Alex Neundorf Note Added: 0032800
2013-04-17 19:14 nagger File Added: search for string_v2.zip
2013-04-17 19:16 nagger Note Added: 0032903
2013-04-17 19:17 nagger Note Edited: 0032903
2013-04-18 14:01 Alex Neundorf Note Added: 0032906
2013-04-18 14:01 Alex Neundorf Assigned To Clinton Stimpson => Alex Neundorf
2013-04-18 14:01 Alex Neundorf Status backlog => closed
2013-04-18 14:01 Alex Neundorf Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team