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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>