Commit Graph

526 Commits

Author SHA1 Message Date
Martin Kleusberg
9cb0614ecf Grammar: Parse NOT LIKE constraints correctly
Parse column constraints with a 'NOT LIKE' expression correctly. For
example in a table definition like this:
CREATE TABLE not_working(
    value TEXT CONSTRAINT "value" CHECK(value NOT LIKE "prefix%")
);

This fixes issue #40.
2014-06-20 12:47:20 +02:00
Peinthor Rene
682561fbb9 editdialog: accept shortcut for CTRL+Enter 2014-06-19 16:08:44 +02:00
Martin Kleusberg
2136813bd6 MainWindow: Add Ctrl+Return shortcut for executing SQL and add tooltips
Add the Ctrl+Return shortcut for executing the current SQL again. This
needs to be done using C++ code instead of setting it in Qt Designer
because setting multiple shortcuts in the latter means defining a key
sequence row.

Also add the keyboard shortcuts to the tooltips of the buttons as they
didn't appear anywhere in the program.
2014-06-14 13:51:12 +02:00
Peinthor Rene
651e3bf146 edittable dialog: add splitter and better default size
I added a splitter and set better expanding properties
2014-06-13 18:14:09 +02:00
Peinthor Rene
25fe80f5f9 remove Ctrl+Return shortcut from executing sql
somehow neither F5 nor Ctrl+Return would work in that combination
2014-06-13 18:02:17 +02:00
Martin Kleusberg
f1e5502d50 Fix bug in filter function when havin multiple filters
Since commit 707323067d there has been a
bug in the SqliteTableModel::setQuery method which rendered the filters
useless when using them on multiple columns: Because this method is
called whenever a filter value is changed and because it deleted the
internal representation of the filters all filters except the one last
modified were deleted but still shown in the UI.
2014-06-12 19:54:09 +02:00
Martin Kleusberg
2b65bbcea2 EditDialog: Fix text editor when NULL chars are typed in hex editor
When using the hex editor widget of the Edit Dialog to insert a NULL
character and then changing to the text editor without saving and
reopening the window first lead to the text being truncated at the NULL
character.
2014-06-12 18:53:53 +02:00
Martin Kleusberg
b407704959 EditDialog: Use Monospace font in text editor 2014-06-12 18:51:23 +02:00
Peinthor Rene
f246ddde1e correctly extract check expression from AST 2014-06-11 22:48:51 +02:00
Peinthor Rene
55d8c9f9d8 add a test with create table with IN 2014-06-11 22:48:51 +02:00
Peinthor Rene
b02b36b2a2 fix create table statements with IN operator
fixes issue #34
IN wasn't added to the token list and not enabled in the suffix expression
as this gives a parser generator warning, because of an ambiguity with IN as an operator
we stick with the warning right now
2014-06-11 22:48:51 +02:00
Martin Kleusberg
1e787b4d22 sqbpro: Allow relative database file paths
When the path to the database file given in a project file doesn't exist
try parsing it relative to the path of the loaded project file. This
makes it possible to move project and database file around together
without need to manually correct the path in the project file.

See #36.
2014-06-11 21:01:06 +02:00
Martin Kleusberg
daf12d413c Remove unnecessary overloaded function 2014-06-08 12:48:53 +02:00
Martin Kleusberg
210207d135 MacOS: Update plist file to include project files as well 2014-06-07 13:41:02 +02:00
Martin Kleusberg
7139ad0086 Show temporary tables and views in Structure and Browse tabs
Also show temporary tables in the Database Structure and the Browse Data
tabs as well as in the export dialogs etc.
2014-06-07 13:38:24 +02:00
Martin Kleusberg
8c8187740d MainWindow: Increase default size, tabify docks by default
Increase the default size of the main window a bit.

Move the SQL log dock to the right side and tabify it with the plot
dock. This way there is much more space for actual information by
default.

The idea behind both changes is to make it easier for first time users
to find their way around and offer them a more appropriate window layout
for the usual tasks. The layout is still entirely configurable and
non-first-time users are not affected at all.
2014-06-07 00:14:50 +02:00
Martin Kleusberg
62622ae8e8 Add support for basic project files
This add support for saving and loading of SQLiteBrowser project files.
As of now these files contain a reference to the used database file,
store some window and widget settings as well as the content of the SQL
tabs.

Note that while working this is a first draft only. Especially the
parsing code still might contain a bug or two and there is a lot more
information to be added to these files later (like filters, plot
settings, etc.).

Also note that the main intention behind these project files was to make
the life of users easier while not getting into the way of those who don't
need them. The program still remains a database browser and doesn't
become a visual database studio thing.
2014-06-06 23:32:35 +02:00
Martin Kleusberg
6e5c98b653 Grammar: Allow 'NULL' constraints
Allow NULL constraints in a column definition when parsing a CREATE
TABLE statement. Before this only NOT NULL constraints were parsed
correctly even though NULL is proper SQL as well - it's just a redundant
information.
2014-06-04 20:50:08 +02:00
Martin Kleusberg
5e1169b43d MainWindow: Keep column widths for each table in Browse Data tab
Store the column widths of the table view widget for each table/view
individually and restore them when changing back to the table/view.
2014-06-01 19:47:20 +02:00
Martin Kleusberg
2aaf7345ff Reduce scope of some variables 2014-05-30 19:13:43 +02:00
Peinthor Rene
040be65489 fix memory leak 2014-05-30 18:59:59 +02:00
Martin Kleusberg
f8b2dd0ee3 ExportCsvDialog: Add option to define custom quote/separator chars
Make it possible to use other quote and separator characters than those
predefined in the respective combo boxes when exporting a CSV file.

See issue #23.
2014-05-30 18:11:49 +02:00
Martin Kleusberg
55435e2703 ImportCsvDialog: Add options to define custom quote/separator chars
Make it possible to use other quote and separator characters than those
predefined in the respective combo boxes when importing a CSV file.

See issue #23.
2014-05-30 17:54:13 +02:00
Martin Kleusberg
a209e840b8 EditTableDialog: Also update the SQL when type is automatically changed
Also update the internal table representation and thus the SQL string at
the bottom of the window when the type of a column is changed
automatically, e.g. when the AI checkbox is clicked.

Closes #24.
2014-05-27 20:13:18 +02:00
Martin Kleusberg
2fcb131c25 MainWindow: Add keyboard shortcut for 'Write Changes' action
Closes #22.
2014-05-27 09:56:02 +02:00
Shouqun Liu
ccfdf55840 Add High DPI text rendering support for Mac OSX.
For text render, adding 'NSHighResolutionCapable' key into plist fixes
high-dpi display
2014-05-26 16:26:31 +08:00
Martin Kleusberg
ae4d04f9b1 EditDialog: Show warning when editing binary data in text mode 2014-05-25 17:30:57 +02:00
Martin Kleusberg
41296e3ac0 EditDialog: Increase size to fit the hex editor widget entirely 2014-05-25 17:15:28 +02:00
Martin Kleusberg
c1bbbac56b CreateIndexDialog: Sort tables names alphabetically
Sort the table names in the combo box in the CreateIndexDialog
alphabetically.

Add the table icon to each entry of the combo box - not because there
are any possible object types other than tables here but just for
improved consistency with the rest of the UI.
2014-05-25 14:42:57 +02:00
Martin Kleusberg
297bfbce0a Move filter header from window to table widget and show sort indicators
Move the FilterTableHeader object from the MainWindow to the
ExtendedTableWidget class because it actually is a part of the latter,
not the former.

Show sort order arrows in the table header of the Browse Data tab after
clicking it.
2014-05-25 14:35:56 +02:00
Peinthor Rene
80d5c1a117 qt5 different including hit me again 2014-05-25 13:33:11 +02:00
Peinthor Rene
400746c9df remove virtual from MainWindow class
it is veeerryy unlikely anyone will ever extend this class
2014-05-25 13:24:22 +02:00
Peinthor Rene
f7315f5f90 add a few more help menu entries
website, wiki, bug report
2014-05-25 12:58:01 +02:00
Martin Kleusberg
7b9a120d42 EditDialog: Improve handling of binary data in text mode
Make the EditDialog a bit more user friendly when editing binary data in
text mode:

Don't change back to the hex editor after changing any character.

Show the full binary data even if it contains a NULL byte.

Also (though a bit unrelated) disable rich text input for the text widget.

This partially fixes issue #19.
2014-05-25 11:53:31 +02:00
Peinthor Rene
516d71f146 Don't show cells with long text values as BLOB
Don't show cells with a text value longer than 1024 characters as
'(BLOB)'.

Also don't change back to binary mode in the EditDialog after manually
switching to the text mode.

Closes issue #16.
2014-05-24 20:34:03 +02:00
Martin Kleusberg
42501d31fe Fix some strings in the MainWindow form file
Change the tool tips and help texts for the navigation buttons in the
Browse Data tab. They were still referring to the old concept of pages
of 1000 records.
2014-05-24 20:24:20 +02:00
Martin Kleusberg
ca56fb9f4a Fix project file 2014-05-24 20:19:48 +02:00
Martin Kleusberg
c24fa1fcbc Translation: Begin German translation 2014-05-24 20:12:24 +02:00
Martin Kleusberg
dac1ed1fdb Fix last commit.
Still had some debug code in there. Sorry!!
2014-05-24 20:03:13 +02:00
Martin Kleusberg
51be349c74 Fix loading of translation files
The QTranslator objects need to be stored as class attributes as
otherwise they are destroyed after the Application constructor is done
and translations won't work.
2014-05-24 20:01:22 +02:00
Martin Kleusberg
a6fdb49aa0 CSV import/export: Add pipe character as possible field separator 2014-05-24 19:28:08 +02:00
Justin Clift
f9ffd0d887 Make About dialog larger, so it displays fully on OSX
Also specify font size better for bottom text, which was previously
unreadable on OSX 10.7.
2014-05-20 19:51:41 +01:00
Peinthor Rene
1126b6f7cd plot: windows or qt4 doesn't like empty column headers 2014-05-17 10:31:45 +02:00
Peinthor Rene
b5e5d3b0c5 updater: show the url we got from the release file 2014-05-16 18:29:13 +02:00
Peinthor Rene
1fdf3e4fd4 updater: exit a possible redirect loop 2014-05-16 18:24:26 +02:00
Peinthor Rene
edab586c08 plot: rescale to all drawn axis
I did miss this call on the customplot widget
2014-05-16 18:02:32 +02:00
Peinthor Rene
39ab238ddd plot: only select a color on double click
otherwise we will get some random globalcolor from qt
2014-05-16 17:49:42 +02:00
Peinthor Rene
a4f8ee7721 plot: swap Y and X column
also add a dummy column so the color isn't shown the rest of the row
2014-05-16 17:37:12 +02:00
Peinthor Rene
404274be32 plot: keep the color between model updates 2014-05-16 17:32:25 +02:00
Martin Kleusberg
dc54c548b7 Implement file associations on MacOS by reacting on QFileOpenEvent
Remove the deactivated MacOS dependent code for reacting on Cocoa events
for file associations from main.cpp

Try to implement the same functionality by reacting on QFileOpenEvent in
the Application class.
2014-05-15 17:52:00 +02:00