Commit graph

3175 commits

Author SHA1 Message Date
Robert C. Helling
0d619d569b Planner rebreather mode
Do the switching based on the index rather than the string (which is
translatable!).

Update set-points when turning on/off CCR mode (remeber: the rebreather
mode is stored in two places: the divemode and implicitly in the setpoitns.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:18:48 +13:00
Robert C. Helling
f2939dd991 Minor PSCR fixes
Update O2 metabolsim rate and adopt default gas switch depths to
pSCR oxygen drop.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:17:29 +13:00
Tomaz Canabrava
ac40c458fa Reduce the refresh rate of the toolTipItem to 25fps.
This reduces a lot of CPU time and makes the overall use of the tooltip a
breeze.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:07:14 +13:00
Tomaz Canabrava
67865a86be Honor prefs.anim_speed on the ToolTip animations
The tooltip animation had a fixed animation speed, this patch
honors the anim_speed on the preferences, and also disables
the animation completely if the speed == 0.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:06:33 +13:00
Tomaz Canabrava
85909ca28d Reduce the number of calls to boundingRect
There are a few calculations that go on boundingRect that can be avoided
if we simply store the result.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:05:48 +13:00
Tomaz Canabrava
85a3cbf8af Fix the colors of the rectangle
Correct pen and brush set. the ToolTip now is correctly rounded,
translucent and happy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:05:01 +13:00
Tomaz Canabrava
12dd46c140 Implement the paint method to draw the rounded rectangle.
The rectangle is now correct, but the collors are still
wrong. I'm tracking that down - most probably I've set
the wrong pen or brush  ( or both ) somewhere.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:04:37 +13:00
Tomaz Canabrava
48a23b9b3c Remove the background and the separator
Those items were used to fake the background of the path item
but since the rectangle can be painted with a border and a
fill, this is uneeded.

The rect is still ugly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:04:08 +13:00
Tomaz Canabrava
deafa40d34 Inherit from QGraphicsRectItem instead of QGraphicsShapeItem
a rectangle is *much* faster to paint than a simple ShapeItem,
so this is a safer choice. We still need to create the paint
method so we can use the correct roundness for the rectangle.
Currently it's white with a 1px solid line - terrible. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:03:18 +13:00
Tomaz Canabrava
054521d3a1 Reduce the amount of calls to create the background on the ToolTip
We were deleting / recreating the graphics background item for *every*
mouse movement. Now we are just creating the painter path; no more
allocations / desalocations, adding, removing from the scene. This should
make things a tiny bit faster.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 14:47:44 +13:00
Tomaz Canabrava
6a1a6c82bf Reuse the entry tooltip item and do fewer calls for each mouse move
While analizing the code for the mouse movement I've discovered that
we did a lot of uneeded things: Set the color, the pen, the size
of a fixed-colored line, twice.

We also deleted-newed the same Pixmap / Text for every mouse movement
so now we reuse the 'entryToolTip' that consists of a huge line and
a pixmap, and after that we add the other tooltips that are not static

Also, reduced a lot the number of calls to expand() (that did a lot of
math).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 14:46:57 +13:00
Tomaz Canabrava
3169ec8dc9 Do not set the rectangle if it's the same
Strangelly, this method was being called even if the rectangle was the
same, so we deleted everything and recreated everything again. tsc tsc.

Some more improvement is needed but we are getting there.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 14:28:25 +13:00
Tomaz Canabrava
806d984107 Only update the rectangle if it changed
Very often the rectangle of the ToolTip doesn't need to change but we were
calling and firing an animation for it for *every* mouse movement, even
when we didn't really needed it.
Now it will only fire something if the rectangles are indeed different.

From my tests we reduced the number of calls to the animatior by about 20%
using a real divelog as test.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 14:26:35 +13:00
Tomaz Canabrava
54898b15ff Do not free the membuffer, reuse it
This is an attempt to make fewer calls to alloc functions when the mouse
is moving.

We were creating a membuffer, filling it (malloc / realloc), then freeing
it just after use. but we could simply hold that allocated area and reuse
it again.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 14:23:46 +13:00
Tomaz Canabrava
501f72c697 Speed Improvemens: fewer calls to mapFromScene / mapToScene
We did three cals to mapToScene / mapFromScene on the mouse moveEvent at
the ProfileWidget2 where we only needed to call one in the common case and
two in the worst case.

This doesn't really help in terms of speed (unless you have a really old
cpu) but since it's code that gets called *very* often, it seemed a
reasonable thing to do.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 07:24:13 +13:00
Tomaz Canabrava
db4ffd0b70 Fix memory leak
The QPainter and the QPixmap were being created but never freed. A QPixmap
and a QPainter don't need to be created by new, they can be safely created
on the stack.

So, create them on the stack, pass them via const-reference
and use them correctly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 07:23:48 +13:00
Tomaz Canabrava
633dd64d2f Major speedup when moving the mouse in the profile
After looking with great care at the result of the mouse movement
on the profile, and also playing a bit with callgrind I've found
out that one thing that we were doing wrong was the way we looked at the
items in the scene, by calling scene()->items with
Qt::ItemIntersectsShape, our shapes are very complex curves
with thousends of points and we have lots of them. and it usually
doesn't matter because *most* of the time we are getting the
tooltip information from 'get_plot_details_new', so no accessing
to items was necessary.

By changing the access from Qt::ItemIntersectsShape to
Qt::IntersectsItemBoundingRect we had a speedup of almost 500x in a
section of code that's very important, and the good thing, nothing bad
happened because one of the only things that we are using this code is to
get information from the events, not the curves.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15 07:20:35 +13:00
Cristine Guadelupe
2b19341609 Remove instantMeanDepthLine
Take instantMeanDepthLine out of the code. We have the moving average line
plus the exact data in the information overlay.

