Settings

You should really spend some time to study the settings. TimeTracker can be configured in very different ways.

If you’re running the Personal Edition it’s up to you to do the right settings.

If you’re running the Group or Enterprise Edition your Group Manager or IT Admin will create some profiles and send out to the devices.

Settings are part of the Application Menu: Swipe down from top to get the ApplicationMenu:

Z30_appmenu

Then tap on ‘Settings‘ and you’ll get this:

Z30_settings

Z30_settings_p2

In this sample you see the ‘Personal Edition‘ is in-use and the Profile is a ‘Local profile’ – so you can edit all Settings by yourself. If a ‘Remote Profile‘ was injected, you can only enter your name.

As long as you have opened the Settings you cannot swipe down again – the Application Menu is blocked while editing.

There are different ways to implement ApplicationMenus – I’m using a NavigationPane.

Tap on a section to see the details. Details are pushed on top. The ActionBar always has a ‘Back‘ Button and a disabled ‘Cancel‘ Button:

ab_back_cancel

As soon as you’re changing properties, the Page becomes ‘dirty’:

  • Cancel‘ is now activated
  • Back‘ changed to ‘Assign

ab_dirty

There are also ways to implement this as a Sheet, where ‘OK’ and ‘Cancel’ are buttons as port of Titlebar. I prefer short ways and to have the navigation at the bottom where your fingers already are present. (No move to the top of a large screen as Z30)

Here you can see HowTo change the Back Button:

paneProperties: NavigationPaneProperties {
    backButton: ActionItem {
        title: isDirty ? qsTr("Assign") : qsTr("Back")
        imageSource: isDirty ? "asset:///images/ic_upgrade.png" : ""
        onTriggered: {
            if (! dataValid()) {
                return
            }
            if (isDirty) {
                app.updateProfile(updated)
            }
        }
    }
}

before writing values back I always call a function to validate the data.

I’m storing my settings in a JSON file inside data folder in secure sandbox. You can also use QSettings to do this, but from my POV it’s easier to deal with JSON for complex Settings as used here for TimeTracker.

updateProfile() is a method from C++ marked as Q_INVOKABLE to make it possible to execute from QML. I really like the easy way to get JavaScript Objects mapped from QML to C++ where they’re automatically mapped to a QVariantMap and QVariantMap can be written to a .json file also without any conversion using JsonDataAccess class.

isDirty is a property on the details page:

property bool isDirty: false
onIsDirtyChanged: {
    rootPane.setPeekEnabledOnActivePane(! isDirty)
}

From Pages pushed on top of NavigationPane you can ‘peek back’ to see what’s below this page and this also allows you to go back by swipe-from-left-to-rigth. As soon as the Page becomes dirty I want to disable peeking to avoid going back without deciding to save or cancel. This way I’m getting same behaviour as from Sheets, where I also cannot close by swiping. if nothing changed, user can go back by button or swipe.

From the Menu below you can go into the details of each section.

Settings in detail:

APP Permissions

Some of the Settings are only working well if Permissions are set. Learn more about TimeTracker APP Permissions here.