Commit graph

8102 commits

Author SHA1 Message Date
Tomaz Canabrava
32b0afa3e7 Move Tankinfomodel to its own file
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:10:30 -07:00
Tomaz Canabrava
f432b764e7 Move DivePlannerModel and CylinderModel to qt-models
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.

A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.

I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:09:13 -07:00
Tomaz Canabrava
6e4aa7d044 Move CleanerTableModel to its own file
models.h / .cpp was getting too big (around 2.5k lines), and each change
triggered a rebuild in tons of parts of Subsurface, this is the first
commit trying to make the models code sane by removing them all of the
models.h/cpp file and also clearning code in the process.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:08:36 -07:00
Tomaz Canabrava
338c0f22aa Move the models to its own folder
This is an attempt to help share code between the desktop version of
Subsurface and the mobile version.
More code will be moved around and the models will be split in a way that
will help recompile times and also creation of different interfaces for
different form-factors.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:07:54 -07:00
Dirk Hohndel
29e7459d6b Remote storage: second attempt to fix build with older libgit2
That was embarrassing...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 21:43:32 -07:00
Salvador Cuñat
64ba7f8683 Correctly save dive rating after changing it
Corrects typo in ebaa7d1fd which impeded that changes in dive rating
were saved after editing.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 16:12:37 -07:00
Dirk Hohndel
c6e0b74452 Remote storage: turns out you need a newer libgit2
I was afraid that this would only work with a farily current git master of
libgit2 and it turns out I was right. The API was available, but the
correct type wasn't.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 16:09:29 -07:00
Dirk Hohndel
61c0d0c73d Remote storage: collect email and PIN in preferences
This allows entering / storing the PIN (aka passphrase) for the ssh key.
The email isn't used, yet - this will be used by the automated backend to
create a unique git repository that will turn into the remote storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:40:06 -07:00
Dirk Hohndel
c90635cef2 Remote storage: add preferences UI
This isn't hooked up at all right now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:39:53 -07:00
Dirk Hohndel
43254a70ca Remote storage: provide credentials for ssh based remotes
The key location is hard coded as this is only intended for our own
infrastructure, so we don't need multiple keys.

If the private key is protected by a passphrase, this needs to be manually
added to the preferences. As RemoteStorage->passphrase.

