-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retain compatibility with older Cura versions because the Ultimaker M…
…arketplace only supports one plugin version globally for all Cura's
- Loading branch information
Showing
10 changed files
with
218 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ import QtQuick.Window 2.2 | |
import UM 1.5 as UM | ||
import Cura 1.1 as Cura | ||
|
||
|
||
Cura.MachineAction | ||
{ | ||
id: base; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import QtQuick 2.2 | ||
import QtQuick.Controls 1.1 | ||
import QtQuick.Layouts 1.1 | ||
import QtQuick.Window 2.1 | ||
|
||
import UM 1.2 as UM | ||
import Cura 1.0 as Cura | ||
|
||
|
||
Cura.MachineAction | ||
{ | ||
id: base; | ||
|
||
property var finished: manager.finished | ||
onFinishedChanged: if(manager.finished) {completed()} | ||
|
||
function reset() | ||
{ | ||
manager.reset() | ||
} | ||
|
||
anchors.fill: parent; | ||
property var selectedInstance: null | ||
|
||
property bool validUrl: true; | ||
|
||
Component.onCompleted: { | ||
actionDialog.minimumWidth = screenScaleFactor * 500; | ||
actionDialog.minimumHeight = screenScaleFactor * 255; | ||
actionDialog.maximumWidth = screenScaleFactor * 500; | ||
actionDialog.maximumHeight = screenScaleFactor * 255; | ||
} | ||
|
||
Column { | ||
anchors.fill: parent; | ||
|
||
Item { width: parent.width; } | ||
Label { text: catalog.i18nc("@label", "Duet Address (URL)"); } | ||
TextField { | ||
id: urlField; | ||
text: manager.printerSettingUrl; | ||
maximumLength: 1024; | ||
anchors.left: parent.left; | ||
anchors.right: parent.right; | ||
onTextChanged: { | ||
base.validUrl = manager.validUrl(urlField.text); | ||
} | ||
} | ||
|
||
Item { width: parent.width; } | ||
Label { text: catalog.i18nc("@label", "Duet Password (if you used M551)"); } | ||
TextField { | ||
id: duet_passwordField; | ||
text: manager.printerSettingDuetPassword; | ||
maximumLength: 1024; | ||
anchors.left: parent.left; | ||
anchors.right: parent.right; | ||
} | ||
|
||
Item { width: parent.width; } | ||
Label { text: catalog.i18nc("@label", "HTTP Basic Auth: user (if you run a reverse proxy)"); } | ||
TextField { | ||
id: http_userField; | ||
text: manager.printerSettingHTTPUser; | ||
maximumLength: 1024; | ||
anchors.left: parent.left; | ||
anchors.right: parent.right; | ||
} | ||
|
||
Item { width: parent.width; } | ||
Label { text: catalog.i18nc("@label", "HTTP Basic Auth: password (if you run a reverse proxy)"); } | ||
TextField { | ||
id: http_passwordField; | ||
text: manager.printerSettingHTTPPassword; | ||
maximumLength: 1024; | ||
anchors.left: parent.left; | ||
anchors.right: parent.right; | ||
} | ||
|
||
Item { width: parent.width; } | ||
Label { | ||
visible: !base.validUrl; | ||
text: catalog.i18nc("@error", "URL not valid. Example: http://192.168.1.42/"); | ||
color: "red"; | ||
} | ||
|
||
Item { | ||
width: saveButton.implicitWidth | ||
height: saveButton.implicitHeight | ||
} | ||
|
||
Button { | ||
id: saveButton; | ||
text: catalog.i18nc("@action:button", "Save Config"); | ||
width: screenScaleFactor * 100; | ||
onClicked: { | ||
manager.saveConfig(urlField.text, duet_passwordField.text, http_userField.text, http_passwordField.text); | ||
actionDialog.reject(); | ||
} | ||
enabled: base.validUrl; | ||
} | ||
|
||
Button { | ||
id: deleteButton; | ||
text: catalog.i18nc("@action:button", "Delete Config"); | ||
width: screenScaleFactor * 100; | ||
onClicked: { | ||
manager.deleteConfig(); | ||
actionDialog.reject(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import QtQuick 2.1 | ||
import QtQuick.Controls 1.1 | ||
import QtQuick.Dialogs 1.2 | ||
import QtQuick.Window 2.1 | ||
|
||
import UM 1.1 as UM | ||
|
||
UM.Dialog | ||
{ | ||
id: base; | ||
property string object: ""; | ||
|
||
property alias newName: nameField.text; | ||
property bool validName: true; | ||
property string validationError; | ||
property string dialogTitle: "Upload Filename"; | ||
|
||
title: dialogTitle; | ||
|
||
minimumWidth: screenScaleFactor * 400 | ||
minimumHeight: screenScaleFactor * 120 | ||
|
||
property variant catalog: UM.I18nCatalog { name: "uranium"; } | ||
|
||
signal textChanged(string text); | ||
signal selectText() | ||
onSelectText: { | ||
nameField.selectAll(); | ||
nameField.focus = true; | ||
} | ||
|
||
Column { | ||
anchors.fill: parent; | ||
|
||
TextField { | ||
objectName: "nameField"; | ||
id: nameField; | ||
width: parent.width; | ||
text: base.object; | ||
maximumLength: 100; | ||
onTextChanged: base.textChanged(text); | ||
Keys.onReturnPressed: { if (base.validName) base.accept(); } | ||
Keys.onEnterPressed: { if (base.validName) base.accept(); } | ||
Keys.onEscapePressed: base.reject(); | ||
} | ||
|
||
Label { | ||
visible: !base.validName; | ||
text: base.validationError; | ||
} | ||
} | ||
|
||
rightButtons: [ | ||
Button { | ||
text: catalog.i18nc("@action:button", "Cancel"); | ||
onClicked: base.reject(); | ||
}, | ||
Button { | ||
text: catalog.i18nc("@action:button", "OK"); | ||
onClicked: base.accept(); | ||
enabled: base.validName; | ||
isDefault: true; | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters