Commit Graph

3132 Commits

Author SHA1 Message Date
mgrojo
fd4ddfe035 New icons for record insertion and deletion
The new icons are believed to be more easy to parse and identify.

They are derived from @damieng's Silk Companion 1 (icon table_row.png) and
the Silk's bullet icons for (+) and (-).

https://damieng.com/creative/icons/silk-companion-1-icons

See issue #2083
2020-01-17 19:55:04 +01:00
Justin Clift
cac58e003b Remove FileIO Extension for now, as its breaking Win32/64 compilation 2020-01-18 02:40:09 +11:00
Martin Kleusberg
ac0b74cea0 Fix regexp implementation to work with Unicode characters
After switching from QRegExp to QRegularExpression matching Unicode
characters was broken. This functionality is now restored.

See issue #2054.
2020-01-17 12:22:36 +01:00
Martin Kleusberg
8c0788d82a qmake: Fix build on some platforms
Building with qmake did not work on macOS or at least not on all macOS
systems. This can be fixed by not compiling the header-only json library
into an empty static library - which is not needed anyway.

See issue #2014.
2020-01-17 11:05:43 +01:00
Martin Kleusberg
6143925d7e Fix handling of databases with a view and a trigger with the same name
This fixes editing and browsing views which have the same name as a
trigger in the same database.

See issue #2091.
2020-01-16 17:35:12 +01:00
Martin Kleusberg
2888530a10 Do not accidentally check "Unlock View editing" in Browse Data tab
When switching to a view for a second time, the "Unlock view editing"
menu item was suddely checked. This is now fixed.

See issue #2091.
2020-01-16 17:27:05 +01:00
Martin Kleusberg
54866e1827 Disable editing of cells in views in Browse Data tab when not enabled
See issue #2091.
2020-01-16 17:20:19 +01:00
Justin Clift
a657d2bff6 Merge pull request #2071 from wojnilowicz/master
Update Polish translation
2020-01-07 01:46:06 +11:00
mgrojo
08fd226d6f Avoid getting notifications of files just saved by us
Closing the file in the destructor seems to be done after the watch is
in place, so it can get a notification in some platforms.
2020-01-06 00:55:33 +01:00
mgrojo
e4d57f741e Set SQL editor in Modify Table dialog as read-only programmatically
Otherwise the UI dynamic property does not seem to work, although it
use to and should. Please, improve it if a way to return to the correct
behaviour.

Fixes issue #2078
2020-01-06 00:53:25 +01:00
mgrojo
9b670b4b94 Support for control characters as quote and separator in CSV import
New options and spin boxes are added for entering any non-printable
character in the Import CSV dialog.

This adds support for Concordance DAT files and similar cases. See issue
#2012
2020-01-06 00:50:33 +01:00
mgrojo
d0e0ee3f64 Take into account Windows line separator in Execute SQL
QScintilla text(line) returns the string of the passed line including the
line terminator. Given the differences in platforms in that regard, we
only supported the case for a single character separator.

This should solve issue #2073 for Windows.

It also should solve #1768 and #1632, which were only reproduced in Windows
or editing files with lines ending in "\r\n" in general.
2020-01-04 19:36:41 +01:00
mgrojo
ff86e525b3 Optimize simplification of Schema column
According to documentation
https://doc.qt.io/qt-5/qstring.html#simplified

> Whitespace means any character for which QChar::isSpace() returns true.
> This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.

So replacing '\n' is redundant and can be removed without effect.
2019-12-30 20:48:58 +01:00
mgrojo
b4e8898dfa Revert to savepoint when applicable, also after failed statements
The end of the function is unified for failed and successful cases, so
the savepoint reversion is always made when it has to be.

Reported in issue #2073
2019-12-30 20:33:33 +01:00
mgrojo
81ee07355d Skip whitespace at the beginning of a failing query for the indication
For the error indicators and scrolling to the failing query, all the
whitespace present at the starting end of the query is skipped. Otherwise
the point indicated to the user could be very far to the actual query.

See issue #2073
2019-12-30 20:29:44 +01:00
mgrojo
a287d8a27b Use correct syntax when format applied to string containing apostrophe
The string has to be correctly quoted so contained apostrophes are doubled.

