Commit Graph

2126 Commits

Author SHA1 Message Date
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
Martin Kleusberg
dd85634f81 Also emit loading finished signal when fetching an empty table set
When fetching data from an empty table or from an SQL query which
doesn't return any rows, we didn't emit the finishedFetch() signal which
is used to indicate that the fetching is completed. This is fixed by
this commit, so that the signal is always emitted no matter the number
of rows returned.

This fixes (probably besides other things) the current row numbers at
the bottom of the Browse Data tab when changing from a non-empty table
to an empty one.
2017-11-17 13:25:04 +01:00
Martin Kleusberg
d0771cb4bd Fix possible crashes when using context menu in Browse Data tab
Deactivate all menu actions in the context menu in the Browse Data tab
if no database file is opened. Without a database the read-only actions
were still enabled and would lead to a crash.

See issue #1228.
2017-11-17 13:20:08 +01:00
Martin Kleusberg
011f7edd1f Remove unused variable 2017-11-17 12:33:52 +01:00
mgr
23155a72d4 Fix bug in the incremental search and in find previous occurrence
Fixed the bug reported by @pamtbaau for the incremental search and the
bug noted by @MKleusberg for the find-previous, both described at #1220
2017-11-16 22:38:16 +01:00
mgr
ade562769a Minor improvements in Plot Dock columns
The Column Field is resized to the content.

The dummy column has been removed and the header no longer stretches the
last section property.

The table has alternating row colors for easy following of the field
checks.
2017-11-13 23:59:36 +01:00
mgr
124b209fa8 Add myself to the list of recipients for Travis notifications. 2017-11-12 23:05:02 +01:00
mgr
9ce4b232ba New shortcut for Copy with Headers and some self-documented shortcuts
Ctrl+H invokes the Copy with Headersers action in the Extended Table Widget
as suggested in #1058.

The following options in context menu display now their shortcuts:
Set to Null, Copy, Copy with Headers and Paste.

Some other shortcuts are now displayed in the corresponding tooltips.
2017-11-12 19:26:39 +01:00
mgr
d8aeae1a6f Avoid displaying an unnecessary horizontal scrollbar in SQL editor widgets
The following scroll width functionalities are added to QScintilla:
setScrollWidth, getScrollWidth, setScrollWidthTracking and
getScrollWidthTracking.

This allows setting a lower value for the initial scroll width (default is
2000 pixels).  Consequently, the horizontal scroll is only visible if the
SQL lines become bigger than window width.

The scroll width, though, is never reduced by Scintilla for performance
reasons.

See this for explanation:
https://github.com/jacobslusser/ScintillaNET/issues/216

And see this for a possible implementation of a fully adjusted scroll
width with fixed-width fonts:
https://groups.google.com/forum/#!topic/scintilla-interest/ly8u7mVDgyQ
2017-11-12 14:32:14 +01:00
mgr
e8e5671588 Range of plot points can be selected in graph and in table
The user is now able of selecting a range of contiguous points in any of
the graphs of the plot, through rectangle selection or click in single
point. This selection triggers automatically the selection of the
corresponding lines in the browsed table. In this way the user can analyse
the plot in detail.

Two other minor improvements: spelling error fixed and the dummy column in
the plot selection table has now transparent foreground (intends to avoid
wondering of the user about what functionality provides this column).
2017-11-11 23:10:11 +01:00
Martin Kleusberg
0c30659b6a Apply find bar visibility to all SQL tabs
If multiple SQL tabs are opened, show or hide the find bar for all of
them when changing the check state of the button. Also apply the find
bar state to newly opened SQL tabs.

This also fixes a crash which would happen if you click the Find button
prior to opening any SQL tabs, i.e. before opening the first database
file.
2017-11-11 19:31:33 +01:00
Martin Kleusberg
bbc1954f16 Fine-tune layout of the search bar
Remove the splitter between editor and find bar.
2017-11-11 19:31:33 +01:00
Martin Kleusberg
75e3171d61 Change SQL search icon 2017-11-11 19:31:33 +01:00
mgr
5b6cdf231e Execute SQL tab: Add search bar for SQL code #191
The find operations in QScintilla are used for implementing a find frame
in the SQL Editor of the main window. A checkable tool button is added
in the SQL Editor toolbar for showing and hiding this frame.