Signed-off-by: Cristine Guadelupe <cristineguadelupe@me.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-14 12:24:57 +13:00
Joseph W. Joshua
25fc828458 Ignore QWebView in Android
Ignore QWebView instances in the preferences dialog when compiling under
Android, as QWebView is not yet supported under Android.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-14 07:49:24 +13:00
Dirk Hohndel
a0c52237ea Dive download UI: sort the dive computer dropdown
I could have sworn we did this at some point. The vendors are already
sorted, but the products for each vendor should be sorted, too.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-13 22:05:55 +13:00
Dirk Hohndel
af3dd1e835 Attempt a better layout for the download dialog
This seems to work well and provides a lot less wasted space.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-13 21:58:28 +13:00
Dirk Hohndel
578e9c22af Dive d/l selection UI: clear table when retrying
After a partial download (because the user hits cancel or because there
was an error, if the user hits Retry the list of dives downloaded so far
should be cleared because we will simply try to re-download the same dives
again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-11 07:46:21 -08:00
Dirk Hohndel
bccbdf8264 Don't use current_dc unless you know there's a current_dive
This will crash if for some reason current_dive is invalid.

And in general, when displaying information, we want to use the correct dc
in the displayed_dive, not the current_dc, which references the
current_dive...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-11 07:29:29 -08:00
Robert C. Helling
e219bc70f8 Refactor dctype -> divemode
... and repair a failed rebase (sorry).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:25 -08:00
Robert C. Helling
bfe05b4340 Replot after changing divetype
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
7d8ecf8ec8 Add preferences field for default set-point
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
0f7f2195d5 Add setpoint events according to divetype
When changing to a CCR dive, add a setpoint change to the default setpoint
at the beginning of the dive. Otherwise add an explicit setpoint change to 0
.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
a478eb5711 Maintab combobox to set dive type
still needs some work

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
d01c6c824b Rebreather type selector UI
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Dirk Hohndel
762f33bd13 Dive d/l UI: redo the states, the flow, the buttons
This is bigger and more invasive then I wanted, but it's hard to break it
down into smaller pieces. Here's what it does:

The former "Download" button becomes the "Download", "Cancel download" and
"Retry" button. So this button controls your interaction with the dive
computer.

The other two buttons are now purely "OK" and "Cancel" for the dialog.
"Cancel" discards what happened (much easier now that we download into a
different table), and "OK" adds the dives that were selected in our
selection UI (by default all downloaded dives) to the real dive_table.

And while redoing all this, I also redid some of the state machine
underlying the dialog. The biggest change that the user will see is that
partial downloads (after canceling or after an error) will still offer the
dives that were completely downloaded up to that point in the selection
menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 15:06:25 -08:00
Dirk Hohndel
f10b66237e If we can't find the dive, simply return no data
This seems better than forcing a crash or accessing random data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 15:06:25 -08:00
Dirk Hohndel
7357633905 Now use our table when downloading from the dive computer
We pass a different table to libdivecomputer (and the uemis code) and have
that table filled. And then we simply copy the dives from that table into
the real dive_table when the user accepts the download.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 15:06:25 -08:00
Dirk Hohndel
e43ea018fa Add a private table for downloaded dives
This still isn't actually used, just puts it in place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 15:06:25 -08:00
Dirk Hohndel
6f25713408 Add more infrastructure for a separate dive table
This will allow us to download the dives from the dive computer into a
separate table just for that purpose and not into the main dive_table.

I really dislike the code that's in place that dates back to the very
earliest code written for Subsurface. Dumping the dives straight into the
main dive_table seems really stupid to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 15:06:18 -08:00
Dirk Hohndel
a92484e4ed Dive d/l selection UI: remove setData() method
Since we now track all clicks on the row, having the setData() actually
neutralized the action that we took on the clicked() signal.

Now you can select / deselect a dive, regardless where in the row you
click.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 12:42:09 -08:00
Dirk Hohndel
4d26e3a0cb Dive d/l selection UI: fix the row count ranges
Yet another bug because the indices are inclusive. We need to start off
with the last being smaller than first and we need to adjust the row
count. It might be easier to just fix thing to make last be exclusive...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 12:42:09 -08:00
Dirk Hohndel
80af8e7fa2 Dive d/l selection UI: update checkmark state correctly
This fixes the issue where there was no visual feedback when clicking on
the second or third column in the grid. It would actually change the
checked state of the checkmark internally (and you would see the new state
once you clicked on another dive), but it wouldn't give immediate visual
feedback.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 12:42:09 -08:00
Dirk Hohndel
15fb6158bc Dive d/l selection UI: the indices are inclusive, allocate enough space
The array we allocated was one entry too small.

On the flip side, let's just make sure we cannot call this with a negative
range. That would be bad, too.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 12:41:38 -08:00
Dirk Hohndel
cd2cee4974 Dive d/l selection UI: only allow one download for now
We may reconsider this as this might replace the Retry function that's
currently completely broken.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 12:00:34 -08:00
Dirk Hohndel
e9e6e75feb Dive d/l selection UI: don't setup the model if there are no dives
Setting things up for zero dives will cause all kinds of weird corner
cases. Just don't do it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 11:28:15 -08:00
Willem Ferguson
d45e870289 Repair minor bug in CCR setpoint graph
Correct minor malfunction with CCR setpoint display. It was showing even
when the po2 display was turned off. This patch ensures that the setpoint
graph only shows when the po2 toolbar button is activated (and in addition
the appropriate checkbox in the Preferences).

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09 09:16:29 -08:00
Anton Lundin
3c15834c3c Remove unused headers
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 14:35:09 -08:00
Anton Lundin
8a5f2ef52f Only suggest OSTC3 fw upgrade on newer version
Previous code suggested a "upgrade" if your firmware where other than
whats parsed from the autofirmware call.

This switches that logic into only suggesting firmware upgrade if the
found firmware is newer than the firmware your device runs.

The previous logic was very annoying if you have a device running a
development version of the firmware. If you have taken that step of the
guided path, you shouldn't be told to "upgrade" to something older
every time you download from your computer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 14:35:03 -08:00
Anton Lundin
4f8536c253 Remove stray debug prints
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 14:34:51 -08:00
Dirk Hohndel
d7762f8fbe No need for a new variable
We already have provider in a local variable. The lookup and "model"
variable is redundant.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 13:44:51 -08:00
Dirk Hohndel
562f88d2b7 Use setEnabled() instead of setDisabled()
I don't like mixing setEnabled() and setDisabled()... let's just always
use setEnabled().

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 12:56:17 -08:00
Dirk Hohndel
0dd8d11a18 Dive d/l selection UI: hook up select / unselect all
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 12:54:53 -08:00
Dirk Hohndel
3ae664b6dc Dive d/l selection UI: add select all / unselect all
This isn't hooked up, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 12:41:45 -08:00
Dirk Hohndel
e6b5a00e35 Dive d/l selection UI: allow clicking anywhere in a row
It seemed silly to only be allowed to click the tiny checkbox.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 11:39:34 -08:00
Dirk Hohndel
d16bff13bb Dive d/l selection UI: fix more array access errors
The checked array is zero based, reflecting the rows shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 11:27:47 -08:00
Dirk Hohndel
32824e8db8 Dive d/l selection UI: brute force size optimizations
This is horrible, but it gets something in place and hopefully we can
clean this up soon.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 11:19:01 -08:00
Dirk Hohndel
3854495832 Give reasonable names to layouts
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 10:22:31 -08:00
Dirk Hohndel
d143527732 Dive d/l selection UI: show reasonable column headers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 10:12:43 -08:00
Dirk Hohndel
1ce2d42e8d Random whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 10:02:28 -08:00
Dirk Hohndel
17b9597f3e Dive d/l selection UI: fix check if things were checked
Math is hard.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 10:00:30 -08:00
Dirk Hohndel
847289605b Dive d/l selection UI: close the dialog when done
This is where we need to call accept()

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:59:01 -08:00
Dirk Hohndel
cb6f04f16c Dive d/l selection UI: Only show checkbox on the first column
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:43:29 -08:00
Dirk Hohndel
9d38ceb95d Dive d/l selection UI: disable OK until things are downloaded
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:39:47 -08:00
Dirk Hohndel
a20040a561 Fix missing return value
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:33:52 -08:00
Dirk Hohndel
c1bc29bd4b Dive d/l selection UI: show useful data in a useful format
We don't get location data from the dive computer (at least not from
99.99% of the dive computers today). And we really need to show the data
in a human readable format.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:33:47 -08:00
Dirk Hohndel
a3ea1d51f9 Dive d/l selection UI: don't close the dialog when we're done downloading
The whole point is that we then want to pick and choose which dives to add
to the divelist.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 09:33:40 -08:00
Tomaz Canabrava
747afa314a Dive d/l selection UI: Rename button
Fix the name of a button so the download from dc actually works.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:48:07 -08:00
Tomaz Canabrava
6b11f94996 Dive d/l selection UI: Only try to get the dive list if d/l succeeded
This fixes a crash where we tried to get the data without actually having
downloaded anything.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:47:22 -08:00
Tomaz Canabrava
afafbb3a3e Dive d/l selection UI: Remove unused variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:47:11 -08:00
Tomaz Canabrava
f5f0938d8c Dive d/l selection UI: Add method to remove unused dives
This tries to relete from the dive list the dives that shouldn't be
imported.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:46:41 -08:00
Tomaz Canabrava
25323c2717 Dive d/l selection UI: Hook up OK button
Create an on_ok_clicked that will do the actuall parsing of choosen dives.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:45:58 -08:00
Tomaz Canabrava
09d6d4f5de Dive d/l selection UI: Create a button to download the data from DC
Now, ok should close the dialog, and not download the dives from the DC,
this way the user can choose what happens.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:45:30 -08:00
Tomaz Canabrava
acb5168254 Dive d/l selection UI: Add a table for the new dives from DC dialog
It will show the model that I just created.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:44:50 -08:00
Tomaz Canabrava
f8e86b2f4b Dive d/l selection UI: Fill the checked vector as true
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:44:29 -08:00
Tomaz Canabrava
f8af0239ce Dive d/l selection UI: Set the item flags
Now the user can click on the dives that they want to keep.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:43:38 -08:00
Tomaz Canabrava
797bf49129 Dive d/l selection UI: Add the setData method
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:43:01 -08:00
Tomaz Canabrava
55cc16d77d Dive d/l selection UI: Add the check states
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:42:25 -08:00
Tomaz Canabrava
76725265fc Dive d/l selection UI: Display the downloaded dives in a table
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:41:51 -08:00
Tomaz Canabrava
f7abde84af Dive d/l selection UI: setImportedDivesIndexes implementation
Here we list in the model what are our dives, inside the dive_table.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:41:17 -08:00
Tomaz Canabrava
9ee615bca3 Dive d/l selection UI:: Constructor, rowCount and ColumnCount
Add importedDivesIndexes and Data.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:40:51 -08:00
Tomaz Canabrava
db367ae0a2 Dive d/l selection UI:: Add skeleton for the dialog
So the user can remove the ones they don't like.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:40:33 -08:00
Dirk Hohndel
5f4770a5bd CSV import: make predefined imports work again
We need to reparse the file when the known type changes and want to make
sure that we only try to guess the separator and the columns if the user
hasn't told us otherwise.

