Commit Graph

19 Commits

Author SHA1 Message Date
mgrojo
2b15029be5 Button for new Un/Comment Block feature
A new button has been added to the "Execute SQL" toolbar for invoking the
new Un/Comment Block feature.

See issue #1614
2018-11-23 18:35:52 +01:00
mgrojo
2c4ff851b1 Comment/uncomment code command for the SQL editor
A new command is added for commenting or uncommenting SQL code (depending
of the state of the first line of the block).

It is bound to "Ctrl+/" as used by many IDEs ("Ctrl+-" is more standard as
Zoom out). Unusual Scintilla binding for "Ctrl+/" is removed for avoiding
interference.

If there is no selection, the current line is un/commented.

See issue #1614
2018-11-18 01:44:59 +01:00
Martin Kleusberg
fb1eba1391 Remove some virtuals and add some overrides
In our case this is more a question of code style.
2018-10-09 20:28:22 +02:00
mgrojo
8896ecca40 Refactoring and find/replace dialog in the JSON editor.
SQL and JSON text editor classes have been refactored. A new parent class
for both editors have been added for the common logic implementable without
depending on the specific lexer.

The only visible effect of this change should be that the JSON editor
(issue #1173) now has the same find/replace dialog as the SQL editor.

This prepares for the implementation of the XML editor (issue #1253).
2017-12-16 00:09:47 +01:00
mgrojo
de260d32c5 Always open the find/replace dialog with Ctrl+H and option in context menu
The shortcut is constrained to the Widget context so it does not conflict
with other SqlTextEdit widgets in the application. Now all SqlTextEdit
widgets are able of opening the dialog with the same shortcut and behave
in the same way (do not block the parent window).

The find/replace dialog can now be discovered by the user in the context
menu at the SqlTextEdit widgets.
2017-12-15 21:15:39 +01:00
mgrojo
c9bf5f87cb Find/Replace dialog improvements
Find/Replace dialog does not block the main window.

Dialog reused, so checks changed by user are preserved.

The selection of the last occurrence in Find All and Replace All
is cleared, so all the occurrences have the same appearance.
2017-11-26 01:19:33 +01:00
mgrojo
82665e3f09 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.
2017-11-25 21:39:41 +01:00
Martin Kleusberg
ee32b3e4e1 Use nullptr where possible 2017-10-30 21:20:02 +01:00
Martin Kleusberg
5e0d1ba34e Add option for disabling the SQL error indicators
See issue #302.
2015-06-22 12:38:50 +02:00
Martin Kleusberg
cf412a211d qscintilla: Reload settings properly after they have changed 2015-04-23 19:52:07 +02:00
Martin Kleusberg
649b1790e5 Mark syntax errors in Execute SQL tab
If a syntax error is reported by SQLite during execution in the Execute
SQL tab of the main window try to locate the problematic SQL statement
and highlight it using a red squiggling line.
2015-04-23 19:52:06 +02:00
Martin Kleusberg
cde2393539 Use QScintilla instead of own implementation of a code editor
This is a first rough implementation of QScintilla support as SQL text
editor.

It should work mostly and build fine with qmake as well as cmake. The
new code supports all the features of the old one plus adding a few
subtle improvements. The main point of this, however, is reducing the
code we have to maintain and making it easier to add new features to the
editor.
2015-04-23 19:51:54 +02:00
schdub
2bfeb03b7e Suggestion: 'Tab' indents multiline selection in SQL editor 2015-04-15 11:13:59 +03:00
Martin Kleusberg
f257f9248e Move syntax highlighter objects to SqlTextEdit class
Any SqlTextEdit object has its SQL syntax highlighter anyway, so it
makes sense to move the syntax highlighter object inside the text edit
class instead of maintining somewhere else. This hopefully makes the
code a bit easier to maintain.
2014-11-09 12:20:02 +01:00
Martin Kleusberg
929bb9026d SqlTextEdit: Support opening files by drag and drop
When dropping a file on the editor widget try to open and read it.
2013-05-17 15:05:21 +02:00
Martin Kleusberg
432180ec03 SqlTextEdit: Show line numbers
Show line numbers in the SqlTextEdit widget. This code is based on the
CodeEditor example from the Qt documentation.
2013-05-07 20:16:17 +02:00
Martin Kleusberg
0de7ff8564 SqlTextEdit: Highlight current line 2013-05-04 21:10:50 +02:00
Martin Kleusberg
57b44b891d Add auto completion in SQL editor again 2013-05-03 11:47:53 +02:00
Peinthor Rene
ba34c1e986 add basic autocompletion for tables and fields to the sql text input
this does only work on full table names, NOT on aliases
for a full auto completion to work we need a sqlite parser
2013-02-14 17:32:54 +01:00