From 1f2fea14ceed8b66f45ee6faf5ccd2dfe69a6035 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 20 Mar 2019 16:08:50 +0100 Subject: [PATCH 1/3] Little refactors (apply review comments). [CURA-6294] --- cura/CuraApplication.py | 1 - cura/UI/WelcomePagesModel.py | 1 - resources/qml/Cura.qml | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index f3a79cecce..6fbe8fde73 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -453,7 +453,6 @@ class CuraApplication(QtApplication): # Misc.: "ConsoleLogger", #You want to be able to read the log if something goes wrong. "CuraEngineBackend", #Cura is useless without this one since you can't slice. - # NOTE: User-Agreement is part of the 'onboarding flow' now (See Welcome Pages). "FileLogger", #You want to be able to read the log if something goes wrong. "XmlMaterialProfile", #Cura crashes without this one. "Toolbox", #This contains the interface to enable/disable plug-ins, so if you disable it you can't enable it back. diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index c0aeffb3ad..d72071fd7f 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -7,7 +7,6 @@ from PyQt5.QtCore import QUrl, Qt from UM.Qt.ListModel import ListModel from UM.Resources import Resources -from logging import Logger if TYPE_CHECKING: from PyQt5.QtCore import QObject diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index d71f219052..47fa54dbc1 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -78,13 +78,13 @@ UM.MainWindow { welcomeDialog.visible = true; welcomeDialog.currentStep = 0; - welcomeDialog.show(); } else { - welcomeDialog.hide() welcomeDialog.visible = false; } + // TODO: While the new onboarding process contains the user-agreement, + // it should probably not entirely rely on 'needToShowUserAgreement' for show/hide. } Item From 9a2b800fe814c61360df20775bfe0aba66a11f40 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 20 Mar 2019 17:01:37 +0100 Subject: [PATCH 2/3] Future proof: also accept IPv6 address. [CURA-6294] --- resources/qml/WelcomePages/AddPrinterByIpContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 40216ec235..0ffc79cc5b 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -79,7 +79,7 @@ Item validator: RegExpValidator { - regExp: /[0-9\.\-\_]*/ + regExp: /[a-fA-F0-9\.\:]*/ } onAccepted: addPrinterButton.clicked() From 8f9bd0ad0697774c51194606f4fe65c553f6c252 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 20 Mar 2019 17:20:06 +0100 Subject: [PATCH 3/3] Adapted to more review comments. [CURA-6294] --- resources/qml/WelcomePages/AddPrinterByIpContent.qml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 0ffc79cc5b..f3ed58200b 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -18,7 +18,6 @@ Item id: addPrinterByIpScreen - property bool hasPushedAdd: false property bool hasSentRequest: false property bool haveConnection: false @@ -42,7 +41,7 @@ Item anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.bottomMargin: UM.Theme.getSize("default_margin").height anchors.horizontalCenter: parent.horizontalCenter - width: (parent.width * 3 / 4) | 0 + width: Math.floor(parent.width * 3 / 4) Item { @@ -99,12 +98,11 @@ Item { if (hostnameField.text.trim() != "") { - addPrinterByIpScreen.hasPushedAdd = true - UM.OutputDeviceManager.addManualDevice(hostnameField.text, hostnameField.text) + enabled = false; + UM.OutputDeviceManager.addManualDevice(hostnameField.text, hostnameField.text); } } - enabled: ! addPrinterByIpScreen.hasPushedAdd BusyIndicator { anchors.fill: parent