For the predefined imports this then looks up the correct columns and
places the correct headings there - and then allows the user to modify
them if needed.

This has been lightly tested, there may be dragons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 17:02:42 -08:00
Dirk Hohndel
db988aa62b CSV import: first steps to enable the preset types again
With the new infrastructure colum numbers are 0 based, so the indices had
to change.
This commit also adds the column names for sample based formats (and ends
up re-indenting parts of that code).

This doesn't make things work, yet, but it's a step in the right
direction.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 16:59:42 -08:00
Dirk Hohndel
a51110b0d0 CSV input UI: if we detect columns, set type to "manual" for now
We still need to re-implement the other presets.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 15:11:54 -08:00
Dirk Hohndel
e3aebfdd66 CSV import UI: Minor update to strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 15:09:24 -08:00
Dirk Hohndel
b08b32af2c CVS import UI: mark the column names in blue as well
And make the bubbles slightly larger.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 13:00:16 -08:00
Dirk Hohndel
02103978ec CVS import UI: mark the drop row in blue
That way it is distinct from the rest.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 13:00:06 -08:00
Dirk Hohndel
2f5d4720e9 CVS import UI: better message if some columns were matched
If we automatically matched the columns this might already be correct. So
the standard text is confusing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:41:06 -08:00
Joseph W. Joshua
810840ddb1 Better resizing in the divelog import dialog
Resize the components of the divelog import dialog neatly, with the
table view expanding to fill most of the available space.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:34:45 -08:00
Tomaz Canabrava
c4b7ed5444 CSV Import UI: Prettifications, hide headers, code cleanup.
Just a few cleanups.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:33:30 -08:00
Tomaz Canabrava
11fc888cdc Fix moving columns around when one of the columns is empty
I used to compare strings, but since there can be more than one empty
column, this was a very sad choice, now I'm comparing indexes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:33:12 -08:00
Tomaz Canabrava
3b654438b6 Draw a nice rounded rect around the avaliable column names
This drawns a nice rounded rect around the avaliable column names, using
antialiasing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:32:15 -08:00
Tomaz Canabrava
ce9d972ffa Give the items a bit more spacing / enable the delegate
Enable the new delegate on the view, and give the items a bit more
spacing, so we can draw things around them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:31:52 -08:00
Tomaz Canabrava
8531cec100 Add delegate skeleton for the drag columns
This new class is the responsible to draw the columns that can be dragged
from the top bar to the bottom one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:30:25 -08:00
Lubomir I. Ivanov
2b311b1c2c profile: don't show instantMeanDepth for printMode
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:29:59 -08:00
Dirk Hohndel
1c06252c00 CVS import UI: use my own match function
This makes the code simpler and allows us to do a much better job matching
the column names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 12:27:20 -08:00
Dirk Hohndel
816367eb06 CSV import UI: First step towards recognizing column headers
This doesn't do a good job of matching the titles, but it works for some
of them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 11:24:57 -08:00
Dirk Hohndel
481de7da74 CSV import dialog: try to guess the separator based on the file
This is taking a very simplistic approach. It picks the predominant
potential separator. If there is no clear winner, it uses the UI default
and makes the user pick (and either way, this can always be overwritten by
the user).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 08:57:08 -08:00
Dirk Hohndel
925bb019c7 Fix potential crash
Commits 0de3bc8452 ("Display CCR setpoint values on the po2 graph") and
65eed80e37 ("Don't always show the setpoint graph") didn't take into
account that current_dive could be NULL and therefore accessing current_dc
could crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 20:35:57 -08:00
Dirk Hohndel
f42b986474 Adjust capitalization to our style
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 20:21:51 -08:00
Dirk Hohndel
e544796199 Add missing divemaster field to the manual import
No idea why I didn't notice earlier that this was missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 20:19:45 -08:00
Dirk Hohndel
5a4d85bf7c Fix crash when importing CSV that requires change of separator
The dialog defaults to tab; if a file is indeed comma separated and one
switches to that, data() could be called on a higher index before the
model is re-populated.

I'm a bit surprised why index.isValid() doesn't catch this, but the manual
check appears to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:53:49 -08:00
Tomaz Canabrava
9511ee0294 Do not allow the drop target to erase an old column
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:56 -08:00
Tomaz Canabrava
a96e0e1ec1 Fix moving columns
Qt has a very bad habit of getting the inner widget instead of the outer
one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:50 -08:00
Tomaz Canabrava
6746b73d85 Remove data if it was correctly moved to the upper model
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:42 -08:00
Tomaz Canabrava
1ba08e2fec Make it possible to move from top to bottom
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:40 -08:00
Tomaz Canabrava
59fc5cecb7 Add the code to actually make it possible to move columns
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:38 -08:00
Tomaz Canabrava
fd41ff4ab9 Start to make it possible to move columns around
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:37 -08:00
Tomaz Canabrava
325f47c8d8 Add missing returns
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:35 -08:00
Tomaz Canabrava
8a230f9145 Remove drag operations from the 'From' widget
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:30 -08:00
Tomaz Canabrava
e3fbfe5498 Remove pesky QDebug that snook in
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:28 -08:00
Tomaz Canabrava
555fd979cb Port the code that actually parses the CSV to the new system
Change the QWidget based approach to the Model based approach, using the
result QStringList for finding if we have the depth or the time of some
specific column.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:19 -08:00
Tomaz Canabrava
d0a62e452b Better sizings for the CSV dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:17 -08:00
Tomaz Canabrava
f48065ac3c Do not accept drops from outside of subsurface
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:16 -08:00
Tomaz Canabrava
909be75113 Re-add the string to the avaliable models if drag cancelled
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:12 -08:00
Tomaz Canabrava
9042abc68c Set data done, drag & drop works
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:10 -08:00
Tomaz Canabrava
7d53299831 Implement most of the drag operation
Only thing missing is the Drop.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:08 -08:00
Tomaz Canabrava
4e7bd86e07 Fix constructor
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:04 -08:00
Tomaz Canabrava
af13ba7d44 Add setData() to the ColumnResult model
This way the drop target will work when implemented.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:38:00 -08:00
Tomaz Canabrava
74596cc193 Add the data() method
Now we can correctly visualize the file data, and changing
the separator will update on the fly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:57 -08:00
Tomaz Canabrava
58e21a6160 Add the setColumnValues() method
This method populates the model with a few lines of the CSV data to help
the user to define what each column is.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:48 -08:00
Tomaz Canabrava
79e81d70ec Implement LoadFileContents
This will get the first 10 lines of data, try to separate
them using the separator specified, and then try to make
things display correctly on the table.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:46 -08:00
Tomaz Canabrava
ba30e938b3 Another skeleton: LoadFileContents
Also, do not pass QStringLists by pointer, uneeded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:44 -08:00
Tomaz Canabrava
f1b90813cf Set the model on the table view, one more skeleton
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:42 -08:00
Tomaz Canabrava
858fe5588a Add skeleton code for the model that will have the result of columns
This model will show some columns and the user will
need to provide the correct information for each of them

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:40 -08:00
Tomaz Canabrava
aa33ae9526 Add skeleton code for the table view that will accepts drops
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:37 -08:00
Tomaz Canabrava
cedf339e1e Show the pixmap being dragged
This way we know that we got the correct drag thingy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:35 -08:00
Tomaz Canabrava
b7e27e3141 Re-add the string removed upon drop operation
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:27 -08:00
Tomaz Canabrava
6149004f47 Remove the string from the model while dragging
We are not correctly readding it yet - be patient.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:23 -08:00
Tomaz Canabrava
81f2ee5892 More DragDrop skeletons
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:37:20 -08:00
Tomaz Canabrava
0a1908137b Start to drag the correct values
This piece of code starts a drag and moves around data, it does nothing
with it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:35:12 -08:00
Tomaz Canabrava
2034508c07 Add class skeleton that will handle the drag starts
This class will handle the drag 'n drop "drag" part.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:35:03 -08:00
Tomaz Canabrava
d57d86f5dc Set the lsit view to IconMode
This is needed so the list of items appear in a grid like view.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:34:57 -08:00
Tomaz Canabrava
d2a4cd9965 Display the list of column names on the ListView
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:34:56 -08:00
Tomaz Canabrava
7bc93d4242 Add data, row count and the string list that populate the model
I know that there is a QStringListModel, but that doesn't
have add and remove methods, and thus I cannot use it. ;)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:34:54 -08:00
Tomaz Canabrava
3d8e2d0643 Skeleton code for the model that has the columns information
Just the skeleton, then start doing stuff.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:34:51 -08:00
Tomaz Canabrava
48775c530e Clean a lot of code for a new and improved CSV import dialog
This mostly cleans out stuff that is going to be uneeded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 19:34:45 -08:00
Anton Lundin
ae6f5f0a5a Remove unused imports
These doesn't exits in Qt for android to...

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 19:37:53 -08:00
Joakim Bygdell
4b98d17800 Give oxygen a proper colour in the tankbar
Oxygen should be representad by its own solid green colour not the yellow/green of nitrox.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 13:30:47 -08:00
Dirk Hohndel
65eed80e37 Don't always show the setpoint graph
We need to use the same conditional here as we do earlier in the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 11:14:59 -08:00
Willem Ferguson
0de3bc8452 Display CCR setpoint values on the po2 graph
When a CCR dive is viewed and the toolbar button for PO2 is activated,
both the PO2 (green line) and the O2 setpoint (red line) are shown.
This allows evaluation of the PO2 in the CCR loop with respect to the
pre-configured O2 setpoint.

