Commit Graph

2630 Commits

Author SHA1 Message Date
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
Justin Clift
df3a1b1188 Remove no-longer-needed Ubuntu build steps note 2018-11-19 22:09:55 +11:00
mgrojo
209120c01e Updated QScintilla version to 2.10.8
Summary from NEWS file:

  - Control-wheel scroll will now zoom in and out of the document.
  - Added accessibility support.
  - Added setScrollWidth() , scrollWidth, setScrollWidthTracking() and
    scrollWidthTracking() to QsciScintilla. (one of our patches)
  - Bug fixes.
2018-11-18 17:37:08 +01:00
Navdeep Singh Sidhu
52332c98ef Merge pull request #1617 from deepsidhu1313/master
Snap package support to upstream.
2018-11-18 09:53:41 -06:00
jamesrobertclarke
8be9733c08 Update BUILDING.md for Ubuntu 18.04 (#1615)
This is to deal with building on Ubuntu 18.04 and seeing the message:

  Could not find a package configuration file provided by "Qt5LinguistTools"
  with any of the following names:

    Qt5LinguistToolsConfig.cmake
    qt5linguisttools-config.cmake
2018-11-18 23:42:39 +11:00
Navdeep Singh Sidhu
ce36277c96 * Commented code required to build AppImage (CI/CD) packages for the moment as it was causing trouble with Travis config.
Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-18 01:32:18 -06:00
Navdeep Singh Sidhu
b6f7b1eec3 Snap package - Removed wrapper file
* As mentioned in one of previous commits, dump wrapper was causing problem with launchpad CI/CD for snap packages. Content of this wrapper file resemble snapcraft-desktop-helpers for gtk application.

Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-18 00:52:42 -06:00
Navdeep Singh Sidhu
c31d299fed * Readme.md - Fixed heading of compiling section.
Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-18 00:10:40 -06:00
Navdeep Singh Sidhu
cc6cf60e9c Fixed snap heading in readme
Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-18 00:08:26 -06:00
Navdeep Singh Sidhu
fb9e80820d Updated Readme
* Added instructions for Snap package installation.

Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-18 00:06:40 -06:00
Navdeep Singh Sidhu
abec29823b Merge branch 'master' of git://github.com/sqlitebrowser/sqlitebrowser 2018-11-17 23:27:19 -06:00
Navdeep Singh Sidhu
323b416462 * Removing wrappers (to test fix https://bugs.launchpad.net/snapcraft/+bug/1791871)
* Added qt5-gtk-platformtheme in comments, this can be uncommented if snap is build on base 18 to support gtk theme for QT app.

Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
2018-11-17 22:30:19 -06: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
Derek
dcf252e7f2 Update README.md (#1609) 2018-11-12 16:00:45 +11: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
Navdeep Singh Sidhu
a18a665233 Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2018-11-03 23:30:11 -05: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
Martin Kleusberg
1da7ca8d43 Change project file format to support multiple sort columns (#1593)
This commit changes the project file format (and some internal data
structures) to support multiple sort columns in the Browse Data tab.
Note that this does not add actual support for multiple sort columns,
it's just a preparation for that.
2018-10-30 21:47:55 +01:00
Martin Kleusberg
064ce6f8fe Simplify code
Merge two very similar functions into one while keeping the best parts
of both.
2018-10-30 21:38:57 +01:00
Manuel
abb6f686a3 Initial implementation of "conditional formatting" (#1503)
After setting a filter, the user can select from the context menu in the
filter line a new option "Use for Conditional Format", that assigns
automatically a colour to the background of cells fulfilling that
condition.

The formatting is preserved after the user has removed the filter. Several
conditional formats can be successively added to a column using different
filters.

The conditional formats of a column can be cleared when the filter is empty
selecting "Clear All Conditional Formats" from the filter line context
menu.

The conditional formats are saved and loaded in project files as other
browse table settings.

A new class Palette has been added for reusing the automatic colour
assignment of the Plot Dock. It takes into account the theme kind of the
application (dark, light) for the colour selection.

A new class CondFormat for using the conditional formatting settings from
several classes. The conversion of a filter string from our format to an
SQL condition has been moved here for reuse in filters and conditional
formatting.

Whether the conditional format applies is resolved by SQLite, so filters
and conditional formats give the same exact results.

Code for getting a pragma value has been reused for getting the condition
result, and consequently renamed to selectSingleCell.

Possible future improvement:
- New dialog for editing the conditional formatting (at least colour and
application order of conditions, but maybe too: adding new conditions and
editing the condition itself).
2018-10-30 21:22:14 +01:00
bss, shaoshi
4031a165fa update Simplified Chinese translation (#1594)
Updated for 3.11 release
2018-10-28 22:12:58 +01:00
mgrojo
184cdae9e1 French translation updated for the 3.11 release
Authored by @mvt91
2018-10-28 20:51:15 +01:00
Iulian Onofrei
d526fa0b64 Add last location saving and loading per action type (#1587)
* Fixed code style

* Added last location saving and loading per action type

This saves and loads different paths per action type when presenting the
native file dialog popup.
2018-10-27 22:24:01 +02:00
Martin Kleusberg
aad06b8d7c Fix spelling error 2018-10-24 13:57:13 +02:00
Martin Kleusberg
5a1d338647 Allow specifying an ON CONFLICT strategy in the Import CSV dialog
Add a new dropdown box to the Import CSV dialog to set an ON CONFLICT
strategy when importing into an existing table. You can now choose
between the old and still default behaviour of aborting the import in
case of a conflict, ignoring the conflicting row from the CSV file, and
replacing the existing row in the table.

See issue #1585.
2018-10-24 13:38:28 +02:00
mgrojo
9d2b476283 Fix formatting problems in the Spanish translation 2018-10-23 22:06:12 +02:00
Martin Kleusberg
f11b1a0445 Better error handling in import CSV dialog
Make sure to show the correct error message when there is an error
during CSV import.

Make sure to release the DB handle used for the import before rolling
back to the last savepoint in case of an error in the CSV import. This
avoids a deadlock situation.

See issue #1590.
2018-10-23 19:52:34 +02:00