M4rtinK / modrana

ModRana is a flexible GPS navigation system for mobile devices. This is the main upstream modRana source code repository - waiting for your pull requests & patches! :)
www.modrana.org
GNU General Public License v3.0
66 stars 21 forks source link

Add a yes/no QML element/dialog #228

Closed M4rtinK closed 6 years ago

M4rtinK commented 6 years ago

Mainly to confirm potentially important decisions (delete POI X ? yes/no).

Given the application architecture, it could be a page that asks the question and then pops itself from the stack once an option has been selected.

Such an element could be also useful in Tsubame.

Karry commented 6 years ago

Ahoj Martine

Sailfish Silica already has component for this - Remorse. It will shows cancelable countdown before real action. I suggest to use this "native" behaviour. You can find usage on ManuPage.qml in ComonentGallery app from SDK...

    RemorsePopup {
        id: clearRemorse
    }
    SilicaListView {
        PullDownMenu {
            MenuItem {
                text: "Clear"
                visible: listView.count
                onClicked: clearRemorse.execute("Clearing", function() { listModel.clear() } )
            }
        }
    }
M4rtinK commented 6 years ago

Yeah, I know about the remorse timer - but frankly, I never liked the concept. It seems just too fragile & needlessly introduces a delay:

All in all I think the remorse time was one of the more unfortunate UI decisions on Sailfish OS, together with long-press for additional actions (which is pretty undiscoverable).

Also the remorse timer is a Silica exclusive concept not available anywhere else (Qt Quick Controls 1/2). ModRana is a GUI component toolkit independent application thanks to Universal Components. So if I wanted to use the remorse timer concept I would have to implement a new element to Universal Components, that provides the remorse timer with the Silica backend and provides something similar with the Controls backend.

I don't think re-implementing the remorse timer so that it shows up to unsuspecting users on desktop and Android would be a good idea, so I would have to use some sort of fallback dialog anyway.

So it just seems to me easier to use a proper dialog that to solve the much more complicated problem of using the (IMHO pretty broken) remorse timer concept in a multi platform way.

M4rtinK commented 6 years ago

Implemented in ae92954b36e05cd6e1d27a04f4c3cef8629ec02c.