The idea is that a week after the user starts using Subsurface we ask them
if they would like to submit a survey response.
If you are running a development build, don't wait seven days.
This patch doesn't do anything with the user's selections, doesn't submit
anything to our server, etc. It's just a placeholder to tune what we
should ask, etc.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In planner mode, this replaces the globe with the dive plan and introduces
a new plannerSettingsWidget in the diveListPane. All new fields are still
disfunctional. This is WIP.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"warning: suggest parentheses around assignment used
as truth value [-Wparentheses]"
I think 4.8.2 is confused about this one, but we suppress
it regardless by separating into two assignments.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And make sure it gets called whenever it needs to get called - it was
missing from the openRecentFile case.
Fixes#530
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is kind of a random cut off, but if plotting the dive takes more than
a second and TTS/NDL is on, we force it off. Because the algorithm for
that is fundamentally quadratic in nature it can take a VERY long time -
getting users to think something is broken.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems odd to have different behavior depending on whether the window
manager tells us that the user wants to close the window or whether the
user hits quit or ctrl-q.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small changes in the model to display the pictures of the dives.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Call that method from the mainWindow when the dive changes.
The updateDivePictures walks around the events of the first dc (since all
pictures are distributed allong all dive computers) to get the events of
type '123' (I wonder if there's not a better way to save pictures on the
dive, like an linked list of char* named pictures.)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When switching to / from plan mode, we switch to show either the dive plan
detail widget, or the dive list widget.
So far this widget does nothing. This just makes sure it's there.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Moved the connections between DivePlannerPointsModel and
MainWindow from inside the Planner class to the MainWindow.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If there was no current dive we didn't set up any cylinder at all which
was a bit awkward as we use AIR but have no cylinder corresponding to it,
which breaks assumptions elsewhere.
Instead we use either the default cylinder or make one up.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Duh. We had to reload the list (and make sure the internal data structures
are recreated as well) before restoring the selection.
I also switched to simply accessing the widget directly, instead of via
the dive_list() call.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is still something seriously wrong here.
For now let's just not restore the selection and at least this prevents us
from crashing. But I still don't understand why it crashes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
for some reason the next selected dive is NULL after cancelling the
plan. I'm investigating.
This patch fixes the show of the empty profile and it also untangles
some parts of the code, keeping the mainwindow where it should belong
: the mainwindow.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This only partially works. If I start from an empty dive list, plan a
dive, then abort, there are still leftovers in the profile widget.
Hitting Ctrl-W clears that out. But it just runs the same cleanUpEmpty()
again...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On an empty dive list we would remember the new dive (which gets
auto-selected since it's the only dive) and then crash when we try to
restore that selection after cancel (in which case that new dive is gone).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were making things way too hard (and were doing things that don't need
doing, like clearing the DivePlanPointModel).
Currently we still crash after manually adding a dive or when canceling
a plan.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As Tomaz suggested, I don't need to pass the information whether we are on
the planner into the function - it's part of the DivePlannerPointsModel
and therefore already knows.
Also, we want to make sure we actually use the gas that's in the first
cylidner of the staging dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This still crashes when you abort the plan.
And when you accept the plan, the profile stays stuck in PLAN mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The existing code had no chance of every working - on so many levels.
First unselect all dives, then extract data from a selected dive?
Set up the cylinder data (which didn't work), and then clear the data
again?
What the heck.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On the cleanup dirk forgot to set the plan tipe to PLAN instead of ADD
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow to both create the full default dive or ownly the descent and bottom
part (so the planner can deal with the ascent).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is working in the wrong way, mostly because I'm setting the
plannermodel to ADD state ( and the planner graphic to the
correct PLAN state ), but I don't know why - when on PLAN state
on the model, things just don't work.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This function should likely to move to C in the future, I'm only
adding this here because I'm changing this file so much ( already
4 rewrites of the function )
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The disableDcShortcuts is called inside of the ProfileGraphics
( I actually think that this method should be moved to there )
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This correctly enables the planner on the new profile,
but it doesn't triggers the correct paint on the canvas.
[Dirk Hohndel: remove other remnants of the disabled planner as well]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code removed was already ported to the New Profile.
We managed to clean quite a bit. huhhy
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
But it doesn't move the handlers yet, and when you confirm it you also
must click on the dive to select it or the profile will show garbage.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a signal to MainTab, that should be removed from there
when we finish the rework on the edit part, to go to the edit classes,
but in the meantime, let's keep it there.
The signal is connected to the ProfileWidget in a way that the end of the
edit will also trigger the profile to go back to ProfileState (show the
dive, if there's any) or empty Profile (if there's none).
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is highly broken in many ways - but it's the right first step.
I ported two of the most important methods from the old profile and now if
you are in add dive mode, double clicking on the new profile will
correctly add a handler on the planned dive. To see and move the handler
around, however, you need to activate the old planner.
Next step: add the handlers on the new profile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the ability to close the exporting window, also Quit Subsurface with
this window in front, for consistency.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As our menus are getting many export entries, it is better to create a
single export dialog where user is able to select the export type and
whether to export selected dives or all of them. This should also be
more intuitive than the current way when export from file menu export
all dives and right click menu on divelist exports only selected dives.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No attempt is made to ensure that what the user does is sane. So this can
result in duplicate numbers, non-consecutive numbers, non-monotonous
numbers, whatever floats the users boat.
You can renumber a single dive or all selected dives (with a starting
number given that is applied to the oldest selected dive and then for each
newer selected dive that number is incremented by one).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we successfully download dives, the old selection should be cleared and
the one of the newly downloaded dives should be selected. I decided to
pick the last dive downloaded, which for most dive computers (but for
example not for the Uemis SDA) will be the first or earliest of the dives.
That seems much more intuitive than keeping the previous selection around.
Of course this is harder than it should be because of the way we track
selections and because we need a consistent dive list model in order to
change the selection.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This may sound counterintuitive but it actually makes sense.
If you have a default filename that's the name of you "normal working
file". If you want "Save as" something, that by definition is NOT your
normal working file but a subset or an experiment or something. And you
most definitely do NOT want to overwrite your default file with that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>