<commit_before>import QtQuick 2.0
import Sailfish.Silica 1.0
import "helper.js" as Helper

Dialog {

    id: page
    onAccepted: { save(); }
    Component.onCompleted: {
        getSettings();
        settingsLoad = foodAPI.settingsLoadingStatus();
    }

    BusyIndicator {
        anchors.centerIn: parent
        size: BusyIndicatorSize.Large
        running: settingsLoad
    }

    SilicaFlickable {
        anchors.fill: parent
        contentHeight: childrenRect.height

        Column {
            id: content
            spacing: Theme.paddingSmall
            width: parent.width
            height: 200

            DialogHeader {
                acceptText: "Save"
            }

            ComboBox {
                id: combo
                parent: content
                width: 540
                label: "Language"
                currentIndex: language

                menu: ContextMenu {
                    id: combocontent
                    MenuItem {
                        text: "Finnish"
                        height: 60
                    }
                    MenuItem {
                        text: "English"
                        height: 60
                    }
                }
            }

        }

        anchors.leftMargin: Theme.paddingMedium

        SilicaListView {
            parent: page
            id: listView
            y: 390
            width: page.width; height: 500
            model: restaurantModel
            anchors.leftMargin: Theme.paddingMedium

            delegate: BackgroundItem {
                id: delegate
                down: check

                Label {
                    id: kitchenlabel
                    anchors.verticalCenter: parent.verticalCenter
                    y: Theme.paddingSmall
                    font.pixelSize: 26
                    wrapMode: Text.WordWrap
                    text: name
                    anchors.leftMargin: Theme.paddingMedium
                    verticalAlignment: Text.AlignVCenter
                    color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                }
                onClicked: select(kitchenlabel.text, index)

                function select(name, index) {
                    if (Helper.selected.indexOf(name) !== -1) {
                        Helper.selected.splice(Helper.selected.indexOf(name), 1);
                        restaurantModel.setProperty(index, "check", false)
                    } else {
                        Helper.selected.push(name);
                        restaurantModel.setProperty(index, "check", true)
                    }
                }

            }
            VerticalScrollDecorator { flickable: listView }
        }
    }

    ListModel {<commit_msg>some UI fixes to settings<commit_after>import QtQuick 2.0
import Sailfish.Silica 1.0
import "helper.js" as Helper

Dialog {

    id: page
    onAccepted: { save(); }
    Component.onCompleted: {
        getSettings();
        settingsLoad = foodAPI.settingsLoadingStatus();
    }

    BusyIndicator {
        anchors.centerIn: parent
        size: BusyIndicatorSize.Large
        running: settingsLoad
    }

    SilicaFlickable {
        anchors.fill: parent
        width: parent.width
        contentHeight: childrenRect.height

        DialogHeader {
            id: header
            acceptText: "Save"
        }

        Column {
            id: content
            spacing: Theme.paddingSmall
            width: parent.width
            anchors.top: header.bottom
            height: 200

            ComboBox {
                id: combo
                parent: content
                width: 540
                label: "Language"
                currentIndex: language

                menu: ContextMenu {
                    id: combocontent
                    MenuItem {
                        text: "Finnish"
                        height: 60
                    }
                    MenuItem {
                        text: "English"
                        height: 60
                    }
                }
            }

        }

        anchors.leftMargin: Theme.paddingMedium

        SilicaListView {
            parent: page
            id: listView
            y: 390
            width: parent.width;
            height: 500
            model: restaurantModel

            delegate: BackgroundItem {
                id: delegate
                down: check
                width: parent.width
                anchors.left: parent.left;

                Label {
                    id: kitchenlabel
                    font.pixelSize: 26
                    wrapMode: Text.WordWrap
                    text: name
                    width: parent.width
                    height: parent.height
                    anchors.left: parent.left;
                    anchors.leftMargin: Theme.paddingMedium
                    verticalAlignment: Text.AlignVCenter
                    color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                }
                onClicked: select(kitchenlabel.text, index)

                function select(name, index) {
                    if (Helper.selected.indexOf(name) !== -1) {
                        Helper.selected.splice(Helper.selected.indexOf(name), 1);
                        restaurantModel.setProperty(index, "check", false)
                    } else {
                        Helper.selected.push(name);
                        restaurantModel.setProperty(index, "check", true)
                    }
                }

            }
            VerticalScrollDecorator {
                flickable: listView

            }
        }
    }

    ListModel {
{'fraction_non_alphanumeric': 0.06563100017455054, 'fraction_numerical': 0.008378425554197941, 'mean_word_length': 1.0486235252055773, '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': '6307175', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1255, 'n_words': 284}