aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.h
AgeCommit message (Collapse)Author
2015-02-10Add the first call to registerApplicationStateGravatar Tomaz Canabrava
This will be used to set the 'default' state. The other two possible states right now are plan and add; those will be created right next. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Don't just change the location when double clicking on the globeGravatar Dirk Hohndel
Instead be consistent with other parts of the code and put us in editing mode so the user can accept / reject the change. See #800 Fixes #801 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Headers cleanup.Gravatar Tomaz Canabrava
Too much noise on the headers, this commit remove uneeded headers when they are uneeded. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Globe: do a better job detecting double clicks and setting GPS coordinatesGravatar Dirk Hohndel
For some reasons Marble appears to sometimes not detect double clicks and call the correct callback. With this commit we manually intercept the double clocks and route them to the right function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Gratuitous whitespace changesGravatar Dirk Hohndel
I keep trying to get to consistenct. Completely hopeless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Fix building with NO_MARBLE prepareForGetDiveCoordinatesGravatar Anton Lundin
Commit fb82da58a2 ("Globe: assume that we are looking at the current_dive") changed the prototype for GlobeGPS::prepareForGetDiveCoordinates. This patches the dummy in NO_MARBLE. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Fix building with NO_MARBLE, centerOnCurrentDiveGravatar Anton Lundin
Commit 2bc76beb65 ("Globe: we always center on the current dive") changed GlobeGPS::centerOn to GlobeGPS::centerOnCurrentDive. This patches the dummy in NO_MARBLE, too. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-08Fix building with NO_MARBLE after prototype changeGravatar Anton Lundin
4243fcb915 ("Dont set coordinates when two or more dives are selected") Changed how the prototypes in GlobeGPS looks. This aligns NO_MARBLE version of GlobeGPS with that. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-07Globe: assume that we are looking at the current_diveGravatar Dirk Hohndel
As in commit 3870bdafee53 ("Globe: we always center on the current dive") passing in a specific dive here makes no sense - it's always about the current dive. Fixes #513 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-07Globe: we always center on the current diveGravatar Dirk Hohndel
Simplify the API (we'll take advantage of this in the next commit). We always center the globe on the current dive, so no point in passing that dive in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01Dont set coordinates when two or more dives are selectedv4.0.97Gravatar Tomaz Canabrava
If a trip is selected (or for other reasons more than one dive), this would change the GPS coordinates of the whole selection which almost certainly isn't what the user wanted. Instead, only allow changes of the coordinates on the globe if exactly one dive is selected. [Dirk Hohndel: massively rewritten and extended - but I didn't want to simply "steal" the commit from Tomaz... This now maintains the "zoom out mode" for dives without GPS coordinates and deals with edits of multiple dives that are initiated the "normal way" by starting to edit other data as well.] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01Restore the previous globe zoom level after showing dive without GPSGravatar Dirk Hohndel
Thanks to commit 83c5ab58718e ("Zoom out when dive has no coords.") we show more of the globe when displaying dives without GPS data - but that caused us to forget the zoom level we used before and so the experience when switching back to a dive with GPS data was disappointing. This makes sure we track the last valid zoom level and restore it when needed. I also replaced the deprecated zoomView() calls with setZoom() calls. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Introduce NO_MARBLE define, make GlobeGPS a dummyGravatar Anton Lundin
Some users have requested a way to build subsurface without marble. This hides all traces in the ui and creates a GlobeGPS-dummy thats just a QLabel saying that marble is disabled, in case its shown somehow. The dummy is there so we can just ignore the fact that marble is disabled in the rest of the code. Fixes #394 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Fixes Setting the dive-location via the map.Gravatar Tomaz Canabrava
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>
2013-11-22Disables zooming by double click and context menu on marble.Gravatar Tomaz Canabrava
Marble is a weird piece of Qt software, it seems that it wasn't thought of being a library when first written. Most of its features are not achieved by subclassing && overriding one of Qt default methods, instead we need to eventFilter for almost everything ( which is a pain, and a bit error prone - see our combo box delegate *puke*. ) This one's ready, only one thing though - if we want to implement our own context menu, we will need to use the eventFilter, and not the contextMenuEvent. Fixes #291 [Dirk Hohndel: this does not disable the context menu for me...] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Immediately show new locations on globe widgetGravatar Dirk Hohndel
When modifying or adding a dive location on the globe widget while in dive edit or dive add mode, we now show the modified / new location right away on the globe (assuming a location name has been given). This makes it much easier to manually reposition a dive location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Handle double clicks on globe during dive edit modeGravatar Dirk Hohndel
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 #239 Fixes #131 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Fix marble losting track of zoom levelGravatar Dirk Hohndel
Marble had a bug on the way it treats zoom level, there's no way for it to find out if it's user-input or algorithm input and when a user clicks on a dive, it spins and centers on it, but if the user clicks on another dive when it's still spinning, it will get the zoom in the actual state ( spinning, usually zoom is far away from the first position ) and continue the spin to the other position. This patch works by saving the first location and triggering a helper function with a timer that will only update the zoom level if the timer is not active ( and thus, will not get the bugged zoom state set by the animation. ). Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Consistently use slots / signalsGravatar Dirk Hohndel
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind. Let's make this consistent again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Get single click on the map widget in a callback for further processingGravatar Dirk Hohndel
Now Linus can write the code that selects the right dives... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Show locations with same name on the map if they are more than 50m apartGravatar Dirk Hohndel
Not showing them at all was a little too blunt of an instrument. There likely are dive spots with the same name at different resorts. And even at the same resort you could have multiple morings for the same dive site. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30Fix compilation: error: ‘GeoDataDocument’ does not name a typeGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-25Avoid marble widget resize when switching divesGravatar Henrik Brautaset Aronsen
The "no dive location" message box was displayed above the marble widget, which made the layout splitter move horizontally. Made the message box as an overlay on the map instead. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22The never ending, futile fight for whitespace consistencyGravatar Dirk Hohndel
I just need to write a tool that does this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-17Borrowed the KMessageWidget code to better show passive information.Gravatar Tomaz Canabrava
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>
2013-05-17Added the possibility to change the coordinates of a dive.Gravatar Tomaz Canabrava
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>
2013-05-17Adds rotation while selecting a dive.Gravatar Tomaz Canabrava
This adds rotation, a very, very shinny feature. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-17removed whitespace.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-17Added real support for the marble widgetGravatar Tomaz Canabrava
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>
2013-05-17Adds preliminary support for Marble WidgetGravatar Tomaz Canabrava
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>