There are check boxes for Whole Words, Case Sensitive and Regular
Expressions. The QScintilla facilities in the findFirst method are used
for the implementation.
2017-11-11 19:31:33 +01:00
Martin Kleusberg
ed9fda28ea Speed up CSV import by not querying the stream position
Avoid querying the position in the text stream using Qt's pos() function
to update the progress dialog. Instead keep track of the stream position
manually. This is possible here because we don't ever seek in the file.
In result, this speeds up the CSV import dramatically.
2017-11-05 12:40:32 +01:00
mgr
a03a901051 Copy rows + header to clipboard
A new option in the context menu of the table widget is added for copying
to clipboard the content of the selected cells prepended with the
appropiate column names.

See issue #1058
2017-11-04 19:53:36 +01:00
Justin Clift
9016bf6dc7 Include Qt image format plugins with the Windows installers 2017-11-03 17:53:49 +00:00
Martin Kleusberg
4d2845c028 Add separate patch file for commit 3a0e29cf28
This way we can keep track of the changed we did to the included third
party libraries.
2017-11-02 23:10:02 +01:00
mgrojo
31e499d9fa Retain display formats (#1202)
The Colum Display Format Dialog recognizes now the current format in the
combo instead of falling back to Custom.

The display format items have been reorganized in groups with separators
in between. This is because the strict alphabetical order looses sense in
the translations.
2017-11-02 23:02:55 +01:00
Martin Kleusberg
60ce9c869b Fix progress dialog for imports of very large CSV files
QProgressDialog only takes an int as the maximum value and the current
value. So using the number of bytes parsed so far isn't going to work
for very large files when an int will overflow. This commit changes this
by precalculating a progress indicator and handing that over to the
QProgressDialog object.

See issue #1212.
2017-11-02 22:56:39 +01:00
Martin Kleusberg
fae7235548 Fix regression introduced by 1ca92cdde3
Turns out this doesn work as expected. So we have to convert the
QVariant to int and then case it to char instead.
2017-11-02 22:39:31 +01:00
Martin Kleusberg
69dc78da3a Fix regression introduced in 955848f957
This fixes a regression which recently was introduced by commit
955848f957. Because the status message was
overwritten by a version without the returned row count, you would never
see the intended status message when running SELECT statements in the
Execute SQL tab.

See issue #1211.
2017-11-02 22:24:55 +01:00
mgr
3a0e29cf28 Fixed incorrect display of SQL calltips containing non-US-ASCII characters.
QScintilla was incorrectly converting the text of the calltips to Latin1
although the encoding was set to UTF-8.

This fixes #1107 (Russian) and  #1206 (Korean).
2017-11-01 20:19:00 +01:00
mgr
c017a2d800 Add support for the special case for empty strings (issue #1189) in the "Use as Filter" option. 2017-11-01 13:25:10 +01:00
Martin Kleusberg
0bc430bfad Show the build date of the nightlies in the About dialog 2017-10-31 18:21:58 +01:00
Martin Kleusberg
3fe181bba7 Explicitly specify the plugins directory on Windows systems
Not sure if this is necessary because the documentation says that it is
automatically added but it's worth a try.

See issue #1188.
2017-10-31 17:58:25 +01:00
Martin Kleusberg
7e0bca5ce3 Add support for filtering for empty strings in Browse Data tab
Add special filters "=''" and "<>''" to the filter row in the Browse
Data tab for filtering for empty string and non-empty-string fields. The
latter also excludes all NULL fields because that's how SQLite works.

See issue #1189.
2017-10-31 13:52:21 +01:00
Martin Kleusberg
2545058111 Support renaming table to a name that's only differs in case
SQLite doesn't support this by itself, so we have to work around it.

See issue #1200.
2017-10-31 13:35:18 +01:00
Martin Kleusberg
87c0476d1c Introduce helper function for generating unique temporary table names 2017-10-31 13:06:27 +01:00
Martin Kleusberg
8ad34abb06 Simplify code 2017-10-31 12:14:29 +01:00
Martin Kleusberg
8b5eb417da Replace Q_NULLPTR by nullptr 2017-10-31 12:12:18 +01:00
Martin Kleusberg
5a14e47419 Mark some more constructors as explicit 2017-10-31 12:11:03 +01:00
Martin Kleusberg
ee32b3e4e1 Use nullptr where possible 2017-10-30 21:20:02 +01:00
Martin Kleusberg
6afcaf6c1f travis: Further reduce download size 2017-10-30 14:13:29 +01:00
Martin Kleusberg
1ca92cdde3 Use our Settings class everywhere
Don't use the QSettings class directly. This keeps the code more
consistent and makes it a bit easier to read. It also means that all
parts of the code profit from the settings cache that we have
implemented in the Settings class.
2017-10-30 13:37:34 +01:00
Martin Kleusberg
9f17176bf6 Simplify code
Does anybody know why this was the way it was?
2017-10-30 13:19:52 +01:00
Martin Kleusberg
3a70b412e8 Turn some slots into normal functions
They aren't used for signal processing at the moment and don't look like
they can be used for that easily.
2017-10-30 13:15:43 +01:00
Martin Kleusberg
7c1ff86900 Fix usage of 'emit' macro
Even though it doesn't expand to anything...
2017-10-30 13:12:28 +01:00
Martin Kleusberg
3bd2dc3bc1 Replace 'foreach' by range-based for loop from C++11 2017-10-30 13:10:08 +01:00
Martin Kleusberg
ac70855ee0 travis: Reduce download size prior to build
This should hopefully build just like before but reduce the number of
packages download when setting up the build environment. This way we
should get our Travis results faster and reduce the number of falsely
reported build errors, too.
2017-10-29 15:59:49 +01:00
Martin Kleusberg
9b309402db Better BLOB detection in the Browse Data tab
This improves the BLOB detection in the Browse Data tab which was
working pretty poorly because it was only looking for null bytes, not
for any other non-printable characters.

See issue #1201.
2017-10-29 13:39:24 +01:00
Martin Kleusberg
557ef399bb Rename "Not null" column to "NN" in Edit Table dialog
The "Not null" text didn't fit in the column width anyway and this makes
it more consistent with the other constraint columns.

See issue #1184.
2017-10-29 13:14:09 +01:00
Martin Kleusberg
4a386dd6a3 Add missing include 2017-10-29 11:37:58 +01:00
Martin Kleusberg
56630a20e5 Don't use system locale when parsing SQL statements
Antlr uses the current system locale when parsing SQL statements. This
is problematic because SQL is case-independent and for converting
characters to lower/upper case it is going to use the locale. For
Turkish however this adds implicit conversions between the dotted and
dotless I which triggers another problem in Antlr: it doesn't cover the
whole Unicode character set. This commit fixes the implicit conversions.

See issue #1194.
2017-10-27 18:42:43 +02:00
Martin Kleusberg
18b781495c Simplify code 2017-10-27 18:36:39 +02:00
Martin Kleusberg
955848f957 Improve detection of query vs. modify statements in Execute SQL tab
This should improve the detection of read-only query statements vs.
modifiying statements in the Execute SQL tab. The idea is to stop
looking for the SELECT keyword at the beginning of the statement and
instead fully rely on whether SQLite returns any data for this
statement.

See issue #1185.
2017-10-27 18:36:39 +02:00
Martin Kleusberg
b9595b9b7e Remove the valid flag from the SqliteTableModel class
Remove the valid flag from the SqliteTableModel class and remove its
usage in the Execute SQL tab of the main window. I believe this hasn't
been used for some time now because the main sources of error should
really be noticed before the query is even handed over to the model.
Additionally the valid flag wasn't as realible either anymore because of
the multi-threaded execution of the model queries.
2017-10-27 18:36:39 +02:00
mgrojo
9fd4ebe0e0 Fixed crashed when editing the display format and the currently browsed table name is actually a view.
Now it is checked the object type before the cast. This avoids the crash and the field name is obtained for each case.
2017-10-27 11:50:38 +02:00
Martin Kleusberg
c69314f566 Fix ampersand not showing up in dialog when renaming SQL tabs
This didn't work on Windows as pointed out by Chris Locke.
2017-10-27 11:30:59 +02:00
Martin Kleusberg
66fa44497d Try to fix build on Windows
See issue #1193.
2017-10-26 23:24:04 +02:00