Bug 57965 - Grep tool focuses to last active field rather than to pattern field
Summary: Grep tool focuses to last active field rather than to pattern field
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-01 15:56 UTC by Bill Davenport
Modified: 2003-05-01 16:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Davenport 2003-05-01 15:56:42 UTC
Version:           Snapshot 20030501 (using KDE KDE 3.1)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2 
OS:          Linux

I find the grep dialog less usefull than it could be. My work habit is to pick up a text string (into the copy buffer) and then invoke the grep dialog box. My expectation is to be able to paste the search string and hit enter, but the dialog box doesn't automatically focus on the pattern field.

I've put together a small patch that causes the grep dialog box to focus on the pattern field when it is brought up:

diff -urN kdevelop-20030501/parts/grepview/grepdlg.h kdevelop-20030501-modified/parts/grepview/grepdlg.h
--- kdevelop-20030501/parts/grepview/grepdlg.h  2003-04-05 20:55:16.000000000 -0500
+++ kdevelop-20030501-modified/parts/grepview/grepdlg.h 2003-05-01 09:55:11.000000000 -0400
@@ -42,6 +42,8 @@
        { return files_combo->currentText(); }
     QString directoryString() const
        { return dir_combo->currentText(); }
+    void setFocusPattern()
+       { pattern_combo->setFocus(); }
     bool recursiveFlag() const
        { return recursive_box->isChecked(); }
 #ifdef IGNORE_SCM_DIRS
diff -urN kdevelop-20030501/parts/grepview/grepviewwidget.cpp kdevelop-20030501-modified/parts/grepview/grepviewwidget.cpp
--- kdevelop-20030501/parts/grepview/grepviewwidget.cpp 2003-04-29 21:55:17.000000000 -0400
+++ kdevelop-20030501-modified/parts/grepview/grepviewwidget.cpp        2003-05-01 09:55:18.000000000 -0400
@@ -116,6 +116,7 @@

 void GrepViewWidget::showDialog()
 {
+    grepdlg->setFocusPattern();
     grepdlg->show();
 }
Comment 1 Jens Dagerbo 2003-05-01 16:57:21 UTC
Yeah, this always annoyed me as well.. Thanks for the patch! :)  
 
(Btw, you have seen the nifty rightclick menu option for grep, right? Much easier than 
to copy and paste yourself..) 
Comment 2 Bill Davenport 2003-05-01 18:31:12 UTC
Subject: Re:  Grep tool focuses to last active field rather than to pattern field         

Yep - but copy/paste behavior is hard to unlearn. BTW - it might be reasonable to remove the few references to IGNORE_SCM_DIRS (the #define and a few #ifdef) - the patch I had sent in to implement that mechanism had these to make the code a bit more obvious when I opened it in the editor - they probably shouldn't have made it into the source pool. Also, I'm looking at adding a menu item (so I can create a shortcut) that opens the grep dialog with the text currently in the copy buffer as the pattern to search for (so I can copy, then invoke grep and have the text already in the pattern string - much like the context menu). Should I send that in when complete? Thanks,Bill

Jens Dagerbo <jens.dagerbo@swipnet.se> wrote:------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.

http://bugs.kde.org/show_bug.cgi?id=57965 
jens.dagerbo@swipnet.se changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED



------- Additional Comments From jens.dagerbo@swipnet.se 2003-05-01 16:57 -------
Yeah, this always annoyed me as well.. Thanks for the patch! :) 

(Btw, you have seen the nifty rightclick menu option for grep, right? Much easier than 
to copy and paste yourself..)

---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.<DIV>Yep - but copy/paste behavior is hard to unlearn. BTW - it might be reasonable to remove the few references to IGNORE_SCM_DIRS (the #define and a few #ifdef) - the patch I had sent in to implement that mechanism had these to make the code a bit more obvious when I opened it in the editor - they probably shouldn't have made it into the source pool.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Also, I'm looking at adding a menu item (so I can create a shortcut) that opens the grep dialog with the text currently in the copy buffer as the pattern to search for (so I can copy, then invoke grep and have the text already in the pattern string - much like the context menu). Should I send that in when complete?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Bill<BR><BR><B><I>Jens Dagerbo &lt;jens.dagerbo@swipnet.se&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">------- You are receiving this mail because: -------<BR>You reported the bug, or are watching the reporter.<BR><BR>http://bugs.kde.org/show_bug.cgi?id=57965 <BR>jens.dagerbo@swipnet.se changed:<BR><BR>What |Removed |Added<BR>----------------------------------------------------------------------------<BR>Status|UNCONFIRMED |RESOLVED<BR>Resolution| |FIXED<BR><BR><BR><BR>------- Additional Comments From jens.dagerbo@swipnet.se 2003-05-01 16:57 -------<BR>Yeah, this always annoyed me as well.. Thanks for the patch! :) <BR><BR>(Btw, you have seen the nifty rightclick menu option for grep, right? Much easier than <BR>to copy and paste yourself..)</BLOCKQUOTE><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.