Commit Graph

3615 Commits

Author SHA1 Message Date
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
Nikolay Zlatev 591c566c65 Application: PM_SmallIconSize (QDockWidgets with custom stylesheet) workaround is applied for windows only.
Screen detection now use QDesktopWidget::screenNumber(const QWidget *widget = nullptr)

toolBarIconSize is set to 18
2021-06-14 13:23:41 +03:00
Nikolay Zlatev c0a75294e2 Application: styleproxy now uses screen->logicalDotsPerInch() 2021-06-13 01:29:55 +03:00
Nikolay Zlatev aada909f03 TableBrowserDock: Change title style 2021-06-12 22:28:06 +03:00
Nikolay Zlatev a39ea9d0a6 Application: Move DB4SProxyStyle to the Application unit.
Set default maximum icon size for QToolBar to 20px, and for MenuItem to 16px,
before that MenuItem icon was bigger than QToolBar icon.

Pixel metric for SmallIconSize is set to 12px to avoid strange
render behaviour for QDockWidget with custom stylesheet.
2021-06-12 22:15:11 +03:00
mgr 36054cd767 Replace all remaining PNG icons by scalable ones and license details
edit_cut.svg: released under public domain by The Tango Desktop Project.
 https://commons.wikimedia.org/wiki/File:Edit-cut.svg

hourglass.svg: from Noto project, released under Apache license. See:
 https://commons.wikimedia.org/wiki/File:Noto_Emoji_Pie_23f3.svg

Remaining ones are from https://codefisher.org/pastel-svg/
see details in `LICENSE-PLUGINS`

package_rename.svg, package_save.svg, clear_sorting.svg and script_copy.svg
are own work based on Pastel SVG and released under the same license.
2021-06-11 22:04:54 +02:00
Manuel 5b89c2c1e4 Merge pull request #2485 from sandman7920/SVG
HiDPI on all platforms and new vectorial icon-set.
2021-06-11 20:51:46 +02:00
Justin Clift 5737b7ad38 Merge pull request #2736 from pgp/master
Fix typo in italian translation
2021-06-10 22:53:46 +10:00
pgp be07d48cdd Fix typo in italian translation
replace 'modifca' with 'modifica'
2021-06-10 10:41:16 +02:00
Nikolay Zlatev bb44fc158b fix indentation (4 spaces) 2021-05-31 23:25:09 +03:00
Martin Kleusberg 6f6113c257 Add basic support for new RETURNING keyword
This adds support for the RETURNING keyword which was introduced in
SQLite 3.35.0 by adding it to the syntax highlighter and the auto
completion as well as adding it to the lexer and parser (though it is
not used by the latter in any significant way).
2021-05-25 22:16:13 +02:00
Martin Kleusberg 6cde3f51ad When modifying a view use DROP VIEW IF EXISTS instead of just DROP VIEW
Clicking on Edit View in the database structure tab opens a new SQL tab
with a DROP VIEW statement to delete the existing view and a copy of the
CREATE VIEW statement used for the current view. When the user modifies
the CREATE VIEW statement introduces an error in it, and then executes
the statements, the view is deleted and an error reported. Fixing that
error and re-running the script then fails at the DROP VIEW statement.
This means it makes more sense to make it a DROP VIEW IF EXISTS
statement.

See issue #2661.
2021-05-23 11:08:46 +02:00
Martin Kleusberg bbfaca2e06 Use LIMIT + OFFSET when generating SELECT statements instead
Instead of constructing queries using the LIMIT offset,limit notation
use the LIMIT limit OFFSET offset style.

See https://www.sqlite.org/lang_select.html#limitoffset.
2021-05-22 10:35:07 +02:00
Martin Kleusberg 3be5969bca Do not always refresh the table browser dock when opening a database
It does not seem like there is a good reason to always refresh the table
browser dock (there is always exactly one at this point) when opening a
database file, even when it is not visible. This only generates
unnecessary queries to the database.
2021-05-22 10:28:49 +02:00
Martin Kleusberg f56288023b dbhub: Avoid ambiguous F5 shortcut
Remove the F5 shortcut for refreshing the DBHub.io remote databases
because it is ambiguous and can make the main view not work as expected.
Since the refresh action is not super important in the DBHub.io dock any
way it is probably best to just remove the shortcut there.

See issue #2695.
2021-05-22 10:10:01 +02:00
Martin Kleusberg 50b48bc756 Avoid multiple error messages when deleting cell values
When multiple cells are selected pressing the Delete key tries to set
all of them to an empty string. In case of a unique constraint or
similar constraints this throws an error. This commit copies the
behaviour of the set to NULL menu action in that it aborts at the first
error to avoid multiple error messages.

See issue #2704.
2021-05-22 09:55:49 +02:00
Martin Kleusberg 8ffe641ae1 Fix d7074bb834
This fixes a bug introduced in d7074bb834.
It turns out we cannot treat the edited table as similar to the other
tables after all.
2021-05-22 09:44:00 +02:00
Juho Lee 4c40400001 Update Korean Translation file (#2624)
* Update Korean L10N Strings for translation

* Fix typo in Korean translation file

* Translate Korean Strings based on the latest master branch
2021-05-21 21:42:38 +02:00
Martin Kleusberg 7c1454e785 Fix possible crash when removing constraints from table definition
This fixes a possible crash when trying to remove a table constraint
from a table definition. The issue was introduced in commit
4e1d1ff49f.

See issue #2670.
2021-05-21 19:49:03 +02:00