New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute SQL tab: Add search bar for SQL code #191

Closed
MKleusberg opened this Issue Jan 28, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@MKleusberg
Copy link
Member

MKleusberg commented Jan 28, 2015

It'd be nice to have the option to search for texts or patterns in the SQL code in the Execute SQL tab. Some people keep all their SQL queries as some sort of history (I don't), but this would also be useful when opening a database dump or some similarly large SQL file. A find & replace function makes it even more useful.
I would suggest implementing this as one of these search bars modern application like to have, instead of adding a new dialog for it. The search bar is a bit more difficult to implement but easier to use and, when added to the SqlTextEdit class, would also work for all the other places where this class is used (like the SQL log).

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jan 29, 2015

This is a bit unclear to me. Can you whip up a dodgy pic or something to illustrate? (doesn't have to be pretty, just needs to get the concept across) 😉

@MKleusberg

This comment has been minimized.

Copy link
Member Author

MKleusberg commented Jan 29, 2015

Here's a mockup of what I mean - "something you'd expect to open when you press Ctrl+F" might've been a better description :)
find_mockup

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jan 30, 2015

Ahhh, ok. In the example above, would it then reduce the output to show only rows with 'example' in them?

@mgrojo mgrojo self-assigned this Nov 6, 2017

mgrojo added a commit that referenced this issue Nov 8, 2017

Execute SQL tab: Add search bar for SQL code #191
The find operations in QScintilla are used for implementing a find frame
in the SQL Editor of the main window. A checkable tool button is added
in the SQL Editor toolbar for showing and hiding this frame.

There are check boxes for Whole Words, Case Sensitive and Regular
Expressions. The QScintilla facilities in the findFirst method are used
for the implementation.

MKleusberg added a commit that referenced this issue Nov 11, 2017

Execute SQL tab: Add search bar for SQL code #191
The find operations in QScintilla are used for implementing a find frame
in the SQL Editor of the main window. A checkable tool button is added
in the SQL Editor toolbar for showing and hiding this frame.

There are check boxes for Whole Words, Case Sensitive and Regular
Expressions. The QScintilla facilities in the findFirst method are used
for the implementation.
@MKleusberg

This comment has been minimized.

Copy link
Member Author

MKleusberg commented Nov 11, 2017

Thanks for adding this, @mgrojo! I think we can finally close this issue then 😄

@MKleusberg MKleusberg closed this Nov 11, 2017

@jungle-boogie

This comment has been minimized.

Copy link
Contributor

jungle-boogie commented Nov 11, 2017

Thanks for implementing this, @mgrojo! It is a qt thing for the escape key to clear a field? If so, I think that would be a worthwhile improvement for this.

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Nov 11, 2017

@jungle-boogie, do you mean that the Escape key should clear the search field? I'd prefer it to hide the search bar, like Firefox and other applications do. For clearing the field in Qt, we have Ctrl+U, at least in Linux, where it is a default for many applications. It may be different in Windows.

By the way, currently Ctrl+F toggles the search bar visibility.

@jungle-boogie

This comment has been minimized.

Copy link
Contributor

jungle-boogie commented Nov 11, 2017

hi @mgrojo,

do you mean that the Escape key should clear the search field?

Yes, that's it.

I'd prefer it to hide the search bar, like Firefox and other applications do.

I don't have any objections to that, especially now that you make the reference to firefox.

we have Ctrl+U, at least in Linux, where it is a default for many applications.

Ah, that's nice to know!

mgrojo added a commit that referenced this issue Nov 19, 2017

Minor icon changes
New icons in resources from our icon set: Silk from
famfamfam.com

Icon for close. Applied to the find bar (see issue #191).

New icon for special copy. Applied to the "Copy with
Headers" option.

Removed the execution permission from some icon files.

mgrojo added a commit that referenced this issue Nov 25, 2017

Find/Replace dialog for SQL editors and logs
A classic Find/Replace dialog including all the options provided
by the QScintilla editor. Additionally a "Replace All" and a
Find All" button are implemented. This complements issue #191

New shortcut in main window for opening the find/replace dialog
connected to the focused widget. Standard for Replace is Ctrl+H.
Consequently the shortcut for Copy with Headers is changed to
Ctrl+Shift+C (see issue #1058).

For SQL text widgets not embedded in the main window, the standard
shortcut cannot be enabled, otherwise it conflicts with the main
window. Therefore the shortcut Ctrl+Shift+H is enabled for all the
SQL widgets as fallback. A better solution would be desirable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment