On Tue, Jun 10, 2014 at 11:43:37PM +0200, Anton Lundin wrote:
> Open a dive without Location name or coordinates, ex. dives/test0.xml
> 
> Add a location name, hit save. Try to add a coordinate via clicking in
> the marble widget, nothing happens.

Hmm, can you try this patch? It's ugly as #*$&% but should make sure that
we get double clicks delivered even if marble "doesn't feel like it".

diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 8d234194ecb5..440d5a0dd12d 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -88,17 +88,23 @@ GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
 
 bool GlobeGPS::eventFilter(QObject *obj, QEvent *ev)
 {
+       enum QEvent::Type type = ev->type();
+       if (type == QEvent::MouseButtonDblClick)
+               doubleClick = true;
+       else if (type == QEvent::MouseButtonPress)
+               doubleClick = false;
+
        // This disables Zooming when a double click occours on the scene.
-       if (ev->type() == QEvent::MouseButtonDblClick && !editingDiveLocation)
+       if (type == QEvent::MouseButtonDblClick && !editingDiveLocation)
                return true;
        // This disables the Marble's Context Menu
        // we need to move this to our 'contextMenuEvent'
        // if we plan to do a different one in the future.
-       if (ev->type() == QEvent::ContextMenu) {
+       if (type == QEvent::ContextMenu) {
                contextMenuEvent(static_cast<QContextMenuEvent *>(ev));
                return true;
        }
-       if (ev->type() == QEvent::MouseButtonPress) {
+       if (type == QEvent::MouseButtonPress) {
                QMouseEvent *e = static_cast<QMouseEvent *>(ev);
                if (e->button() == Qt::RightButton)
                        return true;
@@ -116,6 +122,12 @@ void GlobeGPS::contextMenuEvent(QContextMenuEvent *ev)
 
 void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit 
unit)
 {
+       if (doubleClick) {
+               // strangely sometimes we don't get the changeDiveGeoPosition 
callback
+               // and end up here instead
+               changeDiveGeoPosition(lon, lat, unit);
+               return;
+       }
        // don't mess with the selection while the user is editing a dive
        if (MainWindow::instance()->information()->isEditing() || 
messageWidget->isVisible())
                return;
diff --git a/qt-ui/globe.h b/qt-ui/globe.h
index c40eefc466ff..bb8ace47b49e 100644
--- a/qt-ui/globe.h
+++ b/qt-ui/globe.h
@@ -34,6 +34,7 @@ private:
        int currentZoomLevel;
        bool needResetZoom;
        bool editingDiveLocation;
+       bool doubleClick;
 
 public
 slots:

> > > > * All gases doesn't show up from my OSTC3 downloads. I should debug this
> > > >   further, but i got the bottom gas downloaded, the 50%, but not the O2
> > > 
> > > That's strange - I've never had the problem of a gas NOT showing up.
> > > Usually too many gases show up. Are the gas switches there? Did you ever
> > > switch to O2? Or is this as simple as the "unused cylinder" flag in
> > > preferences?
> > 
> > Haven't seen an answer to my question.
> 
> Found the bug and send a patch.

Yeah, that was a STUPID one...
Show you that I've never done deco with fO₂ > 90%

> > > > Maybe post 4.2
> > > > * Start logging a dive before you download the profiles. I like to write
> > > >   down pressures and notes as soon as possible, while i remembered them.
> > > >   It would be great if i could do that without adding a profile and just
> > > >   get the profiles later when i have downloaded the dives.
> > > 
> > > This should work today. If you start with about the right start time (and
> > > don't get me started about Qt's terrible time entry widget) it should
> > > simply merge things. Maybe I'm missing, what you are suggesting.
> > 
> > Ditto.
> > 
> 
> Awesome! I didn't even realize that. Don't i get a manually added dive
> profile that i can't delete via the ui then? Yea, i can hand-edit the
> xml file but thats kinda...

Yes, you get an extra dive computer, but I added the feature that you can
make the other one the first dive computer from the ui (right click on the
dive computer name in the profile)

BTW: that needs to be added to the manual, I believe...

> > As discussed, part of this was implemented.
> > The part that's missing seems a tiny bit too user specific.
> > Breaking this down as "volume of air" + "volume of O₂" + "volume of He" is
> > of course possible, but I'm not sure a lot of people would have any use
> > for that data.
> > I could see maybe adding this as a tooltip... still not sure.
> >
> 
> I would actually like such a feature. We usually by 50L bottles of He
> and O2 and mix our gases ourself and when its time to split the bill its
> kinda good to verify that what got written into the gas fill log is
> somewhat close to what i actually logged i used.
> 
> I'm currently trying to produce a poc of how this could look.

I'd love to see that. I'll consider it.

/D
_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to