Commit Graph

171 Commits

Author SHA1 Message Date
mgrojo
217563fd47 Dialog and foreground configuration for conditional formats
A new dialog for editing conditional formats that can be invoked from the
filter line editor or from the data browser contextual menus. The dialog
allows adding and removing conditional formats, changing the priority order
and editing foreground colour, background colour and filter condition.

The conditional formats have been expanded to allow defining the foreground
colour. By default is the setting configured by user.

This is a continuation of the functionality introduced in PR #1503.
2019-03-23 22:14:18 +01:00
Justin Clift
064514a919 Update our Win32 builds to use MSVC 2015 instead of MSVC 2013
This is so the new JSON library we're using doesn't break things. :)

Note also the "8.1" added to the end of the vcvars line in the batch
file, so the correct SDK is selected.

Without it, when both MSVC 2015 & MSVC 2017 are installed, the MSVC
2015 installation (by default) will be unable to find rc.exe.
2019-03-10 21:07:55 +11:00
Martin Kleusberg
e59100f297 Use Niels Lohmann's JSON library instead of Qt's
Replace Qt's own JSON library functions by Niels Lohmann's JSON library
in the Export JSON dialog. This was necessary because for very large
JSON objects Qt's library functions generated incomplete JSON exports.

See issue #1789.
2019-03-08 12:26:17 +01:00
Scott Furry
543b98ec55 Enable build against external QCustomPlot (#1784)
* Enable build against external QCustomPlot

Source-base distribution has stand-alone QCustomPlot library package.
Feature request is to modify the build instructions to enable use of
external library, rather than building internal supplied library,
with cmd-line switch.

If unable to locate external library, fallback to building internal QCustomPlot.
Build internal is on by default.

* Enable build against external QCustomPlot #1784 - revised

Invert naming/logic:
FORCE_INTERNAL_QCUSTOMPLOT=ON(default) will build QCustomPlot library provided sources
(consistent with current processes)

FORCE_INTERNAL_QCUSTOMPLOT=OFF will search for external QCustomPlot library on system and
fall back to internal if not found.

[github #1784]
2019-03-06 12:29:42 +01:00
Scott Furry
b4af221ee1 Improve FindQScintilla.cmake functioning
Changes depend on successful find_package(Qt5...) call and when
building against external QScintilla.

Modified FindQScintilla.cmake providing extra hints of locations
to search for needed header files. Hints include paths based on
where Qt5 is installed. Presuming Unix/Linux distributions will
put QScintilla header files under Qt5 header folders.
2019-03-06 10:27:28 +01:00
mgrojo
ed178689a4 New setting allowing to set a dark style using a style-sheet
A new setting allows to follow the system style or set a new dark style
based on a the style-sheet provided by
https://github.com/ColinDuquesnoy/QDarkStyleSheet
The style-sheet is licensed under the MIT license. Images contained in
that project are licensed under CC-BY license.

Pending issues:

- Use of stylesheets is incompatible to QPalette. Some colours for
previewing settings in the Preferences dialog are eclipsed by the style-
sheet
See https://github.com/ColinDuquesnoy/QDarkStyleSheet/issues/48

- Changing the style should select matching background and foreground
colours for the Browse Data and SQL tabs in Preferences.

See issues #1751 #1493 and #1738
2019-02-22 22:15:19 +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
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
b182d9520e Use Qt 5.12.1 for our Win64 nightly builds 2019-02-06 16:28:19 +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
Tien Do
4f939285fc refactor: find correct QScintilla package 2019-01-24 16:06:37 +07:00
Justin Clift
573bcdb7d0 Use Qt 5.11.3 for our Win64 nightly builds 2018-12-22 22:44:15 +11:00
Justin Clift
1181687115 Update Windows x64 nightly build to use Qt 5.12.0 2018-12-11 19:34:58 +11:00
Feyn-Man
6431998470 Italian translation (#1584)
Partial Italian translation for now.  Will be continued later as time permits.
2018-12-08 14:39:34 +11:00
Martin Kleusberg
7e0ff3061b Move code for running SQL statements into a separate class
This is only done for better readability and for easing future changes.
No major logic changes intended here.
2018-12-05 18:37:52 +01:00
Karim ElDeeb
9f28851d00 Allow overriding a library path from the commandline when using CMake on Windows
Change the path of used libraries to a cache entry instead of a normal variable. More info https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry

If you are automating Windows build, you have to change the path of every library in CMakeLists.txt, to match your system, after every update to DB4S source.

This commit will set every library path to a cache entry instead of a normal value so it can be changed from the commandline using the `-D` flag.

For example, to change Qt5 path run `cmake -DQT5_PATH=/path/to/qt5 ...` to let CMake use this path instead of the one in CMakeLists.txt. This doesn't affect the current used paths and they will continue to work, and be used, if they are not replaced on the commandline.
2018-12-01 15:58:48 +02:00
Justin Clift
bd2cd99f2d Remove all references to VSREDIST too
Missed from the previous commit
2018-11-24 21:39:09 +11:00
Justin Clift
c01e6d3e85 Remove CPack pieces and winlaunch.bat, as they're no longer needed 2018-11-24 21:15:45 +11:00
Justin Clift
058f2acd14 Typo fix in a comment 2018-11-24 10:12:41 +11:00
Justin Clift
17193d96f3 Update Win x64 builds to use MSVC 2017 2018-11-24 05:39:37 +11:00
Martin Kleusberg
ed06c0289e Move query generation from SqliteTableModel into a separate class 2018-11-08 16:20:34 +01:00
Martin Kleusberg
35a5b43ce0 Move SQL object classes into a separate directory 2018-11-08 16:20:33 +01:00
Manuel
abb6f686a3 Initial implementation of "conditional formatting" (#1503)
After setting a filter, the user can select from the context menu in the
filter line a new option "Use for Conditional Format", that assigns
automatically a colour to the background of cells fulfilling that
condition.

The formatting is preserved after the user has removed the filter. Several
conditional formats can be successively added to a column using different
filters.

The conditional formats of a column can be cleared when the filter is empty
selecting "Clear All Conditional Formats" from the filter line context
menu.

The conditional formats are saved and loaded in project files as other
browse table settings.

A new class Palette has been added for reusing the automatic colour
assignment of the Plot Dock. It takes into account the theme kind of the
application (dark, light) for the colour selection.

A new class CondFormat for using the conditional formatting settings from
several classes. The conversion of a filter string from our format to an
SQL condition has been moved here for reuse in filters and conditional
formatting.

Whether the conditional format applies is resolved by SQLite, so filters
and conditional formats give the same exact results.

Code for getting a pragma value has been reused for getting the condition
result, and consequently renamed to selectSingleCell.

Possible future improvement:
- New dialog for editing the conditional formatting (at least colour and
application order of conditions, but maybe too: adding new conditions and
editing the condition itself).
2018-10-30 21:22:14 +01:00
Justin Clift
4a39e343db Update Qt path for the 64-bit Windows nightly builds 2018-10-19 18:41:06 +11:00
Justin Clift
00b57a79dd Update version number of the nightly builds to 3.11.99 2018-10-08 17:48:12 +11:00
Manuel
ce032d95e6 Issue #530: constraints on table prevents new record being added (#1477)
* Issue #530: constraints on table prevents new record being added

This adds a new dialog for adding records to a table. The current approach
is broken for several cases where foreign keys and check constraints are
impeding the insertion of an empty record. With the dialog, the user can
inspect the constraints (tooltip) and type of fields and add values
consistent with the requirements. The data is only inserted when the user
presses the Save button.

The dialog is modelled after the Edit Table or Edit Index dialog. An upper
frame allows entering the data using widgets. The lower frame previews the
SQL statement that will be used.

The old approach for adding records is still accessible pressing Tab on
the last cell of the table.

* Fix build problem introduced in previous commit on this branch

* Dialog as fallback for failure after empty row insertion and read only text

The insertion of an empty row is always tried. When it fails due to
constraints and foreign keys, the Add Record Dialog is open so the user
can enter values for the new record considering the constraints.

When the table has not constraints, or the row insertion provides valid
values, the user is still able to insert rows using the simple approach.

SQL preview in dialog is now read-only.

* Visual improvements for the Add Record dialog

QLineEdit as item delegate for the value, so it is more visible that we
are supposed to edit the value.

Remove last end-of-line in tool-tip.

* Improvements in the "Add Record" dialog

Display of NULL values using DisplayRole (no focus) or place holder text
(when focus).

Set value to NULL through a context menu and shortcut in the value line
edit.

Take text type affinity into account for quoting or not entered numbers.
New isType and affinity functions in sqlitetypes.

Clarify wording of constraints in tooltip for value. Added the same tooltip
for the type.

Escape quotes inside string values.

Removed unused parameters warnings.

Other wording or code improvements based on the pull-request review: #1477.

* User access to the Add Record dialog

The Add Record dialog is now accessible for the user. The New Record button
is converted to a QToolButton and a new pop-up menu is added to it for
invoking the in-line table insertion (New Record) or the Add Record dialog
(Insert Values...). What's This information for the button updated.
2018-08-27 21:35:09 +02:00
Justin Clift
a1c982c158 CentOS 7 provides CMake 2.8.12.2, so this commit moves the min version to that
For #1488.
2018-08-10 15:01:06 +01:00
Justin Clift
1b7ba4a7e7 Update Qt path for build server to use Qt 5.8 2018-07-15 17:33:10 +01:00
Justin Clift
eccc6f269c Update Qt path for build server to use Qt 5.9.6 2018-07-15 12:29:19 +01:00
Justin Clift
9a76537aa4 Fix Win compile failure
* Revert c861f1b9d9, as it's breaking
  the MSVC 2013 compile.
* Move the new OUTPUT_NAME line slightly, so it's recognised
2018-07-13 00:46:14 +01:00
Justin Clift
6a2c4511f1 Update Win x64 Qt path for our build server 2018-07-12 22:28:16 +01:00
Martin Kleusberg
5a339ea9d0 Fix cmake build on Windows
See issue #1471.
2018-07-12 20:44:02 +02:00
Marcin Mikołajczak
44920ce098 i18n: Add Polish translation (#1456)
Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
2018-07-10 23:12:28 +02:00
Iulian Onofrei
961141ec36 Replace deprecated qt5_use_modules function (#1419)
* Replace deprecated qt5_use_modules function

* Fix includes that fall under a larger module

* Bump minimum Cmake version to use newer features and properly use libs

* Replace deprecated qt5_use_modules function and bump minimum CMake version to 3.1.0 for 3rd party libraries
2018-07-10 20:57:55 +02:00
Iulian Onofrei
3cdc65a63f Add automatic crypted databases open via dotenvs (#1404)
* Rename confusing variables

* Fix some project warnings

* Fix code style

* Add constant for the default page size

* Move KeyFormats enum to CipherSettings

* Fix code style

* Fix memory leak

* Stop relying on CipherDialog for encryption settings management

* Fix code style

* Add .env format for QSettings

* Add automatic crypted databases open via dotenvs

This adds support for `.env` files next to the crypted databases that
are to be opened that contains the needed cipher settings.

The only required one is the plain-text password as a value for the key
with the name of the database like this:

    myCryptedDatabase.sqlite = MyPassword

This way, databases with a different extension are supported too:

    myCryptedDatabase.db = MyPassword

You can also specify a custom page size adding a different line
(anywhere in the file) like this:

    myCryptedDatabase.db_pageSize = 2048

If not specified, `1024` is used.

You can also specify the format of the specified key using the
associated integer id:

    anotherCryptedDatabase.sqlite = 0xCAFEBABE
    anotherCryptedDatabase.sqlite_keyFormat = 1

where `1` means a Raw key. If not specified, `0` is used, which means a
simple text Passphrase.

Dotenv files (`.env`) are already used on other platforms and by
different tools to manage environment variables, and it's recommended
to be ignored from version control systems, so they won't leak.

* Add new files to CMakeLists

* Move DotenvFormat include to the implementation

* Fix build error

* Remove superfluous method

(related to ac51c23)

* Remove superfluous checks

* Fix memory leaks

(introduced by 94bbb46)

* Fix code style

* Make dotenv related variable and comment clearer

* Remove duplicated code

* Remove unused forward declaration

(introduced by e5a0293)
2018-07-10 20:46:17 +02:00
Martin Kleusberg
3da520cdd1 Clean up multi threading patch, fix build and some bugs
Make strings translatable, remove some more debug code, fix tests,
reduce size of patch slightly, remove weird tooltip, don't crash when
closing database, simplify code, fix filters, don't link agains pthread
on Windows.
2018-06-08 22:46:47 +02:00
Martin Kleusberg
51dbe72e23 Multi-threading patch
This was done by Michael Krause.
https://lists.sqlitebrowser.org/pipermail/db4s-dev/2018-February/000305.html

In this commit I only fixed two compiler warnings, some whitespace
issues and removed some debug messages.
2018-06-08 22:46:47 +02:00
Karim ElDeeb
b69e7cd034 Add build version to the nightly builds (#1390)
Make the Windows nightly build versioning information meaningful. ;)
2018-05-20 13:54:24 +01:00
Justin Clift
e43ed17162 Include the Qt XML dll in our installation package 2018-01-30 20:34:57 +00:00
mgrojo
7c9fe7039c Merge branch 'master' into xml_cell_edit
# Conflicts:
#	src/EditDialog.cpp
#	src/ExtendedScintilla.cpp
2018-01-27 19:01:08 +01:00
Giuseppe Zizza
a993c19853 File Extension management interface (#659)
[NEW] Add new interface and functionality to manage database file
extension. (Implements feature request #659)
2018-01-13 16:43:24 +01:00
Martin Kleusberg
5562119563 Move check for binary data into separate function
There are two places in the code where we check for binary data in
database cells. This commit takes the code and moves it into a separate
function so it's easier to improve the situation in both function
simultaneously.
2017-12-31 15:25:01 +01:00
mgrojo
a0e0fc98ae XML mode for the cell editor
The new editor mode shares the same Scintilla widget as the JSON mode.
The JsonTextEdit class has been generalised. Future modes supported by
Scintilla could be added with the current pattern. As a consequence, the
EditMode is not always equal to the current stacked widget.

Some code in EditDialog has been refactored, so it is easier to understand
and modified with so many modes. textNullSet has been replaced by the use
of dataType as Null.

SVG is promoted to a new recognised data type, so it can be edited in the
XML mode.

The XML data is formatted and validated following the pattern established
by the JSON mode.

New modules are needed by the XML mode: the Qt XML module and some new
Scintilla files required by the HTML/XML lexer.

The indent_compact was incorrectly named in Setting::getDefaultValue.

See issue #1253.
2017-12-23 22:19:17 +01:00
mgrojo
8896ecca40 Refactoring and find/replace dialog in the JSON editor.
SQL and JSON text editor classes have been refactored. A new parent class
for both editors have been added for the common logic implementable without
depending on the specific lexer.

The only visible effect of this change should be that the JSON editor
(issue #1173) now has the same find/replace dialog as the SQL editor.

This prepares for the implementation of the XML editor (issue #1253).
2017-12-16 00:09:47 +01:00
mgrojo
82665e3f09 Find/Replace dialog for SQL editors and logs
A classic Find/Replace dialog including all the options provided
by the QScintilla editor. Additionally a "Replace All" and a
Find All" button are implemented. This complements issue #191

New shortcut in main window for opening the find/replace dialog
connected to the focused widget. Standard for Replace is Ctrl+H.
Consequently the shortcut for Copy with Headers is changed to
Ctrl+Shift+C (see issue #1058).

For SQL text widgets not embedded in the main window, the standard
shortcut cannot be enabled, otherwise it conflicts with the main
window. Therefore the shortcut Ctrl+Shift+H is enabled for all the
SQL widgets as fallback. A better solution would be desirable.
2017-11-25 21:39:41 +01:00
Justin Clift
12ee94cee9 Adding our license files to the Win install list 2017-11-19 21:29:41 +00:00
mgrojo
ae55de4aee Merge branch 'json_cell_edit' 2017-11-18 15:00:15 +01:00
mgrojo
c832d8a58c JSON mode for cell editor
Support for JSON in the Database Cell editor using the QScintilla library.

The lexJSON has been added to the compilation.

See issue #1173
2017-11-18 14:57:36 +01:00
Justin Clift
b7057bfa1f Include TIFF and WebP image formats with our Windows builds 2017-11-17 22:24:45 +00:00
Justin Clift
9016bf6dc7 Include Qt image format plugins with the Windows installers 2017-11-03 17:53:49 +00:00