mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
DL: Align with online backend on allowed characters.
CURA-8395
This commit is contained in:
parent
918d1f188b
commit
71937bf828
3 changed files with 6 additions and 8 deletions
|
@ -93,7 +93,7 @@ Popup
|
||||||
}
|
}
|
||||||
validator: RegExpValidator
|
validator: RegExpValidator
|
||||||
{
|
{
|
||||||
regExp: /^[^\\\/\*\?\|\[\]]{0,96}$/
|
regExp: /^[^\\\/\*\?\|\[\]]{0,99}$/
|
||||||
}
|
}
|
||||||
|
|
||||||
text: PrintInformation.jobName
|
text: PrintInformation.jobName
|
||||||
|
@ -148,7 +148,7 @@ Popup
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
text: "Create"
|
text: "Create"
|
||||||
enabled: newProjectNameTextField.text != "" && !busy
|
enabled: newProjectNameTextField.text.length >= 2 && !busy
|
||||||
|
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ Item
|
||||||
anchors.topMargin: UM.Theme.getSize("thin_margin").height
|
anchors.topMargin: UM.Theme.getSize("thin_margin").height
|
||||||
validator: RegExpValidator
|
validator: RegExpValidator
|
||||||
{
|
{
|
||||||
regExp: /^[^\\\/\*\?\|\[\]]{0,96}$/
|
regExp: /^[\w\-\. ()]{0,255}$/
|
||||||
}
|
}
|
||||||
|
|
||||||
text: PrintInformation.jobName
|
text: PrintInformation.jobName
|
||||||
|
@ -200,7 +200,7 @@ Item
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
text: "Save"
|
text: "Save"
|
||||||
enabled: (asProjectCheckbox.checked || asSlicedCheckbox.checked) && dfFilenameTextfield.text != ""
|
enabled: (asProjectCheckbox.checked || asSlicedCheckbox.checked) && dfFilenameTextfield.text.length >= 3
|
||||||
|
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
|
|
|
@ -365,12 +365,10 @@ class DigitalFactoryApiClient:
|
||||||
:param on_finished: The function to be called after the result is parsed.
|
:param on_finished: The function to be called after the result is parsed.
|
||||||
:param on_error: The function to be called if anything goes wrong.
|
:param on_error: The function to be called if anything goes wrong.
|
||||||
"""
|
"""
|
||||||
|
Logger.log("i", "Attempt to create new DF project '{}'.".format(project_name))
|
||||||
display_name = re.sub(r"^[\\w\\-\\. ()]+\\.[a-zA-Z0-9]+$", " ", project_name)
|
|
||||||
Logger.log("i", "Attempt to create new DF project '{}'.".format(display_name))
|
|
||||||
|
|
||||||
url = "{}/projects".format(self.CURA_API_ROOT)
|
url = "{}/projects".format(self.CURA_API_ROOT)
|
||||||
data = json.dumps({"data": {"display_name": display_name}}).encode()
|
data = json.dumps({"data": {"display_name": project_name}}).encode()
|
||||||
self._http.put(url,
|
self._http.put(url,
|
||||||
scope = self._scope,
|
scope = self._scope,
|
||||||
data = data,
|
data = data,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue