Commit Graph

2175 Commits

Author SHA1 Message Date
mgrojo 882fc8d3d3 Merge pull request #1246 from sqlitebrowser/save_filter_as_view
Save current filter, sort column and display formats as a new view
2017-12-01 21:51:47 +01:00
mgrojo 5da3d14ee3 Fixed issues from @MKleusber's review
New view name validated with isNull().

Text in information box reworded.

Column names are preserved in the new view, except for the ones with
display formats, for which an underline is appended in order to fix the
reported filtering defect.
2017-12-01 19:28:57 +01:00
Martin Kleusberg e79c5db308 Manually set the keyboard shortcut for the Find/Replace dialog to Ctrl+H
Make sure the keyboard shortcut for the Find & Replace dialog is always
set to Ctrl+H instead of using Qt's QKeySequence::Replace. At least on
KDE desktops but probably on other systems too it break the Ctrl+R
shortcut which is used for refresh and SQL execution.
2017-12-01 13:52:02 +01:00
Martin Kleusberg 16263452c8 plot: Correctly restore Y axis check states
When restoring the plot state we always checked set the use-on-y-axis
checkbox when a colour was defined for a field. This is correct most of
the times because a field doesn't have a colour as long as it's not used
in the plot. However, when you uncheck a field it keeps its colour which
starts causing issues as soon these settings are reloaded.

The solution is to not only store the colour but also the check state
independently. This changes the project files format though, so the code
needs to support loading old and new file formats.

See issue #1245.
2017-12-01 13:03:48 +01:00
mgrojo dcc0c32c39 Avoid adding an empty row in the clipboard data
This part from 3aef8adc9a is undone, because
it adds an empty row in the clipboard data. The whole loop can be rethought
later, if necessary.
2017-11-30 22:48:45 +01:00
mgrojo c1f2306106 Remove no longer used method SqlExecutionArea::saveAsView()
It was moved to MainWindow for reuse and this copy was no longer used.
2017-11-30 22:44:16 +01:00
mgrojo e5f7456863 Save current filter, sort column and display formats as a new view
A new button is added to the Browse Data tab for saving the current display
of the table (current filter, sort column and display formats) as a new
view. This allows (specially for non advanced users) the creation of simple
views. It can be seen, either as a way of storing the current
filtering or as an easy way of creating views.

This reuses the query set in sqlitetablemodel, but the column aliases when
a display format is used has been changed from col%1 to the original column
names, i.e. format(`orig`) AS `orig`.
2017-11-30 20:41:21 +01:00
Martin Kleusberg b1e42d08c6 Avoid some warnings 2017-11-29 22:22:05 +01:00
Martin Kleusberg 3aef8adc9a Clean up copy & paste code
Also add some TODO comments in preparation for #1244.
2017-11-29 22:17:22 +01:00
mgrojo d486a9ff64 Error indicators in JSON mode editor
Improve the feedback to the user for invalid JSON data using error
indicators like the SQL editor.

Do not select all the text in the JSON mode, in order to see the
syntax highlighting while browsing.

Fix the logic in the case of not compacting/prettifying.

Change "Indent" to "Pretty print" in preferences for coherence to
JSON Export dialog (actually it is not only indentation).

Do not underline error style font, so it does not overlap with
error indicators.

See issue #1173
2017-11-27 22:10:10 +01:00
mgrojo 42d2feb99b Actually change the shortcut for Copy with Headers to Ctrl+Shift+C
The change in commit 82665e3f09 only
affected the label in the context menu.
2017-11-26 14:21:20 +01:00
mgrojo c9bf5f87cb Find/Replace dialog improvements
Find/Replace dialog does not block the main window.

Dialog reused, so checks changed by user are preserved.

The selection of the last occurrence in Find All and Replace All
is cleared, so all the occurrences have the same appearance.
2017-11-26 01:19:33 +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
mgrojo ce06845b36 Folding issues related to the Scintilla JSON lexer
Applied patch from:
https://sourceforge.net/p/scintilla/code/merge-requests/19/

See this thread for info:
https://groups.google.com/forum/#!topic/scintilla-interest/w4sW3sM6Cek

This is merged into Scintilla, so it might come fixed in a future
release.

This should solve the folding issue reported in #1173
2017-11-24 19:31:47 +01:00
mgrojo 189f19695a JSON validation before applying data to cell
A warning dialog is popped-up for confirming application of
invalid JSON data. Parse error is shown in the dialog.

*.json added to import filter.

See issue #1173
2017-11-24 00:27:48 +01:00
Martin Kleusberg 8687bfa3c3 Also apply table view settings to the SQL result tables
Use the same font settings for the result table views in the Execute SQL
tabs as for the Browse Data table view.

See issue #1240.
2017-11-23 17:15:29 +01:00
Martin Kleusberg 0d7ca9b5be Support pasting single value into multiple cells
This adds support for pasting a single value into all selected cells in
the Browse Data tab in order to mimic the behaviour of standard
spreadsheet application more closely.
2017-11-23 17:03:57 +01:00
mgrojo 67c5ed963e Compact and indent on JSON cell editor
New setting for enabling the following feature:
when JSON data is loaded in the JSON cell editor, the text is
indented. Before JSON data written back into the cell, the text
is compacted.

See issue #1173

Minor adjustment in preference label: removed ":" for consistency.
2017-11-23 00:39:17 +01:00
Justin Clift 24267749ea Updated OSX section to mention 10.13 works 2017-11-22 00:28:44 +00:00
SourceTrigger 0a995423fa Source trigger patch file drop (#1236)
* Add Signal if File dropped

* Check if Index is valid

Send Signal and return if Index is invalid and File was dropped

* Connect Dropsignal to fileopen
2017-11-20 21:05:47 +01:00
Justin Clift 09e170f75d Fix typo in German translation. Thanks @weldwatcher :) 2017-11-20 15:58:25 +00:00
SourceTrigger de2131daea Improve 4k/5k resolution rendering speed on macOS/OSX (#1233)
Initialize OpenGL rendering on macOS by add a hidden QOpenGLWidget.
2017-11-20 14:44:37 +00:00
Justin Clift 12ee94cee9 Adding our license files to the Win install list 2017-11-19 21:29:41 +00:00
mgrojo b26948da14 Fix white over grey at invalid JSON in current line
The default style for invalid JSON or unclosed strings uses red
background and white foreground, but the current line has
precedence, so it is by default white over grey. We change the
default to something more readable for the current line at
invalid JSON. See issue #1173.
2017-11-19 21:20:33 +01:00
mgrojo 24a573dc68 Minor icon changes
New icons in resources from our icon set: Silk from
famfamfam.com

Icon for close. Applied to the find bar (see issue #191).

New icon for special copy. Applied to the "Copy with
Headers" option.

Removed the execution permission from some icon files.
2017-11-19 14:59:55 +01:00
mgrojo a457d29fe2 Fix one case for the error visual hint in the SQL results pane 2017-11-19 01:11:20 +01:00
mgrojo 87e1b9bc7c Usability improvements for Extended Table Widget and SQL
results pane

Copy for multi-line text data surrounds the text with the
<pre> tag in the HTML version for avoiding line white-space
adjustments in the pasted text. See #1058

Do not use binary data in the "Use as Filter" option.

Indicate the existence of an error in the background of the
SQL results frame. The error-indicators is reused for
disabling this functionality.

When nothing is shown, a placeholder text hints the
objective of the results pane.

The preference label for the font size of this pane is
modified for consistency (SQL Log is another widget).
2017-11-19 00:57:42 +01:00
mgrojo e60e9ffc75 Clipboard improvements: HTML and avoid pasting image from LibreCalc
Both "Copy" and "Copy with Headers" write in HTML and text format to the
system clipboard, when the selection includes more than one cell. This lets
the pasting application choose the most appropriate format.

Images have now no precedence over text when requesting the clipboard
content, so pasting from applications like LibreCalc, that set both formats
in the clipboard, works as expected, instead of pasting an image of the
copied text.

Copying and pasting inside the DB4S should not be affected, since the
application requests the text format and uses the internal buffer when
necessary (binary data included).

Related issue: #1058
2017-11-18 21:39:54 +01:00
Martin Kleusberg 28d53ef990 Fix qmake build
See issue #1231.
2017-11-18 18:24:21 +01:00
mgrojo 2da8fa7347 Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2017-11-18 16:47:59 +01:00
mgrojo 934ee7808a Added files to fix the build for JSON editor mode 2017-11-18 16:47:31 +01:00
mgrojo c80b8452cc Merge branch 'json_cell_edit' 2017-11-18 16:29:06 +01:00
mgrojo 3c910a9e59 JSON mode for cell editor
Support for JSON in the Database Cell editor using the QScintilla library.

The lexJSON lexer has been added to the compilation, including the
necessary files from the QScintilla source package.

See issue #1173
2017-11-18 16:28:38 +01:00
mgrojo 71091b5cb3 Merge branch 'json_cell_edit' 2017-11-18 16:11:43 +01:00
mgrojo 279c419df9 JSON mode for cell editor
Support for JSON in the Database Cell editor using the QScintilla library.

The lexJSON lexer has been added to the compilation, including the
necessary files from the QScintilla source package.

See issue #1173
2017-11-18 16:10:07 +01: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
Martin Kleusberg 73946400c3 Work around a bug in Qt which causes high pings for Wifi connections
See issue #1209.
2017-11-18 11:47:56 +01:00
Martin Kleusberg 514d5b703b Add "Date as dd/mm/yyyy" display format
Also reorganise the format functions to match the order of the dropbox
items.

See issue #1213.
2017-11-18 11:34:49 +01:00
Martin Kleusberg 2b68afb664 Rename function
Rename the DBBrowserDB::renameColumn() function to alterTable() because
it can do a lot more than just renaming a column.
2017-11-18 11:24:05 +01:00
Martin Kleusberg c502c2e819 Set default tab back to Database Structure
This was changed by accident (I think) in commit
9ce4b232ba.
2017-11-17 23:56:38 +01:00
Martin Kleusberg 5fbf5ca1b2 Change label of "Delete record" button to reflect number of records
Change the label of the "Delete record" button in the Browse Data tab to
"Delete records" when multiple records are selected.

See issue #856.
2017-11-17 23:46:13 +01:00
Justin Clift 75d35c6301 Typo fix 2017-11-17 22:26:49 +00:00
Justin Clift b7057bfa1f Include TIFF and WebP image formats with our Windows builds 2017-11-17 22:24:45 +00:00
mgr 1d701adec7 Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2017-11-17 23:07:30 +01:00
mgr ccc332c1bb Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2017-11-17 22:57:54 +01:00
Justin Clift e0be4d86c2 Add TIFF and WebP license info 2017-11-17 21:57:52 +00:00
mgr e242fc84ee Search bar improvements
New button and key sequence (ESC) to close the search bar.

Clear selection (by not avoiding the search) when the text to search is
deleted, as expected by @pamtbaau at #1220.
2017-11-17 22:56:15 +01:00
Martin Kleusberg 3b511f83c3 Fix crash when exporting SQL files
Exporting SQL files crashed because of the multi-threaded loading of
data which also affects the SQL export. Because the table models were
destructed relatively quickly during the export's progress estimation,
their threads were still running and trying to access invalid data
structures.

See issue #1228.
2017-11-17 13:36:44 +01:00
Martin Kleusberg ccb1fd4ca8 Fix loading settings in Export SQL dialog
Due to a copy-paste error we weren't loading the values of the
checkboxes in the Export SQL dialog correctly.
2017-11-17 13:35:40 +01:00