This should keep the message widget visible without horizontal scroll bar,
even on fairly small screens.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The button box on the bottom of the window made it a bit cluttered
on small screens, this patch uses the window of the MessageWidget
to show the butons - this way less space is used and things are better
spaced on screen.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a context menu to set the dive location
via the globe, being the dive with a coordinate or not.
It also fixes setting the dive location on edit mode.
Fixes: #315
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing air or water temperature, you are actually editing the
information in the active divecomputer structure. But the Dive Info shows
the summary data created from the temperature data in all dive computers.
For most people who will only ever have one divecomputer per dive this may
seem like an artificial distinction, but it's very important if you track
more than one computer.
So in order to have an edit reflected in what's shown, we must redo the
"summary creation" for data from the different divecomputers into the
summary fields of the dive.
Fixes#313
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The "air / water Temperatures" label didn't look to good.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since some early bird thought it was a good idea to force the rest of us
to get up early by changing our clocks during summer, we can not use the
currentDateTime() to determine the timezone offset for all dives.
Instead, we just pretend that everything is in UTC and avoid doing the
offset calculations.
If only that early bird knew that if clocks stayed consistent throughout
the year then I could be asleep instead of fixing this in the middle of
the night..
Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply clear the edited dive (regardless of whether it's set) and hide the
message if visible. The previous code was a little too convoluted...
Fixes#305
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes it possible to hide some columns on the Cylinders
Equipment pane. The 'remove' and 'type' are impossible to hide,
since they are the most important ones for a non-tech diver.
Fixes#281
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing a dive, a group of dives or a trip we need to make sure that
we don't lose track of which dives and trips were selected. Otherwise we
might act on dives that DON'T appear selected in the UI but that we think
are still selected.
Fixes#304
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch remembers the trip selection across the Dive Tree Model.
It's a tiny bit big because we used to have a variable 'selected
trips' that's now calculed dynamically - this is more future proof.
This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the
code in this class to nearly a half. )
Fixes#303
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before, when clicking the OK button on the preferences GUI, we were
updating in-memory preferences from the GUI, saving them to the
configuration file from the GUI, reloading from the file to the
in-memory preferences. Then, to add to the ducplication, when the
application was exiting, some fields were saved again.
Basically the first step and the last step were useless appart from
the fact the the other steps where missing a few fields here and there.
This patch removes the first step and fixes the missing fields.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
ACKed-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit painful, but we basically walk the samples and pick the
valid tank from the events. And then we do a simple discrete integration
to figure out the mean depth per tank and duration per tank. And then we
assemble all that into per tank statistics.
Strangely the value calculated here seems slightly higher than one would
expect from the overall SAC rate. This inconsistency should be
investigated a bit further, but my guess it it's based on the assumption
that the DC provided mean depth is possibly more accurate than what we can
calculate from the profile.
Fixes#284
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This shows how much gas form each cylinder was used. I would like to add
SAC to that list too but it became a mess trying to calculate average
depth per cylinder.
Design based on idea in #284
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Two errors fixed.
- With no location set, the summary line would start with a ','.
- When auto creating a trip for a manually added dive or when editing the
dates of dives in a trip, the timestamp for the trip was not updated
after editing the dive.
Fixes#293
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems like a much nicer user experience. Editing a location's name is
immediately reflected on the globe label, the moment it happens.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we are editing or adding a dive, the globe widget needs to act
differently. Instead of directly changing the lat/lon of selected dives,
it needs populate the coordinate text field as if this information was
entered by the user (effectively all it is is a way to more conveniently
enter coordinates).
As a side effect, this also allows us to change the location once it has
been added (you just need to go into dive edit mode to do so).
There is one weird issue that occasionally (and I can't quite reproduce
this) I get lat/lon very close to 0/0 (as if the globe widget was centered
on 0/0 and not on whatever it is actually showing). That still needs to be
addressed.
Fixes#239Fixes#131
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- get_gas_from_events does NOT always set o2/he. It only updates them IFF
a matching event is found; so we need to make sure we start out with a
valid gas mix
- the way we tried to restore the edited dive in case of an edit to a
manually added that is cancelled was completely bogus. Way too complex
when we can simply and reliably simply store the dive and then copy it
back
Fixes#270
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changes Ok button to a Save button Modifies editing messages to reference
buttons Save and Cancel.
Fixes#245
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of hard coding a American date format, let qt use whatever the
locale suggests.
Fixes#248
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch just reverts some wrong changes that I'v done on a
past commit ( sorry ) and correctly handles the selectDive,
by using a IDX instead of the dive pointer, as dirk told me
it's extremely error-prone since the pointer can change.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When completing tags, the case of the completion prefix
should not matter.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit scares me. Any pointers to dives or indices into the dive
table... anything like that is invalid after we resort the table. Well,
not technically "invalid" (as in bad pointers), but after re-sorting the
table these will possibly not be pointing at what we expected.
This starts with the selection being "wrong" after we add a dive that
isn't the last dive (once we click OK the chronologically last dive will
be selected).
But of course without doing this, our #1 assumption about the dive_table
is broken. The dive_table is supposed to be in chronological order.
Best advice of course would be "don't enter dives out of order" - but of
course that's not realistic.
Fixes#234
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is subtle. Normally you would expect someone to edit the tank data by
simply clicking on it in the equipment tab. But a user could conceivably
edit the tank data after clicking on the profile editing button instead.
This works now as well.
This also addresses the issue that start and end pressure were not shown
in profile editing mode.
Fixes#235
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We remember what was selected before and restore it. Maybe there's a more
"Qt way" of doing this, but my implementation appears to work :-)
Also remove unconditional debug output that snuck into an earlier commit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We carefully assembled the correct data in the cylinders - don't replace
that data when manually editing a dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the offending commit a QWidget was changed to QTableView, but
only in the header - and thus making avaliable all method calls,
but the initialization of the widgets was still a QWidget, and
nothing of QTableView was used besides an incorrect call to
setColumnHidden.
This commit fixes that by using the view() method provided by the
TableView implementation which returns the true QTableView that should be
used for specific nitpicking, like hidding columns. :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Previously gps information was always overwritten, unless the user had
modified it in the current editing session. This causes problem with
some use cases, like when coordinates are provided before the location
name by the companion app.
Now gps information is only overwritten when it is:
- Empty
- Auto-completed in the current editing session. (When the user hits
accept it is considered hand-edited.)
Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This now offers the correct gases for which we have cylinders defined.
For both the planner and add dive we still don't end up with the correct
cylinders in the resulting dive. But that's for another commit to fix.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should leave the program in a consistent state after add dive was
cancelled (and do the right thing in case the dive list was empty).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This just makes sure that we do the right thing with the staging drive,
that we don't mess up the selection, the we are smart about using our
helper functions, etc.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
To make the planner work this adds a new column to the Cylinder widget
(depth - for the depth at which we want to change to a certain gas
during deco).
This also tries to hide that column in the equipment view and hide the
start/end pressure columns in the planner view. Oddly that fails :-(
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This caused us to get royally confused when manually adding a dive and
trying to set the location through the marble widget.
Fixes # 229
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is intended to allow the user to provide the gases / cylinders that
she will be diving with. With that information the planner can warn the
user about insufficient gases, but more importantly it can show relevant
gases in the gas select drop down.
Right now the add cylinder button doesn't add a cylinder - that's a
problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The user could add a dive, and in the middle click on the 'plan'
button. Since we didn't cared about that on the widget, a lot of
inconsistencies could occour. this fixes that by setting a flag
on the Planner, that has now three modes: nothing, plan and add.
(maybe in the future an edit mode will be valid too.)
If in 'NOTHING' mode, user can enter the addition, edition and
planning. If in any other mode, user can't do a thing. The mode
gets back to NOTHING when user accepts or cancels a plan / add
/ edition.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to make sure that the correct segment has the correct gas assigned
to it - and that those gases are correctly tracked when editing a manually
added dive as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On equipment tab, when editing a cell and then clicking on cancel button,
it would delete all the cylinders table. Now it performs the original
behaviour of recovering the original value of the cell and don't delete
the table.
Signed-off-by: exhora <exhora.tat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also hide ui.CoordinatedLabel when editing a trip,
since ui.coordinates is hidden.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I still wonder if we have all the semantics correct for multi dive
editing. This will need more testing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A custom tag widget has been added to MainTab.
Tags are seperated by a comma ",". The implementation
supports escaping a comma by using "\,".
While typing, the widget supports the user by suggesting
tags using a QCompleter.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
This enables undo for the edit mode on added dives, it uses the
premade backup to fill the old dive with data. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This patch enables editing a dive that was manually entered,
it doesn't cover dive plans yet because on the plan I need to
figure out what are the 'user-entered' points, and what are
the algorithm point. and I feel lazy. =p
One last thing that's missing is to revert the dive to the
previous condition if the user cancels the edition, currently
canceling and applying ok is the same thing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>