This has only be tested with a current version of libgit2 master, but
should compile with any previous version (the API doesn't exist in v0.19
and earlier - that's handled with appropriate #if clauses).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:39:35 -07:00
Dirk Hohndel
20d1d2c385 Remote storage: add preference for the passphrase
While we don't expose it as this to the user, we'll need an ssh key and
potentially a passphrase in order to communicate with the git server in
our infrastructure. This simply sets up a way to store the passphrase.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:38:59 -07:00
Dirk Hohndel
95664af53b Add USE_LIBGIT23_API as cmake option
Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.

Simply call cmake with -DUSE_LIBGIT23_API

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 09:13:51 -07:00
Guillaume GARDET
8af85fbc04 Documentation: Merge/update french user-manual translation
Merge/update french user-manual translation.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 08:18:01 -07:00
Robert C. Helling
22bfc4936f Add explicit casts to silence compiler warnings
clang complais when converting (char *) to (unsigned char *), so tell
it it's fine.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 08:16:37 -07:00
Dirk Hohndel
e3215123d1 Fix parsing of git branch encoded in file name
If the folder has a trailing '/' we picked the wrong substring as branch
name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 08:14:16 -07:00
Anton Lundin
b76a0f0b97 Wire gui for diagnostic logs from dc configuration
This copies peaces from the downloadfromdivecomputer dialog into the
configuredivecomputerdialog and connects them to be able to create a
logfile form the configuration of the divecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:50 -07:00
Anton Lundin
4321ef1d88 Enable diagnostic logs from dc configuration
This implements support for writing debug/diagnostic logs when
configuring dive computers and upgrading the firmware.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:43 -07:00
Anton Lundin
4124052b38 Remove the lastError from DeviceThreads
There is no reason for the DeviceThreads to keep a copy of the last
error around, so this removes that code.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:37 -07:00
Anton Lundin
f7be6daacc Remove unused variables and methods
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:27 -07:00
Anton Lundin
d850a67ce8 Restructure ReadSettingsThread::run
This moves the dc_device_close call inside the if case for
dc_device_open, to get rid of the special error case and to look and
behave the same as the other ::run calls.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:16 -07:00
Dirk Hohndel
a8c013869b Strip the default suffix if saving to git branch
For some reason the file selection dialog box now always adds a default
suffix to the file name we pick - which results in our test for git
storage to fail.

So if the filename looks like "<path>[branch].ssrf" then remove the suffix
that was added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 11:14:26 -07:00
Dirk Hohndel
17b7bdfd2e Fix crash when rejecting dive site changes
Emitting the stopFilterDiveSite signal caused us to clean up the UI which
reset currentDs to NULL if this was a new dive site...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 07:53:14 -07:00
Dirk Hohndel
d6e32b02f6 Start editing new site regardless what the user does first
It doesn't matter if we first enter coordinates, name, description or
notes. If there is no currentDs we need to handle that gracefully.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 06:36:19 -07:00
Dirk Hohndel
bfee0a13f0 Dive site management: make sure currentDs is valid
When double clicking on the globe on a dive with no dive site we did
almost the right thing - except that we didn't create a dive site.

Not 100% sure this is the right place to do this, but it seems to work and
prevents the crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 06:31:34 -07:00
Tomaz Canabrava
c6783739c9 Expand trips that are filtered on dive_site_manage
While filtering we would have trips that were collapsed, but this doesn't
really make much sense while managing dive_sites.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:49:19 -07:00
Tomaz Canabrava
ffffccee93 Filter out the dives that are not at dive_site.
Untested code to filter out dives that are not at the active dive_site.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:48:45 -07:00
Tomaz Canabrava
ee7e511372 Create signals/slots for filtering the dive_site,
The dive site management requires that we filter all the dives that are on
the current dive_site, this is the preparatory work for that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:48:22 -07:00
Tomaz Canabrava
785051c9dd Only repopulate model when needed.
The old way we set the location and *then* updated the model, so the very
first location that we tried to show was empty.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:55 -07:00
Tomaz Canabrava
b7ec57bdef Show the correct dive_site on the manage combobox
When triggering the dive_site management, we need to get the uuid that was
send to us and set it as the current dive_site on the combobox, the dialog
can fill all required info for us.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:21 -07:00
Tomaz Canabrava
609688b489 Do not create a new dive site when curr is invalid
We will however create a new dive site when the user clicks on the add
button - creating it here would led to strange behavior.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:02 -07:00
Tomaz Canabrava
562ee7410c Don't setLocationId when accept/reject changes
setLocationId will filter the dives, so ignore the visual changes when
accepting / rejecting, it will only be triggered again when we are showing
this dialog again.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:46:29 -07:00
Tomaz Canabrava
46aa97bfc4 Do not set the dive_site when changing dives
We should only set the dive_site on the dive site management widget when
we are going to use that information, this is because the dive_site
management widget will filter all dives on the dive list.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:45:54 -07:00
Robert C. Helling
44f5a72822 Allow a comma in decimal GPS coordinates
this is the format used by Google maps and thus this...

Fixes #875

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 12:14:40 -07:00
Rick Walsh
ffa6a23590 Correct default RFCOMM channel in documentation
The default RFCOMM channel is 1, not 0 as previously stated in FAQ and
user manual.  This patch corrects it.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 12:14:06 -07:00
Dirk Hohndel
ed57442bf7 Layout issues: Fix rating/visibility vs suit
The suit field should take up all the remaining space and the stars should
be vertically centered with the text.

This looks much better

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:15 -07:00
Tomaz Canabrava
8f2f9164fc Layout issues: Fix the Profile/Toolbar
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:15 -07:00
Tomaz Canabrava
adb61b38ea Do not connect null to a signal
The parent here should have been the mainwindow, but we create this dialog
on the stack instead of the heap and because of that we don't set the
parent to prevent a double free.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
f17f4ec9a0 Layout issues: Fix planner layout
Layout was wrong.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
0f7061b93e Layout issues: Fix DownloadFromDiveComputer
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
4a52f44ae3 Layout issues: Fix DiveShare export dialog
One more.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
307ad174ae Layout issues: Fix the DiveImportDialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:11 -07:00
Tomaz Canabrava
42acaa40f5 Layout issues: Fix the export dialog
This patch makes the export dialog more consistent with the rest of
Subsurface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:21 -07:00
Tomaz Canabrava
946615b8d7 Layout issues: Major rework on the MainTab
This seems almost perfect now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:14 -07:00
Tomaz Canabrava
d5013a7883 Layout issues: Fix spacing for the filter dialog
This is the single filter dialog - the spacing is much better, but when
activated it seems cluttered, this is because the outer layout (the one
that encapsulates everything) has the wrong layouting - I need to find and
fix that. I'll actually change that to a splitter, it will provide a more
flexible resize of the widgets.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:08 -07:00
Tomaz Canabrava
a46cc691dc Layout issues: Fix issues in other places of the MainTab
Also, added tooltips to the Tab Texts.
I need to fix the layout issues of the Equipments, but that's not inside
the UI. Things are much more sane now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:55 -07:00
Tomaz Canabrava
d801bd622a Layout issues: Fix the layout ugliness on Mac & Linux
I seem to have found a sane way to create layouts:
If it's the 'outer' layout, the one that encapsulates everything:
- Horizontal Spacing: 5
- Vertical Spacing: 5

If it's a vertical inner layout that is grouping items like label +
control:
- Spacing: 0
This way the label will be 'touching' the item, without empty space, so
you know that the label refers to that widget.

If it's an horizontal inner layout:
- Spacing: 5
Different from the Vertical Layout, we don't want to make horizontal items
touch each other, a bit of space is fundamental to the eyes.

If it's a Grid Layout:
- Vertical Space: 0
- Horizontal Space: 5

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:49 -07:00
Tomaz Canabrava
7d1df992fa Layout issues: Remove auto layout management from mainwindow.cpp
While this worked for a bit, it was very error prone as it relied in
layout having specific names, and layouts in the .ui files are treated as
substandard items. Every time a 'break layout' command is issues (and it's
issued quite a lot when trying to reorganize the items on the widget) all
layout items are removed and new ones are added later, without any of the
names.

Since the new layout can be different the old names are not usefull
anymore - and a clean compilation won't trigger a single warning either:
the name resolution is done at runtime and not at compile time, so it
would just fail silently.

Instead of brute-forcing each layout to have 0,0 or 5,5 margins, we should
put the correct values on the .ui files.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:35 -07:00
Tomaz Canabrava
0fdb87b011 Use group of files to show the project hierarchy
This doesn't work on QtCreator yet - but it's the documented way in CMake
to display the project hierarchy in some IDEs (the one that I know that it
works with is Visual Studio). Even knowing that this doesn't work with
QtCreator, it's a valid change because someone can fix creator in the
future.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:10:41 -07:00
Dirk Hohndel
1a97d011bf Remove rules and control files for Ubuntu 12.04
Since we got rid of all the Qt4 support there is no point in having those
files around anymore, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:52:10 -07:00
Tomaz Canabrava
38456cbaac Remove support for Qt4 (part 8)
Also remove some of the code for building on Ubuntu 12.04.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:37:23 -07:00