Commit Graph

2975 Commits

Author SHA1 Message Date
Martin Kleusberg
97d77d557b Fix build for Qt version < 5.6
This fixes 8a4e363483.
2019-07-26 15:34:01 +02:00
Martin Kleusberg
b32351e7b6 Try to avoid automatic column resizing in Browse Data tab
See issue #1941.
2019-07-26 15:10:32 +02:00
Martin Kleusberg
8a4e363483 Add "Browse Table" action to the context menu of the DB Structure dock
Add a "Browse Table" action to the right-click menu of the table and
view items in the Database Structure dock.

See issue #1943.
2019-07-26 14:51:26 +02:00
Martin Kleusberg
6cfac1b0f1 Fix right click action "Browse Table" for tables with whitespace
Fix a crash when using the "Browse Table" action in the right click menu
in the Database Structure tab. It crashed whenever the table name or the
schema name started or ended with a space character.
2019-07-26 14:26:00 +02:00
Martin Kleusberg
ec4e0dc5cc Don't treat numbers as JSON data in Edit Cell dialog
When detecting the data type in the Edit Cell dialog, don't treat
simple numbers as a JSON document. They should be handled as text
instead.

Thanks to @mgrojo for pointing this out here.
d344f396b2 (r34132706)
2019-07-26 14:18:53 +02:00
Justin Clift
0f7523ca50 Merge pull request #1940 from deepsidhu1313/master
Added JSON support for snap and AppImage packages
2019-07-23 10:19:24 +10:00
Navdeep Singh Sidhu
21b398a6fc Added JSON support for AppImage Packages 2019-07-22 17:28:34 -05:00
Navdeep Singh Sidhu
623d3b7b51 added JSON support for snap packages 2019-07-22 17:27:20 -05:00
mgrojo
9fe529752b Allow to change sort order for any column in the multi-column sort list
A second Ctrl+Click over an already added column changes the direction of
any column.

Before this change, the effect was only applied to the last selected column
and a second Ctrl+Click on the other columns triggered a requery without
having changed anything.

This was mentioned in PR #1810. See also issue #1761.
2019-07-13 17:42:50 +02:00
mgrojo
592fa91e25 New function for detecting mixed RTL-LTR texts
Qt's isRightToLeft() returns true only for all left-to-right characters
in the string. That prevents the automatic switch to LTR Text mode, when
the text contains one or more left-to-right characters.

See #1793 and #1929
2019-07-11 22:10:24 +02:00
mgrojo
5e965b1a20 Restore QTextEdit widget for RTL text in the Cell Editor
This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2abfd

QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.

RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.

All these changes can be undone if a new QScintilla editor supports RTL
texts.