This prevented applying a format to cells containing apostrophes (single
quotes) since the SQL code raised a syntax error in SQLite.
2019-12-27 13:02:49 +01:00
mgrojo
0efb1aecdd Update MIME types in desktop entry and Spanish translation
New MIME types according to IANA and our own MIME entry in
distri/mime/packages/db4s-sqbpro.xml

See issue #2024
2019-12-23 15:10:15 +01:00
mgrojo
71fc484c32 Be more specific in dialogs asking for saving or not the changes
The Discard option will be more specific about losing changes than an
ambiguous No, if user does not read the dialog message.

In my platform it is displayed as a "Close without saving"
button.
2019-12-23 14:02:09 +01:00
mgrojo
45e86d3bec Clean-up and better message in openDataWithExternal
Related issue #1791
2019-12-23 13:57:50 +01:00
mgrojo
709c74669f Allow activating "Adjust rows" in views
The contextual menu will show all options for writable tables, and only
"Adjust rows" option for views or read-only DBs.

See issue #2006
2019-12-23 13:55:30 +01:00
mgrojo
a085d99b64 Enhancement: save to temporary file, open external application and reload
A new button has been added in "Edit DB Cell" dock, which saves the cell
data to a temporary file with extension according to detected data and
opens default external application for the file type. It then asks user to
reload the data in a dialog when they have finished editing the data. It
can be also used for viewing if the user cancels the reload.

See related issues #1791 and #1746
2019-12-23 12:35:13 +01:00
mgrojo
604ec0578b Open URL or filename: relative filenames are based on DB path and refactor
When opening a relative filename from "Edit DB Cell" or Table Browser the
relative paths are interpreted from the DB file location. This allows
portability of DB and linked files to a new location.

Refactoring so the open URL code is centralised in MainWindow and a status
message is displayed with error or opening notification.

See issue #1597
2019-12-22 22:02:57 +01:00
mgrojo
34c15538b2 Action to select a file to be inserted as a reference
The "Import file" in the Edit Dialog dock is converted to a menu (after
long click) with a new action for selecting a file to be imported as a
reference in the cell. Then this filename reference can be used to open
the file using the default application with the present "Open in
Application" action. (In Linux, paths containing non-US-ASCII are known
not to work. This seems a bug in Qt QUrl class).

New icon composed from our document-open.png and link.png from Silk icon
set.

Related issue #1597
2019-12-22 18:37:56 +01:00
Łukasz Wojniłowicz
5503667d98 Update Polish translation 2019-12-22 16:05:31 +01:00
mgrojo
99bc7536ed Avoid selecting a column when the table header is clicked for sorting
See issue #1717
2019-12-22 00:15:29 +01:00
mgrojo
61c8f47861 Open URL or filenames from DB cells
A new button is added in the "Edit DB Cell" dock for interpreting the
current value as a URL or filename and opening it using the default
application for the file or a web browser for the URL.

The same can be directly invoked in the table browser using the same
shortcut as the FK navigation.

Related issue #1597
2019-12-22 00:12:04 +01:00
mgrojo
8b252a9e2b Enhancements in row and column resizing to fit contents
A new option is added to the contextual menu of row header to auto-adjust
the row heights to fit the contents.

When no setting is loaded for a table, the new default for column width
will take into account the contents.

This is related to #2006
2019-12-21 19:19:25 +01:00
Martin Kleusberg
2676651bcd grammar: Add support for empty BLOB literals
Thanks to @mgrojo for providing this fix.

See issue #2066.
2019-12-18 22:45:28 +01:00
mgrojo
cac0ae1e8c Check if some column has a NOT NULL constraint in "Set to NULL"
Before setting any cell value to NULL, the existence of a NOT NULL
constraint is checked in the selected columns of the current table. This
avoid raising several warning messages when the DB rejects the individual
values.