The setpoint graph can be disabled from the Preferences/Graphs tab
by checking the appropriate checkbox.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:18:06 -08:00
Joseph W. Joshua
a409c73195 Various capitalization fixes
Fix various discrepancies in the capitalization format, as we are using
'down format' for titles and actions.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:06:35 -08:00
Miika Turkia
9e2e62ec4f Initialize edit hack variable
The accepting mode variable must be initialized to false to allow
editing of dive data.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 23:19:52 -08:00
Joseph W. Joshua
d39eb81bfb Fix Capitalization
Capitalize the word Facebook in 2 occurences in socialnetworks.cpp

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 22:56:33 -08:00
Anton Lundin
6b17f20081 Close two compiler warnings about reordering
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 17:52:21 -08:00
Joseph W. Joshua
7f407095aa Fix spelling error
Fix small spelling error in configure dive computer dialog.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 17:51:52 -08:00
Miika Turkia
fdd152af71 Make sure we do not fall back to edit mode on accept
On Ubuntu 14.04 the edit mode does not exit successfully when applying
the changes. It instead jumps back to edit mode (even though hiding the
option to apply/discard changes again). So let's just have a flag to
prevent faulty behavior.

Fixes #786

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 10:53:10 -08:00
Dirk Hohndel
f7b3c8b496 The margin between toolbar and profile looked strange
Especially on Mac where there is already a lot of padding around the
action buttons.

