mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Fixed code comments
CURA-4501
This commit is contained in:
parent
8bfd10f9aa
commit
0bdc1aad00
4 changed files with 28 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2015 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Extension import Extension
|
from UM.Extension import Extension
|
||||||
|
@ -14,10 +14,9 @@ from PyQt5.QtCore import QUrl, QObject, pyqtSlot
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
class UserAgreement(Extension, QObject):
|
class UserAgreement(QObject, Extension):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
QObject.__init__(self, parent)
|
super(UserAgreement, self).__init__()
|
||||||
Extension.__init__(self)
|
|
||||||
self._user_agreement_window = None
|
self._user_agreement_window = None
|
||||||
self._user_agreement_context = None
|
self._user_agreement_context = None
|
||||||
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
Application.getInstance().engineCreatedSignal.connect(self._onEngineCreated)
|
||||||
|
@ -36,11 +35,11 @@ class UserAgreement(Extension, QObject):
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def didAgree(self, userChoice):
|
def didAgree(self, userChoice):
|
||||||
if userChoice:
|
if userChoice:
|
||||||
Logger.log("i", 'User agreed to the user agreement')
|
Logger.log('i', 'User agreed to the user agreement')
|
||||||
Preferences.getInstance().setValue("general/accepted_user_agreement", True)
|
Preferences.getInstance().setValue("general/accepted_user_agreement", True)
|
||||||
self._user_agreement_window.hide()
|
self._user_agreement_window.hide()
|
||||||
else:
|
else:
|
||||||
Logger.log("i", 'User did NOT agree to the user agreement')
|
Logger.log('i', 'User did NOT agree to the user agreement')
|
||||||
Preferences.getInstance().setValue("general/accepted_user_agreement", False)
|
Preferences.getInstance().setValue("general/accepted_user_agreement", False)
|
||||||
CuraApplication.getInstance().quit()
|
CuraApplication.getInstance().quit()
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright (c) 2015 Ultimaker B.V.
|
// Copyright (c) 2017 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Controls 1.3
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
import UM 1.3 as UM
|
import UM 1.3 as UM
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ UM.Dialog
|
||||||
minimumHeight: Math.floor(UM.Theme.getSize("modal_window_minimum").height * 0.5)
|
minimumHeight: Math.floor(UM.Theme.getSize("modal_window_minimum").height * 0.5)
|
||||||
width: minimumWidth
|
width: minimumWidth
|
||||||
height: minimumHeight
|
height: minimumHeight
|
||||||
title: "User Agreement"
|
title: catalog.i18nc("@title:window", "User Agreement")
|
||||||
|
|
||||||
TextArea
|
TextArea
|
||||||
{
|
{
|
||||||
|
@ -36,10 +36,12 @@ UM.Dialog
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
|
UM.I18nCatalog { id: catalog; name:"cura" }
|
||||||
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
text: "I understand and agree"
|
text: catalog.i18nc("@action:button", "I understand and agree")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
manager.didAgree(true)
|
manager.didAgree(true)
|
||||||
}
|
}
|
||||||
|
@ -48,7 +50,7 @@ UM.Dialog
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
text: "I don't agree"
|
text: catalog.i18nc("@action:button", "I don't agree")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
manager.didAgree(false)
|
manager.didAgree(false)
|
||||||
}
|
}
|
||||||
|
@ -59,6 +61,4 @@ UM.Dialog
|
||||||
onClosing: {
|
onClosing: {
|
||||||
manager.didAgree(false)
|
manager.didAgree(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2015 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from . import UserAgreement
|
from . import UserAgreement
|
||||||
|
|
|
@ -18,6 +18,21 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||||
|
|
||||||
|
#Manually added for plugins/UserAgreementPlugin/UserAgreement.qml
|
||||||
|
msgctxt "@title:window"
|
||||||
|
msgid "User Agreement"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#Manually added for plugins/UserAgreementPlugin/UserAgreement.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "I understand and agree"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#Manually added for plugins/UserAgreementPlugin/UserAgreement.qml
|
||||||
|
msgctxt "@action:button"
|
||||||
|
msgid "I don't agree"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: Manually added for plugins/UM3NetworkPrinting/PrinterInfoBlock.qml
|
#: Manually added for plugins/UM3NetworkPrinting/PrinterInfoBlock.qml
|
||||||
msgctxt "@label:status"
|
msgctxt "@label:status"
|
||||||
msgid "Print aborted"
|
msgid "Print aborted"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue