Commit Graph

3633 Commits

Author SHA1 Message Date
Martin Kleusberg
f4416c2ee0 build: Fix a couple of issues in the macOS build script
In commit 33ee7364f7 we have started
moving the macOS build scripts towards using cmake instead of qmake.
This commit fixes some issues introduced in that commit.

Do not call lupdate and lrelease any more because they rely on the qmake
project files and are called by cmake anyway.

Make sure cmake is reinstalled via brew after removing any installed
brew packages.

Set a hint to the Qt5 library path so cmake should be able to find it.
2021-08-15 15:34:12 +02:00
Martin Kleusberg
c54304cbdb build: Remove any mentions of qmake from the documentation
This removes all mentions of the qmake build system from our build
instructions because we are planning to remove support for qmake in the
near future. Building using cmake should work fine on all platforms.
2021-08-13 15:54:24 +02:00
Martin Kleusberg
060e925074 build: Make CMakeLists.txt easier to use
This adds the moc header files to the dependencies of the executable in
the cmake project so they show up in their proper location in QtCreator.
This makes it more pleasant to use the cmake files as a QtCreator
project file.

Also rework the CMakeLists.txt file a bit by fixing whitespace issues,
rearranging some blocks and unifying the code style a bit.
2021-08-13 14:47:06 +02:00
Martin Kleusberg
33ee7364f7 build: Use cmake for macOS builds
This is a first attempt to use cmake instead of qmake for building our
nightlies on macOS. We are using cmake on most platforms and it would be
easier for us to only maintain one build system. Because support for
qmake is dropped in Qt6 anyway it makes sense to transition to only
using cmake in the near-ish future.

Please note that this commit has been assembled in a mostly blind
fashion. I would be surprised if this worked without further tweaking.
2021-08-12 22:24:46 +02:00
Nikolay Zlatev
183d8f7e34 ColumnDisplayFormatDialog: Adjusts the size of the widget. 2021-08-12 16:59:06 +03:00
Martin Kleusberg
254df474e1 travis: Make sure to install the QtSvg libraries 2021-08-11 20:57:51 +02:00
Martin Kleusberg
6508974c54 travis: Update to Ubuntu bionic 2021-08-11 11:49:05 +02:00
dnuzhdin
6448ed7eac Add assignment of ON CONFLICT clause into GUI 2021-08-10 14:16:20 +02:00
Martin Kleusberg
ef87dc63da Fix changes to constraints in Edit Table dialog not always being applied
Changes to constraints in the Edit Table dialog were not always
correctly applied, especially when only constraints were changed. This
was because we did not make deep copies of the constraint objects so
instead of copied we were changing the original constraints. This meant
that the ALTER TABLE code we have in place thought that there were no
changes made in compariron to the original table.
2021-08-10 14:15:58 +02:00
mgrojo
dc8557110d Settings: fix file check in "-S" option for Windows
In Windows the file has to be opened in text mode to get line ending
conversion so the check for the first line works.

See issue #2791
2021-08-09 21:57:55 +02:00
mgrojo
128babb602 Execute SQL: add Ctrl+Shift+T for "Open SQL file(s)"
It is already used by QScintilla for "Copy current line", which is moved
to Ctrl+Shift+Insert

See issue #2798
2021-08-09 14:16:00 +02:00
mgr
d5937c6d71 Automatic editor mode: change default for SVG to Image Viewer
This will give precedence to viewing SVG images over editing them as XML.
I suppose it makes sense, because most users will load images from disk
or using an application and will generally want to view them and not
editing them.

This also makes more sense for 4e5f117851
2021-07-23 20:06:33 +02:00
Justin Clift
21f483abd0 Merge pull request #2778 from tudo75/master
Update sqlitebrowser.desktop to work with Plank
2021-07-23 00:34:30 +10:00
Nicola Tudino
2d7f97494a Update sqlitebrowser.desktop to work with Plank
Added StartupWMClass=sqlitebrowser to fix issues of the app launcher with Plank dock bar
2021-07-22 01:22:05 +02:00
mgrojo
6bdacf6595 CLI: Reuse --table as table name for a CSV Import
This allows user to specify the destination table of the import from the
command line.

