<commit_before>import UM 1.2 as UM
import Cura 1.0 as Cura

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

Item
{
    id: base

    property bool isUM3: Cura.MachineManager.activeDefinitionId == "ultimaker3"
    property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
    property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands

    Row
    {
        objectName: "networkPrinterConnectButton"
        visible: isUM3
        spacing: UM.Theme.getSize("default_marging").width

        Button
        {
            height: UM.Theme.getSize("save_button_save_to_button").height
            tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer")
            text: catalog.i18nc("@action:button", "Request Access")
            style: UM.Theme.styles.sidebar_action_button
            onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication()
            visible: base.printerConnected && !base.printerAcceptsCommands
        }

        Button
        {
            height: UM.Theme.getSize("save_button_save_to_button").height
            tooltip: catalog.i18nc("@info:tooltip", "Connect to a printer")
            text: catalog.i18nc("@action:button", "Connect")
            style: UM.Theme.styles.sidebar_action_button
            onClicked: connectActionDialog.show()
            visible: !base.printerConnected
        }
    }

    UM.Dialog
    {
        id: connectActionDialog
        Loader
        {
            anchors.fill: parent
            source: "DiscoverUM3Action.qml"
        }
        rightButtons: Button
        {
            text: catalog.i18nc("@action:button", "Close")
            iconName: "dialog-close"
            onClicked: connectActionDialog.reject()
        }
    }


    Item
    {
        objectName: "networkPrinterConnectionInfo"
        visible: isUM3
        Button
        {
            height: UM.Theme.getSize("save_button_save_to_button").height
            tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer")
            text: catalog.i18nc("@action:button", "Request Access")
            onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication()
            visible: base.printerConnected && !base.printerAcceptsCommands
        }
    }

    UM.I18nCatalog{id: catalog; name:"cura"}
}<commit_msg>Add stub button to sync configuration from printer to Cura<commit_after>import UM 1.2 as UM
import Cura 1.0 as Cura

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

Item
{
    id: base

    property bool isUM3: Cura.MachineManager.activeDefinitionId == "ultimaker3"
    property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
    property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands

    Row
    {
        objectName: "networkPrinterConnectButton"
        visible: isUM3
        spacing: UM.Theme.getSize("default_marging").width

        Button
        {
            height: UM.Theme.getSize("save_button_save_to_button").height
            tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer")
            text: catalog.i18nc("@action:button", "Request Access")
            style: UM.Theme.styles.sidebar_action_button
            onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication()
            visible: base.printerConnected && !base.printerAcceptsCommands
        }

        Button
        {
            height: UM.Theme.getSize("save_button_save_to_button").height
            tooltip: catalog.i18nc("@info:tooltip", "Connect to a printer")
            text: catalog.i18nc("@action:button", "Connect")
            style: UM.Theme.styles.sidebar_action_button
            onClicked: connectActionDialog.show()
            visible: !base.printerConnected
        }
    }

    UM.Dialog
    {
        id: connectActionDialog
        Loader
        {
            anchors.fill: parent
            source: "DiscoverUM3Action.qml"
        }
        rightButtons: Button
        {
            text: catalog.i18nc("@action:button", "Close")
            iconName: "dialog-close"
            onClicked: connectActionDialog.reject()
        }
    }


    Item
    {
        objectName: "networkPrinterConnectionInfo"
        visible: isUM3
        Button
        {
            tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer")
            text: catalog.i18nc("@action:button", "Request Access")
            onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication()
            visible: base.printerConnected && !base.printerAcceptsCommands
        }

        Button
        {
            tooltip: catalog.i18nc("@info:tooltip", "Load the configuration of the printer into Cura")
            text: catalog.i18nc("@action:button", "Activate Configuration")
            visible: false
        }
    }

    UM.I18nCatalog{id: catalog; name:"cura"}
}
{'fraction_non_alphanumeric': 0.09521039363971301, 'fraction_numerical': 0.015125072716695753, 'mean_word_length': 2.4409606404269515, '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': '7447191', 'n_tokens_mistral': 1512, 'n_tokens_neox': 1451, 'n_words': 288}