Commit Graph

447 Commits

Author SHA1 Message Date
Martin Kleusberg
6057edaaf1 qmake: Avoid 'double linking' of qcustomplot library 2014-04-23 20:45:32 +02:00
Peinthor Rene
fdbda563d4 plot: only allow X column to be selected once 2014-04-23 19:54:07 +02:00
Rene Peinthor
0ecff2caa2 cmake: build qcustomplot as static lib and fix windows build 2014-04-23 08:31:53 +02:00
Martin Kleusberg
9e73f31a18 Reset plot dock after closing a DB
Reset the new plot widget after closing a database.
2014-04-22 22:28:01 +02:00
Martin Kleusberg
d1ed2d151f Update the recordset label in the Browse tab after closing a DB
Reset the recordset label in the Browse Data tab of the main window
after closing a DB file.
See issue #44.
2014-04-22 22:21:46 +02:00
Martin Kleusberg
a7110ea0fc Clear the tree widget in the Structure tab when after closing a DB
Clear the tree widget in the 'Database Structure' tab of the main window
after closing a database.
See issue #44.
2014-04-22 22:08:27 +02:00
Martin Kleusberg
f451beef0d Update qmake files
As promised, here is me updating the qmake project files in order to
allow building the new version with qmake instead of cmake.
2014-04-20 12:36:21 +02:00
Peinthor Rene
956dde9a59 plot: wrong date format 2014-04-19 22:44:28 +02:00
Peinthor Rene
0b2a61d213 better visualize the log from the execute sql tab 2014-04-19 22:20:04 +02:00
Peinthor Rene
88ccd48173 plotting: add a simple mechanism to visualize data
added a plotting dock, where you can select x and y axis
and it will draw a chart out of it
2014-04-19 22:19:32 +02:00
Peinthor Rene
75de1fa795 fix a bug in our mainwindow ui design
it wasn't possible to add new tab pages from the qt designer
added a QWidget container with a vertical layout as this is
done also if you create a new empty mainwindow
2014-03-07 21:04:57 +01:00
Martin Kleusberg
30cef84f09 Add CSV export to context menu of the Database Structure tab
Add an entry for the CSV export to the context menu of the Database
Structure tab of the main windows as well which preselects the currently
selected table.

When opening the CSV export dialog via the standard menu also preselect
the currently selected table when the Database Structure tab is active.
2014-02-14 16:40:44 +01:00
Martin Kleusberg
4cd5131d1a ExportCsvDialog: Set table selection to current table in Browse Data tab
When called while the Browse Data tab of the main window is selected
also select the current table or view in the ExportCsvDialog.

Sort the table names in the combobox of the ExportCsvDialog.
2014-02-14 16:22:51 +01:00
Martin Kleusberg
393a58be73 Sort db objects in Database Structure tab by their name 2014-02-14 16:12:09 +01:00
Peinthor Rene
2552249cf8 fix bug, if there is no NL in the last line comment #40
if there was no NL in the line comment we ran into an
endless recursion, now we check for that corner case.
2014-02-14 13:41:15 +01:00
Peinthor Rene
de1fb9ff2f qt5: full qt5 compability
ifdef rest of the code which can't be ported 100%
add CMake option USE_QT5 to use qt5 ;)
Thanks to stretchtiberius for initial patch
2014-02-14 00:28:42 +01:00
Peinthor Rene
58ec477344 use begin/end resetmodel 2014-02-13 23:59:13 +01:00
Peinthor Rene
5a9b1672a7 qt5: include QMimeData 2014-02-13 23:52:35 +01:00
Peinthor Rene
202b6c915e qt5: toAscii() -> toLatin1() 2014-02-13 23:52:03 +01:00
Peinthor Rene
9ce88b8619 show the statement failed to parse 2014-02-12 19:17:55 +01:00
Peinthor Rene
192ee9c0a8 add unittest for non ascii characters 2014-02-12 19:15:27 +01:00
Peinthor Rene
7ad887b0b3 Fix lexer to allow a lot more unicode characters in column and table identifier 2014-02-12 19:13:58 +01:00
Martin Kleusberg
35c571ba7b SqlExecutionArea: Replace UTF8 paragraph separator by newline char
When the user selects multiple lines of SQL code and hits F5 to execute
them the execution stops after the first line because we use the
selectedText() method of the QTextCursor class to get the selected text
and this method returns Unicode U+2029 paragraph separator characters
instead of newline \n characters.
(see http://qt-project.org/doc/qt-4.8/qtextcursor.html#selectedText)
Fix this by replacing these by regular newline characters to.
2014-02-10 13:56:22 +01:00
Martin Kleusberg
6ab8cf3dd3 MainWindow: Update execute query table view when no results returned
Also update the table view widget and the status message in the Execute
Query tab of the main window when the query was valid but returned no
results.

Fixes #38.
2014-02-07 20:14:17 +01:00
Peinthor Rene
9f811e18dd qt4 still has activated for combobox, too much search and replace 2014-01-18 19:47:35 +01:00
Peinthor Rene
f373340c0b activated() is old qt3 support signal use triggered() 2014-01-18 19:28:25 +01:00
Martin Kleusberg
0ae6f1895e Allow space characters in table and index names, disallow ` chars
Spaces in table, index and field names are actually allowed by SQLite,
so no need to check for them.
However, "`" characters cause problems when appearing in SQL statements
so disallow them instead.
2014-01-16 19:56:58 +01:00
Martin Kleusberg
0632ecc35f Further simplification of the qmake files
I missed two lines when removing all traces of the version script, so
delete them now.
2014-01-14 21:50:54 +01:00
Martin Kleusberg
3b45f0fe26 Re-introduce basic qmake support
Allow building the project using qmake as discussed on commit
88f66be89e. This lacks the support for generating a dynamic version
number from the Git log though and obviously most of the nice features
of CMake.
2014-01-14 21:36:34 +01:00
Peinthor Rene
88f66be89e get rid of the version.sh script and also drop support for qmake building 2014-01-12 21:59:06 +01:00
Martin Kleusberg
044907f655 Fix infinite loop when executing some SQL statements with limit part
Issue #31 was about some problems in the SqliteTableModel which caused
an endless loop in the Execute SQL tab when executing statements with a
LIMIT part that didn't end with a semicolon. This was fixed in 0362d615fd
but the regular expression in this commit only worked for statements
like 'SELECT * FROM t LIMIT 0,10' and didn't detect a statement like
'SELECT * FROM t LIMIT 10' where there is only one number after 'limit',
so the bug still ocurred for those commands. This is fixed by this
commit.
2014-01-01 14:45:27 +01:00
Martin Kleusberg
190deca0c3 Fix version.sh script to run on non-bash shells
Most non-bash(like) shells don't support command line arguments for the
echo command and print them like regular text. On these systems an
invalid gen_version.h file is generated. This can be fixed by using
printf instead of echo which works the same on all Unix systems.

Also fix the detection whether the gen_version.h file changed before
rewriting it. This prevents creating a file with exactly the same content
but a newer timestamp and therefore make deciding to recompile all files
including it.
2014-01-01 14:15:26 +01:00
Peinthor Rene
1e2ee439ea fix memory leak 2013-12-24 20:01:18 +01:00
Peinthor Rene
be1ba804c6 add a version check feature
this is only enabled on windows as there is no package manager handling the versions
and we don't want users to stay on old versions forever
2013-12-02 16:52:48 +01:00
Martin Kleusberg
6ff8ba2fdb ExtendedTableWidget: Fix bug when just copying one cell
The code for copying the selected cells to the clipboard doesn't work
when there is just one cell selected. Fix the code by including a
special handling for this case which returns the content of the single
selected cell without any quotes or the like.
2013-11-30 14:08:19 +01:00
Peinthor Rene
9214cfbc21 add a unittest for the keyword in column name issue 2013-11-24 10:26:32 +01:00
Peinthor Rene
331455cf20 the token .txt file isn't needed by the build 2013-11-24 10:26:08 +01:00
Peinthor Rene
fd89ef72a6 Fix an issue with keywords in table or column names
note: table names are a bit more restrictive than column names
And btw. you can always have any name you want, just put it in quotes.
2013-11-24 10:23:55 +01:00
Peinthor Rene
94819f22e2 for loop pre-increment optimization's and a slight syntax style change 2013-09-20 14:49:07 +02:00
Peinthor Rene
1bac11348f include cleanup 2013-09-19 22:55:35 +02:00
Peinthor Rene
4a231c5dfe increase size of AboutDialog so all the text fits 2013-09-10 17:05:57 +02:00
Martin Kleusberg
97f1d165aa Update license information
Remove reference to public domain license from readme file.

Delete the old licensing file while keeping a reference to the author of
the icons we use.

Delete the Qt license file as we're not shipping any Qt code at all.
2013-09-10 11:01:53 +02:00
Martin Kleusberg
785a9be751 AboutDialog: Change license information
Also change the licensing information in the about dialog from public
domain to GPL3.
2013-09-09 21:39:26 +02:00
Martin Kleusberg
c01a890992 MainWindow: Support deleting multiple rows at once
When multiple rows are selected in the Browse Data tab of the main
window and the delete record button is clicked delete all selected rows
and not just one of them.
2013-09-07 12:15:56 +02:00
Martin Kleusberg
bc2511434e SqliteTableModel: Fix bug in last commit to support multiline strings
Fix a bug in the last commit to correctly remove comments on multi-line
queries.
2013-09-06 14:30:50 +02:00
Martin Kleusberg
169eccbebb SqliteTableModel: Remove comments from SQL queries
Remove any single line comments from the SQL queries to fix all those
problems ocurring when a query ending with such a comment is inserted
into the COUNT query.

Executing the query
SELECT * FROM table -- comment
would otherwise lead to this one being executed as well
SELECT COUNT(*) FROM (SELECT * FROM table -- comment);
This is obviously invalid SQL and therefore returns no data, sometimes
even crashing the application, even though the original statement by the
user is perfectly fine.

The code used in this commit is a bit of a workaround and should be
replaced as soon as there is a more complete SQL parser supporting SQL
comments in our grammar tools.

Closes #31.
2013-09-06 14:08:33 +02:00
Martin Kleusberg
a98c96e314 SqliteTableModel: Fix invalid SQL syntax if there's already a LIMIT
Fix the syntax of the SQL string generated by fetchData() if there is
already a LIMIT statement at the end of the query. In this case don't
add an additional one. This fixes half of issue #31.
2013-09-06 12:22:25 +02:00
Martin Kleusberg
26d5645671 SqliteTableModel: Don't add LIMIT to query if it is a PRAGMA or EXPLAIN
Don't add a "LIMIT x,y" at the end of the query in fetchData() when it
is a PRAGMA or EXPLAIN statement. This way correct SQL code is produced
and it also fixes an endless loop when the statement didn't end in a
semicolon.
2013-07-19 22:36:28 +02:00
Martin Kleusberg
427581f51d MainWindow: Don't cancel after one INSERT or the like in SQL tab
When executing multiple INSERT/UPDATE/... statements don't cancel after
the first one. Also don't try to load them into the SqliteTableModel
class - it won't work and just generates a warning.
2013-07-19 22:13:08 +02:00
Martin Kleusberg
16b5be4a8b DbStructureModel: Also send table data when dragging one
When using drag & drop on a table also send the entire content of that
table.
2013-07-19 22:06:34 +02:00