Also made the spelling of the zeroMargins variable more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 08:05:30 -08:00
Dirk Hohndel
317bbe4425 Fix incorrect name for layout
If I want to use the names to make more sense out of the layouts, I might
as well name them correctly...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 07:42:28 -08:00
Dirk Hohndel
e02a6b9c42 Make text in user survey follow our capitalization conventions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 07:42:08 -08:00
Dirk Hohndel
371c91f5ea Attempt to move the more frequently used toolbar actions to the top
This is highly dependent on the user, I guess. So I may be totally off
here. But the previous order was pretty much random (and even tried to
push one button in there twice in a row)...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 07:31:22 -08:00
Dirk Hohndel
a308d2b7b4 Fix toolbar icon size issue
Instead of messing with the margin (which didn't work, anyway), we need to
set the size of the icons. Apparently on Linux this was implicitly done,
but on Mac it didn't scale the icons and provided space for the largest
one (and we have a couple that are twice as big as the others).

What we really need are scalable icons that allow us to set the icon size
relative to the font size. But for now this solves the ugliness on Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 07:15:23 -08:00
Dirk Hohndel
71f3a29819 Trip editing: zero out potential previous edits
This was silly; if we rely on this to be zero to indicate no change then
we better zero it out when we start editing.

Fixes #805

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04 06:43:36 -08:00
Dirk Hohndel
6d1e44f05c Layout fine-tuning: remove the outermost margin around the window
That added visual distraction on some desktop themes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 23:11:54 -08:00
Linus Torvalds
08d2ceb66b Extend SAMPLE_EVENT_GASCHANGE2 to have cylinder index in 'flags' field
A value of zero (which is the normal legacy one) remains "unknown", but
the divecomputer backend can now give both gasmix and cylinder number
this way.

Currently only the EON Steel backend does that, but it should be easy
enough to extend others too.

Also, fix the user-visible cylinder numbering in the cylinder change
tooltip to use a human-friendlier one-based numbering (ie first cylinder
is "cyl 1", not "cyl 0")

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 21:36:51 -08:00
Dirk Hohndel
ccfea0872d When editing trip data, only copy actual changes
We zero out the displayedTrip and only copy changed data into it; so a
NULL value is not deleted text, it means there was no change.

Fixes #805

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 16:06:00 -08:00
Dirk Hohndel
5cc261311e Fix the update check logic
Oops. That was supposed to do the opposite of what it ended up doing. The
goal was to NOT check for two weeks when the user updates to a new
version.
Instead it always checked when the user updated to a new version.
This mostly would hit developers...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03 13:47:05 -08:00
Linus Torvalds
9a4cafd0f1 Fix gaschange tooltip information
The code tried to look up the cylinder index from the Qt data models,
which was not only horribly confusing, but was also buggy.  I think the
index ends up being off by one when the first cylinder change is hidden
(because it's at the beginning of the dive), but I can't make heads or
tails of that crazy code, so there might be something else going on.

Just remove all the crazy code, and use the event data directly.  Which
gas the gasmix and the (potential) explicit cylinder index already.
It's much more straightforward, and it just automatically gets the right
end result whether some other event is hidden or not.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:43:21 -08:00
Dirk Hohndel
8a312616b0 Zero out the margins instead of just not changing them
At least on the Mac some objects appear to have generous default margins.
This creates a somewhat less wasteful layout. Still we have those massive
margins around the toolbar buttons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:51 -08:00
Dirk Hohndel
7482e0540d Layout fine tuning. Exclude a few more layouts.
The goal is to have things look as consistent as possible - so if some
elements have another nested level of layouts, their margins need to be
zero.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
bdaaf23a82 Remove margins from maintab.ui file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
17195e44a5 Remove all margins from mainwindow.ui file
And adjust them in code instead. This seems to look nice.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
36ba5d3382 Give more layouts reasonable names
This time for the mainwindow.

This includes an adjustment in the C++ code where we actually referenced
one of those weird generic names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
57b49a7833 Fine tune some spacing
Now that we set the margins everywhere, the manual corrections here aren't
needed. At the same time, the spacing for the labels looks better if it is
a tiny bit more generous.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
66c2d3d9da Set up consistent margins in the various layouts
The hard coded margins were random and inconsistent and generally ended up
with a rather unbalanced look. This was worse on Mac than on other
platforms, as there the margins get exaggerated for some reason.

This code is a bit of a hack and a bit brute force, but it seems to work
to create a much more pleasing appearance. It may need some fine tuning
(depending on OS or DE (under Linux)), but it definitely seems like a
massive improvement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
a6a76fbffd Give layouts reasonable names
I should do this for the other .ui files as well, but for now this was
enough to get me going.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Tomaz Canabrava
93f42418e6 Try to fix spacing between widgets.
We had two internal layouts, each of them using 6 of spacing,
wich accounted for 24 of spacing if we took into account
items side by side.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02 22:24:50 -08:00
Dirk Hohndel
cef150d7dc User survey: always wait a week
I can't remember why I decided to show the survey immediately if someone
was running a development version. Seems silly to me in retrospect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 22:50:03 -08:00
Dirk Hohndel
864c4ce94d Automatic update check with an opt out
Store the last version used, the next time we can check, and the decision
if the user does or does not want these checks in the settings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 20:49:24 -08:00
Dirk Hohndel
4c4bc71803 Make the moving mean depth line a less obnoxious color
The red made it stand out way too much.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 16:43:30 -08:00
Dirk Hohndel
c4954d90a1 Whitespace cleanup
Quite a bit of wild white space going on...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 16:28:37 -08:00
Krzysztof Arentowicz
b6f47883c3 Get rid of mean depth line
Flat mean depth line (whole dive, not the instant one) is redundant as we now
 have a much more useful mean depth graph.

Signed-off-by: Krzysztof Arentowicz <k.arentowicz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 16:28:20 -08:00
Krzysztof Arentowicz
e3378e299a Plot mean depth data
As we already have running depth sum values for each sample
why don't just plot running average depth graph.

Signed-off-by: Krzysztof Arentowicz <k.arentowicz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 16:23:22 -08:00
Krzysztof Arentowicz
ee1ef52330 Avoid divide by 0 error
Avoid crash when moving mouse to left side of the plot when showing
mean depth

Signed-off-by: Krzysztof Arentowicz <k.arentowicz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 16:14:01 -08:00
Dirk Hohndel
26c3dcbcb6 Update check: better message when running development version
This isn't an error. The server tells us what it knows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 12:13:27 -08:00
Dirk Hohndel
75af60f327 Use the canonical version when checking for updates
This is in the form major.minor.subminor.commit_nr and makes it easy for
the backend process on the server to figure out what to do.

This changes the query argument from ver to version so the backend knows
that this is now a canonical version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 12:08:57 -08:00
Dirk Hohndel
9b247af3f6 Always show the full git version in the about screen
This way we finally get the right version shown on Mac and Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 11:58:04 -08:00
Tim Wootton
ba72946b0c Happy New Year
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01 09:08:56 -08:00
Dirk Hohndel
ac7d1f15c6 Add better icons for the filter dialog
These are from the public domain icon tango icon set at
http://tango.freedesktop.org/Tango_Icon_Library

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 23:53:28 -08:00
Miika Turkia
ed89febcbb Enable and disable unit selection
Unit selection is supported only for CSV exports, thus enabling the
selection only for those.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:59 -08:00
Miika Turkia
5d68c7d4a1 Use unit selection for XSL transformation on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:20 -08:00
Miika Turkia
c1d9055948 GUI change to accommodate unit selection on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:05 -08:00
Miika Turkia
d70a6f23ed Change the XSLT to use the duration format instead of "logic"
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 08:35:36 -08:00
Miika Turkia
a46cebd1ad GUI change to specify duration on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 08:35:24 -08:00
Tomaz Canabrava
b3e3947b79 Make the moving mean depth line work
It's a bit jumpy, but works.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:14:53 -08:00
Tomaz Canabrava
d6fddcaadc Add a new signal to send the current time/depth of the mouse pos
As the explanation says. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:14:40 -08:00
Tomaz Canabrava
3e239c7e3e Add the instantMeanDepth on Scene
But nothing is hoocked yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:13:41 -08:00
Tomaz Canabrava
4f4857f19f Move stuff to protected on DepthLine
I wanna use some of it on the InstantMeanDepthLine

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:13:09 -08:00
Tomaz Canabrava
c7a5d81683 Set data model for the MeanDepth line
This way we can poke around data for the mean depth line.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:12:49 -08:00
Tomaz Canabrava
146030f805 Add skeleton for the instant mean depth line
This class will hold the visible line of the mean depth for the time 'now'

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:12:28 -08:00
Tomaz Canabrava
2839aed8f2 Add the runnimg_sum data to the data model to be displayed on the profile
Without this nothing would be displayed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:12:15 -08:00
Tomaz Canabrava
d4d71bd6d3 Add the gradient factor on the table
It was impossible to guess what this column was just by looking at it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:12:04 -08:00
Tomaz Canabrava
fed79490bf Add text for the heart beat data on the table
This was missing on the UI and it was really hard to guess what it was.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 16:11:14 -08:00
Miika Turkia
f3446fadc1 Clear DC information when closing log file
Fixes #799

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 15:59:53 -08:00
Anton Lundin
4da7ab2431 Remove unused variable
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:56:06 -08:00
Anton Lundin
08b5ed14d7 Connect the UserSurvey to its qt-parrent
This makes sure the UserSurvey object is removed correctly by the qt
object tracking system.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:56:00 -08:00
Anton Lundin
db96850782 Correct capitalisation
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:55:54 -08:00
Anton Lundin
fc63dd90cd Remove NO_USERSURVEY
Back in 71dbcdc0d6 ("Added the option of opening User Survey form
explicitly") a define for not adding the user-survey was created.

This is quite unnecessary and this removes that option.

Based-on-patch-by: Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:55:45 -08:00
Miika Turkia
3416278da4 Allow unit selection on known CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:35:23 -08:00
Dirk Hohndel
d8178b15c5 Add Facebook logo to preferences as well
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 17:42:58 -08:00
Dirk Hohndel
80171cbdb2 User survey: these options aren't mutually exclusive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:33:58 -08:00
Anton Lundin
42f8bbdbeb Remove duplicate tool-tip setting
We set the real tool-tips with setBtnToolTip from maintab.cpp, so this
is just duplicate and miss-leading.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:27:44 -08:00
Anton Lundin
221b5f0ff7 Only check for update after successfull download
We check that the logbook download didn't error out before checking if
we should remind the user to upgrade the firmware. Otherwise we will
check if whatever the current firmware version is, is greater than zero
and always remind the user to upgrade the fw.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:27:44 -08:00
Anton Lundin
e00233051e Add reminder for OSTC Sport to re-enable bluetooth
The OSTC Sport exits bluetooth mode after the loogbook download. To
update the firmware in the OSTC Sport, we need it enabled again, so we
gently remind the user about doing that before continuing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:27:26 -08:00
Anton Lundin
95461830bb Initialize members in the declared order
This closes a compiler warning.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 16:22:20 -08:00
Dirk Hohndel
3e5c1713d2 Facebook integration: Album name is required
The upload would fail with an empty album, so disable the OK button onless
an album name is set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 11:59:21 -08:00
Dirk Hohndel
dd51b434e6 Facebook integration: improve dialog layout
I'm not very good with these layouts, but this seems much more informative
and easier to use.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 11:58:38 -08:00
Dirk Hohndel
cab320201b Facebook integration: improve the confirmation UI experience
Date and time needs to be a string, not a time_t.
Duration should be called that (and not time) and wasn't hooked up.
Also added a helper to get the duration string.
Finally reordered the components of the text that is shown to make it more
natural (or I should say, more in line with the order we use elsewhere).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 11:14:34 -08:00
Miika Turkia
adb5cc5d30 Highlight that this CSV export is about dive profile.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:25:33 -08:00
Miika Turkia
175ee84cc5 Description of CSV detail export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:25:28 -08:00
Tomaz Canabrava
a65816db7d Remove uneeded Facebook album setting
This now is chosen directly from the popup box that appears when you try
to send a picture to facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:07:47 -08:00
Tomaz Canabrava
b84edad597 Facebook integration: Add an interface to select the stuff that's sent
Generate the stub message that will go on the Facebook picture upload.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:06:55 -08:00
Tomaz Canabrava
ecd0f25c04 Facebook integration: Add the SocialnetworkDialog.ui
This dialog is used to choose what goes into the message of the profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:06:29 -08:00
Tomaz Canabrava
ed903c42b9 Facebook integration: Always ask for a folder before sending the photo
This way we are sure that the upload was made in the correct folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:05:53 -08:00
Tomaz Canabrava
571f86485d Move the Facebook send profile button
Move from the Dive List context menu to the Dive Info tab, it will only
appear when connected to Facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:05:08 -08:00
Dirk Hohndel
b2f4896f3c Whitespace cleanup
Plus removal of a few qDebug() calls I introduced earlier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 21:02:28 -08:00
Dirk Hohndel
4559a26e31 Fix ConfigureDiveComputer class
This caused a crash when trying to call the firmware upgrade from the
downloader - no idea how this worked for the other caller (from the main
menu).

Anyway, with this the "offer to upgrade the OSTC after a download from an
OSTC that doesn't have the latest version" is indeed functional.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 20:46:44 -08:00
Dirk Hohndel
003f5d18b6 Automatic OSTC firmware update: download file and try to install
This successfully downloads the hex file.
The actuall update of the OSTC fails before it gets started with a crash
when the ConfigureDiveComputer object is created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 10:22:46 -08:00
Dirk Hohndel
0be0cdb046 OSTC firmware update prompt: use the stable changelog files
Heinrichs Weikamp is giving us stable URLs from which we can get the
latest stable version. The parsing is a bit simplistic, but it seems to
work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 07:37:11 -08:00
Miika Turkia
5cb20ee4c9 Add .dlf to known extensions (Divesoft)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 06:42:43 -08:00
Miika Turkia
6cf3355508 Include QDebug header - otherwise a compile error
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 06:41:44 -08:00
Dirk Hohndel
2461a731fc Progress towards automatic OSTC firmware updates
Better parsing of the website data, a simpe dialog that informs the user
that they should upgrade their firmware.

Still doen't call the right code path to DO the upgrade.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28 06:39:30 -08:00
Dirk Hohndel
52084c80f7 Move OSTC firmware check around a bit
This rearranges the code so we can call it from the download dialog and
tell the user if there is a newer version of the firmware available.

This needs a proper dialog and needs to be hooked up so that the user can
accept the suggestion and go directly to the firmware update code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 08:31:51 -08:00
Dirk Hohndel
1c65b2f3c4 Small whitespace fix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 08:26:40 -08:00
Robert C. Helling
230ba7ace8 Read current version from H&W web page
This is only partial. It prints the current version string (to be
processed by a regex) via qDebug().

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27 07:14:31 -08:00
Miika Turkia
1e04aec7fd Preconfigured import of Subsurface CSV log file
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:43:43 -08:00
Tomaz Canabrava
42bd55877b Send the current selected dive to Facebook
This still only works for FB app admins at this time.
It always sends the dive that is shown in the profile.
It uses the resolution / size of the profile on screen.
It doesn't add any description and doesn't ask the user for explicit
permission to post (a preview would be even better with the ability to
edit the post).

But it's a great next step!

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:33:53 -08:00
Tomaz Canabrava
3d3eac7cc7 Send an experimental file to the experimental album on Facebook
And I had to create the Http header by hand because I couldn't
figure out how to do using HttpMultiPart from Qt.
not fun.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-25 10:40:09 -08:00
Miika Turkia
83fd196c4a Automatically increment column number on CSV import
This increments the column number automatically when doing manual CSV
import. Counter is decreased when un-checking checkboxes, but that is
all the logic there currently is.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-25 10:38:23 -08:00
Tomaz Canabrava
ee5d93e155 Changed Facebook stuff to socialnetworks.h/cpp
All Facebook related stuff now is on SocialNetworks.h/cpp
this makes it much easier to implement things and looking
for bugs.

working:
- logging in
- getting user id
- getting album id ( or creating it )

*much* more testing is needed, of course.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 15:54:28 -08:00
Dirk Hohndel
c8c17dc01e Revert "Remove unused strings from ui files"
This reverts commit 6e72b5b8c5.

That broke the functionality to add elements to the tables in the planner
and the equipment tab.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 10:06:41 -08:00
Tomaz Canabrava
a76fdd8d54 Create a Facebook album for Subsurface
We still need to do a lot of stuff on that part.
Currently when asking for sending a profile, it will just
create a private album.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 07:32:36 -08:00
Tomaz Canabrava
14a858cf2a Save and restore Facebook Prefs.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:38:12 -08:00
Tomaz Canabrava
5aa9fc6fe7 Get and save the UserID for use with Facebook.
Next: Publish something with the Graph API.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:58 -08:00
Tomaz Canabrava
9a2f836b1a Ask for facebook permission to post to a user newsfeed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:50 -08:00
Tomaz Canabrava
a7e148c0a8 Disconnect from facebook manually.
Added a button to disconnect from facebook.
This clears the webview cookies so it correctly
disconnects us from facebook, and clears the
access token.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:41 -08:00
Tomaz Canabrava
cc69e6ffa2 State that you are connected on Facebook.
TODO: Disconnect from facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:28 -08:00
Tomaz Canabrava
1a5cd0e155 Connect to facebook, save the tokens for future use.
We can now correctly connect to facebook endpoint. Nothing
really fancy at the moment. =/

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:36:53 -08:00
Tomaz Canabrava
1b8169036f Allow subsurface to login with facebook.
This piece of code allows subsurface to login with facebook
using the 'Subsurface' app created within facebook for secure
reasons. I'm the admin of it currently - but I'll pass it to
Dirk as well.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:35:54 -08:00
Dirk Hohndel
87febd33be Carefully create some forced margins
We don't want to waste space, but we don't want things to be too crammed
together, either. Especially not having horizontal margins for text can
look very awkward.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-23 10:16:11 -08:00
Dirk Hohndel
aff1bac497 Enable tag bubble eye candy for Qt5 and Mac
This works when building against Qt5, so no reason to hide the cute
bubbles from our Mac users anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-23 09:39:05 -08:00
Anton Lundin
44dd4df852 Enable firmware updates for OSTC3/OSTC Sport
This enables the dormant OSTC3/OSTC Sport firmware update code, now when
the hw_ostc3_device_fwupdate call is available in libdivecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:28:59 -08:00
Dirk Hohndel
74f5842f0c Add second CSV export with dive details
This is intended to export all the details that someone might copy from a
paper logbook. We need a matching import template to make this simple.

This hasn't been well tested, I'm sure it will break when elements and
attributes are missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-21 21:51:54 -08:00
Miika Turkia
071cea15c0 Glue between GUI and XSLT for additions in CSV import
This code sets the parameters properly to support the new fields in
manual CSV import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:30:52 -08:00
Miika Turkia
eb72f250b8 Hook the enable-disable for CSV import
This enables and disables the spinbox according to check box selection
for new fields in manual CSV import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:30:46 -08:00
Miika Turkia
8233f6c3b0 GUI change for manual CSV import
This adds fields for cylinder and temperature information on the
importing dialog.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:30:42 -08:00
Anton Lundin
1a4380c8c1 Connect QGraphicsScene to its parrent
This is to prevent a leak of QGraphicsScene.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
85d3817bd2 Connect Tagfilter to its parrent
This plugs another leak found by valgrind.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
4af39b7e37 Connect TankUseDelegate to its parrent
This plugs a memory leak found with valgrind.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
6e72b5b8c5 Remove unused strings from ui files
This removes unused strings from ui files. These showed up for
translation and are quite meaningless to translate.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
f14ef84c9a Free descriptions copied for TankItem
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:34:00 -08:00
Anton Lundin
4599172a19 Switch to having ui as member in MultiFilter
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 08:33:35 -08:00
Anton Lundin
8571268d21 Have ProfileWidget2 delete its allocated data
This creates a destructor for ProfileWidget2 that deletetes its new'ed
objects on exit.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:22:39 -08:00
Anton Lundin
bdea7dd0d6 Prevent leak by connecting object to its parrent
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:22:24 -08:00
Anton Lundin
d812d7b1f6 Free memory returned from get_dive_gas_string
After we created a QString from it, we need to free the char*.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:20:25 -08:00