Ordering here is important - we can't resize the columns before they are
created. On the other hand this now means that we explicitly need to
expand to the first dive shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds support showing and for editing weigthsystems in the equipment tab,
so, now the two things that are missing are 'edit' and 'delete', wich are quite easy to do.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
i
Added the code to show the cylinders from a dive,
this code also already permits additions from the
interface, so the user can click 'add' and insert
what he wants there.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Small changes to the names of elements the divecomputer download UI and
very simplistic first stab at populating the device_data_t structure.
This is lacking lots of things
- it should remember the last vendor / product used
- it should figure out which device (mount point) to offer
- it needs proper error handling
But it's a step in the right direction.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This uses the QStringListModel to populate the items
of the QComboBoxes. I used a QHash to hold every Computer
of a particular Vendor. so, products[vendor] gives me
the full list of products from each vendor.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
I think it's self explanatory - When user clicks on
'Cancel', the interface will wait for the trhead to quit
then will close itself.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This is the skeleton code for a non-blocking ui-thread
It already creates the first-thread ( 'do not block the ui' )
and the second thread ('download from the dive computer')
We can in the future merge both in the same place - I didn't
want to do that now because the download function is written
in the libdivecomputer.c code, and I cant just transform that
to a QThread and use signals, so I used two threads for that.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This also removes some incorrect code from the clear() function for the
DiveInfo tab. Putting the readOnly() calls for the DiveNotes tab there was
wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This would be correct if the current selection code wasn't broken. Right
now we only add to our internal notion of what is selected - we never
deselect anything.
Once that is fixed, thestatistics should be correctly displayed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's not editable. And of course it continues to look like utter crap -
even more so now since this is left aligned and everything else is
centered.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This also fixes a potential crash if no dives were loaded and the user
started editing the fields and clicked OK.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows us to do the right thing at exit (and also connects to more of
the menu actions to actually do something).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We want to give the user the option to 'cancel' and not exit the program,
to 'save' the file, or to say I'm 'OK' with losing the unsaved data.
This does NOT implement the actual save / save-as, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old names made sense in the initial model (where you'd click on the
edit button to start an edit). The new names seem much more natural given
what we do now.
Also a tiny code cleanup removing a redundant if statement.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit 7b00668b400b ("Improve the Dirk edit mode.") had what looks like an
"autocomplete" typo. This also stops us from changing the text on the
button that in this edit mode is always just the "OK" button.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Pulled one more helper from statistics-gtk.c (but didn't modify the code
there to use it as that code is no longer being compiled).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dirk edit mode will be triggered as soon as the user
clicks on the field that he wants to edit. then he can
edit all fields, till he press ok / reset.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This is just a for choosing the default edit style in the
future. I prefer the new edit style as the user is sure
what the hell is going on ( ie - if he chooses to edit,
he is editing, there's a message warning him that he is
editing and everything else is blocked till he finishes
editing. ) and the GTK version is 'edit whenever I feel like',
wich I think is more unsafe but dirk asked me to put an option
and let the others choose.
e
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This makes the DiveList be similiar to the GTK one, comparing
the size of the text. The current code makes text on the
table be 30% smaller.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This seemed more logical than keeping it as "edit" and basically having to
hit "edit" a second time in order to save a change.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is to prevent loss of data, so if the user is editing something,
either cancel the edition or save it, to continue moving around on
the Dive List. - Only the dive list is affected, user can still
play with the globe and the profile.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added option to edit the selected dive.
Now the user can click on 'Edit', and a nice box will
appear stating that the dive is in edit mode, and the user
can edit all of the 'Notes' tab fields, including the
rating. When the edition is finished, the user needs to
click on 'edit' again to mark as accepted, or in
reset to reset the fields to it's original state
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a major hack. Debian appears to be missing a necessary header file
for Marble to work correctly. We include this header file for now and hack
the Configure process to recognize that we are on Debian and force using
our local copy of the header file in that case.
This may be needed on Ubuntu as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Borrowed the code from KMessageWidget from Aurelian Gateau, Kdelibs,
to better show passive information and notifications. instead of a
popup blowing in the user's face, a nice, animated and well designed
widget will gracefully fade-in, show the notes, and fade out when
not needed anymore.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the possibility to change the coordinates of a dive.
it's too intrusive in the moment, but it was a proof
of concept. so I'll commit as is and try to find a better
way to warn the user what's going on in the future, using
something less terrible than a popup exploding in his face.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The marble widget now shows the dive locations
and also will center on the dive that the user clicked
in the dive list.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Adds preliminary support for marble widget, alongside with the
dive list. my idea is to let the view stay there at the left of the
dive list since we got a lot of unused space and a globe is something
nice to have - so you can look around where did you dived, the
dives near the one that's currectly selected, and so on.
I'm not using OpenStreetMaps right now, but a good thing about
marble is that it is skinnable - so for instance, a dive school
could present a dive lesson using subsurface with a globe from the
1600, to make it feel like 'history'.
This version will only compile to Qt4.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
When the application launches, the oldModel is null.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch fixes loading a second dive-file after the first
one had been loaded. it simply clears some information and
makes sure that the current selected dive is invalid when
the file closes. I also did a bit of code cleanup on this one
to make things simpler in the future.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On some maps, the lack of setting up the dc before plotting
the dive-computer nick caused a division by zero, breaking
the correct visualization of the dive.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The selected dive was being set to zero when the program
started, but zero is actually the first dive. There
were workarounds on the gtk code for that probably
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The weight management widget added 500 grams / 0.5 lbs
when a new entry was added.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>