Bug 232098 - [Patch] Provide a faster way to add measure points (ctrl+click)
Summary: [Patch] Provide a faster way to add measure points (ctrl+click)
Status: RESOLVED MOVED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Unspecified
: NOR task
Target Milestone: ---
Assignee: Dennis Nienhüser
URL:
Keywords: junior-jobs
: 280121 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-25 12:25 UTC by k_the_first
Modified: 2016-11-05 09:16 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed patch (1.37 KB, patch)
2010-09-03 17:46 UTC, Thomas Lenarz
Details
[Patch] Proposed patch fast adding measure-points (5.03 KB, patch)
2010-11-28 18:06 UTC, Thomas Lenarz
Details
updated patch (5.25 KB, patch)
2011-08-20 14:04 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description k_the_first 2010-03-25 12:25:57 UTC
Version:            (using KDE 4.3.4)
Installed from:    Debian testing/unstable Packages

please add a possibility to add measurement points by just one click while holding down a modifier key (maybe Ctrl).
Comment 1 Thomas Lenarz 2010-09-02 21:21:36 UTC
I am new to marble development. I played around with the QT-Version and would like to propose the following change.

However, I am not sure if this change could break something around the rubber-band code, which uses the control-key as well. Therefore I compare the coordinates between button-press and button-release. The addMeasurePoint() triggers only if the coordinates are equal.

I am not sure how to generate a patch. It would be great if anyone could point me to some guidelines.

Thanks, 
Thomas 

File: marble/src/lib/MarbleWidgetInputHandler.cpp

            // Regarding mouse button releases:
            if ( e->type() == QEvent::MouseButtonRelease
                 && event->button() == Qt::LeftButton )
            {

                if (      ( event->modifiers() & Qt::ControlModifier )
                      &&  ( event->globalPos() == d->m_selectionOrigin     )
                        )
                {
                    d->m_addMeasurePointAction->setData( QPoint( event->x(), event->y() ) );
                    addMeasurePoint();
                }
                else
                {

                    //emit current coordinates to be be interpreted
                    //as requested
                    emit mouseClickScreenPosition( d->m_leftpressedx, d->m_leftpressedy );

                }

                MarbleWidgetInputHandler::d->m_widget->setViewContext( Still );
                if ( MarbleWidgetInputHandler::d->m_widget->mapQuality( Still )
                     != MarbleWidgetInputHandler::d->m_widget->mapQuality( Animation ) )
                {
                   MarbleWidgetInputHandler::d->m_widget->updateChangedMap();
                }

                d->m_leftpressed = false;
            }
Comment 2 Thomas Lenarz 2010-09-03 17:46:01 UTC
Created attachment 51276 [details]
Proposed patch
Comment 3 Torsten Rahn 2010-09-18 20:13:03 UTC
Thomas: thanks! Looks nice. I suggest that you also post patch suggestions to marble-devel and/or to reviewboard to raise awareness (I just accidently stumbled over this when looking through the bugs). :-)
Comment 4 Thomas Lenarz 2010-11-28 18:06:55 UTC
Created attachment 53830 [details]
[Patch] Proposed patch fast adding measure-points

Hello,
I would like to propose a second patch for this junior job.
It still uses the CTRL modifier key. However, "measure mode" has to be switched on via a new added menu toggle option within the right-mouse-button menu. This should avoid the conflict with the rubber-band-selection using the CTRL modifier key as well.
When in "measure mode" the mouse-pointer changes to the "arrow-up"-pointer when CTRL is pressed to indicate the different behaviour.

Please see attachment.

Best wishes,

Thomas
Comment 5 Bernhard Beschow 2011-08-20 10:20:08 UTC
*** Bug 280121 has been marked as a duplicate of this bug. ***
Comment 6 Alexander Potashev 2011-08-20 14:04:10 UTC
Created attachment 62999 [details]
updated patch

I've taken the Thomas Lenarz's patch and updated it, because it didn't apply to the latest Marble sources. Works as expected here. The feature works even better that in Google Earth, because in Google Earth you can't scroll the map using left mouse button while you are drawing the path (due to left mouse button being used for both dragging and path drawing).
Comment 7 Dennis Nienhüser 2016-11-05 09:16:32 UTC
Please follow up in https://phabricator.kde.org/T4260