Commit graph

19 commits

Author SHA1 Message Date
Berthold Stoeger
24c72cb359 Inform LocationFilterModel of added dive site name
If the user implicitly adds a dive site by editing a dive, and
a location filter is active, check the new dive site in the
location filter.

This is done by informing the LocationFilterModel of the new
dive site name prior to repopulation. The LocationFilterModel
then adds a corresponding entry and marks it as checked.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26 18:50:40 -08:00
Berthold Stoeger
2a0520d57d Simplify signal handling after dive site editing
Since commit 01d961086c, MainWindow::refreshDisplay()
is called in the refreshDiveInfo() signal of maintab after editing a
dive site. Since this was the only use of the refreshDiveInfo signal,
remove this signal and instead connect to MainWindow::refreshDisplay directly.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26 18:50:40 -08:00
Stefan Fuchs
3649963bc4 In maintab clear location tags when selecting a dive w/o dive site
Until now when selecting a dive w/o dive site after having a previous
dive with dive site and location tags displayed, the location tags of the
previously selected dive where still displayed.

This fixes this behavior.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-26 14:17:38 +01:00
Berthold Stoeger
01d961086c Refresh display if a dive site was edited
Calls MainWindow::refreshDisplay() if a dive site was edited so that
the filter lists are updated. The old call to updateDiveInfo() was
removed because it is call implicitly in MainWindow::refreshDisplay()
anyway.

Fixes #675.

Requested-by: Stefan Fuchs <sfuchs@gmx.de>

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25 15:34:51 -08:00
Stefan Fuchs
010f5f2abc In maintab disable correct label when dive trip selected
Until now accidentally the dateLabel was disabled and the timeLabel
was enabled. Changed this the other (correct) way round.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-16 11:34:12 -08:00
Robert C. Helling
a422957cd6 Use displayed_dc instead of current_dc
current_dc is a macro that determines the dive computer
based on the current dive number. When the planner is started
from an emtpy dive list, the dive number ends up being -1 and
that doesn't produce a valid dive computer. Use the divecomputer
of the displayed_dive instead. This is done via a macro that
can also be used in two other places. Without this patch, the
planner crashed when called on an empty dive list.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-19 14:57:02 -04:00
Stefan Fuchs
884e690049 Tags for geo references: Nicer look, translations and warning message
For the geo references tags update the following:
- Nicer look w/o "Tags:" text and brackets when inside location UI
- Translation for "Tags:"
- Warning message when no dive site layout categories are set

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-17 06:12:07 -04:00
Dirk Hohndel
0799d046ba Disable editDiveSiteButton without dive site name
Entering a name first creates and hooks up a dive site which we can then
use in the edit dive site dialog to store modifications.

This doesn't really fix these two bugs, but it might impact whether they
can still be recreated

See #633
See #636

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07 08:16:53 -07:00
Dirk Hohndel
ed78aeade0 Change the signature of constructLocationTags
We actually want to be able to pass a specific divesite structure
and not have it look that up by uuid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04 08:05:09 -07:00
Lubomir I. Ivanov
4bb180b117 remove Marble from the source tree
In desktop-widgets, remove globe.cpp, globe.h and also remove
the NO_MARBLE macro usage.

At this point the MapWidget will always be created and there will
always be a map in the application.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-09-04 07:46:35 -07:00
Lubomir I. Ivanov
ae52e2a272 maintab: use GlobeGPS / MapWidget abstraction
Based on NO_MARBLE, call the same methods in the two different classes.
Later the dummy Marble GlobeGPS (for NO_MARBLE) should be removed.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Dirk Hohndel
ad5819c42e Save tags when manually adding dive
Tags are handled differently from other fields, we need to call
the special handling after the new dive was added and marked as
the current dive.

Fixes: #369

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06 12:47:04 -07:00
Dirk Hohndel
9021a44ccc Add SPDX header to desktop widgets
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Tomaz Canabrava
7aac3852c1 Fix saving table size
We need to make sure the model is avaliable for the table
until it hits the destructor.

Fixes #347

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-26 17:45:34 +02:00
Stefan Fuchs
bea1217f7b Move extra info tab in main window to the very right side again
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-21 11:27:15 -07:00
Jan Mulder
b809019c7a Also translate tab headers
After the restyle of the maintab code, the translation of some tab titles went
missing. Corrected here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-14 09:50:38 -07:00
Tomaz Canabrava
385816be2e Aparently, remove a QXB warning.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:25:53 -07:00
Tomaz Canabrava
2f86cbdc36 Clean up some widgets
Simplify logic of handling the Message that this
dive is being modified.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:25:15 -07:00
Tomaz Canabrava
1fc4fba69f Break down MainTab into smaller classes
Maintab is one of our most complex classes, and it's
something I'm not actually proud of. But it currently
works and the idea of splitting it was in my head for
quite a while.

This is the third or fourth tentative of splitting it,
and this time I let the most complex part of it untouched,
the Notes and Equipment tab are way too complex to untangle
right now on my limited time.

A new class 'TabBase' should be used for any new tab that
we may create, and added on the MainTab (see the new lines
on the MainTab constructor).

Also, Extra Info, Information, Photos and Statistics where
ported to this new way helping reduce the number of
lines and functions on the MainTab quite a bit.

Overall this is a step in the right direction for the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:23:25 -07:00
Renamed from desktop-widgets/maintab.cpp (Browse further)