See issue #2021.
2019-12-16 22:23:59 +01:00
mgrojo
8e8a3aa216 Undocking Database Cell Editor was clearing input
See issue #2062
2019-12-15 18:58:01 +01:00
Martin Kleusberg
6ad853db4f Add possibly missing include
Just in case...
2019-11-22 12:22:52 +01:00
Martin Kleusberg
317918d7cd Speed up the REGEXP implementation by adding a cache
Speed up the new REGEXP implementation based on QRegularExpression for
SQL queries by adding a cache for compiled regular expression objects.

See issue #2052.
2019-11-22 12:16:53 +01:00
Martin Kleusberg
74a16912e1 Remove close buttons on tabs and add button for closing SQL tabs
This gives us some more space in the tab bar and should reduce the risk
of accidentally closing a tab. It looks prettier too. We could add an
option for this in the Preferences dialog but in order to not add too
many rarely used options, let's try it without an option first.

See issue #1968.
2019-11-20 21:17:16 +01:00
Justin Clift
fc5f9d25cf Fix our Win32 nightly builds 2019-11-20 01:34:33 +11:00
Justin Clift
574303a550 Update paths on build server for Qt 5.12.6 x64 2019-11-19 22:58:09 +11:00
mgrojo
914292f299 Use the column type affinity for the default text alignment
In this way the entire column has the same alignment and gives a hint of
the column datatype. Note that if the DB has data incoherent with the
affinity, it will not be reflected in the text alignment.

See issue #2032
2019-11-15 21:21:06 +01:00
mgrojo
d567f3856f Do not open a new SQL tab when a DB file is open or created unless there
is not any yet.

See issue #1706
2019-11-15 00:00:23 +01:00
mgrojo
c9f5d3138e Show status message when saving to project file
Otherwise, there isn't any feedback about the file having been saved.

See issue #1706
2019-11-15 00:00:23 +01:00
Martin Kleusberg
bbeada2011 Fix importing CSV files with no trailing line break and only one column
See issue #193.
2019-11-14 17:46:37 +01:00
Martin Kleusberg
ec41b491ef Fix regression from ba1270cedb 2019-11-14 17:45:54 +01:00
Martin Kleusberg
6d2db6d681 Add MIME information file
See issue #2024.
2019-11-13 22:02:45 +01:00
Tellow Krinkle
6b8fb51f04 Support custom cipher_plaintext_header_size
For all those people loading databases from their iOS devices
2019-11-13 20:57:56 +01:00
Martin Kleusberg
b01c1c94bb Use QRegularExpression instead of QRegExp for SQLite's REGEXP operator
Replace the old QRegExp class by the newer QRegularExpression class in
the implementation of SQLite's REGEXP operator. This should fix some
problems with greediness and similar options.

See issue #2040.
2019-11-11 11:29:41 +01:00
Martin Kleusberg
ecb9abf51d Add replace bar to Browse Data tab
This adds a replace bar to the already existing find bar in the Browse
Data tab. It allows the user to replace the matching text in a cell by
some other text.

See issue #1608.
2019-11-11 00:39:27 +01:00
Martin Kleusberg
3535bdbf62 Fix crash when searching in an empty table 2019-11-10 13:41:15 +01:00
mgrojo
fa3a844454 Don't enable the Attach Database button if there is no DB open 2019-11-09 17:45:40 +01:00
mgrojo
d447c739c0 Keep project open when a DB is closed
Although a project cannot be saved without an associated DB file, we allow
to keep the project open when the current DB file is closed. The only
action that closes the project is opening another project or closing the
application.

The window title must reflect the three situations:
- Nothing is open
- DB file is open
- Project is open with a DB file or not

See discussion in issue #2027
2019-11-09 17:44:58 +01:00
Martin Kleusberg
58beba0b3f Make sure table widget shortcuts do not affect other parts of the UI
When handling the Ctrl+Space and Shift+Space keyboard shortcuts in
ExtenededTableWidget, make sure to not do anything if there is 1) no
table selection, or 2) if the table widget has no focus.

See issue #2038.
2019-11-07 17:29:42 +01:00
Martin Kleusberg
15051ed0ee Fix last commit
Sorry - too tired ;)
2019-11-06 21:27:28 +01:00
Martin Kleusberg
dd6de9479a Fix build for Qt versions < 5.10 2019-11-06 20:59:24 +01:00