Commit Graph

2042 Commits

Author SHA1 Message Date
Justin Clift
2ce52c0518 Add entry for Italian flag to flags.qrc 2018-12-08 16:34:22 +11:00
Justin Clift
e399d3ac1b Trivial spacing adjustment. 2018-12-08 14:42:00 +11:00
Feyn-Man
6431998470 Italian translation (#1584)
Partial Italian translation for now.  Will be continued later as time permits.
2018-12-08 14:39:34 +11:00
Bartlomiej Przymus
f2be488898 Working on Polish Translation (#1582)
Update file with some translations done
2018-12-08 12:06:51 +11:00
Martin Kleusberg
47422f36c7 Fix alterTable() function when renaming a column
When renaming a column using SQLite >= 3.25 and changing something else
in the table, you would lose all the data in the renamed column. This is
because the second part of the alterTable() function (the part after the
renaming) didn't know about the new column name and so assumed it still
to be the old one.

See issue #1650.
2018-12-07 20:50:23 +01:00
Martin Kleusberg
b42097c704 Fix insert and delete record buttons not being activated
This was introduced in 10b6c34be6 which
fixed another issue. So this is pretty embarassing ;)
2018-12-07 20:36:38 +01:00
mgrojo
49fbc52fec Added hourglass icon to resources
The file was added and used in PR #1575 but at some time it should have
been lost in the icon resources file, so it was not actually working.
2018-12-06 21:26:14 +01:00
mgrojo
6425fb177e Use native names in the tool-tips documenting some shortcuts
There are three reasons for not hard-coding the shortcut names in tool-tips
or other texts inside the UI elements:
- Qt uses portable names for the shortcuts, that are translated to different
key combinations depending on the operating system, e.g. Ctrl is translated
to Cmd in MacOS.
- An eventual change in a shortcut is propagated to user strings affecting
translations.
- If we ever allow configuring the shortcuts in Preferences, the text
would be incoherent.

The shortcuts are added programmatically to the tool-tips and consequently
they are removed from the UI files. The translation files have been updated
semi-automatically so the translated strings aren't lost.

Shortcuts have been added to actions that lacked them (because they are
implemented through other means) so they can be used. The WidgetShortcut
scope prevents in those cases any interference with the current shortcut
logic.

In the case of Ctrl+Return for "Execute all/selected SQL", it has been
moved from code to UI file, since it no longer made sense.

See issue #721
2018-12-06 18:56:24 +01:00
mgrojo
6eebefb0f7 Fix Spanish shortcut translations for Qt5.9.5 (Ubuntu 18.04)
This translation was working for Ubuntu 16.04, because it matched the
official Qt translation for Shift, but in Qt5.9.5 (Ubuntu 18.04) the
translation is no longer abbreviated (Mayúsculas) and the former
translation breaks the shortcuts. Using the original English terms should
work for all versions and it is automatically translated in the display.
2018-12-06 18:56:24 +01:00
mgrojo
41312837b1 Consistency and fix in the Spanish translation
Avoid "Title Case" in two cases for consistency with the rest of the
translation.

Fix an "All files" filter lacking a "(*)".
2018-12-05 21:08:11 +01:00
Martin Kleusberg
a150656d87 dbhub: Make the initial account creation process a bit more obvious
This shows a short text in the Remote dock when no certificates are
configured yet. This text contains links to the dbhub.io page and gives
at least some information on the overall process. As soon as the first
certificate is imported, the old view is shown instead.
2018-12-05 19:33:20 +01:00
Martin Kleusberg
1f9101ae2a Move SQL execution in Execute SQL tab into a separate thread 2018-12-05 18:37:52 +01:00
Martin Kleusberg
7e0ff3061b Move code for running SQL statements into a separate class
This is only done for better readability and for easing future changes.
No major logic changes intended here.
2018-12-05 18:37:52 +01:00
Martin Kleusberg
10b6c34be6 Fix view editing
This was probably broken by f1e01dde8c.

See issue #141.
2018-12-05 18:11:21 +01:00
Karim ElDeeb
2b21e1b18b Add math extension source 2018-11-29 04:14:42 +02:00
Martin Kleusberg
e8a03f462c Fix bug in 9e36f21112
This fixes a bug in the code to modify multiple table columns in one go.
We were accidentally adding more tracked columns when adding a new
column and then changing its name.

See issue #1627.
2018-11-28 12:13:38 +01:00
mgrojo
58f52f13cb Set the POSIX flag in Scintilla regex find
The POSIX flag is passed to QScintilla for stardardisation of the regex
implementation. This only changes the syntax for sub-expressions. Before
this change it was '\( \)'. With the POSIX flag it is simply '( )' for
sub-expressions, consequently \( and \( have to be used for matching
parenthesis.

Both the Qt implementation (used in filters and REGEXP operator) and the
C++11 standard (possibly used in the future for the editor, if QScintilla
add support) use the the new syntax for sub-expressions.

References:
https://en.cppreference.com/w/cpp/regex/syntax_option_type
>    If no grammar is chosen, ECMAScript is assumed to be selected.

https://en.cppreference.com/w/cpp/regex/ecmascript
>    The Atom ( Disjunction ) is marked subexpression

Qt also uses subexpressions in the POSIX style.
http://doc.qt.io/qt-5/qregexp.html#capturing-parentheses

See issue #1625
2018-11-25 18:43:27 +01:00
mgrojo
87a8aeb1c0 Option to find&replace in selection #1618
New check box in the Find and Replace dialog for Scintilla editors. The
new option uses the feature in QScintilla for finding text in the
selection only.

The implementation has been changed to use findFirst(InSelection) and
findNext so it works exactly as designed by QScintilla. Consequently the
finding process has to be cancel whenever any of the parameters have
changed.
2018-11-24 00:25:40 +01:00
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
33266b7707 Improvement and fixes to the un/comment block feature
The last line of the selection is considered part of the block, even if it
is not completely selected. At the same time, we have to discard this last
line of the selection, if the index is 0, since in that case there is no
actual selected character in the line.

Additionally all the steps in the replacement are considered a single
action for history, so that user can undo the change in a single undo
action.

See issue #1614
2018-11-21 21:13:40 +01:00
Martin Kleusberg
39586da475 Remove some unneeded includes 2018-11-20 23:57:00 +01:00
Martin Kleusberg
32f4394eb8 Remove unreachable code 2018-11-20 23:11:25 +01:00
Martin Kleusberg
594e3a2945 Remove unnecessary 'virtual' to silence some warnings 2018-11-20 22:09:23 +01:00
mgrojo
70534e2ae3 Adapt to QScintilla behaviour with Windows line terminator
QScintilla is returning strings with text(line) with line terminator and
they are also counted by lineLength, so the Windows version has to
substract one for setSelection.

This solves various problems resulting in characters being removed at the
beginning of lines when commenting or uncommenting blocks of code with
Windows line terminators.
2018-11-20 00:19:42 +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
mgrojo
12b4fd91a7 Replace button in SQL Editor inserts text at cursor after a previous find
Each time the searched term or the dialog is closed, the find process in
the QScintilla widget is cancelled. This avoids the problem mentioned in
issue #1612 and similar others, like finding, then changing the searched
term and pressing Replace. In all these cases Replace only finds the next
term to be replaced without performing any actual replacement.
2018-11-17 14:51:46 +01:00
Martin Kleusberg
ef7492adfb Better identifier quoting
This commit fixes the SQL export which did not quote the field names in
the INSERT statements.

This also simplifies the code for escaping SQL identifiers.
2018-11-16 11:05:13 +01:00
Martin Kleusberg
9e36f21112 Allow any number of changes to the table schema in one alterTable call
In the Edit Table dialog we used to call our alterTable function (which
works around SQLite's missing full ALTER TABLE support by - besided
other things - copying all the data of the table) for pretty much every
change immediately. This was taking a lot of time for larger tables.

Our alterTable function allowed any number of changes if they affect
only one field of the table at once. So we could have reduced the number
of calls a lot by just using that capability. Instead however, this
commit improves the alterTable function to make possible transforming a
table completely in just one call. It does so by taking the new table
schema and using that without further modification. It also takes a new
parameter to keep track of what column in the old table becomes what
column in the new table, so the data can be preserved.

This commit obviously also changes the Edit Table dialog to make proper
use of the new features. This means that whatever changes you make to a
table, you will only have to wait once until for the alterTable call,
and that's when clicking the OK button.

See issue #1444.
2018-11-16 10:59:20 +01:00
Martin Kleusberg
37a5645bf5 Fix some shadow warnings 2018-11-15 15:24:00 +01:00
Martin Kleusberg
c91009c7f3 Fix old-style-cast warnings 2018-11-15 15:11:09 +01:00
mgrojo
f262bf6b18 Prepare for different options when the DB is in use
waitForDbRelease receives a parameter for waiting, cancelling the other
operation or asking the user; defaulting to ask.

The wait option is used for the conditional formatting, so it doesn't
interfere with the loading. This avoid opening a dialog when scrolling
the table over a still not fetched area with conditional formats.
And it is done independently of the threading model supported by SQLite.
2018-11-15 14:45:43 +01:00
Martin Kleusberg
5a606fd194 Fix bug introduced in f1e01dde8c
Thanks to @mgrojo for pointing this out in #1606.
2018-11-15 14:32:23 +01:00
Martin Kleusberg
0449406450 Fix warning 2018-11-15 14:16:05 +01:00
Martin Kleusberg
b63f1520bc Simplify code and fix useless-conversion warnings 2018-11-15 14:15:36 +01:00
Martin Kleusberg
81b39ccdaa qmake: Add new option for enabling more warnings 2018-11-15 14:08:20 +01:00
Martin Kleusberg
f715dc95e6 Fix a possible compiler warning
See issue #1603.
2018-11-15 13:47:06 +01:00
mgrojo
92cc5d287a German translation update for #1588 2018-11-10 20:17:01 +01:00
mgrojo
8043e94452 Updated translations with messages from issue #1588
Only relevant changes to ongoing translations are committed, so that
future conflicts are minimised.

Added Spanish translation for the new messages.
2018-11-10 20:01:50 +01:00
mgrojo
c923cc29b5 Regexp filters
This adds support for the REGEXP operator using the syntax /regexp/ in the
filter line boxes.

A new helper option for a not-containing filter is added using this new
syntax. This could be simplified using a NOT LIKE filter, but we don't
currently support that.

The "Use in Filter Expression > Containing" option escapes a possible
slash in the beginning, so it is not interpreted as a regexp filter.

See issue #1522
2018-11-08 23:00:30 +01:00
Martin Kleusberg
a393bbf25d Improve read only project file loading
This slightly changes the behaviour regarding the read-only mode in
project files. It makes sure that we always respect the user's choice to
open a file in read-only mode, even if the project file says it wasn't
opened in read-only mode before.
2018-11-08 16:59:08 +01:00
Martin Kleusberg
a8338406c9 Save read-only state in project file
When opening a database in read-only mode and creating a project file,
save the read-only flag in the project file.

When loading a project file with a read only flag set, open the database
in read-only mode.

See issue #1598.
2018-11-08 16:55:52 +01:00
Martin Kleusberg
a81ea2b983 Fix possible warnings
See issue #1603.
2018-11-08 16:55:51 +01:00
Martin Kleusberg
11ace1efa6 Show current database action in status bar and add cancel button
This adds a label to the status bar which becomes visible whenever the
database is busy. It also specifies the currently running action. Also
add a button which allows you to cancel this action at the next
opportunity.

Note that this doesn't work for the Execute SQL tab yet which requires
some more rewriting of the code there.
2018-11-08 16:52:38 +01:00
Martin Kleusberg
f1e01dde8c Use new Query class from outside SqliteTableModel to assemble queries 2018-11-08 16:20:34 +01:00
Martin Kleusberg
ed06c0289e Move query generation from SqliteTableModel into a separate class 2018-11-08 16:20:34 +01:00
Martin Kleusberg
35a5b43ce0 Move SQL object classes into a separate directory 2018-11-08 16:20:33 +01:00
mgrojo
e6830b91ba Updated Arabic translation for the 3.11 release
Generated 990 translation(s) (990 finished and 0 unfinished)
    Ignored 7 untranslated source text(s)

See issue #1567
2018-11-05 20:51:32 +01:00
mgrojo
dadccef861 Avoid deadlock and cancel dialog when using conditional formats
When a conditional format is used and the table does not load all the rows
at once, a deadlock ocurred when scrolling to a not yet loaded area.

This avoids the deadlock by unlocking before the conditional format query
is performed.

Additionally the cancel-query dialog is avoided when the threading mode of
SQLite is Serialize, since in that case the queries can be sent to SQLite
concurrently.

See discussion in PR #1503
2018-11-04 23:55:24 +01:00
mgrojo
bcf2c660b6 Fix to the French translation for the 3.11 release
Authored by @mvt91
2018-11-03 13:06:39 +01:00
Manuel
23f7346f78 Avoid setting the db dirty with some trailing whitespace and comments (#1543)
If we execute a select statement and there is some trailing whitespace or
comments in the buffer, we are passing that to SQLite and fooling
ourselves thinking that it may be a query modifying the database. Since
we aren't very smart about knowing which queries modify the database, this
change at least avoids this particular case by breaking when there is only
trailing whitespace and comments.

The issue has probably origin in #1455, since previously we didn't pass
the comments to SQLite.
2018-10-30 22:01:21 +01:00