Commit Graph

2397 Commits

Author SHA1 Message Date
Marcin Mikołajczak
44920ce098 i18n: Add Polish translation (#1456)
Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
2018-07-10 23:12:28 +02:00
Martin Kleusberg
788134eee6 grammar: Fix parsing of complex expression
This fixes parsing of expressions of the form '(x) AND/OR y' and similar
types. It also fixes expression of the '(x)' type and of the '(x op y
AND z op w)' type.

See issue #1454.
2018-07-10 23:07:38 +02:00
Iulian Onofrei
961141ec36 Replace deprecated qt5_use_modules function (#1419)
* Replace deprecated qt5_use_modules function

* Fix includes that fall under a larger module

* Bump minimum Cmake version to use newer features and properly use libs

* Replace deprecated qt5_use_modules function and bump minimum CMake version to 3.1.0 for 3rd party libraries
2018-07-10 20:57:55 +02:00
Iulian Onofrei
3cdc65a63f Add automatic crypted databases open via dotenvs (#1404)
* Rename confusing variables

* Fix some project warnings

* Fix code style

* Add constant for the default page size

* Move KeyFormats enum to CipherSettings

* Fix code style

* Fix memory leak

* Stop relying on CipherDialog for encryption settings management

* Fix code style

* Add .env format for QSettings

* Add automatic crypted databases open via dotenvs

This adds support for `.env` files next to the crypted databases that
are to be opened that contains the needed cipher settings.

The only required one is the plain-text password as a value for the key
with the name of the database like this:

    myCryptedDatabase.sqlite = MyPassword

This way, databases with a different extension are supported too:

    myCryptedDatabase.db = MyPassword

You can also specify a custom page size adding a different line
(anywhere in the file) like this:

    myCryptedDatabase.db_pageSize = 2048

If not specified, `1024` is used.

You can also specify the format of the specified key using the
associated integer id:

    anotherCryptedDatabase.sqlite = 0xCAFEBABE
    anotherCryptedDatabase.sqlite_keyFormat = 1

where `1` means a Raw key. If not specified, `0` is used, which means a
simple text Passphrase.

Dotenv files (`.env`) are already used on other platforms and by
different tools to manage environment variables, and it's recommended
to be ignored from version control systems, so they won't leak.

* Add new files to CMakeLists

* Move DotenvFormat include to the implementation

* Fix build error

* Remove superfluous method

(related to ac51c23)

* Remove superfluous checks

* Fix memory leaks

(introduced by 94bbb46)

* Fix code style

* Make dotenv related variable and comment clearer

* Remove duplicated code

* Remove unused forward declaration

(introduced by e5a0293)
2018-07-10 20:46:17 +02:00
Martin Kleusberg
c861f1b9d9 Silence a clang warning 2018-07-10 20:39:50 +02:00
mgrojo
bbe2e33ea4 Issue #1463: give assistance to users in using the filters
Added contextual menus in filter line box and cells for assisting in using
filters and for discovering existing filters.

The menu in the filter line adds "What's This" option and helper options
that add the operator and a selected placeholder (?) for easy editing.
Special options for NULL and empty strings are also added. Those work
directly.

The menu in the cells works as the current "Use as Filter" but for
different operators. In this case, only the range operator is incomplete.

Currently, not all the operators make sense for strings because we take
them as LIKE filters. At least the Not Equal filter (<>) should work, but
the other would also make sense. This will be addressed in future commits.
2018-07-08 14:29:52 +02:00
mgrojo
e0fcbf93ba Issue #1440: added context hints in the identifier quotes options
Give hints to the user about the context where the different quoting
options would be useful.

Declare the Standard SQL option as the recommended setting.
2018-07-08 12:32:12 +02:00
mgrojo
8f1f55bf3d Issue #1461: Binary cell dump not visible - with no scrollbars
QHexEdit widget was being set disabled instead of read-only, according to
comments, because there wasn't any setReadOnly in qhexedit. At least in
the current version, the method actually exists, so it is now used.

This allows the user to move the scroll and select text in the binary mode
of the 'Edit Database Cell' dock.
2018-07-08 01:41:15 +02:00
mgrojo
6b78b13871 Improvements for "Copy as SQL" feature (PR #1422)
- Set the line terminator according to operating system (text and SQL
versions).

- Quote identifiers using the user preference and string literals as 'SQL
standard'.

- Support BLOB literals for any kind of binary data and avoid converting
any kind of image to PNG in the process of setting the BLOB literal in SQL.
2018-07-07 20:36:25 +02:00
Manuel
cff07955df Merge pull request #1422 from GortiZ6/sql_export
As said by the author GortiZ6:
> I've added the ability to copy fields from tables in SQL format.
> I found much robust and easier copy data in SQL from one DB to another so that if the number of columns differs or if I want to build a single SQL file to share several fields from several table with someone I can do it.
2018-07-07 18:31:27 +02:00
mgrojo
1130d0c89e Issue #1458: fix tab_sql save and loading in project files
This issue was introduced in 211f7341ff
(issue #1306).

browse_table_settings node was not closed, and consequently tab_sql node
was left inside tab_browse but the loading case for tab_sql was still
expecting it outside tab_browse. Since this was an unintended change the
tab_sql node is reverted now to its former location.

This means that all the nightly versions since
211f7341ff until this fix generate project
files with incorrect format and later versions will also not be able to
restore the SQL tabs for those project files unless manually edited.

Nevertheless, the loading code was also broken for tab_sql since there
was an incorrect skipCurrentElement call before getting to the tab_sql tag.
2018-07-07 17:58:35 +02:00
Justin Clift
9174abea4d Merge pull request #1443 from hasufell/PR/configurable-install-paths
Make install paths configurable
2018-07-03 23:36:59 +01:00
Manuel
719416e7e7 Merge pull request #1436 from sqlitebrowser/identifier_quotes
Preference for quoting identifier mechanism (issues #683 and #1280)
2018-06-30 18:15:29 +02:00
mgrojo
a45a7a39c1 Issue #1450: resize Name column in DB Schema tab to contents
Resize also the Name column in the Dock since it has usually short content
and there is little space there, so it's better to resize it after every
schema population.
2018-06-30 18:06:35 +02:00
mgrojo
588363b7f6 Get the encoding name from a combo box in the "Set encoding" dialog
User can enter the encoding name with completion or select it from the
list using the mouse. This will help users to discover available codecs
and to find a suitable one in an easier way. This should help with encoding
issues like #1453.
2018-06-29 22:37:25 +02:00
mgrojo
98f4b88fd6 Issue #1450: adjust SQL Schema column in DB Schema dock to content
The SQL Schema column in DB Schema dock is set to resize automatically
to adjust to the content, like it is already done for the same column in
the Database Structure tab.
2018-06-25 20:52:30 +02:00
mgrojo
e11b32ed54 Issue #1432: Popup menu in "Open Database"
A popup menu has been added in the "Open Database" button. A normal click
selects the "Open Database..." action as before. A delayed click opens the
popup menu for selecting either the "Open Database..." action or the
"Open Database Read Only..." action.
2018-06-24 20:43:17 +02:00
mgrojo
58a6dba100 Pref: "SQL editor font" and its size on the same row and other improvements
"SQL editor font" and "SQL editor font size" are located at the same row
for saving vertical space in the Preferences dialog.

Accelerator keys for "Wrap lines" and "Quotes for identifiers" have been
added.

Some buddies have been fixed.
2018-06-23 19:04:27 +02:00
mgrojo
2803e163e0 New tests for the new standard quoting and for the other quoting styles
Modified some tests for taking into account the new standard quoting and
added some more for testing the quoting configuration and for correct
parsing of different quoting styles.

Default branch in escapeIdentifier() for trying to avoid warning.
2018-06-23 17:57:18 +02:00
Julian Ospald
873d705e03 Make install paths configurable 2018-06-22 13:50:56 +02:00
mgrojo
01f0146bbe Reset SQL results table when the query has not returned data
When we know that the just executed query has not returned data, reset the
table results model, so the results view is also reset.

Added QAbstractItemModel::beginResetModel() and
QAbstractItemModel::endResetModel() to the model's reset method. This
resets completely the table view.

This improves the situation for #1431, without addressing the underlying
problem of not detecting correctly the type of query. In any case, any
query not returning data should reset the results from previous queries.
2018-06-21 11:52:46 +02:00
Martin Kleusberg
9e0e3309df Move font size settings into the same row in settings dialog 2018-06-21 11:11:47 +02:00
mgrojo
614068a57a Improve messages in incorrect editor modes for better feedback
The messages in the invalid modes for the current data type in "Edit
Database Cell" are improved for giving hint to the user about the correct
modes.

For this commit and 885f4f7847 see issue
#1438
2018-06-21 00:24:34 +02:00
mgrojo
885f4f7847 Export dialog in Edit Database Cell uses data type for extension filter
The extension filter is adjusted to the type of data loaded in the editor.
Previously, only image extensions were adjusted, remaining were treated
as text. Now the following are used: *.bin, *.txt, *.json and *.svg.

For coherence, the *.bin filter is added to the import dialog.
2018-06-20 23:50:34 +02:00
mgrojo
da8057c964 Revert to grave accents as default quoting
The former quoting is expected by the tests, so the former behaviour is
restored as default, until a decision about the best default value is made.
2018-06-18 19:40:53 +02:00
mgrojo
265b077a5f Revert to grave accents as default quoting
The former quoting is expected by the tests, so the former behaviour is
restored as default, until a decision about the best default value is made.
2018-06-18 19:03:35 +02:00
mgrojo
5c7238d3d0 Preference for quoting identifier mechanism
A new option is added to the SQL tab in Preferences for choosing which
quoting characters must be used by the application when it inserts an
identifier in SQL code. The three options supported by SQLite are
available.

Default quoting characters have been changed from `Grave accents` to
"Double quotes" (SQL standard).

This options also affect the highlighting of double quoted strings: when
the SQL standard is selected, double quoted expressions are highlighted as
identifiers, otherwise as literal strings.
2018-06-18 17:49:12 +02:00
Giuseppe Zizza
3d2e8205a0 [CHG] Converted to HEX from Base64 the image SQL export
[CHG] Using sqlb::escapeIdentifier() for table quotation to uniform with the rest of the code
2018-06-12 13:44:18 +02:00
Martin Kleusberg
48d3cc6c7e Fix buddy in cipher dialog
Fixes a minor oversight in 9c2cec628b.
2018-06-08 23:51:14 +02:00
Martin Kleusberg
28b8652ad6 Improve loading of all data
The multithreading patch didn't properly load all data into the cache
when this was necessary. It would only do so if the chunk size was
sufficiently high. This is fixed in this commit.

Show a progress dialog while loading all data which can be cancelled by
the user.

When cancelling the loading of all data in those cases which require all
data to be loaded, stop whatever process needs the data too.
2018-06-08 22:46:47 +02:00
Martin Kleusberg
115d1f185a Tweak enabling/disabling of insert and delete record buttons
Improve the enabling and disabling code for the insert and delete record
buttons in the Browse Data tab. With this the buttons should be enabled
if and only if they can actually be used. The commit also makes the code
easier to read because the final state of the buttons don't depend on
the call order of the involved functions anymore. Instead there is only
one function now which enables and disables them.

This also fixes one TODO in the multithreading patch.
2018-06-08 22:46:47 +02:00
Martin Kleusberg
3da520cdd1 Clean up multi threading patch, fix build and some bugs
Make strings translatable, remove some more debug code, fix tests,
reduce size of patch slightly, remove weird tooltip, don't crash when
closing database, simplify code, fix filters, don't link agains pthread
on Windows.
2018-06-08 22:46:47 +02:00
Martin Kleusberg
51dbe72e23 Multi-threading patch
This was done by Michael Krause.
https://lists.sqlitebrowser.org/pipermail/db4s-dev/2018-February/000305.html

In this commit I only fixed two compiler warnings, some whitespace
issues and removed some debug messages.
2018-06-08 22:46:47 +02:00
Iulian Onofrei
9c2cec628b Make sure only powers of two are entered for the page size (#1405)
* Make sure only powers of two are entered for the page size

* Replace QSpinBox with QComboBox

Having a QSpinBox didn't make too much sense when we only have 8 valid
values. Forcing the user to type a valid value would have required a
warning message too, along with translations.

Having a QComboBox makes it clear (obviously) what values we are
expecting, without any risk of invalid values or confusion.

* Add thousands separator for page size values
2018-06-08 16:31:11 +02:00
Giuseppe Zizza
18be12e9e9 [CHG] Removed unnecessary duplicated functions 2018-06-08 15:26:08 +02:00
Giuseppe Zizza
f6e8f50b47 [FIX] Correzione estetica file icons.qrc 2018-06-08 14:47:29 +02:00
Giuseppe Zizza
4c211ed95a [NEW] Aggiunta possibilita` di copiare le righe della tabella in SQL per facilitarne l'import 2018-06-08 14:43:48 +02:00
Iulian Onofrei
c92a981164 Add Slack integration for Travis CI 2018-06-08 12:42:36 +03:00
Iulian Onofrei
dfc7df471c Fix YAML file syntax 2018-06-08 12:42:00 +03:00
Justin Clift
21a0cd7cf1 Add Patreon image to the buttons line 2018-06-08 09:23:27 +01:00
Iulian Onofrei
2165dd61a0 Remove tracking attributes from Gitter link 2018-06-07 21:31:34 +03:00
Iulian Onofrei
c07652e418 Add correct link for the Slack image's alt attribute 2018-06-07 20:21:53 +03:00
Justin Clift
6eeffc421d Merge pull request #1417 from sqlitebrowser/hotfix/slack-link
Add Slack invite link in the README file
2018-06-07 16:34:04 +01:00
Martin Kleusberg
f51b44d8d7 Add support for deleting rows in views which are unlocked for editing
If a view has been unlocked for editing by specifiying a pseudo primary
key, with this commit you can now delete records from the view if an
appropriate trigger exists.

See issue #141.
2018-06-07 16:08:08 +02:00
Iulian Onofrei
2b75b18426 Add Slack invite link in the README file 2018-06-07 16:43:18 +03:00
Martin Kleusberg
ea25618f22 Don't ask for PK again when chaging back to a editing-enabled view
When unlocking a view for editing by specifying a pseudo-PK, then
switching to another table, and then coming back to the original view,
you would be asked again for the pseudo-PK even though it was stored.
The same applies when loading a project file for this case. This is
fixed by this commit.
2018-06-07 14:44:30 +02:00
Martin Kleusberg
72506fb902 Fix table view after unlocking view editing 2018-06-07 14:38:25 +02:00
Giuseppe Zizza
7f0ec315fc Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2018-06-07 14:11:14 +02:00
Justin Clift
6466aac5ea Use Base64 encoding for BLOBs in JSON export (#1413) 2018-06-07 13:39:58 +02:00
Justin Clift
4c368b305b Merge pull request #1414 from karim/msi-shortcuts
Make the application shortcuts configurable on Windows
2018-06-05 18:32:45 +01:00