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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
As per the suggestion by Dirk Hohndel, I changed the "Type of Diver" from
RadioButton to Checkbox.
The User Survey UI was not clear earlier, so I grouped the similar options under
a question. I also modified the language and re-arranged the visual components.
Earlier, the user could choose contradicting import types at once. This has beencorrected by using RadioButtons instead of CheckBoxes.
Signed-off-by : Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The UI in the User Survey page was not clear and the Text Blocks were getting
cut. So I increased the size of the Text Blocks.
Also the survey was using CheckBoxes instead of RadioButtons. The problem with
this is that the user could choose to be both Recreational and Technical diver
which cannot be possible. So I replaced the CheckBoxes with RadioButtons.
I also replaced the CheckBoxes, which asked the user from where he was importing data, with RadioButtons so that the user can select only one option.
I also modified the English used and made it concise and clear.
Signed-off by : Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Earlier, there was no option for the user to explicitly open the User
Survey form. This has been corrected by placing an option in the "Help"
menu by which the user can explicity open the User Survey form.
Signed-off-by: Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since replotting is expensive and it is triggered while scrolling
through the list of cylinders, better not do it for improved
user experience and replot only after the combo box loses
focus.
I hope this...
Fixes#768
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
<marble/MarbleDebug.h> is not availaible in all Marble versions.
As Marble::MarbleDebug::setEnabled(verbose) is only used when
MARBLE_SUBSURFACE_BRANCH is defined, also include header file only when
MARBLE_SUBSURFACE_BRANCH is set.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually inserting set-point changes at negative times (left
of the profile) caused the setpoint to end up at stupid values
(probably some signed/unsigned confusion). This patch aligns
them with the start of the dive.
Fixes#774
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Calling Subsurface with -v now gets you debug output. Of course, with a
regular "release" build of Marble you still won't see much. But with the
changes in the special Subsurface-testing branch you actually get some
very useful information when debugging a lack of maps in Marble.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Depending on the options shown, the latest change appears to have moved
the temperature graph a bit too low. This seems to work better in my
experiments.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This micro patch adds the ability to sort the lists alphabetically
for user interaction. Dirk asked me to do this for location, but
this actually changes for location, divemaster, buddy and suit.
Seems a good thing for all.
Fixes#780
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When opening the filter dialog we allow the user to filter the choices
that are shown. The text that they enter in that filter for filter
criteria should be treated as case insensitive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No idea why this code was there... but what it caused was an invalid
access to checkState[-1] when a dive had that first tag. This explains why
sometimes the dives that had that tag were shown, regardless of whether
the selected filter criteria should have excluded them or not.
Fixes#769
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The successful message was emitted in a some what older way then the
other messages so it was always emitted, even on error.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This changes the code so we include all the cylinders from a previous
dive when we re-plain a dive.
Otherwise we would have a hole in the cylinders table when we plan a
dive based on a dive where we have unused cylinders, and it makes more
sense to copy all of them rather than not.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A profiler session in the planner shows that for deep long dives
a significant amount of CPU time is spent in populate_pressure_information()
which interpolates the cylinder pressure graphs.
This patch introduces a "fast" flag for the replot of the profile
which is active while the mouse button is still pressed and that
suppresses this calculation.
In the future, this flag could be used for other responsiveness tunings
of the plot.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a context menu entry to add a setpoint change
event. In particular, this can be used to turn a logged dive into
a CCR dive.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows more space between the input fields in the dialog.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Date and duration formats are not necessarily self explanatory so adding
tooltips to explain the expected format.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For each polygon that we paint we have to step through the
plot_info from the start again.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before you could 'Cancel' the edit and then would be asked if you wanted
to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the
action of having clicked 'Cancel'. That's so confusing, it's even hard to
explain. Yes, it uses "typical" language for user interaction and kind of
makes sense, but it's not easy to understand for the non-technical user.
With the new labels the user is asked to whether they want to 'Apply' the
changes or 'Discard' them. And when they choose 'Discard' the verification
question is still 'Discard' or 'Cancel'. That seems much more consistent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If not cylinder with type DILUENT or OXYGEN is defined, this function
returns -1 which should not be used as an index to an array. This
patch adds code to check for this return value and exit gracefully.
On line I marked with a comment. Someone more knowledgeable of that part of
code than me should double check that return is here what we want.
[Dirk Hohndel: fixed small oversight...]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Clearly the static dialogs don't work. Even with the previous commit the
dialog still said "Save" insted of "Open". So let's just assemble our own
dialog and be done with it. I hope I got all the options right...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using the SaveFile dialog to open a file caused it to ask the user if they
wanted to overwrite a file when they actually tried to open an existing
file. This fixes that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we can specify file names that don't exist and therefore make our
git syntax (/path/to/dir[branch]) work.
Thanks to Tomaz for pointing this out.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a title bar with close button.
Set an appropriate title.
Centred the window relative to mainwindow.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code sets up the UI that will allow the user to adjust tank pressures
at a gaschange event. The actual changing of the pressure is not
implemented, yet, so this is disabled until someone finds time to do so.
The scenario is this: a tec diver or sidemount diver without pressure
sensors on at least one of their tanks still wants to reasonably
accurately track gas consumption during a dive. The diver takes notes of
the pressures at every tank switch (I find that odd, but apparently some
cave divers indeed do that as they switch back and forth between different
gases) and then wants to adjust the pressures in Subsurface to match those
written down.
One difficulty here is that the first and last pressure of a tank with no
sensor data is still considered "sensor pressure" - this is basically an
implementation detail in the code that is used to do the pressure
interpolation to have constant-SAC pressure plots for tanks without
sensors. So when we check if there is indeed no pressure data available at
the gas change, we can't just work with the interpolated pressure - if
this is the first (or last) time the tank was used, that pressure may be
marked as sensor pressure.
What's missing is the UI to enter the desired new pressure plus the black
magic that actually inserts this into the dive in a way that doesn't break
the assumptions in the rest of the code. I'm running out of time to do
that but wanted to preserve this code so someone can continue this later.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had the variable. As a pointer. Which we used memset to clear. Ouch -
that smells like some bad cut and paste.
With this change the object keeps the corresponding plotInfo around (just
like some others do) and can use it later. I suspect this code could use
some larger cleanup, but it's a bit too late for this in the development
cycle, I guess. I'm sure I'll regret this in the future...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the context menu of the profile it makes no sense to offer the ability
to switch gases unless there is a gas to switch to.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The only place where I'm not sure if there are unintended sideeffects of
changing over to the new domain is QCoreApplication::setOrganizationDomain
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt by default uses a rather simplistic text heuristic to figure out if a
menu entry is one of the special ones that need to be moved into the
application menu (About, Preferences, Quit - but for Preferences anything
that matches settings, options, config is used as well).
This patch tells Qt to keep its hands off the the DC configuration entry
in the menu.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
RulerNodeItem2::recalculate() does something which is
apparently not a good idea in combination with
RulerNodeItem2::mouseMoveEvent().
Each time the mouse moves, setPos() is called. Then in
recalculate() the x() value is checked and if less than 0
it's changed to x = 0 (setPos(0, y());).
This last call (setPos(0, y());)
however does not work and the value remains less than zero
leaving one of the ruler points outside of the graph.
To solve the issue we add a silly explicit check if x() < 0
before calling setPos() in RulerNodeItem2::mouseMoveEvent().
The 'x() > timeAxis->posAtValue(data->sec)' strangely works
on the other hand.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Extend the tooltips to be shown both on the labels and the values and add
tooltips for all min/avg/max elements.
To avoid confusion when only one dive is selected, no longer show min SAC
or max SAC or min duration or max duration.
Fixes#694
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove the unused upper widget, set a somewhat random but at least more
reasonable default size and finally support Ctrl-W and Ctrl-Q shortcuts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also fixes a bug in the diluent pressure interpolation
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Maybe it would be better to just copy the whole structure and then clear
the things we don't want to copy? This seems fragile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We copied the string pointers instead of copying the strings. Once those
got freed, things went downhill.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
--047d7b8737f87ede8e050803e6b2
Content-Type: text/plain; charset=UTF-8
<div dir="ltr"><br></div>
From 3db4a422485374801ca2f6233ec23b8671a8656d Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@intel.com>
Date: Sun, 16 Nov 2014 23:22:58 -0200
Subject: [PATCH] fix 727 - position correctly the popup.
When the user entered a tag and that made the message box display
the popup with the possible choices was still in the old position
hidding the line edit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The MultiFilter itself should walk the dives in a trip. This way the logic
(OR within a category, but AND between categories) is correctly applied
and the flags in the dives are set correctly (which makes the overall
counts for dives filtered work correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the text easier to translate (and more meaningful).
Also modifies its position to be centereed in order to look less "squeezed
into the corner".
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
But the filter count seems to be broken for some reason and
I really don't know why. It seems to work for tags, but
not for everything else.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
as we load dives and dives, new DiveEvents will be created
but the transparent pixmap never deleted, also this makes
the transparent pixmap only for the correct event, not for
all of them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some dive computers appear to have heading data in every sample. In order
to avoid a completely cluttered dive profile we no longer show a flag for
every heading event but instead show a basically transparent pixmap (which
is invisible to the user) that allows us to report the heading information
in the tooltip but leaves the profile uncluttered.
Fixes#586
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the .txt to the list of all dive log files as this is the file we
expect to be opened for Poseidon Mk6 log files.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Seems like QMarginsF and QPageLayout were added quite
recently - in Qt5.3!
We attempt to support older versions by using something
found in the Qt4.7 documentation.
Patch also fixes small ordering issue where top / left
margins were swapped.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
All the print options will be stored after the user closes
or "cancels" the print dialog.
There seems to be no good way to store the last
selected page size, because print dialogs are different and
some just list them as strings - A4, A3, etc.
The patch also applies the following changes:
- renames display.h's 'struct options' to 'struct print_options'
as these were really just for the print dialog
- the print_options dialog now stores more options as 'bool'
- demote PrintDialog's 'printOptions' to 'private'
Fixes#653
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is no longer just a tag filter. Also, since we use this entry (and
its shortcut) like a toggle we should mark the menu entry accordingly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the last of the series of Macros that I'll do to ease
the creation of a QStringListModel based filter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
New method to simplify the creation of 4 of the common
methods for each filter in an easy way. There are
a few other methods that I'm also thinking on how
to do this.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
samething as the other commits, use common code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The setData of any filter based on a StringList with
checkboxes should be the same, so let's use the same
codebase for it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is just to simplify the creation of more filters.
more macros will be used, because I tend to abuse them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already have a bunch of filters, let's pack them together
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Depth is often mentioned in a length unit, but what we care about is
pressure. When diving in fresh water the pressure is lower than the same
depth in salt water. This adds support for using different salinities in
planning.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By popular demand, this changes the names of the Suunto Safety levels.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way other parts of the code can act on the "hidden_by_filter" state.
This also cleans up the way we track if a dive is hidden - do it in the
multi filter instead of the individual filters.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Code to clean the filters. Maybe I'll also need to call this upon
closing the dialog?
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
clicking on the close button will close the widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Buttons to close, minimize and clear were added. We need better icons.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
a bit of extra spacing was necessary to get rid of the scrollbar.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>