<commit_before>// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1

Column {
        id: col
        spacing: 10

        Label {
                // TODO:
                text: qsTr("Camera settings");
        }

        SectionHeader {
                text: qsTr("Show captured content");
        }

        ButtonRow {
                anchors.horizontalCenter: parent.horizontalCenter
                Button { text: qsTr("Disabled"); }
                Button { text: qsTr("2 seconds"); }
                Button { text: qsTr("5 seconds"); }
                Button { text: qsTr("No timeout"); }
        }

        SectionHeader {
                text: qsTr("Creator name");
        }

        TextField {
                placeholderText: qsTr("Name or copyright");
                width: parent.width
        }

        Item {
                width: parent.width
                height: 40 // TODO: hardcoded

                Label {
                        id: gpsLabel
                        anchors.left: parent.left
                        text: qsTr("Use GPS");
                }

                Switch {
                        anchors.right: parent.right
                }
        }

        Item {
                width: parent.width
                height: 40 // TODO: hardcoded

                Label {
                        id: geotagsLabel
                        anchors.left: parent.left
                        text: qsTr("Use geotags");
                }

                Switch {
                        anchors.right: parent.right
                }
        }
}
<commit_msg>CommonSettings will now store and load settings<commit_after>// -*- qml -*-
import QtQuick 1.1
import com.nokia.meego 1.1

Column {
        id: col
        spacing: 10

        Label {
                // TODO:
                text: qsTr("Camera settings");
        }

        SectionHeader {
                text: qsTr("Show captured content");
        }

        ButtonRow {
                anchors.horizontalCenter: parent.horizontalCenter

                Button {
                        text: qsTr("Disabled");
                        checked: settings.postCaptureTimeout == 0;
                        onClicked: settings.postCaptureTimeout = 0;
                }

                Button {
                        text: qsTr("2 seconds");
                        checked: settings.postCaptureTimeout == 2;
                        onClicked: settings.postCaptureTimeout = 2;
                }

                Button {
                        text: qsTr("5 seconds");
                        checked: settings.postCaptureTimeout == 10;
                        onClicked: settings.postCaptureTimeout = 10;
                }

                Button {
                        text: qsTr("No timeout");
                        checked: settings.postCaptureTimeout == -1;
                        onClicked: settings.postCaptureTimeout = -1;
                }
        }

        SectionHeader {
                text: qsTr("Creator name");
        }

        TextField {
                placeholderText: qsTr("Name or copyright");
                width: parent.width
                text: settings.creatorName
                onTextChanged: settings.creatorName = text;
        }

        Item {
                width: parent.width
                height: Math.max(useGpsLabel.height, useGps.height);

                Label {
                        id: useGpsLabel
                        anchors.left: parent.left
                        text: qsTr("Use GPS");
                }

                Switch {
                        id: useGps
                        anchors.right: parent.right
                        // We have to do it that way because QML complains about a binding
                        // loop for checked if we bind the checked property to the settings value.
                        Component.onCompleted: checked = settings.useGps;
                        onCheckedChanged: settings.useGps = checked;
                }
        }

        Item {
                width: parent.width
                height: Math.max(useGeotagsLabel.height, useGeotags.height);

                // TODO: transition when hiding/showing and we should scroll a bit to show it
                visible: useGps.checked

                Label {
                        id: useGeotagsLabel
                        anchors.left: parent.left
                        text: qsTr("Use geotags");
                }

                Switch {
                        id: useGeotags
                        anchors.right: parent.right
                        // We have to do it that way because QML complains about a binding
                        // loop for checked if we bind the checked property to the settings value.
                        Component.onCompleted: checked = settings.useGeotags;
                        onCheckedChanged: settings.useGeotags = checked;
                }
        }
}

{'fraction_non_alphanumeric': 0.07485988791032826, 'fraction_numerical': 0.00600480384307446, 'mean_word_length': 0.9704258675078864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2094363', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1088, 'n_words': 292}