See issue #2772
2021-07-18 18:36:33 +02:00
mgrojo
fd02005913 Avoid "unused parameter" warning 2021-07-18 17:01:18 +02:00
mgrojo
8d0d6e3213 Icon set details in About dialog
It should have gone with 36054cd767
2021-07-18 17:00:23 +02:00
mgrojo
532457edb7 Workaround for Qt bug shown in issues #2763 and #2490
- Adjust fixed sizes in EditTableDialog so the bug is less visible
- Resize columns to contents after item insertion, so it is not resized
to contents when only the header is present.
2021-07-18 16:33:24 +02:00
Nikolay Zlatev
23a597bcd1 ImageViewer: Improve scaling logic 2021-07-15 17:18:29 +03:00
Nikolay Zlatev
f749f38fb0 ImageViewer: Add mouse wheel zoom 2021-07-15 14:47:53 +03:00
Nikolay Zlatev
8bc9d3320b ImageViewer: Use QScrollArea::viewport for boundaries check.
QScrollArea::viewport is now used for boundaries check and
for image pan (m_pan_mode).
This should provide more accurate event filtering (content only)
2021-07-15 11:47:02 +03:00
Nikolay Zlatev
2df29fad89 AboutDialog: Change layout to fit large font better 2021-07-14 13:50:23 +03:00
Nikolay Zlatev
67a70dd263 Merge pull request #2767 from sandman7920/master
SpatiaLite to SVG display format
2021-07-14 09:51:04 +03:00
Nikolay Zlatev
4a0ba0d51a ColumnDisplayFormatDialog: geomToSVG change default resolution to 640 2021-07-14 09:48:46 +03:00
Nikolay Zlatev
c4dd27e034 ImageViewer: Code cleanup 2021-07-14 09:34:24 +03:00
Nikolay Zlatev
d62ccb1a6d ImageViewer: Added mouse pan mode 2021-07-13 19:46:20 +03:00
Nikolay Zlatev
f97d1013cd ImageViewer: Change image alignment to center 2021-07-13 17:39:38 +03:00
Nikolay Zlatev
d2e957cbdf ImageViewer: Keep aspect ratio for a scaled image 2021-07-13 17:27:09 +03:00
Nikolay Zlatev
daee6bcaf1 ImageViewer: Use scrollArea widget for boundaries check
Check if the image is inside the scrollArea widget,
not the "scrollable content".
2021-07-13 14:44:38 +03:00
Nikolay Zlatev
78a1209c3e ImageViewer: initialize m_scale_factor with default value 2021-07-13 14:34:35 +03:00
Nikolay Zlatev
4e5f117851 ColumnDisplayFormatDialog: Added SpatiaLite geometry to SVG Display Format
The new Display Format should convert SpatiaLite geometry (BLOB) into SVG.
By default the geometry is scaled to 320 pixels (0..319)
2021-07-12 16:38:09 +03:00
Nikolay Zlatev
64d86a0e92 ColumnDisplayFormatDialog: Escape column_name only once 2021-07-12 16:24:29 +03:00
Martin Kleusberg
af3c0f8239 tests: Add test for c5853727b7 2021-07-10 14:32:43 +02:00
oldlaptop
c5853727b7 Permit dollar signs ($) after the first char in unquoted IDs
Follow the canonical SQLite lexer in recognizing $ as a valid
 character in unquoted identifiers, for compatibility with certain
 other databases. See:

 https://www.sqlite.org/cgi/src/file?name=src/tokenize.c&ci=c5e2de1d24d34589&ln=162-165
 https://www.sqlite.org/cgi/src/file?name=src/global.c&ci=fd8b68a474226e3b&ln=113-116
2021-07-10 14:28:38 +02:00
Nikolay Zlatev
b7f5ef3ff9 CipherDialog: Improve password fields validation
For RawKey key format, password length must at least 3 symbols.
'0x' is just a placeholder and the real key begins at the third symbol
2021-07-07 10:42:15 +03:00
Nikolay Zlatev
1e77bc78e4 CipherSettings: fix crash with empty RawKey
Fix crash when CipherSettings::getPassword() is called with empty RawKey.

