<commit_before>// Copyright (c) 2015 <NAME>.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1.2

import UM 1.1 as UM

UM.Dialog
{
    id: base;

    width: 500 * Screen.devicePixelRatio;
    height: 100 * Screen.devicePixelRatio;

    visible: true;
    modality: Qt.ApplicationModal;

    title: catalog.i18nc("@title:window","Firmware Update");

    Column
    {
        anchors.fill: parent;

        Label
        {
            anchors
            {
                left: parent.left;
                right: parent.right;
            }

            text: {
                if (manager.errorCode == 0)
                {
                    if (manager.firmwareUpdateCompleteStatus)
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Firmware update completed.")
                    }
                    else if (manager.progress == 0)
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Starting firmware update, this may take a while.")
                    }
                    else
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Updating firmware.")
                    }
                }
                else 
                {
                    switch (manager.errorCode)
                    {
                        case 1:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an unknown error.")

                        case 2:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an communication error.")


                        case 3:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an input/output error.")

                        case 4:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to missing firmware.")

                        default:
                            //: Firmware update status label
                            return catalog.i18nc("@label", "Unknown error code: %1").arg(manager.errorCode)
                    }
                }
            }

            wrapMode: Text.Wrap;
        }

        ProgressBar
        {
            id: prog<commit_msg>Code-style<commit_after>// Copyright (c) 2015 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1.2

import UM 1.1 as UM

UM.Dialog
{
    id: base;

    width: 500 * Screen.devicePixelRatio;
    height: 100 * Screen.devicePixelRatio;

    visible: true;
    modality: Qt.ApplicationModal;

    title: catalog.i18nc("@title:window","Firmware Update");

    Column
    {
        anchors.fill: parent;

        Label
        {
            anchors
            {
                left: parent.left;
                right: parent.right;
            }

            text: {
                if (manager.errorCode == 0)
                {
                    if (manager.firmwareUpdateCompleteStatus)
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Firmware update completed.")
                    }
                    else if (manager.progress == 0)
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Starting firmware update, this may take a while.")
                    }
                    else
                    {
                        //: Firmware update status label
                        return catalog.i18nc("@label","Updating firmware.")
                    }
                }
                else
                {
                    switch (manager.errorCode)
                    {
                        case 1:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an unknown error.")
                        case 2:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an communication error.")
                        case 3:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to an input/output error.")
                        case 4:
                            //: Firmware update status label
                            return catalog.i18nc("@label","Firmware update failed due to missing firmware.")
                        default:
                            //: Firmware update status label
                            return catalog.i18nc("@label", "Unknown error code: %1").arg(manager.errorCode)
                    }
                }
            }

            wrapMode: Text.Wrap;
        }

        ProgressBar
        {
            id: prog
{'fraction_non_alphanumeric': 0.07844574780058651, 'fraction_numerical': 0.016129032258064516, 'mean_word_length': 1.0121681415929205, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7579638', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1184, 'n_words': 344}