|
1 |
| -import QtQuick 2.2 |
2 |
| -import QtQuick.Controls 1.1 |
3 |
| -import QtQuick.Layouts 1.1 |
4 |
| -import QtQuick.Window 2.1 |
| 1 | +import QtQuick 2.10 |
| 2 | +import QtQuick.Controls 2.3 |
| 3 | +import QtQuick.Layouts 1.2 |
| 4 | +import QtQuick.Window 2.2 |
5 | 5 |
|
6 |
| -import UM 1.2 as UM |
7 |
| -import Cura 1.0 as Cura |
| 6 | +import UM 1.5 as UM |
| 7 | +import Cura 1.1 as Cura |
8 | 8 |
|
9 | 9 |
|
10 | 10 | Cura.MachineAction
|
@@ -32,81 +32,92 @@ Cura.MachineAction
|
32 | 32 | }
|
33 | 33 |
|
34 | 34 | Column {
|
35 |
| - anchors.fill: parent; |
| 35 | + anchors.fill: parent |
36 | 36 |
|
37 | 37 | Item { width: parent.width; }
|
38 |
| - Label { text: catalog.i18nc("@label", "Duet Address (URL)"); } |
| 38 | + UM.Label { |
| 39 | + text: catalog.i18nc("@label", "Duet Address (URL)") |
| 40 | + } |
39 | 41 | TextField {
|
40 |
| - id: urlField; |
41 |
| - text: manager.printerSettingUrl; |
42 |
| - maximumLength: 1024; |
43 |
| - anchors.left: parent.left; |
44 |
| - anchors.right: parent.right; |
| 42 | + id: urlField |
| 43 | + text: manager.printerSettingUrl |
| 44 | + selectByMouse: true |
| 45 | + maximumLength: 1024 |
| 46 | + anchors.left: parent.left |
| 47 | + anchors.right: parent.right |
45 | 48 | onTextChanged: {
|
46 |
| - base.validUrl = manager.validUrl(urlField.text); |
| 49 | + base.validUrl = manager.validUrl(urlField.text) |
47 | 50 | }
|
48 | 51 | }
|
49 | 52 |
|
50 | 53 | Item { width: parent.width; }
|
51 |
| - Label { text: catalog.i18nc("@label", "Duet Password (if you used M551)"); } |
| 54 | + UM.Label { |
| 55 | + text: catalog.i18nc("@label", "Duet Password (if you used M551)") |
| 56 | + } |
52 | 57 | TextField {
|
53 |
| - id: duet_passwordField; |
54 |
| - text: manager.printerSettingDuetPassword; |
55 |
| - maximumLength: 1024; |
56 |
| - anchors.left: parent.left; |
57 |
| - anchors.right: parent.right; |
| 58 | + id: duet_passwordField |
| 59 | + text: manager.printerSettingDuetPassword |
| 60 | + selectByMouse: true |
| 61 | + maximumLength: 1024 |
| 62 | + anchors.left: parent.left |
| 63 | + anchors.right: parent.right |
58 | 64 | }
|
59 | 65 |
|
60 | 66 | Item { width: parent.width; }
|
61 |
| - Label { text: catalog.i18nc("@label", "HTTP Basic Auth: user (if you run a reverse proxy)"); } |
| 67 | + UM.Label { |
| 68 | + text: catalog.i18nc("@label", "HTTP Basic Auth: user (if you run a reverse proxy)") |
| 69 | + } |
62 | 70 | TextField {
|
63 |
| - id: http_userField; |
64 |
| - text: manager.printerSettingHTTPUser; |
65 |
| - maximumLength: 1024; |
66 |
| - anchors.left: parent.left; |
67 |
| - anchors.right: parent.right; |
| 71 | + id: http_userField |
| 72 | + text: manager.printerSettingHTTPUser |
| 73 | + selectByMouse: true |
| 74 | + maximumLength: 1024 |
| 75 | + anchors.left: parent.left |
| 76 | + anchors.right: parent.right |
68 | 77 | }
|
69 | 78 |
|
70 | 79 | Item { width: parent.width; }
|
71 |
| - Label { text: catalog.i18nc("@label", "HTTP Basic Auth: password (if you run a reverse proxy)"); } |
| 80 | + UM.Label { |
| 81 | + text: catalog.i18nc("@label", "HTTP Basic Auth: password (if you run a reverse proxy)") |
| 82 | + } |
72 | 83 | TextField {
|
73 |
| - id: http_passwordField; |
74 |
| - text: manager.printerSettingHTTPPassword; |
75 |
| - maximumLength: 1024; |
76 |
| - anchors.left: parent.left; |
77 |
| - anchors.right: parent.right; |
| 84 | + id: http_passwordField |
| 85 | + text: manager.printerSettingHTTPPassword |
| 86 | + selectByMouse: true |
| 87 | + maximumLength: 1024 |
| 88 | + anchors.left: parent.left |
| 89 | + anchors.right: parent.right |
78 | 90 | }
|
79 | 91 |
|
80 | 92 | Item { width: parent.width; }
|
81 |
| - Label { |
82 |
| - visible: !base.validUrl; |
83 |
| - text: catalog.i18nc("@error", "URL not valid. Example: http://192.168.1.42/"); |
84 |
| - color: "red"; |
| 93 | + UM.Label { |
| 94 | + visible: !base.validUrl |
| 95 | + text: catalog.i18nc("@error", "URL not valid. Example: http://192.168.1.42/") |
| 96 | + color: "red" |
85 | 97 | }
|
86 | 98 |
|
87 |
| - Item { |
88 |
| - width: saveButton.implicitWidth |
89 |
| - height: saveButton.implicitHeight |
90 |
| - } |
91 |
| - |
92 |
| - Button { |
93 |
| - id: saveButton; |
94 |
| - text: catalog.i18nc("@action:button", "Save Config"); |
95 |
| - width: screenScaleFactor * 100; |
96 |
| - onClicked: { |
97 |
| - manager.saveConfig(urlField.text, duet_passwordField.text, http_userField.text, http_passwordField.text); |
98 |
| - actionDialog.reject(); |
| 99 | + Row { |
| 100 | + anchors.horizontalCenter: parent.horizontalCenter |
| 101 | + width: childrenRect.width |
| 102 | + spacing: UM.Theme.getSize("default_margin").width |
| 103 | + |
| 104 | + Cura.PrimaryButton { |
| 105 | + id: saveButton |
| 106 | + text: catalog.i18nc("@action:button", "Save Config") |
| 107 | + onClicked: { |
| 108 | + manager.saveConfig(urlField.text, duet_passwordField.text, http_userField.text, http_passwordField.text) |
| 109 | + actionDialog.reject() |
| 110 | + } |
| 111 | + enabled: base.validUrl |
99 | 112 | }
|
100 |
| - enabled: base.validUrl; |
101 |
| - } |
102 | 113 |
|
103 |
| - Button { |
104 |
| - id: deleteButton; |
105 |
| - text: catalog.i18nc("@action:button", "Delete Config"); |
106 |
| - width: screenScaleFactor * 100; |
107 |
| - onClicked: { |
108 |
| - manager.deleteConfig(); |
109 |
| - actionDialog.reject(); |
| 114 | + Cura.SecondaryButton { |
| 115 | + id: deleteButton |
| 116 | + text: catalog.i18nc("@action:button", "Delete config") |
| 117 | + onClicked: { |
| 118 | + manager.deleteConfig() |
| 119 | + actionDialog.reject() |
| 120 | + } |
110 | 121 | }
|
111 | 122 | }
|
112 | 123 | }
|
|
0 commit comments