Commit Graph

58 Commits

Author SHA1 Message Date
Martin Kleusberg
37a5645bf5 Fix some shadow warnings 2018-11-15 15:24:00 +01: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
GortiZ
e7752d7398 KUbuntu 14.04 support restored (#1298)
* - [NEW] Add new interface and functionality to manage database file extension. (Implements feature request #659)

* - [FIX] Fixed CMake file to src.pro

* - Applied changes requested by mgrojo to uniform code with sqlitebrowser standards
- Add "history" when closing editor window, but reopen before closing preferences
- Revert some changes done by QtCreator

* Refuse from previous commit

* Additional changes requested by MKleusberg:
- [CHG] Always add "All files (*)" to filters
- [FIX] Removed unused include

* merged from master

* Merge sqlitebrowser master

* [FIX] Fixed compatibility to compile on KUbuntu 14.04 with Qt 5.2.1

* [FIX] Fix Qt version for QOpenGLWidget support on previous commit

* [CHG] Uniformed QT_VERSION_CHECK style
[CHG] Reverted macOS check on Mainwindow for OpenGL context creation
2018-05-20 15:56:01 +02:00
Martin Kleusberg
abf70ea7bd Use nullptr instead of NULL 2018-05-16 19:20:36 +02:00
Martin Kleusberg
ee32b3e4e1 Use nullptr where possible 2017-10-30 21:20:02 +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
24ee209bef dbhub: Use URL returned by server 2017-10-05 22:38:01 +02:00
Justin Clift
d73859736d dbhub: Use a fixed format string when transmitting last modified dates 2017-10-02 12:58:30 +01:00
Justin Clift
64b33413fb dbhub: Include TZ with lastmodified date sent to server 2017-10-02 00:05:12 +01:00
Martin Kleusberg
c692ae0de5 dbhub: When pushing a database, save the new commit id and/or the file
When pushing a local database to the remote server, the new commit id is
returned. Grab that id and insert it into the database of local
checkouts. If there already is an entry for the given file, update that
record. When doing an initial push of a database, also copy the source
database file to our checkout directory to avoid redownloading the file
upon first use.

This should eliminate all unnecessary database downloads, both after
doing the initial push and after committing a modified database.
2017-09-30 16:05:01 +02:00
Martin Kleusberg
8c0e4bfdaa dbhub: Send last modified date when pushing database
Also add some code for receiving the last modified data when fetching
but we're not yet able to set it.
2017-09-30 14:47:19 +02:00
Martin Kleusberg
f926a67dba dbhub: Add foce push option to push dialog 2017-09-30 14:07:18 +02:00
Martin Kleusberg
b2ddcdd470 dbhub: Only keep one record per checked out file
Instead of just adding and adding records to the local checkout
database, search for a previous checkout and update its record. This
avoids all sorts of problems in the rest of the code which always
assumed that there is only one record per file.
2017-09-30 13:35:40 +02:00
Martin Kleusberg
f18064f0ae dbhub: Change schema of local database
Also delete the upgrade mechanism that was put in place because it won't
be that easy anyway later on.
2017-09-30 13:02:18 +02:00
Martin Kleusberg
fef884a4e1 dbhub: Send last known commit id along with the database when pushing 2017-09-30 12:57:46 +02:00
Martin Kleusberg
8a540a2745 dbhub: Add column for branches to local database 2017-09-30 12:43:50 +02:00
Martin Kleusberg
4dc5286596 dbhub: Fix possible crash
This fixes a crash that occurs if there is an error while fetching
something other than a database and no database has been downloaded
before, e.g. when getting the root directory listing fails.
2017-09-25 14:36:31 +02:00
Martin Kleusberg
08e5f532ce dbhub: Fix branch list in push dialog
The JSON format generated by the server has changed.
2017-09-08 14:49:59 +02:00
Martin Kleusberg
4339119377 dbhub: Support pushing to different branches than "master" 2017-09-03 13:20:27 +02:00
Martin Kleusberg
ab7f0cf4af dbhub: Ask user what to do when trying to open an updated database
If there is a local clone of a remote database but the remote database
has been updated to a newer version in the meantime, we're now asking
the user what to do. The choice is between downloading the newer version
and overwriting the local one with all the changes it might have
contained or opening the local version and not downloading anything.

See issue #1096.
2017-09-01 18:54:55 +02:00
Martin Kleusberg
300affa839 dbhub: Optimise code 2017-09-01 13:56:05 +02:00
Martin Kleusberg
f830f4265c dbhub: Fix progress dialog for very large files
See issue #1095.
2017-09-01 12:36:20 +02:00
Martin Kleusberg
6cac6643f1 dbhub: Remove closing "." from the progress dialog
See issue #1095.
2017-09-01 11:27:28 +02:00
Martin Kleusberg
516ff44789 dbhub: Redownload database if local copy has been deleted
See issue #1111.
2017-09-01 09:57:44 +02:00
Justin Clift
0c20582edb Stop crash causing event storm for uploading progress dialog 2017-08-17 21:59:50 +01:00
Martin Kleusberg
84615258af dbhub: Push databases using the POST method instead of PUT 2017-08-15 21:22:05 +02:00
Martin Kleusberg
38caf867bc dbhub: Refresh the directory list when a database upload has finished 2017-08-13 14:53:19 +02:00
Martin Kleusberg
0da9e1c3e0 dbhub: Don't tolerate host name mismatch errors
These were only accepted for debug purposes and shouldn't occur in an
actual installation.
2017-08-13 13:45:59 +02:00
Martin Kleusberg
17cf3ad7d9 dbhub: Support multiple simultaneous downloads/uploads of databases
This feature isn't explicitly available via the UI (yet) but should
prevent errors when the user is faster than the network connection, e.g.
when opening two directories very quickly.
2017-08-13 13:42:30 +02:00
Martin Kleusberg
09319001ea dbhub: Don't read entire file at once when pushing it to remote server 2017-08-13 13:24:36 +02:00
Martin Kleusberg
3d1f2062f9 dbhub: Also clear access cache when pushing a database as other user 2017-08-12 21:49:32 +02:00
Martin Kleusberg
d5e922f204 dbhub: Fix progress dialog when fetching/pushing db after cancelling 2017-08-12 18:59:59 +02:00
Martin Kleusberg
1c7cc24b15 dbhub: Improve push database UI
This adds a new Push Database dialog which lets you specify the database
name, the licence, a commit message, and the visibility of the database.
2017-08-12 14:58:30 +02:00
Martin Kleusberg
f458ac37bf dbhub: Fix wrong certificate being used
When changing the client certificate we need to clear the authentication
and access cache of our Qt network access manager instance. If we don't
do so, Qt might decide to use the old certificate information which is
still in the cache for some recurring queries.
2017-08-03 20:31:18 +02:00
Martin Kleusberg
e08ebffd63 dbhub: Improve UI for pushing databases
This improves the user experience for pushing database files. Before
this you had to type in the entire URL for pushing, e.g.:
https://db4s-beta.dbhub.io:5550/username/databasename
With this the host name as well as the user name is taken from the
currently active client certificate. So all you have to type in now is
the database name. And for this we make a sensible automatic suggestion
based on the name of the local file you're trying to push.

Note that while this makes pushing databases a lot easier, it still
doesn't implement proper version control or any extra code for handling
conflicts etc.
2017-08-03 19:02:42 +02:00
Martin Kleusberg
d14fb1fbb1 dbhub: Remove remote menu, add push button to remote dock
This commit removes the File -> Remote menu entirely. The only menu item
that was left was the Save to Remote item which is replaces by a button
in the remote dock.

The button is only enabled when a database file is opened and the user
has logged in using a certificate.

Clicking the button opens the same dialog and performs the same actions
as before. The only difference is that we don't use the first client
certificate - no matter which one it is - but instead use the client
certificate that was used for logging in.
2017-08-03 17:35:36 +02:00
Martin Kleusberg
917e33ff95 dbhub: Fix local version control code 2017-08-02 17:43:40 +02:00
Martin Kleusberg
e17fb6f8ca dbhub: Use commit id instead of version number
This changes all the code to use the commit id of a database version
instead of a version number. This means changing the UI, the code for
the communication with dhhub.io, and the internal database for storing
information on downloaded databases.

The last step makes it necessary to delete that database file on your
system, so it will be recreated! Please do that :)
2017-07-28 14:22:10 +02:00
Justin Clift
ec916226b0 Add dodgy temporary workaround for Qt OSX's missing cert verify() 2017-04-06 20:37:31 +01:00
Martin Kleusberg
43a5175af1 dbhub: Keep track of the cloned databases
This adds a local database to keep track of all the cloned databases.
For now we only use this information to prevent exactly the same
database being downloaded twice.
2017-03-23 19:08:26 +01:00
Martin Kleusberg
b5d352bcdc Fix includes 2017-03-20 23:19:57 +01:00
Martin Kleusberg
f1194d845e Rename all the settings accessor functions
Rename the settings accessor functions from Settings::getSettingsValue()
(and similar) to Settings::getValue() (and similar). The 'Settings' bit
seems a bit redundant and costs a lot of screen space.
2017-03-20 23:16:52 +01:00
Martin Kleusberg
e6390b4d22 dbhub: Automatically generate a file name to save a database under
When fetching a remote database automatically generate a file name to
save the database as instead of asking the user for a path and name.

Also add a preferences option to set the directory for all cloned remote
databases.

This is obviously a trade-off: on the one hand this makes opening remote
databases simpler (it's just a double click), on the other hand it takes
control away from the users. The main reason for doing this, however, is
to indicate to the user that the cloned databases are going to be
controlled by DB4S. We have to keep track of the local databases in
order to update them from the right place, push them back to the right
place, etc. And because the local copies are under DB4S control we don't
want the user to move, rename, or delete them.
2017-03-20 23:06:58 +01:00
Martin Kleusberg
1e9fec270b Merge automatic update check into dbhub.io code
Move the network part of the automatic version check code into the
dbhub.io parts. While semantically this doesn't make a lot of sense it
simplifies the code a bit, reduces the size of the main window class,
and avoids duplication of code e.g. when introducing proxy support.
2017-03-19 17:29:20 +01:00
Martin Kleusberg
dec1c6acb1 dbhub: Code refactoring 2017-03-19 16:56:14 +01:00
Martin Kleusberg
7426e2c143 dbhub: Fix progress dialog
Fix progress dialog interfering with the save file dialog.

Fix cancelling of progress dialog. Before this you couldn't download a
file anymore after cancelling a download.
2017-03-18 21:36:09 +01:00
Martin Kleusberg
3e4f3fc3d2 dbhub: Add remote dock with directory browsing support
This adds a new dock to the main window that contains all the remote
functionality (or is supposed to contain it all in the future).

It also adds a directory browsing feature which allows you to browse
through the folders and files on the dbhub server.

By double clicking a database you can download and open it. The Open
Remote menu action isn't needed anymore and has been removed.

This also fixes an issue with pushing databases where, after sending the
file is completed, the save dialog was opened.

Note that this is still WIP and is far from polished.
2017-03-18 20:40:59 +01:00
Justin Clift
c6f1373ba9 Trivial typo fix 2016-11-08 01:21:35 +00:00
Martin Kleusberg
df5e604e6e dbhub: Add support for sending files
NOt perfect yet but a start.
2016-11-07 23:38:51 +01:00
Martin Kleusberg
eeeec5f2fc dbhub: Use certificate manager to get client cert for authentication
When trying to fetch a database don't load a hardcoded client
certificate but grab one from the certificate manager in the preferences
dialog.

Also add support for password protected private keys.

Note: Since this is all testing code on the front-end side, we just use
the first certificate in case multiple certificates are configured.
2016-11-06 14:50:27 +01:00