Commit Graph

2787 Commits

Author SHA1 Message Date
Martin Kleusberg
13a8a1f282 Speed up the SQL import a bit
This commit attempts to speed up the SQL import a bit by removing
unnecessary conversions and counting of characters. It's still far from
perfect though.

See issue #1045.
2019-02-14 13:45:18 +01:00
Manuel
e9145a0c8e Add warnings to cmake compilation (#1721)
* Add warnings to cmake compilation

Use the same set of warning flags that are used for qmake compilation.

See comments in #1718.

* Add condition for warning flags not supported by GCC 5.5

Satisfy Travis build by adding the unrecognised warning flags only when
the compiler version is greater or equal 7.0. Maybe those flags are
available in previous versions, but I don't know when they were introduced.

Tested with GCC 7.3.

* CMake option for enabling GCC warnings

This option follows the qmake configuration, where the same all_warnings
option exist. This allows users to select compiling with or without
warnings using "cmake -DALL_WARNINGS=ON" or OFF.
2019-02-13 17:53:12 +01:00
Martin Kleusberg
c224d04607 sqlcipher: Fix editing the encryption for SQLCipher4
With SQLCipher4 the encryption was not working as expected because the
KDF and HMAC algorithms were not set properly. This is fixed in this
commit so it should work now with SQLCipher4 as well as SQLCipher3.

See issues #1690 and #1732.
2019-02-12 10:42:51 +01:00
mgrojo
4a728bd4f9 Class 'NullLineEdit' lacks Q_OBJECT macro
Qt Creator and lupdate are giving warnings about this class lacking the
Q_OBJECT macro. Although it seems to not be needed, adding it will silence
the warnings without drawbacks.

See issue #1740.
2019-02-11 23:04:42 +01:00
Justin Clift
37361d8196 Revert currentrelease to 3.10.1
Our encryption of new databases with SQLCipher 4.0.1 is broken :(,
so we'll need to fix it and do a 3.11.1 release.
2019-02-11 12:56:27 +11:00
Iulian Onofrei
1ebd9955ca Fix static analyzer issues (#1727)
* Fix `barsGroup` memory leak

* Remove unused values
2019-02-09 21:01:55 +01:00
mgrojo
3eebffd7c6 Detect XML data starting with a declaration
Checking for "<?xml" at the beginning of a text is a quick and simple test
that will detect most of the XML cases.

This fills an obvious gap in #1537.
2019-02-09 20:01:22 +01:00
mgrojo
e2443d685f Fix text detection check
Truncating the text in bytes boundaries for the quick test was breaking
the text detection for Russian and probably any script encoded in more than
one byte. The problem occurred probably when a multibyte character was
truncated at the 512 boundary. This is a bit improbable in latin-based
languages like German or Spanish, whose most characters are a byte, but
very easy in other scripts, like Cyrillic, whose characters are encoded in
more than one.

The new approach is based in QTextCodec finding invalid characters using
the current encoding, which seems immune to the truncation problem.
According to callgrind, it has also better performance, probably because it
does not involve memory comparison.

See issue #1731
2019-02-09 19:03:42 +01:00
Martin Kleusberg
0089802177 Make Add Record button work again with a single click
In 5f4d0ee7ff the Add Record button in the
Browse Table tab was inadvertently changed to only open a popup menu
after a long click but not triggering the Add Record action after a
normal click. This restores the old behaviour.
2019-02-09 18:42:53 +01:00
Martin Kleusberg
7468bb2139 tests: Add test case for ee70a34ead
Add a test case for the bug which motivated disabling the window
function rules in ee70a34ead.

See issue #1733.
2019-02-09 13:33:56 +01:00
Martin Kleusberg
ee70a34ead grammar: Disable window function parsing
Remove the window function grammar rules. I think they are not needed
anyway as long as we only parse CREATE TABLE and CREATE INDEX
statements and unexpectedly they do seem to cause problems. It it still
worth investigating how this is possible but for now removing them seems
like the best option.

See issue #1733.
2019-02-09 13:26:21 +01:00
Manuel
5f4d0ee7ff Improve the size policy (toolbars and improved icons) (#1684)
* Improve the size policy (and more and better icons)

These changes improve the size policy for translations having long texts
in some buttons by:

* Converting the text buttons in the Edit Database Cell to icons
* Making the "Type of data" label wrappable and expandable
* Converting the text buttons in the Browse Data tab to icons
* Allowing the Plot combo-boxes to shrunk

All this allows both the Browse Data and the docks to grow and shrink with
more freedom.

New icons for buttons are reused when appropriate in context menus.

Added icon for filter and improve icon for docks (has been mirrored so it
matches the actual dock position).

Added Print icon in Edit Database Cell using the extra free space, so the
print action there is more visible.

This continues the effort started in #1324.

* Convert the embedded buttons to actual toolbars

This provides more flexibility, like the way how toolbars are compacted
when they have not enough space.

The QToolButtons in Browse Data tab and in Edit Cell dialog are converted
to QActions and inserted in new toolbars embedded in the same place as
the old buttons. Everything else should stay the same (shortcuts, tool-tips
and what's-this information).

* Set style for all toolbars in Preferences and minor adjustments

The combo-box used for the main toolbar is replicated for all the toolbars
in application. In this way, users with high resolutions can use the styles
with both icons and text, while users with lower resolutions can leave the
default styles, which should be better for them.

Some icon texts has been abbreviated from their default values, so they fit
better in the toolbars when they are visible.

The print icon in Edit Cell has been moved to the right, where it would be
the first to be collapsed.

The original what's-this info for Set as NULL in Edit Cell toolbar has been
restored.

* Remove no longer used overloaded function

The addShortcutsTooltip function applying to QWidget was no longer used
after having converted all the buttons to actions, so it is removed.
2019-02-08 21:45:50 +01:00
Justin Clift
fc697b173d Updated currentrelease file for 3.11.0 2019-02-08 23:03:26 +11:00
Chris Locke
e729a28f97 Update BUILDING.md
Grammar tweak.
2019-02-08 09:34:17 +00:00
Justin Clift
0ad00afcbe Added 3.11.0 to the README.md Releases section 2019-02-08 00:57:44 +11:00
Justin Clift
8aed3dd381 Update DB4S version numbers in our issue templates 2019-02-07 22:16:48 +11:00
Justin Clift
5c4f1ab7da Switch Win64 nightly builds back to Qt 5.11.3
This is due to a weird word wrap bug in Qt 5.12.1
2019-02-06 22:52:38 +11:00
Justin Clift
c9da48b444 qtquick1_*.qm doesn't seem to be included with Qt 5.12.1 2019-02-06 17:18:30 +11:00
Justin Clift
b182d9520e Use Qt 5.12.1 for our Win64 nightly builds 2019-02-06 16:28:19 +11:00
mgrojo
9fc6eeb3c6 Fix ambiguous shortcut for Ctrl+/
The shortcut was ambiguous because it was active in the button and in the
SQL editor itself. In the button was only documentation and was made
ambiguous when enabling the feature and fixing the shortcut in
6425fb177e

Now its scope is reduced to widget like similar button shortcuts so it can
be unambiguous in the editor.

See issue #1614
2019-02-04 20:30:29 +01:00
mgrojo
5383ede3d8 Enable/disable "Save All" button
The  "Save All" button is now disabled and enabled with the same criteria
than the save project buttons.

See issues #871 and #1706
2019-02-02 21:40:14 +01:00
Justin Clift
dc749f98f9 Use our new, slightly customised, SQLite3 Homebrew tap 2019-02-03 02:06:39 +11:00
Justin Clift
56e6adaf3a Homebrew seems to have removed all support for formula options 2019-02-03 01:10:20 +11:00
Brook Milligan
21d8800ce6 CMake installation on macOS should also copy the icon & desktop files
Should address #1723
2019-01-31 17:08:14 +11:00
mgrojo
8162c96c15 Double click a column for selecting it
Since the mouse release triggers the sorting, we were unable to select
only one column. Connecting the double click over the header to a column
selection, we are able to select that column. However, we cannot select
one column without sorting by it, since the sorting is triggered before,
on the first mouse click.

See issue #1717
2019-01-26 21:11:49 +01:00
mgrojo
03e75af3f1 Rectify the sort indicator after multiple column selection
When more than one column is selected we abort the sorting, but Qt has
already assigned the sort indicator to the last selected column, so we
have to restore the saved settings to fix the sort indicator column.

See issue #1717
2019-01-26 20:51:02 +01:00
mgrojo
e22966ec23 Fix override warning in selectAll
This change fixes a cmpile warning on Mac OS: (10.12.6) + Clang

warning: 'selectAll' overrides a member function but is not marked
'override'

Fixes #1718
2019-01-24 23:20:20 +01:00
Tien Do
60c6bad895 Building with CMake on macOS (#1644) 2019-01-24 23:26:40 +11:00
Justin Clift
1380976f5f Merge pull request #1719 from tiendq/cmake-find-qscintilla
Find correct QScintilla package
2019-01-24 23:15:01 +11:00
Tien Do
4f939285fc refactor: find correct QScintilla package 2019-01-24 16:06:37 +07:00
Karim ElDeeb
98c9b3ba98 Fix shortcut items in the MSI installer
See issue #1713.
2019-01-20 01:52:39 +02:00
mgrojo
a14939913b New action "Save All"
New action "Save All" for saving all the files currently opened by the
application: DB file, SQL files and project file. Can be activated through
shortcut (Ctrl+Shift+S) and File menu.

Icon composed from package.png and database_save.png.

See issues #871 and #1706
2019-01-18 23:35:27 +01:00
mgrojo
f08cdb19b8 Ask user about saving any modified data in SQL tabs
User is asked once for saving modified SQL tabs not attached to a file to
the current project file (or to a new project file, when there isn't any
yet).

For each tab linked to a file, the user is asked to save the changes to the
file.

The asking is performed when the tab is closed, or when the application
is closing.

The modified attribute of the editor is set to false when the data is
saved or has just been loaded in the editor.

See issues #1386 and #1706
2019-01-18 00:11:43 +01:00
Martin Kleusberg
fbef621e5a Fix executing selection only in Execute SQL tab
When executing only a part of a query by selecting the start of it in
the Execute SQL tab, SQLite would execute it until the next semicolon,
even when the selection does not go as far. This commit changes this
back to the old behaviour to only ever execute exactly the selected part
of a query.

See issue #1708.
2019-01-14 20:06:46 +01:00
Martin Kleusberg
5dc59feeea Add a comment 2019-01-14 20:03:15 +01:00
Martin Kleusberg
a0b87688ab dbhub: Attempt to fix the OK button in the Push dialog
The OK button in the Remote Push dialog sometimes needed to be clicked
twice in order to work. That's because whenever the Database Name field
loses focus, we would send out a request for the updated branch list.
While processing this request the OK button is effectively disabled by
Qt. This commit aims for an easy fix by changing the request to happen
whenever the text in the Name field changes. This way the timing is a
lot less sensitive. We will need to see however if this introduces other
timing issues for users with slow Internet connections.
2019-01-13 16:32:34 +01:00
Petr Tykal
623a4d6631 New Czech translations (#1710) 2019-01-12 21:36:56 +01:00
mgrojo
8f32d15204 Added icon for foreign-key fields
Fields having a foreign-key constraint are shown with a distinctive icon.

New icon based on page_green.png and bullet_key.png from the Silk icon set.

See comment in issue #192
2019-01-12 21:19:15 +01:00
mgrojo
f5011a233b "Save Project" to remember filename and new "Save Project As" action
"Save Project" remembers used filename, at second and successive calls
the user is not asked for the filename. Ellipsis are removed, since it
only opens a dialog the first time.

A Wait Cursor is set while saving so the user does not get the impression
that pressing "Save Project" does nothing.

"Save Project As" action is added, so the user can still save to another
filename when saved for the first time. Added icon combining package.png
and textfield_rename.png from the Silk icon set.

The base filename for a new project does not include the DB suffix.

Problems saving the project file are detected and the user warned.

See issue #1706
2019-01-11 21:53:45 +01:00
mgrojo
8bf68af047 Add source code locations to Portuguese translation file
Otherwise linguist doesn't show the widgets or source code references.

See PR #1707
2019-01-10 23:29:49 +01:00
Justin Clift
c6e7ca1121 Nuke the AppImage stuff until we have time to investigate the failures 2019-01-09 13:21:44 +11:00
GortiZ
61596adbce Merge e completamento traduzione italiana (#1705) 2019-01-09 13:21:20 +11:00
mgrojo
85ad623c09 Merge updated Spanish translation for v3.11.x (Fix possible resource leaks)
This is an update of the translation file followed by a manual merge of
0ab9f44ce6

See issue #1691
2019-01-03 17:54:32 +01:00
mgrojo
d6edcc08ac Merge updated Spanish translation for v3.11.x
- New SQLcipher dialog strings
- Extensions filter
- Remove translation for Alt+Del, since it has to match the official Qt
translation and it changes between versions. When the shortcut isn't
changed, it is better to not translate the shortcut at all.

# Conflicts:
#	src/translations/sqlb_es_ES.ts
2019-01-03 17:42:16 +01:00
mgrojo
ea6cf146c7 Cmd+Backspace should delete from cursor to the beginning of line on macOS
See issue #815
2019-01-03 00:40:40 +01:00
mgrojo
fc7f2b9440 Align Mac shortcut in Scintilla to standard and Qt for Alt+Backspace
In Mac the standard shortcut for deleting word to the left is Alt+Backspace
so we set this key sequence in Scintilla editors as alternate for Mac.

Reference:

http://doc.qt.io/qt-5/qkeysequence.html
Section Standard Shortcuts:
DeleteStartOfWord	is Alt+Backspace in macOS column.

See issue #815
2019-01-02 21:37:26 +01:00
mgrojo
bf5eaa7330 Replace link style from pragma labels to an embedded icon with link
Even after having removed the hard-coded style from the link texts, this
combination of hyperlink over regular window background is not giving good
results in some dark theme colours. It is uncommon to have this combination
in GUI applications.

The link in the label has been replaced by a link in an embedded icon.

In order to be still recognisable as a link (apart from the hand icon) the
link hover signal is connected to a slot showing the link in the status bar
for 5 seconds.

See issue #1493
2018-12-30 13:30:36 +01:00
Navdeep Singh Sidhu
b7b6bc88a0 Merge pull request #1698 from deepsidhu1313/master
Added support to build x86_64 AppImages  using xenial on Travis CI
2018-12-29 23:47:57 -06:00
Navdeep Singh Sidhu
17ea0cc35a Fixed indent in travis.yml file 2018-12-29 23:44:44 -06:00
Navdeep Singh Sidhu
0601571e48 Updated AppImage versioning to include count from HEAD 2018-12-29 19:18:21 -06:00