Related issue #2743
2021-07-07 10:37:38 +03:00
Martin Kleusberg
3af4c3db81 Avoid error messages when checking for updates
When using rare network settings errors might occur when checking for
updates. Instead of displaying an irritating error message when starting
the application, just silently ignore errors. This is far from perfect
but at least does not make things worse because even if you see the
error message this commit hides, you would not be able to do much about
it.

See issue #2759.
2021-07-06 21:42:12 +02:00
Martin Kleusberg
f1df40c948 Prevent an error message when browsing views using SQLite 3.36 or above
Starting with SQLite 3.36 you cannot select the rowid column anymore
when selecting from a view. Trying to do so will throw an error.
Previously SQLite would silently return NULL when trying to do that.
This commit mimicks SQLite's previous behaviour.
2021-07-06 19:38:37 +02:00
Nikolay Zlatev
f61e983207 Clear SqlExecutionArea error log before SQL query is excuted. 2021-07-06 09:53:09 +03:00
mgrojo
df700d1954 Export SQL: option to keep original CREATE statements
Additionally, for consistency, when the option to keep old schema is not
activated, the statement does not add "IF NOT EXISTS", so it's the same
either when the keep original statement is used or not.

See issues #2735 and #2627
2021-06-26 20:37:49 +02:00
mgrojo
910a2e100c Fix filters for tables with display formats
To check whether selector is different to the column, no escaping can be
used, since selector is never quoted, neither when it is a column name nor
a function.

See issue #2708
2021-06-26 00:14:01 +02:00
Manuel
d8c1096b30 Merge pull request #2751 from oldlaptop/refresh-new-table-browser-tabs
Refresh all new table browser tabs
2021-06-24 22:11:26 +02:00
oldlaptop
832ab35913 Refresh all new table browser tabs
MainWindow::newTableBrowserTab is only calling the new TableBrowser's
 refresh() method through the constructor, before it has its model set,
 and the browser therefore is still blank when the user first sees it.
 A manual refresh at the end seems to be one way to fix this.
2021-06-21 21:40:39 -04:00
Manuel
fdc19ed9d7 Merge pull request #2750 from oldlaptop/fix-2583
Fix #2583: quote identifiers, not expressions
2021-06-21 22:40:05 +02:00
oldlaptop
6b03a33eae Fix #2583: quote identifiers, not expressions
94023a5 switched to storing OrderBy terms by column
 name and/or expression instead of by column index, and
 includes a test to ensure that identifiers are quoted
 and raw expressions are not; unfortunately it seems to
 have gotten the logic backwards.
2021-06-21 15:26:34 -04:00
mgrojo
5097760fe6 CSV Import: use file before it is removed by destructor
The reading of a QTemporaryFile must be done before the object it's destroyed,
otherwise the file is removed.

This was broken since 09aaaccace

Reported in issue #2749.
2021-06-20 18:39:50 +02:00
mgrojo
6510bb104e Improve support for BLOB columns as primary key
Working cases tables without rowid and BLOB as primary key:
- Inserted value is actually TEXT, for example, from the text editor in the
  GUI.
- Inserted value is really BLOB, for example, from the binary editor or
  from SQL and the data is fully binary.

Not yet working case:
- Inserted value is of type BLOB, but the actual data is recognized by
  DB Browser as text. In this case, no type affinity is applied by
  SQLite and the row is not properly selected.

See issue #2738
2021-06-19 00:07:35 +02:00
mgrojo
0f8b3cc092 Merge pull request #2741
Workaround for WindowsVista style (qwindowsvistastyle plugin)

There is some strange bug on windows with the system styles (windows
and windowsvista).  When styleproxy is used and QDockWidget has a
custom stylesheet applied to the widget title, close-button and
float-button are rendered huge.

See #2485
2021-06-18 23:11:13 +02:00
mgrojo
3bb0b96ed2 Avoid warning in DB4SProxyStyle 2021-06-18 23:09:27 +02:00
Nikolay Zlatev
ee6a5046da Application: Move DB4SProxyStyle before MainWindow is created.
DB4SProxyStyle is set before any Widget is created.
QGuiApplication::primaryScreen() is used as a screen.
Now custom QPalette can be set before MainWindows is created,
for example exported palette from KDE (Breeze, Breeze Dark, etc).
2021-06-15 14:10:40 +03:00