See comments in issue #1793
2019-07-11 22:10:24 +02:00
GortiZ
786fac033a Updated Italian translation (#1931)
* [CHG] Updated italian translations
2019-07-10 21:05:27 +02:00
Martin Kleusberg
9594115ef3 Send the fetched signal in RowLoader even when no rows where fetched
Always send the fetched() signal when a RowLoader thread has finished a
fetch task. Before this the signal was only sent when some data was
actually retrieved from the task. This fixes some rare problems in the
Execute SQL tab where the query for determining the row count of a
SELECT statement changes something, so the subsequent row loading task
does not return any rows after all.

The only case I know of is when loading an extension using the
'SELECT load_extension()' function. The load_extension function is
actually called twice when SQLite for some reason reports that rows
where returned from this statement. These calls are:
SELECT COUNT(*) FROM (SELECT load_extension('...'));
SELECT load_extension('...');
After the first call is executed, the extension is loaded. So the second
call does not return any rows and we indefinitely wait for the rows we
expect. Strangely enough this only happens for some extensions.

The change here should have no side effects becaue the signal is only
connected to one slot which skips most steps when no rows where fetched.

See issue #1932.
2019-07-06 23:05:57 +02:00
Martin Kleusberg
b17755c46a Only register error log callback once at start of application
Instead of registering the error log callback function every time a
database file is opened, we now register it only once when the
application is first started. This way we can avoid calling
sqlite_shutdown which can have unintended side effects.

See issue #1932.
2019-07-05 22:13:46 +02:00
Martin Kleusberg
d6e4ff7c20 libs: Update json library to version 3.6.1 2019-06-30 15:00:33 +02:00
Justin Clift
b0bca100c0 SQLCipher: Raise the maximum # of attached databases to 125
For #1926.
2019-06-29 05:25:20 +10:00
Justin Clift
402af87bdb Raise the maximum # of attached databases to 125
For #1926.

Note - this only raises things for SQLite, the same change needs
trying out with SQLCipher
2019-06-29 03:15:28 +10:00
Martin Kleusberg
5589bd9da4 Speed up the loading of the database structure
While testing the original database from issue #1892 which contains
hundreds of tables and fields, I noticed how long the loading of the
database structure takes. This is especially problematic since it needs
to be reloaded on various occasions, e.g. running most statements in the
Execute SQL tab, which stalls the application every time.

According to a profiler it is the QIcon constructor which requires most
of the time. By introducing this small icon cache class we can reduce
the time for loading icons to almost nothing.

While still not perfect the UI already feels much more responsive with
this patch.
2019-06-28 14:58:50 +02:00
Martin Kleusberg
237b1fd9b8 Simplify code 2019-06-28 13:25:46 +02:00
Justin Clift
b0bb376880 Ensure the win nightlies git commit check runs from the git source dir 2019-06-18 14:58:54 +10:00
Karim ElDeeb
e26d32364e Skip building Windows nightlies if there are no new commits
Windows build script will now save, and check, the last build commit and
skip building if there are no new commits since the last automatic build.

See #1917.
2019-06-17 23:45:00 +02:00
Justin Clift
dda70d903e Merge pull request #1918 from mercury233/patch-zh-translation
Minor fix to zh-cn translation
2019-06-17 02:54:32 +10:00
Mercury233
028242160f minor fix zh-cn translation 2019-06-17 00:24:17 +08:00
Martin Kleusberg
ccae4af6d1 Fix off-by-one error 2019-06-13 16:12:47 +02:00
Martin Kleusberg
50c1f46bdb Remove outdated patch
This patch has already been applied upstream and we have already updated
our local copy in the repository.
2019-05-29 16:03:15 +02:00
Scott Furry
cf05e7a462 Centralize File Filter and Resolve End CSV Import Message
Matter came up WRT #1880. In reviewing, several other instances
were found where same file filter as a string literal was repreated.
This commit centralizes	these file filters to one location. Filters
are declared `static const` to prevent accidental modification.

Also applied is a fix to #1881. QMessage at end of Import CSV is removed.
2019-05-29 15:54:27 +02:00
Scott Furry
a692c06637 Add option in CMake to build against external QHexEdit library
From upstream source, QHexEdit is intended to be a modular widget
for Qt5. (README @ https://github.com/Simsys/qhexedit2)

Add ability for platforms that already have QHexEdit installed to
build DB4S against installed (external to DB4S) QHexEdit library.
Current version of library available is consistent with version
contained in DB4S project `libs` folder.
(see https://repology.org/project/qhexedit2/versions)

Default of CMake flag FORCE_INTERNAL_QHEXEDIT is ON (enabled) so
as to minimize impact to current development workflow and other
platforms. Using flag is left as an option to package managers.
2019-05-29 15:39:46 +02:00
mgrojo
09944739cc Log transaction and savepoints statements executed by application
These statements have implications for the user, so it is better to log
them.

See #1859 and #1901
2019-05-29 15:37:23 +02:00
Karim ElDeeb
75ae701b84 Create FUNDING.yml 2019-05-26 13:22:34 +02:00
Justin Clift
7d24e931e0 Merge pull request #1911 from scottfurry/CMP0071
CMakeLists change to silence CMP0071 warning.
2019-05-26 12:17:02 +10:00
Scott Furry
3642d1dedf CMakeLists change to silence CMP0071 warning.
Problem identified in Github Issue #1910.

Update to CMake had policy warning of AUTOMOC usage.
See https://cmake.org/cmake/help/latest/policy/CMP0071.html

Commit adds instructions to silence the warning.
Affect of AUTOMOC behaviour with 'new' needs further study.
2019-05-25 12:05:29 -06:00
mgrojo
1df647b0df Fix copy-paste-edit error in SqlExecutionArea::saveState()
The error was introduced in 59b55ac436

Indentation level also fixed.

Thanks to @scottfurry for pointing this out. See issue #1889.
2019-05-19 19:41:27 +02:00
mgrojo
512f7eeeab Save splitter sizes of the Execute SQL areas to disk under request
Saving cannot be done in the class destructor, since it seems that the
sizes have already change in that moment. Now they are saved under request
of the Main Window at the same time when the Main Window state is saved.

See issue #1889.
2019-05-19 13:45:56 +02:00
mgrojo
59b55ac436 Save splitter sizes in the Execute SQL areas
Whenever the splitters between the SQL editor, the table result and the
last execution results panes are moved, the sizes are saved to memory (for
performance) so the next SQL tab to be opened restores them. When an area
is destroyed the last saved settings are saved to disk, so they are ready
for the next execution without much impact in disk utilisation.

Issue #1889
2019-05-17 23:18:00 +02:00
Justin Clift
b041a7d044 nightlies: For win, always grab latest fileio source from sqlite.org 2019-05-13 00:25:38 +10:00
Justin Clift
786a1debc4 nightlies: For macOS, always grab latest fileio source from sqlite.org 2019-05-12 23:19:40 +10:00
mgrojo
30d0b183a5 Fix crash when opening project file
When opening a project file the following exception is raised in
src/sqlitedb.h:208

terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at

This is related to 64a596a887
2019-05-12 00:15:35 +02:00
Martin Kleusberg
6bbf401abd Fix build for Qt < 5.10 2019-05-11 16:28:48 +02:00
Martin Kleusberg
e2f3186d19 Fix saving/restoring of settings in Import CSV dialog
Saving and restoring of quote and separator characters did not work as
expected in the Import CSV dialog since the last commits. A missing
"else" made us try to save the string "Other" as the quote character
when a custom quote character was selected. Also the translation from
and to the saved format on disk had its problems.

See issue #1860.
2019-05-11 16:10:31 +02:00
Martin Kleusberg
2d12330783 dbhub: Set window title of new Proxy dialog
Forgot that in the last commit.
2019-05-09 15:25:10 +02:00
Martin Kleusberg
38ece2ea42 dbhub: Add proxy configuration support
This adds a new dialog, accessible from the Remote tab in the Preferences
Dialog, which allows the user to configure the proxy to use for all
network connections.

The new default is to use the system-wide proxy settings.

See issue #979.
2019-05-09 15:11:44 +02:00
Martin Kleusberg
4cf6cb7c2a dbhub: Set last modified date of file during initial cloning
The dbhub.io server provides us the last modified date of the database
when cloning it. Because we send the last modified date back to the
server when trying to push a database, it makes sense to initially set
the last modified date of the local file to the date provided by the
server.

See issue https://github.com/sqlitebrowser/dbhub.io/issues/101.
2019-05-09 13:50:39 +02:00
Martin Kleusberg
afee3ca79e Support more field separators and quote chars in the CSV import
This adds support for more characters as field separator and for quoting
in the CSV import. Before this we only supported ASCII characters, with
this we support all characters which when UTF-8 encoded require up to
16 bits.

See issue #1860.
2019-05-08 23:54:06 +02:00
Martin Kleusberg
cec6b82561 Fix loading of last used settings in Import CSV dialog
Fix the loading of the last used import settings in the Import CSV
dialog when the "Other" option has been used in one of the dropdown
boxes.
2019-05-07 23:16:09 +02:00
mgrojo
c70a1fc56f Close version range to apply workaround for QTBUG-73721
It appeared in Qt version 5.12.0 and it is supposed to be fixed in 5.12.3.

See issue #1658
2019-05-07 22:52:52 +02:00
Martin Kleusberg
d1621e31b8 Fix qmake build 2019-05-07 22:17:27 +02:00
Scott Furry
f877f8a10c Resolve Github Issue #1867 - Spurious Empty Filename message.
Problem traced to QFile::exist() producing message when passed an empty QString.
Fix is to test QString length before any QFile::exist() usage with that string.
2019-05-07 22:14:13 +02:00
Scott Furry
d54b820fb2 Shadowed Variable Warnings (#1864)
Compile with ALL_WARNINGS using GCC 8.2.1.
Encountered approximately dozen warnings with this pattern:

    [path to sqlitebrowser root]/src/[somesourcefile]:line:cursor: warning: declaration
	of ‘data’ shadows a member of ‘ClassName’ [-Wshadow]
            OtherDataType data = ....line of code at line given above...
                          ^~~~
    In file included from /usr/include/qt5/QtWidgets/qdialog.h:44,
                     from /usr/include/qt5/QtWidgets/QDialog:1,
                     ...other sources in project
    /usr/include/qt5/QtWidgets/qwidget.h:733:18: note: shadowed declaration is here
         QWidgetData *data;
                      ^~~~

It appears there is a variable named 'data' within Qt global scope. Using 'data`
as a variable name, even one limited in scope to small lamda expressions, causes
compiler some grief.

Commit resolves the warnings in affected files. No problems apparent during execution.
Requires CSV stress-testing.
2019-05-07 22:09:21 +02:00
Scott Furry
800a8daf11 Normalize qhexedit.h include path
Include path used for QHexEdit in EditDialog.cpp is "implementation specific"
to how DB4S uses the QHexEdit library. Change is to make usage of library
more generic.
2019-05-07 21:56:06 +02:00
Martin Kleusberg
c61e172afe Attempt to fix the build on some platforms - again
See issue #1879.
2019-05-07 21:53:09 +02:00